if( outputValue.isEmpty().get() || outputValue.get().equals(IDENTITY_MAPPER) ){ return null; } else {
if (usePromptText.get()) { createPromptNodeRunnable.run(); usePromptText.addListener(observable -> { createPromptNodeRunnable.run(); control.requestLayout();
@Override public void initialize(URL location, ResourceBundle resources) { BooleanBinding noSelection = fileListView.getSelectionModel().selectedItemProperty().isNull(); removeFileButton.disableProperty().bind(noSelection); moveItemUpButton.disableProperty().bind(noSelection.or(fileListView.getSelectionModel().selectedIndexProperty().isEqualTo(0))); // we can't just map the val because we need an ObservableNumberValue IntegerBinding lastIndexBinding = Bindings.createIntegerBinding(() -> fileListView.getItems().size() - 1, Val.wrap(fileListView.itemsProperty()).flatMap(LiveList::sizeOf)); moveItemDownButton.disableProperty().bind(noSelection.or(fileListView.getSelectionModel().selectedIndexProperty().isEqualTo(lastIndexBinding))); fileListView.setCellFactory(DesignerUtil.simpleListCellFactory(File::getName, File::getAbsolutePath)); selectFilesButton.setOnAction(e -> onSelectFileClicked()); removeFileButton.setOnAction(e -> onRemoveFileClicked()); moveItemUpButton.setOnAction(e -> moveUp()); moveItemDownButton.setOnAction(e -> moveDown()); }
passwordNew.disableProperty().bind(passwordKey.textProperty().isEmpty().or(validKey.not())); passwordNew.textProperty().addListener((observable, oldValue, newValue) -> { if (!Strings.isNullOrEmpty(passwordKey.getText())){ validKey.addListener(booleanChangeListener); booleanChangeListener.changed(validKey,validKey.get(),validKey.get()); grid.disableProperty().bind(readOnly); return grid;
ImageView convoyGraphic = new ImageView(convoyImg); ImageView convoyJoinLeaveGraphic = new ImageView(joinConvoyImg); if (inConvoy().get()) { convoyJoinLeaveGraphic.setImage(leaveConvoyImg); } else { BooleanBinding disableWeapon = new BooleanBinding() { super.bind(viewState.getCurrentCityProxy().get().activeShipProperty()); convoyLbl.disableProperty().bind(inConvoy().not()); setupConvoyJoinLeaveLabel(leaveConvoyImg, joinConvoyImg, convoyJoinLeaveGraphic, convoyJoinLeaveLbl, inConvoy().getValue()); inConvoy().addListener((observable, oldValue, newValue) -> setupConvoyJoinLeaveLabel(leaveConvoyImg, joinConvoyImg, convoyJoinLeaveGraphic, convoyJoinLeaveLbl, newValue)); autoTradeLbl.disableProperty().bind(isOrlegCapable().not());
BooleanBinding enableAction = new BooleanBinding() { super.bind(currentShip); action.setDisable(!enableAction.get()); enableAction.addListener((observableValue, oldValue, newValue) -> action.setDisable(!newValue)); getContent().add(action); timerEventBus.register(this);
@Override public BooleanBinding and(ObservableBooleanValue other) { return getDelegate().and(other); }
@Override public void addListener(InvalidationListener listener) { getDelegate().addListener(listener); }
@Override public BooleanBinding not() { return getDelegate().not(); }
dialog.getDialogPane().setContent(pane); BooleanBinding okProperty = folderSelectionPane.nodeProperty().isNotNull() .and(nameTextField.okProperty()); button.disableProperty().bind(okProperty.not()); dialog.setResizable(true); dialog.setResultConverter(buttonType -> buttonType == ButtonType.OK ? Boolean.TRUE : Boolean.FALSE);
comboBox.getEditor().setPromptText(null); comboBox.getEditor().textProperty().addListener((o, oldVal, newVal) -> { linesWrapper.usePromptText.invalidate(); comboBox.setValue(getConverter().fromString(newVal)); });
enablePreviousNext = new BooleanBinding() { super.bind(notices); action.setLayoutY(CLOSE_BTN_Y_POS - 24); enablePreviousNext.addListener((observableValue, oldVBoolean, newValue) -> { next.setDisable(!newValue); previous.setDisable(!newValue);
@Override public Boolean getValue() { return getDelegate().getValue(); }
newValueTextField.disableProperty().bind(keyField.textProperty().isEmpty().or(validKey.not())); newValueTextField.textProperty().addListener((observable, oldValue, newValue1) -> { if (!Strings.isNullOrEmpty(keyField.getText())){ validKey.addListener(booleanChangeListener); booleanChangeListener.changed(validKey,null,validKey.get());
BooleanBinding enableAction = new BooleanBinding() { super.bind(currentShip,sailorsAdditionalOnShip); action.setLayoutY(CLOSE_BTN_Y_POS - 24); action.setDisable(!enableAction.get()); enableAction.addListener((observableValue, oldValue, newValue) -> action.setDisable(!newValue)); getContent().add(action);
private BooleanBinding validatedProperty() { return nameTextField.textProperty().isNotEmpty().and(uniqueName); }
@Override public void addListener(ChangeListener<? super Boolean> listener) { getDelegate().addListener(listener); }
public static <F> Optional<F> showAndWaitDialog(Window window, F parent, Function<String, F> folderCreator, Predicate<String> folderUnique) { Objects.requireNonNull(window); Objects.requireNonNull(parent); Objects.requireNonNull(folderCreator); Objects.requireNonNull(folderUnique); Dialog<F> dialog = new Dialog<>(); try { dialog.setTitle(RESOURCE_BUNDLE.getString("NewFolder")); dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL); NewFolderPane<F> newProjectPane = new NewFolderPane<>(folderCreator, folderUnique); newProjectPane.setPrefSize(350, 100); dialog.getDialogPane().lookupButton(ButtonType.OK).disableProperty().bind(newProjectPane.validatedProperty().not()); dialog.getDialogPane().setContent(newProjectPane); dialog.setResizable(true); dialog.initOwner(window); dialog.setResultConverter(buttonType -> buttonType == ButtonType.OK ? newProjectPane.createFolder() : null); return dialog.showAndWait(); } finally { dialog.close(); } } }
private void invalidatePending() { if(pending != null) { pending.invalidate(); } } }