List of usage examples for javafx.scene.control RadioButton selectedProperty
public final BooleanProperty selectedProperty()
From source file:de.pixida.logtest.designer.testrun.TestRunEditor.java
public void createLogFileSourceInputItems(final List<Triple<String, Node, String>> formItems) { final TextField logFilePath = new TextField(); this.logFilePathProperty.bind(logFilePath.textProperty()); HBox.setHgrow(logFilePath, Priority.ALWAYS); final Button selectLogFileButton = SelectFileButton.createButtonWithFileSelection(logFilePath, LogReaderEditor.LOG_FILE_ICON_NAME, "Select log file", null, null); final HBox fileInputConfig = new HBox(logFilePath, selectLogFileButton); final VBox lines = new VBox(); final double spacingOfLines = 5d; lines.setSpacing(spacingOfLines);/* w w w .j a v a 2s . com*/ final HBox inputTypeLine = new HBox(); final double hSpacingOfInputTypeChoices = 30d; inputTypeLine.setSpacing(hSpacingOfInputTypeChoices); final ToggleGroup group = new ToggleGroup(); final RadioButton inputTypeText = new RadioButton("Paste/Enter log"); inputTypeText.setToggleGroup(group); this.loadLogFromEnteredTextProperty.bind(inputTypeText.selectedProperty()); final RadioButton inputTypeFile = new RadioButton("Read log file"); inputTypeFile.setToggleGroup(group); this.loadLogFromFileProperty.bind(inputTypeFile.selectedProperty()); inputTypeFile.setSelected(true); inputTypeLine.getChildren().add(inputTypeText); inputTypeLine.getChildren().add(inputTypeFile); fileInputConfig.visibleProperty().bind(inputTypeFile.selectedProperty()); fileInputConfig.managedProperty().bind(fileInputConfig.visibleProperty()); final TextArea logInputText = new TextArea(); HBox.setHgrow(logInputText, Priority.ALWAYS); final int numLinesForEnteringLogInputManually = 10; logInputText.setPrefRowCount(numLinesForEnteringLogInputManually); logInputText.setStyle("-fx-font-family: monospace"); this.enteredLogTextProperty.bind(logInputText.textProperty()); final HBox enterTextConfig = new HBox(); enterTextConfig.getChildren().add(logInputText); enterTextConfig.visibleProperty().bind(inputTypeText.selectedProperty()); enterTextConfig.managedProperty().bind(enterTextConfig.visibleProperty()); lines.getChildren().addAll(inputTypeLine, fileInputConfig, enterTextConfig); formItems.add(Triple.of("Trace Log", lines, null)); }
From source file:de.pixida.logtest.designer.logreader.LogReaderEditor.java
public VBox createRunForm() { // CHECKSTYLE:OFF Yes, we are using lots of constants here. It does not make sense to name them using final variables. final VBox lines = new VBox(); lines.setSpacing(10d);/*from ww w.j ava 2 s .c om*/ final HBox inputTypeLine = new HBox(); inputTypeLine.setSpacing(30d); final ToggleGroup group = new ToggleGroup(); final RadioButton inputTypeText = new RadioButton("Paste/Enter text"); inputTypeText.setToggleGroup(group); final RadioButton inputTypeFile = new RadioButton("Read log file"); inputTypeFile.setToggleGroup(group); inputTypeLine.getChildren().add(inputTypeText); inputTypeLine.getChildren().add(inputTypeFile); inputTypeText.setSelected(true); final TextField pathInput = new TextField(); HBox.setHgrow(pathInput, Priority.ALWAYS); final Button selectLogFileButton = SelectFileButton.createButtonWithFileSelection(pathInput, LOG_FILE_ICON_NAME, "Select log file", null, null); final Text pathInputLabel = new Text("Log file path: "); final HBox fileInputConfig = new HBox(); fileInputConfig.setAlignment(Pos.CENTER_LEFT); fileInputConfig.visibleProperty().bind(inputTypeFile.selectedProperty()); fileInputConfig.managedProperty().bind(fileInputConfig.visibleProperty()); fileInputConfig.getChildren().addAll(pathInputLabel, pathInput, selectLogFileButton); final TextArea logInputText = new TextArea(); HBox.setHgrow(logInputText, Priority.ALWAYS); logInputText.setPrefRowCount(10); logInputText.setStyle("-fx-font-family: monospace"); final HBox enterTextConfig = new HBox(); enterTextConfig.getChildren().add(logInputText); enterTextConfig.visibleProperty().bind(inputTypeText.selectedProperty()); enterTextConfig.managedProperty().bind(enterTextConfig.visibleProperty()); final Button startBtn = new Button("Read Log"); startBtn.setPadding(new Insets(8d)); // CHECKSTYLE:ON startBtn.setGraphic(Icons.getIconGraphics("control_play_blue")); HBox.setHgrow(startBtn, Priority.ALWAYS); startBtn.setMaxWidth(Double.MAX_VALUE); startBtn.setOnAction(event -> this.runLogFileReader(inputTypeFile, pathInput, logInputText)); final HBox startLine = new HBox(); startLine.getChildren().add(startBtn); lines.getChildren().addAll(inputTypeLine, fileInputConfig, enterTextConfig, startLine, new Text("Results:"), this.parsedLogEntries); return lines; }
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 ww w . j av a 2 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; }