@PersistentSequence public ObservableList<PropertyDescriptorSpec> getRuleProperties() { return ruleProperties.getValue(); }
public void setRuleProperties(ObservableList<PropertyDescriptorSpec> ruleProperties) { this.ruleProperties.setValue(ruleProperties); }
@Override public void addListener(InvalidationListener listener) { delegate.addListener(listener); }
if (i < this.items.size() && i >= 0) { this.selection.add(this.items.get(i)); persistentSelection.addAll(this.selection.getValue()); changed.bind(Bindings.createBooleanBinding(() -> !persistentSelection.equals(this.selection), this.selection, persistentSelection)); this.selection.addListener((observable, oldValue, newValue) -> validate()); items.addListener((observable, oldValue, newValue) -> { this.selection.clear(); persistentSelection.clear(); });
/** * Returns the list of locations shown by the map. * * @return the list of locations */ public final ObservableList<Location> getLocations() { return locations.get(); }
/** * Removes the element at the given index from the current selection. * * @param index * The index of the element to be removed. * * @return Returns the current field to allow for chaining. */ public MultiSelectionField<V> deselect(int index) { if (index < items.size() && selection.contains(items.get(index))) { selection.remove(items.get(index)); } return this; }
/** * Adds the element at the given index to the current selection. * * @param index * The index of the element to be selected. * * @return Returns the current field to allow for chaining. */ public MultiSelectionField<V> select(int index) { if (index < items.size() && index > -1 && !selection.contains(items.get(index))) { selection.add(items.get(index)); } return this; }
/** * Updates the list of available items to a new list, along with a * pre-defined selection. * * @param newValue * The new list of items. * @param newSelection * The new pre-defined selection. * * @return Returns the current field to allow for chaining. */ public MultiSelectionField<V> items(List<V> newValue, List<Integer> newSelection) { items.setAll(newValue); newSelection.forEach(i -> selection.add(items.get(i))); persistentSelection.setAll(selection.getValue()); return this; }
if (selection < items.size() && selection >= 0) { this.selection.set(this.items.get(selection)); persistentSelection.setValue(this.selection.getValue()); items.addListener((observable, oldValue, newValue) -> { this.selection.setValue(null); persistentSelection.setValue(null);
/** * Sets the list of segments (the model). * * @param segments the list of segments shown by the bar */ public void setSegments(ObservableList<T> segments) { this.segments.set(segments); }
/** * {@inheritDoc} */ public void setBindingMode(BindingMode newValue) { if (BindingMode.CONTINUOUS.equals(newValue)) { selection.addListener(bindingModeListener); } else { selection.removeListener(bindingModeListener); } }
/** * Internal constructor for the {@code Field} class. To create new elements, * see the static factory methods in this class. * * @see Field::ofStringType * @see Field::ofIntegerType * @see Field::ofDoubleType * @see Field::ofBooleanType * @see Field::ofMultiSelectionType * @see Field::ofSingleSelectionType */ protected Field() { // Whenever one of the translatable elements' keys change, update the // displayed value based on the new translation. labelKey.addListener((observable, oldValue, newValue) -> label.setValue(translationService.translate(newValue))); tooltipKey.addListener((observable, oldValue, newValue) -> tooltip.setValue(translationService.translate(newValue))); placeholderKey.addListener((observable, oldValue, newValue) -> placeholder.setValue(translationService.translate(newValue))); labelDescriptionKey.addListener((observable, oldValue, newValue) -> labelDescription = asLabel(translationService.translate(newValue), LABEL_DESCRIPTION_STYLE_CLASS)); valueDescriptionKey.addListener((observable, oldValue, newValue) -> valueDescription = asLabel(translationService.translate(newValue), VALUE_DESCRIPTION_STYLE_CLASS)); requiredErrorKey.addListener((observable, oldValue, newValue) -> validate()); // Whenever the errorMessageKeys change, update the displayed // label to the new translation. This maps the keys to their translated // representation. errorMessageKeys.addListener((observable, oldValue, newValue) -> errorMessages.setAll(errorMessageKeys.stream() .map(s -> translationService.translate(s)) .collect(Collectors.toList()))); }
/** * @return The previously oldest loaded tweets for use in {@link #loadMoreTweets()}. */ private Optional<Status> getOldestTweetLoaded() { if (tweetsProperty.isEmpty()) { getLogger().debug("No older tweets to load."); return Optional.empty(); } final Status oldest = tweetsProperty.getValue().get(tweetsProperty.size() - 1); getLogger().debug("Loading tweets before {}", oldest.getId()); return Optional.of(oldest); }
/** * Updates the list of available items to a new list, along with a * pre-defined selection. * * @param newValue * The new list of items. * @param newSelection * The new pre-defined selection. * * @return Returns the current field to allow for chaining. */ public SingleSelectionField<V> items(List<V> newValue, int newSelection) { items.setAll(newValue); if (newSelection != -1) { this.selection.setValue(items.get(newSelection)); this.persistentSelection.setValue(this.selection.getValue()); } return this; }
/** * Creates a new {@link SingleSelectionField} with the given properties for * items and selection. * * @param itemsBinding * The items property to be bound with. * * @param selectionBinding * The selection property to be bound with. * * @return Returns a new {@link SingleSelectionField}. */ public static <T> SingleSelectionField<T> ofSingleSelectionType(ListProperty<T> itemsBinding, ObjectProperty<T> selectionBinding) { return new SingleSelectionField<>(new SimpleListProperty<>(itemsBinding.getValue()), itemsBinding.indexOf(selectionBinding.getValue())).bind(itemsBinding, selectionBinding); }
@Override public boolean remove(Object obj) { return delegate.remove(obj); }
@Override public boolean addAll(Collection<? extends E> elements) { return delegate.addAll(elements); }
@Override public int size() { return delegate.size(); }