Example usage for javafx.scene.control Button focusedProperty

List of usage examples for javafx.scene.control Button focusedProperty

Introduction

In this page you can find the example usage for javafx.scene.control Button focusedProperty.

Prototype

public final ReadOnlyBooleanProperty focusedProperty() 

Source Link

Usage

From source file:de.ks.text.AsciiDocEditor.java

private void addCommands() {
    editorCommands.forEach(c -> {//  w w w .j  a  va 2  s  . co m
        Button button = new Button();
        button.setMnemonicParsing(true);
        button.focusedProperty().addListener((p, o, n) -> {
            if (n) {
                focusOnEditor = false;
            }
        });
        c.initialize(this, button);
        this.commands.put(c.getClass(), c);
        button.setText(Localized.get(c.getName()));
        button.setOnAction(e -> c.execute(editor));
        editorCommandPane.getChildren().add(button);
    });
}