public WorkspaceController() { this.properties = FXCollections.observableArrayList(); }
@Override public Stream<Item> fieldsFor(T document) { final ObservableList<String> supportedTypes = observableList( dbmsHandler .supportedDbmsTypes() .map(DbmsType::getName) .collect(toList()) ); return Stream.of(new ChoiceBoxItem<String>( "Dbms Type", document.typeNameProperty(), supportedTypes, "Which type of database this is. If the type you are looking " + "for is missing, make sure it has been loaded properly in " + "the pom.xml-file." ) ); } }
@Override public ObservableList<Issue> getIssues() { return FXCollections.unmodifiableObservableList(issues); } }
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); }
@Override public ObservableList<?> getDependencies() { return (dependencies.length == 1)? FXCollections.singletonObservableList(dependencies[0]) : FXCollections.unmodifiableObservableList(FXCollections.observableArrayList(dependencies)); } };
@Autowired public CreditsService(final ObjectMapper objectMapper) { this.creditedWorks = unmodifiableObservableList(observableList(loadCreditsFiles( objectMapper, new PathMatchingResourcePatternResolver() ))); }
/** * Invalidates the info being displayed. */ private void invalidateInfo() { metricResultsListView.setItems(FXCollections.emptyObservableList()); xpathAttributesListView.setItems(FXCollections.emptyObservableList()); scopeHierarchyTreeView.setRoot(null); }
/** * 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 registerBasicValidators() { Validator<String> noWhitespaceName = Validator.createRegexValidator("Name cannot contain whitespace", "\\S*+", Severity.ERROR); Validator<String> emptyName = Validator.createEmptyValidator("Name required"); Validator<String> uniqueName = (c, val) -> { long sameNameDescriptors = backingDescriptorList.getOrElse(FXCollections.emptyObservableList()) .stream() .map(PropertyDescriptorSpec::getName) .filter(getName()::equals) .count(); return new ValidationResult().addErrorIf(c, "The name must be unique", sameNameDescriptors > 1); }; validationSupport.registerValidator(nameField, Validator.combine(noWhitespaceName, emptyName, uniqueName)); Validator<String> noWhitespaceDescription = Validator.createRegexValidator("Message cannot be whitespace", "(\\s*+\\S.*)?", Severity.ERROR); Validator<String> emptyDescription = Validator.createEmptyValidator("Message required"); validationSupport.registerValidator(descriptionField, Validator.combine(noWhitespaceDescription, emptyDescription)); }
public IssueComponentImpl(){ this.issues = FXCollections.observableArrayList(); }
).toSortedMap(); final ObservableList<String> alternatives = FXCollections.observableList( mapping.keySet().stream().collect(toList()) );
/** * Creates a new ChoiceBoxItem. * <p> * The default choice will either be the first choice alternative, or the * alternative matching the current value of the property (if such as * alternative exists). Alternatives will get their name by calling toString() * on the objects in the list of alternatives * <p> * The property will bind to the ChoiceBox.valueProperty(). * * @param label the label text * @param value the property * @param alternatives list of alternatives in the choice box * @param tooltip the tooltip * @param decorator the editor decorator */ public ChoiceBoxItem( String label, Property<T> value, ObservableList<T> alternatives, String tooltip, UnaryOperator<Node> decorator) { super(label, tooltip, decorator); this.currentValue = value; this.alternatives = FXCollections.unmodifiableObservableList(alternatives); }
eventLogTableView.itemsProperty().setValue(logEntries); binding = binding.and( () -> eventLogTableView.itemsProperty().setValue(FXCollections.emptyObservableList()) );
private UserInterfaceComponentImpl() { notifications = FXCollections.observableArrayList(); outputMessages = FXCollections.observableArrayList(); selectedTreeItems = FXCollections.observableArrayList(); properties = FXCollections.observableArrayList(); canGenerate = new AtomicBoolean(true); }
/** * @return the pSourcePath */ public ObservableList<Todo> pTodo() { if (pTodo == null) { pTodo = FXCollections.observableList(this.todo()); } return this.pTodo; }
/** * Creates a new {@link PropertySheet} which will render a collection of * properties. * * @param properties the list of properties to render */ public PropertySheet(ObservableList<PropertyEditor.Item> properties) { requireNonNull(properties); this.properties = FXCollections.unmodifiableObservableList(properties); layout = new PropertyLayout(properties); setCenter(layout); this.properties.addListener((ListChangeListener.Change<? extends PropertyEditor.Item> c) -> { while (c.next()) { if (c.wasRemoved() && properties.isEmpty()) { layout.remove(); layout = new PropertyLayout(properties); setCenter(layout); } else if (c.wasAdded()) { c.getAddedSubList().stream() .forEachOrdered(i -> layout.addItem(i)); } } }); } }
@Override public void detachFrom(@Nonnull TableView<E> tableView) { requireNonNull(tableView, ERROR_TABLE_VIEW_NULL); tableView.setItems(FXCollections.emptyObservableList()); tableView.getColumns().removeAll(columns); } }
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; }
/** * @return the pSourcePath */ public ObservableList<ExtensionFilter> pFileExtension() { if (pFileExtension == null) { pFileExtension = FXCollections.observableList(this.fileExtension()); } return this.pFileExtension; }
/** * @return read only view of observable save files */ public ObservableList<SaveFile> saveFiles() { return FXCollections.unmodifiableObservableList(saveFiles); }