/** * Adds all the beans from a {@link Collection} in one go. More efficient * than adding them one by one. * * @param collection * The collection of beans to add. Must not be null. */ @Override public void addAll(Collection<? extends BEANTYPE> collection) { super.addAll(collection); }
@Override // overridden to make public public BeanItem<BEANTYPE> addBean(BEANTYPE bean) throws IllegalStateException, IllegalArgumentException { return super.addBean(bean); }
@Override // overridden to make public public BeanItem<BEANTYPE> addBeanAfter(IDTYPE previousItemId, BEANTYPE bean) throws IllegalStateException, IllegalArgumentException { return super.addBeanAfter(previousItemId, bean); }
/** * Adds a bean to the container using the bean item id resolver to find its * identifier. * * A bean id resolver must be set before calling this method. * * @see #addItem(Object, Object) * * @param bean * the bean to add * @return BeanItem<BEANTYPE> item added or null * @throws IllegalStateException * if no bean identifier resolver has been set * @throws IllegalArgumentException * if an identifier cannot be resolved for the bean */ protected BeanItem<BEANTYPE> addBean(BEANTYPE bean) throws IllegalStateException, IllegalArgumentException { if (bean == null) { return null; } IDTYPE itemId = resolveBeanId(bean); if (itemId == null) { throw new IllegalArgumentException( "Resolved identifier for a bean must not be null"); } return addItem(itemId, bean); }
/** * Adds a bean at a specified (filtered view) position in the container * using the bean item id resolver to find its identifier. * * A bean id resolver must be set before calling this method. * * @see #addItemAfter(Object, Object, Object) * * @param index * the index (in the filtered view) at which to add the item * @param bean * the bean to add * @return BeanItem<BEANTYPE> item added or null * @throws IllegalStateException * if no bean identifier resolver has been set * @throws IllegalArgumentException * if an identifier cannot be resolved for the bean */ protected BeanItem<BEANTYPE> addBeanAt(int index, BEANTYPE bean) throws IllegalStateException, IllegalArgumentException { if (bean == null) { return null; } IDTYPE itemId = resolveBeanId(bean); if (itemId == null) { throw new IllegalArgumentException( "Resolved identifier for a bean must not be null"); } return addItemAt(index, itemId, bean); }
return null; IDTYPE itemId = resolveBeanId(bean); if (itemId == null) { throw new IllegalArgumentException( "Resolved identifier for a bean must not be null"); return addItemAfter(previousItemId, itemId, bean);
@Override public void addContainerFilter(Filter filter) throws UnsupportedFilterException { addFilter(filter); }
@Override // overridden to make public public BeanItem<BEANTYPE> addBeanAt(int index, BEANTYPE bean) throws IllegalStateException, IllegalArgumentException { return super.addBeanAt(index, bean); }
/** * Adds the bean to the Container. * * @see Container#addItem(Object) */ @Override public BeanItem<BEANTYPE> addItem(IDTYPE itemId, BEANTYPE bean) { if (itemId != null && bean != null) { return super.addItem(itemId, bean); } else { return null; } }
/** * Adds the bean after the given item id. * * @see Container.Ordered#addItemAfter(Object, Object) */ @Override public BeanItem<BEANTYPE> addItemAfter(IDTYPE previousItemId, IDTYPE newItemId, BEANTYPE bean) { if (newItemId != null && bean != null) { return super.addItemAfter(previousItemId, newItemId, bean); } else { return null; } }
/** * Adds a new bean at the given index. * * The bean is used both as the item contents and as the item identifier. * * @param index * Index at which the bean should be added. * @param newItemId * The item id for the bean to add to the container. * @param bean * The bean to add to the container. * * @return Returns the new BeanItem or null if the operation fails. */ @Override public BeanItem<BEANTYPE> addItemAt(int index, IDTYPE newItemId, BEANTYPE bean) { if (newItemId != null && bean != null) { return super.addItemAt(index, newItemId, bean); } else { return null; } }
/** * @deprecated As of 7.0, replaced by {@link #addPropertySetChangeListener} */ @Deprecated @Override public void addListener(Container.PropertySetChangeListener listener) { addPropertySetChangeListener(listener); }
/** * Adds a nested container property for the container, e.g. * "manager.address.street". * * All intermediate getters must exist and should return non-null values * when the property value is accessed. If an intermediate getter returns * null, a null value will be returned. * * @see NestedMethodProperty * * @param propertyId * @return true if the property was added */ public boolean addNestedContainerProperty(String propertyId) { return addContainerProperty(propertyId, new NestedPropertyDescriptor(propertyId, type)); }
@Override public void addContainerFilter(Object propertyId, String filterString, boolean ignoreCase, boolean onlyMatchPrefix) { try { addFilter(new SimpleStringFilter(propertyId, filterString, ignoreCase, onlyMatchPrefix)); } catch (UnsupportedFilterException e) { // the filter instance created here is always valid for in-memory // containers } }
/** * Adds a new bean at the given index. * * The bean is used both as the item contents and as the item identifier. * * @param index * Index at which the bean should be added. * @param newItemId * The bean to add to the container. * @return Returns the new BeanItem or null if the operation fails. */ @Override @SuppressWarnings("unchecked") public BeanItem<BEANTYPE> addItemAt(int index, Object newItemId) throws IllegalArgumentException { return super.addBeanAt(index, (BEANTYPE) newItemId); }
/** * Adds the bean to the Container. * * The bean is used both as the item contents and as the item identifier. * * @see com.vaadin.v7.data.Container#addItem(Object) Container#addItem(Object) */ @Override @SuppressWarnings("unchecked") public BeanItem<BEANTYPE> addItem(Object itemId) { return super.addBean((BEANTYPE) itemId); }
/** * Adds the bean after the given bean. * * The bean is used both as the item contents and as the item identifier. * * @param previousItemId * the bean (of type BT) after which to add newItemId * @param newItemId * the bean (of type BT) to add (not null) * * @see com.vaadin.v7.data.Container.Ordered#addItemAfter(Object, Object) * Ordered#addItemAfter(Object, Object) */ @Override @SuppressWarnings("unchecked") public BeanItem<BEANTYPE> addItemAfter(Object previousItemId, Object newItemId) throws IllegalArgumentException { return super.addBeanAfter((BEANTYPE) previousItemId, (BEANTYPE) newItemId); }
@Override // overridden to make public public void addAll(Collection<? extends BEANTYPE> collection) throws IllegalStateException { super.addAll(collection); }