Example usage for javafx.scene.control Tab getOnClosed

List of usage examples for javafx.scene.control Tab getOnClosed

Introduction

In this page you can find the example usage for javafx.scene.control Tab getOnClosed.

Prototype

public final EventHandler<Event> getOnClosed() 

Source Link

Document

The event handler that is associated with the tab when the tab is closed.

Usage

From source file:org.beryx.viewreka.fxapp.Viewreka.java

public void closeTab() {
    Tab tab = projectTabPane.getSelectionModel().getSelectedItem();
    if (tab != null) {
        EventHandler<Event> handler = tab.getOnClosed();
        if (handler != null) {
            handler.handle(null);//from w ww . j  a  v a 2  s  . c om
        }
        projectTabPane.getTabs().remove(tab);
    }
}