Example usage for javafx.scene.control Tab textProperty

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

Introduction

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

Prototype

public final StringProperty textProperty() 

Source Link

Document

The text shown in the tab.

Usage

From source file:de.pixida.logtest.designer.MainWindow.java

private void addEditorAsNewTab(final Editor editor) {
    final Tab newTab = new Tab();
    newTab.setContent(editor);/*from  ww w.  ja v  a2s  . c  o  m*/
    newTab.setGraphic(Icons.getIconGraphics(editor.getIconName()));
    newTab.textProperty().bind(editor.getTitleShort());
    newTab.setOnCloseRequest(event -> {
        if (!this.handleCloseTab()) {
            event.consume(); // Do not continue / leave tab open
        }
    });
    this.tabPane.getTabs().add(newTab);
    this.tabPane.getSelectionModel().select(newTab);
}