public ProjectProblemController(){ issues = FXCollections.observableArrayList(); hasErrors = Bindings.isNotEmpty(issues.filtered(issue -> issue.getLevel() == Issue.Level.ERROR)); }
private FilteredList<Node> inRow(RowConstraints row) { final int index = grid.getRowConstraints().indexOf(row); return grid.getChildren() .filtered(node -> { final Integer rowIndex = GridPane.getRowIndex(node); return rowIndex != null && index == GridPane.getRowIndex(node); }); }
private void setFilteredItems(PdfVersion required) { if (nonNull(required)) { PdfVersionComboItem selected = getSelectionModel().getSelectedItem(); setItems(unfilteredItems.filtered(t -> t.isHigherOrEqual(required))); int selecedIndex = getItems().indexOf(selected); if (selecedIndex != -1) { getSelectionModel().select(selecedIndex); } else { getSelectionModel().selectFirst(); } } }
void dispose() { if (this.fsSubscription != null) { this.fsSubscription.dispose(); if (this.children != null) { this.children.filtered(i -> i instanceof DirPathItemImpl) .forEach(i -> ((DirPathItemImpl) i).dispose()); } } } }
void dispose() { if (this.fsSubscription != null) { this.fsSubscription.dispose(); if (this.children != null) { this.children.filtered(i -> i instanceof DirPathItemImpl) .forEach(i -> ((DirPathItemImpl) i).dispose()); } } } }
private void updateBackgroundShapes() { int start = 0; // calculate shared values among consecutive nodes FilteredList<Node> nodeList = getChildren().filtered(node -> node instanceof TextExt); for (Node node : nodeList) { TextExt text = (TextExt) node; int end = start + text.getText().length(); Paint backgroundColor = text.getBackgroundColor(); if (backgroundColor != null) { backgroundShapeHelper.updateSharedShapeRange(backgroundColor, start, end, Paint::equals); } BorderAttributes border = new BorderAttributes(text); if (!border.isNullValue()) { borderShapeHelper.updateSharedShapeRange(border, start, end, BorderAttributes::equalsFaster); } UnderlineAttributes underline = new UnderlineAttributes(text); if (!underline.isNullValue()) { underlineShapeHelper.updateSharedShapeRange(underline, start, end, UnderlineAttributes::equalsFaster); } start = end; } borderShapeHelper.updateSharedShapes(); backgroundShapeHelper.updateSharedShapes(); underlineShapeHelper.updateSharedShapes(); }
private ApplicationSidebar createApplicationSidebar() { /* * initialize the category lists by: * 1. filtering by installer categories * 2. sorting the remaining categories by their name */ final SortedList<CategoryDTO> sortedCategories = this.categories .filtered(category -> category.getType() == CategoryDTO.CategoryType.INSTALLERS) .sorted(Comparator.comparing(CategoryDTO::getName)); final ApplicationSidebar sidebar = new ApplicationSidebar(filter, sortedCategories, selectedListWidget); // set the default selection sidebar.setSelectedListWidget(javaFxSettingsManager.getAppsListType()); // save changes to the list widget selection to the hard drive sidebar.selectedListWidgetProperty().addListener((observable, oldValue, newValue) -> { if (newValue != null) { javaFxSettingsManager.setAppsListType(newValue); javaFxSettingsManager.save(); } }); return sidebar; }
private LibrarySidebarToggleGroup createSidebarToggleGroup() { final FilteredList<ShortcutCategoryDTO> filteredShortcutCategories = shortcutCategories .filtered(filter::filter); filteredShortcutCategories.predicateProperty().bind( Bindings.createObjectBinding(() -> filter::filter, filter.searchTermProperty())); final LibrarySidebarToggleGroup categoryView = new LibrarySidebarToggleGroup(tr("Categories"), filteredShortcutCategories); filter.selectedShortcutCategoryProperty().bind(categoryView.selectedElementProperty()); return categoryView; }
private InstallationsSidebarToggleGroup createSidebarToggleGroup() { final FilteredList<InstallationCategoryDTO> filteredInstallationCategories = installationCategories .filtered(filter::filter); filteredInstallationCategories.predicateProperty().bind( Bindings.createObjectBinding(() -> filter::filter, filter.searchTermProperty())); final InstallationsSidebarToggleGroup categoryView = new InstallationsSidebarToggleGroup(tr("Categories"), filteredInstallationCategories); filter.selectedInstallationCategoryProperty().bind(categoryView.selectedElementProperty()); return categoryView; }
/** * This method populates the button group showing all installed containers */ private ContainersSidebarToggleGroup createSidebarToggleGroup() { FilteredList<ContainerCategoryDTO> filteredContainerCategories = containerCategories.filtered(filter::filter); filteredContainerCategories.predicateProperty().bind( Bindings.createObjectBinding(() -> filter::filter, filter.searchTermProperty(), filter.selectedContainerCategoryProperty())); ContainersSidebarToggleGroup sidebarToggleGroup = new ContainersSidebarToggleGroup(tr("Containers"), filteredContainerCategories); filter.selectedContainerCategoryProperty().bind(sidebarToggleGroup.selectedElementProperty()); return sidebarToggleGroup; }
/** * Creates a filtered version of <code>scripts</code> * * @return A filtered version of the scripts list */ private FilteredList<ScriptDTO> createFilteredScripts() { final ApplicationFilter filter = getControl().getFilter(); final FilteredList<ScriptDTO> filteredScripts = scripts.filtered(filter::filter); filteredScripts.predicateProperty().bind( Bindings.createObjectBinding(() -> filter::filter, filter.containAllOSCompatibleApplicationsProperty(), filter.containCommercialApplicationsProperty(), filter.containRequiresPatchApplicationsProperty(), filter.containTestingApplicationsProperty())); return filteredScripts; }
private void selectIntersectingNodes(Parent root, boolean deselect) { List<Node> selectableNodes = root.getChildrenUnmodifiable(). filtered(n -> n instanceof SelectableNode); boolean rectBigEnough = rectangle.getWidth() > 1 || rectangle.getHeight() > 1; for (Node n : selectableNodes) { boolean selectN = rectangle.intersects( rectangle.parentToLocal( n.localToParent(n.getBoundsInLocal()))); SelectableNode sn = (SelectableNode) n; if ((deselect || potentiallySelected(sn)) || (selectN && rectBigEnough)) { WindowUtil.getDefaultClipboard().select( sn, (selectN && rectBigEnough)); } } }
/** * This method populates the button group showing all known engine categories */ private EnginesSidebarToggleGroup createSidebarToggleGroup() { final FilteredList<EngineCategoryDTO> filteredEngineCategories = engineCategories.filtered(filter::filter); filteredEngineCategories.predicateProperty().bind( Bindings.createObjectBinding(() -> filter::filter, filter.searchTermProperty(), filter.showInstalledProperty(), filter.showNotInstalledProperty())); final EnginesSidebarToggleGroup categoryView = new EnginesSidebarToggleGroup(tr("Engines"), filteredEngineCategories); filter.selectedEngineCategoryProperty().bind(categoryView.selectedElementProperty()); return categoryView; }
private CombinedListWidget<ApplicationDTO> createApplicationListWidget() { /* * initialising the application lists by: * 1. sorting the applications by their name * 2. filtering them */ final FilteredList<ApplicationDTO> filteredApplications = ConcatenatedList .create(new MappedList<>( this.categories.filtered(category -> category.getType() == CategoryDTO.CategoryType.INSTALLERS), CategoryDTO::getApplications)) .sorted(Comparator.comparing(ApplicationDTO::getName)) .filtered(this.filter::filter); filteredApplications.predicateProperty().bind( Bindings.createObjectBinding(() -> this.filter::filter, this.filter.filterTextProperty(), this.filter.filterCategoryProperty(), this.filter.containAllOSCompatibleApplicationsProperty(), this.filter.containCommercialApplicationsProperty(), this.filter.containRequiresPatchApplicationsProperty(), this.filter.containTestingApplicationsProperty())); final ObservableList<ListWidgetElement<ApplicationDTO>> listWidgetEntries = new MappedList<>( filteredApplications, ListWidgetElement::create); final CombinedListWidget<ApplicationDTO> listWidget = new CombinedListWidget<>(listWidgetEntries, selectedListWidget); this.selectedApplication.bind(Bindings.createObjectBinding(() -> { final ListWidgetSelection<ApplicationDTO> selection = listWidget.getSelectedElement(); return selection != null ? selection.getItem() : null; }, listWidget.selectedElementProperty())); return listWidget; }
private ApplicationSidebarToggleGroup createSidebarToggleGroup() { final FilteredList<CategoryDTO> filteredCategories = getControl().getItems() .filtered(getControl().getFilter()::filter); filteredCategories.predicateProperty().bind( Bindings.createObjectBinding(() -> getControl().getFilter()::filter, getControl().searchTermProperty(), getControl().containAllOSCompatibleApplicationsProperty(), getControl().containCommercialApplicationsProperty(), getControl().containRequiresPatchApplicationsProperty(), getControl().containTestingApplicationsProperty())); return new ApplicationSidebarToggleGroup(tr("Categories"), filteredCategories, getControl().filterCategoryProperty()); }