Example usage for javafx.scene.control TextArea disableProperty

List of usage examples for javafx.scene.control TextArea disableProperty

Introduction

In this page you can find the example usage for javafx.scene.control TextArea disableProperty.

Prototype

public final BooleanProperty disableProperty() 

Source Link

Document

Defines the individual disabled state of this Node .

Usage

From source file:de.pixida.logtest.designer.automaton.AutomatonNode.java

@Override
public Node getConfigFrame() {
    // TODO: Remove code redundancies; element creating methods have been created in class AutomatonEdge and should be centralized!
    final ConfigFrame cf = new ConfigFrame("State properties");

    final int nameInputLines = 1;
    final TextArea nameInput = new TextArea(this.name);
    nameInput.setPrefRowCount(nameInputLines);
    nameInput.setWrapText(true);/*from  w  ww .  j av a2 s  . c o  m*/
    nameInput.textProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> {
        this.setName(newValue);
        this.getGraph().handleChange();
    });
    cf.addOption("Name", nameInput);

    final int descriptionInputLines = 3;
    this.createTextAreaInput(descriptionInputLines, cf, "Description", this.getDescription(),
            newValue -> this.setDescription(newValue));

    final VBox typeAttributes = new VBox();
    final ToggleGroup flagToggleGroup = new ToggleGroup();
    typeAttributes.getChildren()
            .add(this.createRadioButtonForType(null, "None (intermediate node)", flagToggleGroup));
    typeAttributes.getChildren().add(this.createRadioButtonForType(Type.INITIAL, "Initial", flagToggleGroup));
    final RadioButton successOption = this.createRadioButtonForType(Type.SUCCESS, "Success", flagToggleGroup);
    typeAttributes.getChildren().add(successOption);
    typeAttributes.getChildren().add(this.createRadioButtonForType(Type.FAILURE, "Failure", flagToggleGroup));
    cf.addOption("Type", typeAttributes);

    final CheckBox waitCheckBox = new CheckBox("Active");
    waitCheckBox.setSelected(this.wait);
    waitCheckBox.setOnAction(event -> {
        this.setWait(waitCheckBox.isSelected());
        this.getGraph().handleChange();
    });
    cf.addOption("Wait", waitCheckBox);

    final int expressionInputLines = 1;
    final TextArea successCheckExpInput = new TextArea(this.successCheckExp);
    successCheckExpInput.setStyle("-fx-font-family: monospace");
    successCheckExpInput.setPrefRowCount(expressionInputLines);
    successCheckExpInput.setWrapText(false);
    successCheckExpInput.textProperty()
            .addListener((ChangeListener<String>) (observable, oldValue, newValue) -> {
                this.setSuccessCheckExp(newValue);
                this.getGraph().handleChange();
            });
    successCheckExpInput.disableProperty().bind(successOption.selectedProperty().not());
    cf.addOption("Script expression to verify if node is successful", successCheckExpInput);

    this.createEnterAndLeaveScriptConfig(cf);

    return cf;
}