public HighLightRectangle(Text text) { listener = observable -> clear(text); text.textProperty().addListener(new WeakInvalidationListener(listener)); text.localToSceneTransformProperty().addListener(new WeakInvalidationListener(listener)); }
fieldHost.textProperty().addListener((ob, o, n) -> recalculateFields.run()); fieldPort.textProperty().addListener((ob, o, n) -> recalculateFields.run()); fieldFile.textProperty().addListener((ob, o, n) -> recalculateFields.run()); fieldUser.textProperty().addListener((ob, o, n) -> recalculateFields.run()); fieldName.textProperty().addListener((ob, o, n) -> recalculateFields.run()); fieldSchema.textProperty().addListener((ob, o, n) -> recalculateFields.run()); areaConnectionUrl.textProperty().addListener((ob, o, n) -> recalculateFields.run());
minCircle.setTranslateX(selectionCircle.getRadius() - minCircle.getRadius()); minCircle.setVisible(time.getMinute() % 5 != 0); selectedMinLabel.textProperty().addListener((o, oldVal, newVal) -> { if (Integer.parseInt(newVal) % 5 == 0) { minCircle.setVisible(false); selectedMinLabel.textProperty().addListener((o, oldVal, newVal) -> { if (Integer.parseInt(newVal) == Integer.parseInt(label.getText())) { label.setTextFill(Color.rgb(255, 255, 255, 0.87));
filterField.textProperty().addListener((o, oldVal, newVal) -> { treeView.setPredicate(userProp -> { final User user = userProp.getValue();
period.addListener((o, oldVal, newVal) -> { swapLabelsColor(periodPMLabel, periodAMLabel); updateValue();
selectedHourLabel.textProperty().addListener((o, oldVal, newVal) -> { if (Integer.parseInt(newVal) == Integer.parseInt(label.getText())) { label.setTextFill(Color.rgb(255, 255, 255, 0.87)); selectedHourLabel.textProperty().addListener((o, oldVal, newVal) -> { if (Integer.parseInt(newVal) == Integer.parseInt(label.getText())) { label.setTextFill(Color.rgb(255, 255, 255, 0.54));
username.textProperty().addListener((ob, o, n) -> loginButton.setDisable(n.trim().isEmpty()) );
editor.textProperty().addListener(observable -> {
private void setupReadOnlyTableView() { setupCellValueFactory(firstNameColumn, Person::firstNameProperty); setupCellValueFactory(lastNameColumn, Person::lastNameProperty); setupCellValueFactory(ageColumn, p -> p.age.asObject()); ObservableList<Person> dummyData = generateDummyData(100); treeTableView.setRoot(new RecursiveTreeItem<>(dummyData, RecursiveTreeObject::getChildren)); treeTableView.setShowRoot(false); treeTableViewCount.textProperty() .bind(Bindings.createStringBinding(() -> PREFIX + treeTableView.getCurrentItemsCount() + POSTFIX, treeTableView.currentItemsCountProperty())); treeTableViewAdd.disableProperty() .bind(Bindings.notEqual(-1, treeTableView.getSelectionModel().selectedIndexProperty())); treeTableViewRemove.disableProperty() .bind(Bindings.equal(-1, treeTableView.getSelectionModel().selectedIndexProperty())); treeTableViewAdd.setOnMouseClicked((e) -> { dummyData.add(createNewRandomPerson()); final IntegerProperty currCountProp = treeTableView.currentItemsCountProperty(); currCountProp.set(currCountProp.get() + 1); }); treeTableViewRemove.setOnMouseClicked((e) -> { dummyData.remove(treeTableView.getSelectionModel().selectedItemProperty().get().getValue()); final IntegerProperty currCountProp = treeTableView.currentItemsCountProperty(); currCountProp.set(currCountProp.get() - 1); }); searchField.textProperty().addListener(setupSearchField(treeTableView)); }
rgbField.textProperty().addListener((o, oldVal, newVal) -> updateColorFromUserInput(newVal)); hsbField.textProperty().addListener((o, oldVal, newVal) -> updateColorFromUserInput(newVal)); hexField.textProperty().addListener((o, oldVal, newVal) -> updateColorFromUserInput(newVal));
comboBox.getEditor().promptTextProperty().unbind(); comboBox.getEditor().setPromptText(null); comboBox.getEditor().textProperty().addListener((o, oldVal, newVal) -> { linesWrapper.usePromptText.invalidate(); comboBox.setValue(getConverter().fromString(newVal));
editableTreeTableView.currentItemsCountProperty())); searchField2.textProperty() .addListener(setupSearchField(editableTreeTableView));
public ValidableTextField(String text) { super(text); this.getStyleClass().add("validable-field"); focusedProperty().addListener((o, oldVal, newVal) -> { if (!newVal) { validate(); } }); textProperty().addListener((o, oldVal, newVal) -> validationSupport.makeNotValidated()); validationSupport.validationStateProperty().addListener( o -> { if (validationSupport.validationStateProperty().get() == ValidationState.INVALID && errorTooltipManager != null) { errorTooltipManager.showTooltip(); } }); }
StringProperty a = new SimpleStringProperty(""); StringProperty b = new SimpleStringProperty(""); a.addListener((obs, oldValue, newValue) -> { b.set(newValue); }); b.addListener((obs, oldValue, newValue) -> { a.set(newValue); });
private void initializeListeners() { searchBox.textProperty().addListener(l -> { searchMode = !searchBox.getText().isEmpty(); filterList.setPredicate(val -> searchBox.getText().isEmpty() || columnFilter.getSearchStrategy().test(searchBox.getText(), Optional.ofNullable(val.getValue()).map(Object::toString).orElse(""))); }); }
public static void setupURITextField(TextField textField) { textField.textProperty().addListener((observable, oldValue, newValue) -> { if (newValue!=null){ try { URI uri = new URI(newValue); textField.getStyleClass().removeIf("error"::equals); } catch (URISyntaxException e) { textField.getStyleClass().add("error"); } } }); }
private void registerListeners(boolean live) { if (live) { textInputControl.textProperty().addListener(textHandler); } else { EventHandler<? super KeyEvent> delegate = textInputControl.getOnKeyReleased(); KeyHandler keyHandler = new KeyHandler(delegate); textInputControl.setOnKeyReleased(keyHandler); } }
/** * {@inheritDoc} */ @Override public void setupValueChangedListeners() { super.setupValueChangedListeners(); field.userInputProperty().addListener((observable, oldValue, newValue) -> checkBox.setSelected(Boolean.parseBoolean(field.getUserInput()))); field.errorMessagesProperty().addListener((observable, oldValue, newValue) -> toggleTooltip(checkBox)); field.tooltipProperty().addListener((observable, oldValue, newValue) -> toggleTooltip(checkBox)); checkBox.focusedProperty().addListener((observable, oldValue, newValue) -> toggleTooltip(checkBox)); }
private javafx.scene.Node createStringComponent(Parameter parameter) { TextField textField = new TextField((String) parameter.getDefaultValue()); textField.textProperty().addListener((observable, oldValue, newValue) -> parametersValue.put(parameter.getName(), newValue)); return new VBox(5, new Label(parameter.getDescription()), textField); }
public HighLightRectangle(Text text) { listener = observable -> clear(text); text.textProperty().addListener(new WeakInvalidationListener(listener)); text.localToSceneTransformProperty().addListener(new WeakInvalidationListener(listener)); }