binding = Bindings.createStringBinding(() -> { if( outputValue.isEmpty().get() || outputValue.get().equals(IDENTITY_MAPPER) ){ return null;
@Override public void initialize(URL location, ResourceBundle resources) { Bindings.bindContent( log.getChildren(), ui.outputMessages() ); } }
rootNode.predicateProperty().bind(Bindings.createObjectBinding(() -> { if (filterField.getText() == null || filterField.getText().isEmpty()) return null;
Bindings.createStringBinding(() -> String.format( "Speedment settings for %s '%s' %s", withName instanceof Table Bindings.bindContentBidirectional(ui.getProperties(), properties);
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)); }
/** * will retrieve icons from the glyphs map for a certain glyphName * * @param glyphName the glyph name * @return SVGGlyph node */ public static SVGGlyph getIcoMoonGlyph(String glyphName) throws Exception{ SVGGlyphBuilder builder = glyphsMap.get(glyphName); if(builder == null) throw new Exception("Glyph '" + glyphName + "' not found!"); SVGGlyph glyph = builder.build(); // we need to apply transformation to correct the icon since // its being inverted after importing from icomoon glyph.getTransforms().add(new Scale(1, -1)); Translate height = new Translate(); height.yProperty().bind(Bindings.createDoubleBinding(() -> -glyph.getHeight(), glyph.heightProperty())); glyph.getTransforms().add(height); return glyph; }
buttonConnect.disableProperty().bind(createBooleanBinding( () -> ((fieldHost.textProperty().isEmpty().get() || fieldPort.textProperty().isEmpty().get())
private void hideShowBehaviour(Node node){ node.visibleProperty().bind(enabled); node.managedProperty().bind(enabled); node.disableProperty().bind(Bindings.not(enabled)); }
@Override public void bindBidirectional(Property<U> other) { Bindings.bindBidirectional(this, other); }
private void pathChangedHandler(Observable o) { if (this.currentItem != null) { Bindings.unbindContent(this.elements, this.currentItem.getChildren()); } this.elements.clear(); this.currentItem = getSkinnable().getDir(); if (this.currentItem != null) { Bindings.bindContent(this.elements, this.currentItem.getChildren()); } }
protected HBox buildSelector() { HBox selector = new HBox(); selector.getStyleClass().add("wizard-form-fieldset-selector"); // displayed only if have more than one bloc selector.managedProperty().bind(Bindings.size(fieldsets).greaterThan(1)); return selector; }
private static <T> void addContextMenu(CheckListView<T> listView) { listView.setOnContextMenuRequested(event -> { ContextMenu contextMenu = new ContextMenu(); MenuItem selectAll = new MenuItem(RESOURCE_BUNDLE.getString("SelectAll")); selectAll.disableProperty().bind(Bindings.equal(listView.getItems().size(), Bindings.size(listView.getCheckModel().getCheckedIndices()))); selectAll.setOnAction(event2 -> listView.getCheckModel().checkAll()); MenuItem deselectAll = new MenuItem(RESOURCE_BUNDLE.getString("DeselectAll")); deselectAll.disableProperty().bind(Bindings.isEmpty(listView.getCheckModel().getCheckedIndices())); deselectAll.setOnAction(event2 -> listView.getCheckModel().clearChecks()); contextMenu.getItems().addAll(selectAll, deselectAll); contextMenu.show(listView, event.getScreenX(), event.getScreenY()); }); }
public void dispose() { itemsSubscription.unsubscribe(); Bindings.unbindContent(getChildren(), cellListManager.getNodes()); }
public AutoCompletePopupSkin(AutoCompletePopup<T> control){ this.control = control; suggestionList = new ListView<>(control.getSuggestions()); suggestionList.getStyleClass().add(AutoCompletePopup.DEFAULT_STYLE_CLASS); suggestionList.getStylesheets().add(AutoCompletionBinding.class .getResource("autocompletion.css").toExternalForm()); //$NON-NLS-1$ /** * Here we bind the prefHeightProperty to the minimum height between the * max visible rows and the current items list. We also add an arbitrary * 5 number because when we have only one item we have the vertical * scrollBar showing for no reason. */ suggestionList.prefHeightProperty().bind( Bindings.min(control.visibleRowCountProperty(), Bindings.size(suggestionList.getItems())) .multiply(LIST_CELL_HEIGHT).add(18)); suggestionList.setCellFactory(TextFieldListCell.forListView(control.getConverter())); //Allowing the user to control ListView width. suggestionList.prefWidthProperty().bind(control.prefWidthProperty()); suggestionList.maxWidthProperty().bind(control.maxWidthProperty()); suggestionList.minWidthProperty().bind(control.minWidthProperty()); registerEventListener(); }
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { super.buildFrom(controller, configuration); AnchorPane.setTopAnchor(iconContainer, -2.0); AnchorPane.setRightAnchor(iconContainer, 8.0); AnchorPane.setTopAnchor(link, 4.0); AnchorPane.setLeftAnchor(link, 0.0); AnchorPane.setRightAnchor(link, 0.0); container.getChildren().addAll(link); container.getChildren().add(label); // buildCircleIcon(); label.getStyleClass().add("ep-countable-button-count"); label.visibleProperty().bind(Bindings.greaterThan(count, 0)); Bindings.bindBidirectional(label.textProperty(), count, NumberFormat.getInstance()); }
final double curveTheta = 2 * curves.indexOf(curvedLine) * Math.PI / shapesNumber; curvedLine.controlX1Property().bind(Bindings.createDoubleBinding(() -> { final double a = firstCurve.getControlX1() - centerX; final double b = Math.sin(curveTheta) * (firstCurve.getControlY1() - centerY); }, firstCurve.controlX1Property(), firstCurve.controlY1Property())); curvedLine.controlY1Property().bind(Bindings.createDoubleBinding(() -> { final double a = Math.sin(curveTheta) * (firstCurve.getControlX1() - centerX); final double b = Math.cos(curveTheta) * (firstCurve.getControlY1() - centerY); curvedLine.controlX2Property().bind(Bindings.createDoubleBinding(() -> { final double a = firstCurve.getControlX2() - centerX; final double b = firstCurve.getControlY2() - centerY; }, firstCurve.controlX2Property(), firstCurve.controlY2Property())); curvedLine.controlY2Property().bind(Bindings.createDoubleBinding(() -> { final double a = Math.sin(curveTheta) * (firstCurve.getControlX2() - centerX); final double b = Math.cos(curveTheta) * (firstCurve.getControlY2() - centerY);
okey.disableProperty().bind(Bindings.createBooleanBinding( () -> IS_INVALID_MAIL.test(email.getText()), email.textProperty()
/** * Constructor */ public AdvancedPaginationBar() { super(); previousButton.getStyleClass().add("advanced-pagination-button"); nextButton.getStyleClass().add("advanced-pagination-button"); firstButton.getStyleClass().add("advanced-pagination-button"); lastButton.getStyleClass().add("advanced-pagination-button"); nextButton.setTooltip(new Tooltip("Next")); nextButton.disableProperty().bind(Bindings.not(hasNext)); lastButton.setTooltip(new Tooltip("Last")); lastButton.disableProperty().bind(Bindings.not(hasNext)); previousButton.setTooltip(new Tooltip("Back")); previousButton.disableProperty().bind(Bindings.not(hasPrevious)); firstButton.setTooltip(new Tooltip("First")); firstButton.disableProperty().bind(Bindings.not(hasPrevious)); layout.getChildren().addAll(rowsPerPageLabel, rowsPerPageCombo, itemsCount, firstButton, previousButton, nextButton, lastButton); }
/** * Constructor */ public ObjectModel() { addSetDataListener(); Bindings.bindBidirectional(creation, creationDate, new LocalDateTimeStringConverter()); Bindings.bindBidirectional(lastModification, lastModificationDate, new LocalDateTimeStringConverter()); }
/** * Constructor */ public FiedsetSelectorMenuRow() { getStyleClass().add("fieldset-selector-menu-row-wrapper"); subMenu.managedProperty().bind(subMenu.visibleProperty()); subMenu.getStyleClass().add("fieldset-selector-submenu-row-wrapper"); subMenu.setVisible(false); getChildren().add(rowslayout); expandCollapseIcon.visibleProperty().bind(Bindings.size(submenus).greaterThan(0)); }