title: JavaFX fire close tab event
body: <pre><code>tab.setOnCloseRequest(e -&gt; {
                  e.consume();
                  if (currentEditor.isModified()){
                      switch (DialogBox.newSaveConfirmationBox(tab.getText())){
                          case "Yes": tabPane.fireEvent(???);
                      }
                  }
              }
  </code></pre>
  
  <p>I would like to make a confirmation for a tabbed text editor, where there are opetions "yes" "no" cancel". Is there a way to fire a close tab event when "yes" is selected? thanks</p>
  
  <pre><code>tab.setOnCloseRequest(e -&gt; {
                  if (currentEditor.isModified()){
                      switch (DialogBox.newSaveConfirmationBox(tab.getText())){
                          case "Yes":
                              saveFile();
                          case "Cancel":
                              e.consume();
                      }
                  }
              }
      );
  </code></pre>
  
  <p>Sadly, when <code>currentEditor.isModified()</code> is <code>false</code>, the tab can't be closed, any suggestions? thanks</p>