@Override public boolean containsId(Object itemId) { return container.containsId(itemId); }
@Override public boolean containsId(Object itemId) { return container.containsId(itemId); }
/** * Tests, if the collection contains an item with given id. * * @param itemId * the Id the of item to be tested. */ @Override public boolean containsId(Object itemId) { if (itemId != null) { return items.containsId(itemId); } else { return false; } }
/** * Gets the selected item id or in multiselect mode a set of selected ids. * * @see AbstractField#getValue() */ @Override public Object getValue() { final Object retValue = super.getValue(); if (isMultiSelect()) { // If the return value is not a set if (retValue == null) { return new HashSet<Object>(); } if (retValue instanceof Set) { return Collections.unmodifiableSet((Set<?>) retValue); } else if (retValue instanceof Collection) { return new HashSet<Object>((Collection<?>) retValue); } else { final Set<Object> s = new HashSet<Object>(); if (items.containsId(retValue)) { s.add(retValue); } return s; } } else { return retValue; } }
@Override public void updateHierarchicalWrapper() { super.updateHierarchicalWrapper(); updateFirst(); if (inline == null || expanded == null || captions == null) { inline = new LinkedList<>(); expanded = new HashSet<>(); captions = new HashMap<>(); } else { inline.clear(); Set<Object> s = new HashSet<>(); s.addAll(expanded); s.addAll(captions.keySet()); for (Object o : s) { if (!_container().containsId(o)) { expanded.remove(o); captions.remove(o); } } } makeInlineElements(inline, rootItemIds()); }
if (!container.containsId(id)) { removeFromOrderWrapper(id);
if (!container.containsId(id)) { removeFromHierarchyWrapper(id);
repaintIsNotNeeded, ignoreReadOnly); } else if (newFieldValue == null || items.containsId(newFieldValue)) { super.setValue(newFieldValue, repaintIsNotNeeded, ignoreReadOnly);
/** * Selects an item. * * <p> * In single select mode selecting item identified by * {@link #getNullSelectionItemId()} sets the value of the property to null. * </p> * * @param itemId * the identifier of Item to be selected. * @see #getNullSelectionItemId() * @see #setNullSelectionItemId(Object) * */ public void select(Object itemId) { if (!isMultiSelect()) { setValue(itemId); } else if (!isSelected(itemId) && itemId != null && items.containsId(itemId)) { final Set<Object> s = new HashSet<Object>((Set<?>) getValue()); s.add(itemId); setValue(s); } }
if (!_container().containsId(itemId)) { return false;