Class AbstractBeanContainer<IDTYPE,​BEANTYPE>

    • Constructor Detail

      • AbstractBeanContainer

        protected AbstractBeanContainer​(java.lang.Class<? super BEANTYPE> type)
        Deprecated.
        Constructs a AbstractBeanContainer for beans of the given type.
        Parameters:
        type - the type of the beans that will be added to the container.
        Throws:
        java.lang.IllegalArgumentException - If type is null
    • Method Detail

      • getType

        public java.lang.Class<?> getType​(java.lang.Object propertyId)
        Deprecated.
        Description copied from interface: Container
        Gets the data type of all Properties identified by the given Property ID.
        Specified by:
        getType in interface Container
        Parameters:
        propertyId - ID identifying the Properties
        Returns:
        data type of the Properties
      • createBeanItem

        protected BeanItem<BEANTYPE> createBeanItem​(BEANTYPE bean)
        Deprecated.
        Create a BeanItem for a bean using pre-parsed bean metadata (based on getBeanType()).
        Parameters:
        bean -
        Returns:
        created BeanItem or null if bean is null
      • getBeanType

        public java.lang.Class<? super BEANTYPE> getBeanType()
        Deprecated.
        Returns the type of beans this Container can contain. This comes from the bean type constructor parameter, and bean metadata (including container properties) is based on this.
        Returns:
      • getContainerPropertyIds

        public java.util.Collection<java.lang.String> getContainerPropertyIds()
        Deprecated.
        Description copied from interface: Container
        Gets the ID's of all Properties stored in the Container. The ID's cannot be modified through the returned collection.
        Specified by:
        getContainerPropertyIds in interface Container
        Returns:
        unmodifiable collection of Property IDs
      • getItem

        public BeanItem<BEANTYPE> getItem​(java.lang.Object itemId)
        Deprecated.
        Description copied from interface: Container
        Gets the Item with the given Item ID from the Container. If the Container does not contain the requested Item, null is returned.

        Containers should not return Items that are filtered out.

        Specified by:
        getItem in interface Container
        Overrides:
        getItem in class AbstractInMemoryContainer<IDTYPE,​java.lang.String,​BeanItem<BEANTYPE>>
        Parameters:
        itemId - ID of the Item to retrieve
        Returns:
        the Item with the given ID or null if the Item is not found in the Container
      • getItemIds

        public java.util.List<IDTYPE> getItemIds()
        Deprecated.
        Description copied from interface: Container
        Gets the ID's of all visible (after filtering and sorting) Items stored in the Container. The ID's cannot be modified through the returned collection.

        If the container is Container.Ordered, the collection returned by this method should follow that order. If the container is Container.Sortable, the items should be in the sorted order.

        Calling this method for large lazy containers can be an expensive operation and should be avoided when practical.

        Specified by:
        getItemIds in interface Container
        Overrides:
        getItemIds in class AbstractInMemoryContainer<IDTYPE,​java.lang.String,​BeanItem<BEANTYPE>>
        Returns:
        unmodifiable collection of Item IDs
      • getContainerProperty

        public Property getContainerProperty​(java.lang.Object itemId,
                                             java.lang.Object propertyId)
        Deprecated.
        Description copied from interface: Container
        Gets the Property identified by the given itemId and propertyId from the Container. If the Container does not contain the item or it is filtered out, or the Container does not have the Property, null is returned.
        Specified by:
        getContainerProperty in interface Container
        Parameters:
        itemId - ID of the visible Item which contains the Property
        propertyId - ID of the Property to retrieve
        Returns:
        Property with the given ID or null
      • removeItem

        public boolean removeItem​(java.lang.Object itemId)
        Deprecated.
        Description copied from interface: Container
        Removes the Item identified by ItemId from the Container.

        Containers that support filtering should also allow removing an item that is currently filtered out.

        This functionality is optional.

        Specified by:
        removeItem in interface Container
        Overrides:
        removeItem in class AbstractInMemoryContainer<IDTYPE,​java.lang.String,​BeanItem<BEANTYPE>>
        Parameters:
        itemId - ID of the Item to remove
        Returns:
        true if the operation succeeded, false if not
      • addContainerFilter

        public void addContainerFilter​(java.lang.Object propertyId,
                                       java.lang.String filterString,
                                       boolean ignoreCase,
                                       boolean onlyMatchPrefix)
        Deprecated.
        Description copied from interface: Container.SimpleFilterable
        Add a filter for given property.

        The API Container.Filterable.addContainerFilter(Filter) is recommended instead of this method. A SimpleStringFilter can be used with the new API to implement the old string filtering functionality.

        The filter accepts items for which toString() of the value of the given property contains or starts with given filterString. Other items are not visible in the container when filtered.

        If a container has multiple filters, only items accepted by all filters are visible.

        Specified by:
        addContainerFilter in interface Container.SimpleFilterable
        Parameters:
        propertyId - Property for which the filter is applied to.
        filterString - String that must match the value of the property
        ignoreCase - Determine if the casing can be ignored when comparing strings.
        onlyMatchPrefix - Only match prefixes; no other matches are included.
      • removeContainerFilter

        public void removeContainerFilter​(Container.Filter filter)
        Deprecated.
        Description copied from interface: Container.Filterable
        Removes a filter from the container.

        This requires that the equals() method considers the filters as equivalent (same instance or properly implemented equals() method).

        Specified by:
        removeContainerFilter in interface Container.Filterable
      • getSortableContainerPropertyIds

        public java.util.Collection<?> getSortableContainerPropertyIds()
        Deprecated.
        Description copied from interface: Container.Sortable
        Gets the container property IDs which can be used to sort the items.
        Specified by:
        getSortableContainerPropertyIds in interface Container.Sortable
        Returns:
        the IDs of the properties that can be used for sorting the container
      • sort

        public void sort​(java.lang.Object[] propertyId,
                         boolean[] ascending)
        Deprecated.
        Description copied from interface: Container.Sortable
        Sorts the container items.

        Sorting a container can irreversibly change the order of its items or only change the order temporarily, depending on the container.

        Specified by:
        sort in interface Container.Sortable
        Parameters:
        propertyId - Array of container property IDs, whose values are used to sort the items in container as primary, secondary, ... sorting criterion. All of the item IDs must be in the collection returned by Container.Sortable.getSortableContainerPropertyIds()
        ascending - Array of sorting order flags corresponding to each property ID used in sorting. If this array is shorter than propertyId array, ascending order is assumed for items where the order is not specified. Use true to sort in ascending order, false to use descending order.
      • addItem

        protected BeanItem<BEANTYPE> addItem​(IDTYPE itemId,
                                             BEANTYPE bean)
        Deprecated.
        Adds the bean to the Container. Note: the behavior of this method changed in Vaadin 6.6 - now items are added at the very end of the unfiltered container and not after the last visible item if filtering is used.
        See Also:
        Container.addItem(Object)
      • addItemAt

        protected BeanItem<BEANTYPE> addItemAt​(int index,
                                               IDTYPE newItemId,
                                               BEANTYPE bean)
        Deprecated.
        Adds a new bean at the given index. The bean is used both as the item contents and as the item identifier.
        Parameters:
        index - Index at which the bean should be added.
        newItemId - The item id for the bean to add to the container.
        bean - The bean to add to the container.
        Returns:
        Returns the new BeanItem or null if the operation fails.
      • addBean

        protected BeanItem<BEANTYPE> addBean​(BEANTYPE bean)
                                      throws java.lang.IllegalStateException,
                                             java.lang.IllegalArgumentException
        Deprecated.
        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.
        Parameters:
        bean - the bean to add
        Returns:
        a BeanItem if item added or null
        Throws:
        java.lang.IllegalStateException - if no bean identifier resolver has been set
        java.lang.IllegalArgumentException - if an identifier cannot be resolved for the bean
        See Also:
        addItem(Object, Object)
      • addBeanAfter

        protected BeanItem<BEANTYPE> addBeanAfter​(IDTYPE previousItemId,
                                                  BEANTYPE bean)
                                           throws java.lang.IllegalStateException,
                                                  java.lang.IllegalArgumentException
        Deprecated.
        Adds a bean to the container after a specified item identifier, using the bean item id resolver to find its identifier. A bean id resolver must be set before calling this method.
        Parameters:
        previousItemId - the identifier of the bean after which this bean should be added, null to add to the beginning
        bean - the bean to add
        Returns:
        a BeanItem if item added or null
        Throws:
        java.lang.IllegalStateException - if no bean identifier resolver has been set
        java.lang.IllegalArgumentException - if an identifier cannot be resolved for the bean
        See Also:
        addItemAfter(Object, Object, Object)
      • addBeanAt

        protected BeanItem<BEANTYPE> addBeanAt​(int index,
                                               BEANTYPE bean)
                                        throws java.lang.IllegalStateException,
                                               java.lang.IllegalArgumentException
        Deprecated.
        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.
        Parameters:
        index - the index (in the filtered view) at which to add the item
        bean - the bean to add
        Returns:
        a BeanItem if item added or null
        Throws:
        java.lang.IllegalStateException - if no bean identifier resolver has been set
        java.lang.IllegalArgumentException - if an identifier cannot be resolved for the bean
        See Also:
        addItemAfter(Object, Object, Object)
      • addAll

        protected void addAll​(java.util.Collection<? extends BEANTYPE> collection)
                       throws java.lang.IllegalStateException,
                              java.lang.IllegalArgumentException
        Deprecated.
        Adds all the beans from a Collection in one operation using the bean item identifier resolver. More efficient than adding them one by one. A bean id resolver must be set before calling this method. Note: the behavior of this method changed in Vaadin 6.6 - now items are added at the very end of the unfiltered container and not after the last visible item if filtering is used.
        Parameters:
        collection - The collection of beans to add. Must not be null.
        Throws:
        java.lang.IllegalStateException - if no bean identifier resolver has been set
        java.lang.IllegalArgumentException - if the resolver returns a null itemId for one of the beans in the collection
      • resolveBeanId

        protected IDTYPE resolveBeanId​(BEANTYPE bean)
        Deprecated.
        Use the bean resolver to get the identifier for a bean.
        Parameters:
        bean -
        Returns:
        resolved bean identifier, null if could not be resolved
        Throws:
        java.lang.IllegalStateException - if no bean resolver is set
      • setBeanIdResolver

        protected void setBeanIdResolver​(AbstractBeanContainer.BeanIdResolver<IDTYPE,​BEANTYPE> beanIdResolver)
        Deprecated.
        Sets the resolver that finds the item id for a bean, or null not to use automatic resolving. Methods that add a bean without specifying an id must not be called if no resolver has been set. Note that methods taking an explicit id can be used whether a resolver has been defined or not.
        Parameters:
        beanIdResolver - to use or null to disable automatic id resolution
      • createBeanPropertyResolver

        protected AbstractBeanContainer.BeanIdResolver<IDTYPE,​BEANTYPE> createBeanPropertyResolver​(java.lang.Object propertyId)
        Deprecated.
        Create an item identifier resolver using a named bean property.
        Parameters:
        propertyId - property identifier, which must map to a getter in BEANTYPE
        Returns:
        created resolver
      • addContainerProperty

        public boolean addContainerProperty​(java.lang.Object propertyId,
                                            java.lang.Class<?> type,
                                            java.lang.Object defaultValue)
                                     throws java.lang.UnsupportedOperationException
        Deprecated.
        Description copied from interface: Container
        Adds a new Property to all Items in the Container. The Property ID, data type and default value of the new Property are given as parameters.

        This functionality is optional.

        Specified by:
        addContainerProperty in interface Container
        Overrides:
        addContainerProperty in class AbstractInMemoryContainer<IDTYPE,​java.lang.String,​BeanItem<BEANTYPE>>
        Parameters:
        propertyId - ID of the Property
        type - Data type of the new Property
        defaultValue - The value all created Properties are initialized to
        Returns:
        true if the operation succeeded, false if not
        Throws:
        java.lang.UnsupportedOperationException - if the container does not support explicitly adding container properties
      • addContainerProperty

        protected final boolean addContainerProperty​(java.lang.String propertyId,
                                                     VaadinPropertyDescriptor<BEANTYPE> propertyDescriptor)
        Deprecated.
        Adds a property for the container and all its items. Primarily for internal use, may change in future versions.
        Parameters:
        propertyId -
        propertyDescriptor -
        Returns:
        true if the property was added
      • addNestedContainerProperty

        public boolean addNestedContainerProperty​(java.lang.String propertyId)
        Deprecated.
        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.
        Parameters:
        propertyId -
        Returns:
        true if the property was added
        See Also:
        NestedMethodProperty
      • addNestedContainerBean

        public void addNestedContainerBean​(java.lang.String propertyId)
        Deprecated.
        Adds a nested container properties for all sub-properties of a named property to the container. The named property itself is removed from the model as its subproperties are added. 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.
        Parameters:
        propertyId -
        See Also:
        NestedMethodProperty, addNestedContainerProperty(String)
      • removeContainerProperty

        public boolean removeContainerProperty​(java.lang.Object propertyId)
                                        throws java.lang.UnsupportedOperationException
        Deprecated.
        Description copied from interface: Container
        Removes a Property specified by the given Property ID from the Container. Note that the Property will be removed from all Items in the Container.

        This functionality is optional.

        Specified by:
        removeContainerProperty in interface Container
        Overrides:
        removeContainerProperty in class AbstractInMemoryContainer<IDTYPE,​java.lang.String,​BeanItem<BEANTYPE>>
        Parameters:
        propertyId - ID of the Property to remove
        Returns:
        true if the operation succeeded, false if not
        Throws:
        java.lang.UnsupportedOperationException - if the container does not support removing container properties