@Override protected Node createUndecoratedEditor() { final CheckBox cbNull = new CheckBox(); final Node wrappedCb = ItemUtil.lockDecorator(cbNull, document, ItemUtil.DATABASE_RELATION_TOOLTIP); final Label label = new Label(IMPLEMENTATION_TITLE); final ChoiceBox<ImplementAs> cbImpl = new ChoiceBox<>( observableArrayList(ImplementAs.values()) ); cbImpl.setTooltip(new Tooltip(IMPLEMENTATION_TOOLTIP)); final HBox right = new HBox(label, cbImpl); final HBox left = new HBox(wrappedCb, right); left.setSpacing(16); right.setSpacing(8); right.setAlignment(Pos.CENTER); cbNull.selectedProperty().bindBidirectional(nullable); cbImpl.valueProperty().bindBidirectional(implementation); right.visibleProperty().bind(nullable); right.disableProperty().bind(nullable.not()); return left; }
promptText.setManaged(false); promptText.getStyleClass().add("text"); promptText.visibleProperty().bind(linesWrapper.usePromptText); promptText.fontProperty().bind(getSkinnable().fontProperty()); promptText.textProperty().bind(getSkinnable().promptTextProperty());
promptText.setManaged(false); promptText.getStyleClass().add("text"); promptText.visibleProperty().bind(linesWrapper.usePromptText); promptText.fontProperty().bind(getSkinnable().fontProperty()); promptText.textProperty().bind(getSkinnable().promptTextProperty());
promptText.setManaged(false); promptText.getStyleClass().add("text"); promptText.visibleProperty().bind(linesWrapper.usePromptText); promptText.fontProperty().bind(getSkinnable().fontProperty()); promptText.textProperty().bind(getSkinnable().promptTextProperty());
promptText.setManaged(false); promptText.getStyleClass().add("text"); promptText.visibleProperty().bind(linesWrapper.usePromptText); promptText.fontProperty().bind(getSkinnable().fontProperty()); promptText.textProperty().bind(getSkinnable().promptTextProperty());
@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()); }
areaConnectionUrl.disableProperty().bind( enableConnectionUrl.selectedProperty().not() ); fieldFileBtn.disableProperty().bind( enableConnectionUrl.selectedProperty() ); buttonConnect.disableProperty().bind(createBooleanBinding( () -> ((fieldHost.textProperty().isEmpty().get() || fieldPort.textProperty().isEmpty().get())
private void createPromptNode() { if (promptText != null || !linesWrapper.usePromptText.get()) { return; } promptText = new Text(); StackPane.setAlignment(promptText, Pos.CENTER_LEFT); // create my custom pane for the prompt node promptText.textProperty().bind(getSkinnable().promptTextProperty()); promptText.fillProperty().bind(linesWrapper.animatedPromptTextFill); promptText.getStyleClass().addAll("text"); promptText.getTransforms().add(linesWrapper.promptTextScale); promptText.visibleProperty().bind(linesWrapper.usePromptText); promptText.setTranslateX(1); linesWrapper.promptContainer.getChildren().add(promptText); if (getSkinnable().isFocused() && ((JFXComboBox<T>) getSkinnable()).isLabelFloat()) { promptText.setTranslateY(-snapPosition(promptText.getBaselineOffset() + promptText.getLayoutBounds().getHeight() * .36)); linesWrapper.promptTextScale.setX(0.85); linesWrapper.promptTextScale.setY(0.85); } }
okey.disableProperty().bind(Bindings.createBooleanBinding( () -> IS_INVALID_MAIL.test(email.getText()), email.textProperty()
spinner.disableProperty().bind(auto.selectedProperty()); spinner.setEditable(true);
@Override protected Node createUndecoratedEditor() { //TODO: CustomValue should be bound to defaultValue until we disable auto for the first time final HBox container = new HBox(); final TextInputControl textInput = getInputControl(); final CheckBox auto = new CheckBox("Auto"); final boolean useDefaultValue = value.isEmpty().get() || value.get().equals(defaultValue.get()); textInput.disableProperty().bind(auto.selectedProperty()); if (useDefaultValue) { textInput.textProperty().bind(defaultValue); } else { textInput.setText(value.get()); } customValue.bind(textInput.textProperty()); attachListener(textInput.textProperty(), (ov, o, n) -> { if (n == null || n.isEmpty() || n.equalsIgnoreCase(defaultValue.getValue())) { value.setValue(null); } else { value.setValue(n); } }); auto.selectedProperty().setValue(useDefaultValue); attachListener(auto.selectedProperty(), (ov, o, isAuto) -> setTextFieldBehaviour(textInput, isAuto, defaultValue, customValue) ); HBox.setHgrow(textInput, Priority.ALWAYS); HBox.setHgrow(auto, Priority.NEVER); container.getChildren().addAll(auto, textInput); return container; }
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)); }
@Override public void initialize(URL location, ResourceBundle resources) { commitButton.setOnAction(e -> { commitHandler.ifPresent(Runnable::run); getStage().close(); this.free(); }); commitButton.disableProperty().bind(validationSupport.invalidProperty()); Platform.runLater(() -> { typeId.bind(typeChoiceBox.getSelectionModel().selectedItemProperty()); typeChoiceBox.setConverter(DesignerUtil.stringConverter(PropertyTypeId::getStringId, PropertyTypeId::lookupMnemonic)); typeChoiceBox.getItems().addAll(PropertyTypeId.typeIdsToConstants().values()); FXCollections.sort(typeChoiceBox.getItems()); }); Platform.runLater(this::registerBasicValidators); typeIdProperty().values() .filter(Objects::nonNull) .subscribe(this::registerTypeDependentValidators); }
button.disableProperty().bind(validation.invalidProperty());
closeButton.managedProperty().bind(closeButton.visibleProperty()); closeButton.setVisible(false);
@Inject QuickbarDashboardButtonsPane(List<DashboardItem> items) { items.stream().filter(i -> !i.disabled()).sorted((a, b) -> a.priority() - b.priority()) .map(DashboardButton::new).forEach(currentButton -> { currentButton.displayTextProperty().bind(displayTextProperty()); getChildren().add(currentButton); buttons.add(currentButton); }); eventStudio().addAnnotatedListeners(this); }
@Inject QuickbarModuleButtonsPane(QuickbarModuleButtonsProvider provider) { provider.buttons().forEach(b -> { b.displayTextProperty().bind(displayTextProperty()); getChildren().add(b); this.buttons.add(b); }); eventStudio().addAnnotatedListeners(this); }
btnProceed.disableProperty().bind(hasErrors);
public QuickbarPane(BaseQuickbarButtonsPane items) { ExpandButton expandButton = new ExpandButton(); getStyleClass().add("quickbar"); items.displayTextProperty().bind(expandButton.selectedProperty()); VBox buttonContainer = new VBox(expandButton, items); buttonContainer.getStyleClass().add("quickbar-buttons"); setVgrow(buttonContainer, Priority.ALWAYS); getChildren().addAll(buttonContainer); } }