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; }
/** * 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)); }
/** * Default Constructor */ public SimpleForwardErrorPane() { getStyleClass().add("simple-forward-editor-error-pane"); managedProperty().bind(visibleProperty()); visibleProperty().bind(Bindings.size(getChildren()).greaterThan(0)); }
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { this.configuration = configuration; this.controller = (AbstractViewController) controller; // TODO Handle internationalication // CoreGeneralMessageSource // ms = (ResourceBundleMessageSource) Services.getBean("CoreGeneralMessageSource"); noNotificationsPane = new NoNotificationsPane(); internalPane.getChildren().add(noNotificationsPane); noNotificationsPane.visibleProperty().bind(Bindings.size(notifications).lessThan(1)); notifsPane = new NotifsPane(); internalPane.getChildren().add(notifsPane); notifsPane.visibleProperty().bind(Bindings.size(notifications).greaterThan(0)); filter.addListener((ListChangeListener<NotificationStatus>) c -> { onFilterChange(c); }); }
@Override protected void bind() { super.bind(); view().selectAll().visibleProperty().bind(Bindings.size(this.contentModel.getFilteredList()).greaterThan(0)); }
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(); }
@SuppressWarnings("unchecked") public VLAutoCompletePopupSkin(VLAutocomplete control) { this.control = control; suggestionList = control.getListPopup(); control.getListView().getStylesheets().add(AutoCompletionBinding.class.getResource("autocompletion.css").toExternalForm()); //$NON-NLS-1$ control.getListView().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(control.getListView().getItems())).multiply(LIST_CELL_HEIGHT).add(18)); // Allowing the user to control ListView width. suggestionList.prefWidthProperty().bind(control.widthProperty()); suggestionList.maxWidthProperty().bind(control.maxWidthProperty()); suggestionList.minWidthProperty().bind(control.minWidthProperty()); control.getListView().prefWidthProperty().bind(control.widthProperty()); control.getListView().maxWidthProperty().bind(control.maxWidthProperty()); control.getListView().minWidthProperty().bind(control.minWidthProperty()); }
modifyButton.visibleProperty().bind(Bindings.size(tableView.getTableView().getItems()).greaterThan(0));
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()); }); }
/** * {@inheritDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { this.configuration = configuration; this.controller = (AbstractViewController) controller; loadFXML(); NodeHelper.styleClassAddAll(tableHeaderRootPane, configuration, "styleClass"); NodeHelper.setTitle(headerTitle, configuration, (AbstractViewController) controller, true); NodeHelper.styleClassSetAll(headerTitle, configuration, "titleStyleClass", "ep-table-title-label"); NodeHelper.styleClassAddAll(titleContainer, configuration, "titleContainerStyleClass"); filterTextField.managedProperty().bind(filterTextField.visibleProperty()); filterTextField.setPromptText("Find in table"); boolean filtrable = configuration.getBooleanProperty("filtrable", true); filterTextField.setVisible(filtrable); ((FullTableStructureController) controller).processedElementProperty().addListener((ChangeListener<Object>) (observable, oldValue, newValue) -> { AbstractTableStructure ts = (AbstractTableStructure) ((FullTableStructureController) controller).processedElementProperty().get(); if (ts.getToolbar().isPresent()) { Node tb = ts.getToolbar().get(); HBox.setHgrow(tb, Priority.NEVER); actionsContainer.getChildren().add(tb); } }); setRootModel(); headerTitle.managedProperty().bind(headerTitle.visibleProperty()); headerTitle.visibleProperty().bind(Bindings.size(titleContainer.getChildren()).isEqualTo(0)); titleContainer.visibleProperty().bind(Bindings.size(titleContainer.getChildren()).greaterThan(0)); titleContainer.managedProperty().bind(titleContainer.visibleProperty()); }
list.prefHeightProperty().bind(Bindings.size(list.getItems()).multiply(FONT_SIZE));