public WorkspaceController() { this.properties = FXCollections.observableArrayList(); }
private UserInterfaceComponentImpl() { notifications = FXCollections.observableArrayList(); outputMessages = FXCollections.observableArrayList(); selectedTreeItems = FXCollections.observableArrayList(); properties = FXCollections.observableArrayList(); canGenerate = new AtomicBoolean(true); }
public IssueComponentImpl(){ this.issues = FXCollections.observableArrayList(); }
private ObservableList<Person> generateDummyData(final int numberOfEntries) { final ObservableList<Person> dummyData = FXCollections.observableArrayList(); for (int i = 0; i < numberOfEntries; i++) { dummyData.add(createNewRandomPerson()); } return dummyData; }
public static ObservableList<PropertyDescriptorSpec> observableList() { return FXCollections.observableArrayList(extractor()); } }
private ObservableList<MetricResult> evaluateAllMetrics(Node n) { LanguageMetricsProvider<?, ?> provider = parent.getLanguageVersion().getLanguageVersionHandler().getLanguageMetricsProvider(); if (provider == null) { return FXCollections.emptyObservableList(); } List<MetricResult> resultList = provider.computeAllMetricsFor(n) .entrySet() .stream() .map(e -> new MetricResult(e.getKey(), e.getValue())) .collect(Collectors.toList()); return FXCollections.observableArrayList(resultList); }
AddRemoveStringItem( final DOC column, final String label, final StringProperty value, final String tooltip, final ObservableBooleanValue enableThis) { super(label, tooltip, NO_DECORATOR); final String currentValue = value.get(); if (currentValue == null) { this.strings = FXCollections.observableArrayList(); } else { this.strings = FXCollections.observableArrayList( Stream.of(currentValue.split(",")) .filter(s -> !s.isEmpty()) .toArray(String[]::new) ); } this.column = requireNonNull(column); this.enabled = enableThis; this.cache = new SimpleStringProperty(); this.strings.addListener((ListChangeListener.Change<? extends String> c) -> { @SuppressWarnings("unchecked") final List<String> list = (List<String>) c.getList(); value.setValue(getFormatedString(list)); }); }
public ProjectProblemController(){ issues = FXCollections.observableArrayList(); hasErrors = Bindings.isNotEmpty(issues.filtered(issue -> issue.getLevel() == Issue.Level.ERROR)); }
@Override public Stream<Item> fieldsFor(T document) { final ObservableList<OrderType> alternatives = FXCollections.observableArrayList(OrderType.values()); return Stream.of( new ChoiceBoxItem<>( "Order Type", document.orderTypeProperty(), alternatives, "The order in which elements will be considered.", (editor) -> ItemUtil.lockDecorator(editor, document, ItemUtil.DATABASE_RELATION_TOOLTIP) ) ); }
/** * Gets the XPath attributes of the node for display within a listview. */ private ObservableList<String> getAttributes(Node node) { if (node == null) { return FXCollections.emptyObservableList(); } ObservableList<String> result = FXCollections.observableArrayList(); Iterator<Attribute> attributeAxisIterator = node.getXPathAttributesIterator(); while (attributeAxisIterator.hasNext()) { Attribute attribute = attributeAxisIterator.next(); if (!(isHideCommonAttributes() && IGNORABLE_ATTRIBUTES.contains(attribute.getName()))) { // TODO the display should be handled in a ListCell result.add(attribute.getName() + " = " + ((attribute.getValue() != null) ? attribute.getStringValue() : "null")); } } // TODO maybe put some equivalent to TypeNode inside pmd-core // if (node instanceof TypeNode) { // result.add("typeIs() = " + ((TypeNode) node).getType()); // } Collections.sort(result); return result; } }
private void addChildrenListener(RecursiveTreeObject<T> value) { final ObservableList<T> children = childrenFactory.call(value); originalItems = FXCollections.observableArrayList(); itemsMap = new HashMap<>();
= FXCollections.observableArrayList(xpathEvaluator.evaluateQuery(compilationUnit, version, getXpathVersion(),
fileListView.setItems(FXCollections.observableArrayList(currentItems));
ObservableList<User> users = FXCollections.observableArrayList(); users.add(new User(COMPUTER_DEPARTMENT, "23", "CD 1")); users.add(new User(SALES_DEPARTMENT, "22", "Employee 1"));
public FilterableTreeItem(T value) { super(value); this.sourceList = FXCollections.observableArrayList(); this.filteredList = new FilteredList<>(this.sourceList); this.filteredList.predicateProperty().bind(Bindings.createObjectBinding(() -> { return child -> { // Set the predicate of child items to force filtering if (child instanceof FilterableTreeItem) { FilterableTreeItem<T> filterableChild = (FilterableTreeItem<T>) child; filterableChild.setPredicate(this.predicate.get()); } // If there is no predicate, keep this tree item if (this.predicate.get() == null) return true; // If there are children, keep this tree item if (child.getChildren().size() > 0) return true; // Otherwise ask the TreeItemPredicate return this.predicate.get().test(this, child.getValue()); }; }, this.predicate)); setHiddenFieldChildren(this.filteredList); }
int columnIndex = 0; int rowIndex = 0; squares = FXCollections.observableArrayList(); final int numColors = RAW_VALUES.length / 3; Color[] colors = new Color[numColors];
public JFXTabPaneSkin(TabPane tabPane) { super(tabPane, new TabPaneBehavior(tabPane)); tabContentHolders = FXCollections.observableArrayList(); header = new HeaderContainer(); getChildren().add(JFXDepthManager.createMaterialNode(header, 1));
this.setTableMenuButtonVisible(true); ObservableList<PropertyTypeId> availableBuilders = FXCollections.observableArrayList(PropertyTypeId.typeIdsToConstants().values()); Collections.sort(availableBuilders); StringConverter<PropertyTypeId> converter = DesignerUtil.stringConverter(PropertyTypeId::getStringId, PropertyTypeId::lookupMnemonic);
@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; }
OpenWithDialog initFor(InputPdfArgumentsLoadRequest event) { this.messageTitle .setText(DefaultI18nContext.getInstance().i18n("Select the task to perform on the following files")); filesList .setItems(FXCollections.observableArrayList(event.pdfs.stream().map(Path::toString).collect(toList()))); modules.forEach(m -> { if (m.descriptor().hasInputType(event.requiredInputTyle())) { Button current = new Button(m.descriptor().getName()); current.getStyleClass().addAll(Style.FOOTER_BUTTON.css()); Optional.ofNullable(m.graphic()).ifPresent(g -> { g.setScaleX(0.7); g.setScaleY(0.7); current.setGraphic(g); }); current.setOnAction((e) -> { eventStudio().broadcast(new ClearModuleEvent(), m.id()); eventStudio().broadcast(activeteModule(m.id())); hide(); PdfLoadRequestEvent loadEvent = new PdfLoadRequestEvent(m.id()); event.pdfs.stream().map(Path::toFile).map(PdfDocumentDescriptor::newDescriptorNoPassword) .forEach(loadEvent::add); eventStudio().broadcast(loadEvent, m.id()); }); buttons.getChildren().add(current); } }); return this; }