Class ContainerOrderedWrapper
- java.lang.Object
-
- com.vaadin.v7.data.util.ContainerOrderedWrapper
-
- All Implemented Interfaces:
Container
,Container.ItemSetChangeNotifier
,Container.Ordered
,Container.PropertySetChangeNotifier
,java.io.Serializable
- Direct Known Subclasses:
HierarchicalContainerOrderedWrapper
@Deprecated public class ContainerOrderedWrapper extends java.lang.Object implements Container.Ordered, Container.ItemSetChangeNotifier, Container.PropertySetChangeNotifier
Deprecated.As of 8.0, replaced byDataProvider
A wrapper class for adding external ordering to containers not implementing the
Container.Ordered
interface.If the wrapped container is changed directly (that is, not through the wrapper), and does not implement Container.ItemSetChangeNotifier and/or Container.PropertySetChangeNotifier the hierarchy information must be updated with the
updateOrderWrapper()
method.- Since:
- 3.0
- Author:
- Vaadin Ltd.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.v7.data.Container
Container.Editor, Container.Filter, Container.Filterable, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeEvent, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeEvent, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.SimpleFilterable, Container.Sortable, Container.Viewer
-
-
Constructor Summary
Constructors Constructor Description ContainerOrderedWrapper(Container toBeWrapped)
Deprecated.Constructs a new ordered wrapper for an existing Container.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
addContainerProperty(java.lang.Object propertyId, java.lang.Class<?> type, java.lang.Object defaultValue)
Deprecated.Registers a new Property to all Items in the Container.java.lang.Object
addItem()
Deprecated.Creates a new Item into the Container, assigns it an automatic ID, and adds it to the ordering.Item
addItem(java.lang.Object itemId)
Deprecated.Registers a new Item by its ID to the underlying container and to the ordering.java.lang.Object
addItemAfter(java.lang.Object previousItemId)
Deprecated.Adds a new item after the given item.Item
addItemAfter(java.lang.Object previousItemId, java.lang.Object newItemId)
Deprecated.Adds a new item after the given item.void
addItemSetChangeListener(Container.ItemSetChangeListener listener)
Deprecated.Adds an Item set change listener for the object.void
addListener(Container.ItemSetChangeListener listener)
Deprecated.As of 7.0, replaced byaddItemSetChangeListener(Container.ItemSetChangeListener)
void
addListener(Container.PropertySetChangeListener listener)
Deprecated.As of 7.0, replaced byaddPropertySetChangeListener(Container.PropertySetChangeListener)
void
addPropertySetChangeListener(Container.PropertySetChangeListener listener)
Deprecated.Registers a new Property set change listener for this Container.boolean
containsId(java.lang.Object itemId)
Deprecated.Tests if the Container contains the specified Item.java.lang.Object
firstItemId()
Deprecated.Gets the ID of the first Item in the Container.Property
getContainerProperty(java.lang.Object itemId, java.lang.Object propertyId)
Deprecated.Gets the Property identified by the given itemId and propertyId from the Container.java.util.Collection<?>
getContainerPropertyIds()
Deprecated.Gets the ID's of all Properties stored in the Container.Item
getItem(java.lang.Object itemId)
Deprecated.Gets theItem
with the given Item ID from the Container.java.util.Collection<?>
getItemIds()
Deprecated.Gets the ID's of all visible (after filtering and sorting) Items stored in the Container.java.lang.Class<?>
getType(java.lang.Object propertyId)
Deprecated.Gets the data type of all Properties identified by the given Property ID.boolean
isFirstId(java.lang.Object itemId)
Deprecated.Tests if the Item corresponding to the given Item ID is the first Item in the Container.boolean
isLastId(java.lang.Object itemId)
Deprecated.Tests if the Item corresponding to the given Item ID is the last Item in the Container.java.lang.Object
lastItemId()
Deprecated.Gets the ID of the last Item in the Container..java.lang.Object
nextItemId(java.lang.Object itemId)
Deprecated.Gets the ID of the Item following the Item that corresponds toitemId
.java.lang.Object
prevItemId(java.lang.Object itemId)
Deprecated.Gets the ID of the Item preceding the Item that corresponds toitemId
.boolean
removeAllItems()
Deprecated.Removes all items from the underlying container and from the ordering.boolean
removeContainerProperty(java.lang.Object propertyId)
Deprecated.Removes the specified Property from the underlying container and from the ordering.boolean
removeItem(java.lang.Object itemId)
Deprecated.Removes an Item specified by the itemId from the underlying container and from the ordering.void
removeItemSetChangeListener(Container.ItemSetChangeListener listener)
Deprecated.Removes the Item set change listener from the object.void
removeListener(Container.ItemSetChangeListener listener)
Deprecated.As of 7.0, replaced byremoveItemSetChangeListener(Container.ItemSetChangeListener)
void
removeListener(Container.PropertySetChangeListener listener)
Deprecated.As of 7.0, replaced byremovePropertySetChangeListener(Container.PropertySetChangeListener)
void
removePropertySetChangeListener(Container.PropertySetChangeListener listener)
Deprecated.Removes a previously registered Property set change listener.int
size()
Deprecated.Gets the number of visible Items in the Container.void
updateOrderWrapper()
Deprecated.Updates the wrapper's internal ordering information to include all Items in the underlying container.
-
-
-
Constructor Detail
-
ContainerOrderedWrapper
public ContainerOrderedWrapper(Container toBeWrapped)
Deprecated.Constructs a new ordered wrapper for an existing Container. Works even if the to-be-wrapped container already implements the Container.Ordered interface.- Parameters:
toBeWrapped
- the container whose contents need to be ordered.
-
-
Method Detail
-
updateOrderWrapper
public void updateOrderWrapper()
Deprecated.Updates the wrapper's internal ordering information to include all Items in the underlying container.Note : If the contents of the wrapped container change without the wrapper's knowledge, this method needs to be called to update the ordering information of the Items.
-
firstItemId
public java.lang.Object firstItemId()
Deprecated.Description copied from interface:Container.Ordered
Gets the ID of the first Item in the Container.- Specified by:
firstItemId
in interfaceContainer.Ordered
- Returns:
- ID of the first visible Item in the Container
-
isFirstId
public boolean isFirstId(java.lang.Object itemId)
Deprecated.Description copied from interface:Container.Ordered
Tests if the Item corresponding to the given Item ID is the first Item in the Container.- Specified by:
isFirstId
in interfaceContainer.Ordered
- Parameters:
itemId
- ID of an Item in the Container- Returns:
true
if the Item is first visible item in the Container,false
if not
-
isLastId
public boolean isLastId(java.lang.Object itemId)
Deprecated.Description copied from interface:Container.Ordered
Tests if the Item corresponding to the given Item ID is the last Item in the Container.- Specified by:
isLastId
in interfaceContainer.Ordered
- Returns:
true
if the Item is last visible item in the Container,false
if not
-
lastItemId
public java.lang.Object lastItemId()
Deprecated.Description copied from interface:Container.Ordered
Gets the ID of the last Item in the Container..- Specified by:
lastItemId
in interfaceContainer.Ordered
- Returns:
- ID of the last visible Item in the Container
-
nextItemId
public java.lang.Object nextItemId(java.lang.Object itemId)
Deprecated.Description copied from interface:Container.Ordered
Gets the ID of the Item following the Item that corresponds toitemId
. If the given Item is the last or not found in the Container,null
is returned.- Specified by:
nextItemId
in interfaceContainer.Ordered
- Parameters:
itemId
- ID of a visible Item in the Container- Returns:
- ID of the next visible Item or
null
-
prevItemId
public java.lang.Object prevItemId(java.lang.Object itemId)
Deprecated.Description copied from interface:Container.Ordered
Gets the ID of the Item preceding the Item that corresponds toitemId
. If the given Item is the first or not found in the Container,null
is returned.- Specified by:
prevItemId
in interfaceContainer.Ordered
- Parameters:
itemId
- ID of a visible Item in the Container- Returns:
- ID of the previous visible Item or
null
-
addContainerProperty
public boolean addContainerProperty(java.lang.Object propertyId, java.lang.Class<?> type, java.lang.Object defaultValue) throws java.lang.UnsupportedOperationException
Deprecated.Registers a new Property to all Items in the Container.- Specified by:
addContainerProperty
in interfaceContainer
- Parameters:
propertyId
- the ID of the new Property.type
- the 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
-
addItem
public java.lang.Object addItem() throws java.lang.UnsupportedOperationException
Deprecated.Creates a new Item into the Container, assigns it an automatic ID, and adds it to the ordering.
-
addItem
public Item addItem(java.lang.Object itemId) throws java.lang.UnsupportedOperationException
Deprecated.Registers a new Item by its ID to the underlying container and to the ordering.
-
removeAllItems
public boolean removeAllItems() throws java.lang.UnsupportedOperationException
Deprecated.Removes all items from the underlying container and from the ordering.- Specified by:
removeAllItems
in interfaceContainer
- Returns:
true
if the operation succeeded, otherwisefalse
- Throws:
java.lang.UnsupportedOperationException
- if the removeAllItems is not supported.
-
removeItem
public boolean removeItem(java.lang.Object itemId) throws java.lang.UnsupportedOperationException
Deprecated.Removes an Item specified by the itemId from the underlying container and from the ordering.- Specified by:
removeItem
in interfaceContainer
- Parameters:
itemId
- the ID of the Item to be removed.- Returns:
true
if the operation succeeded,false
if not- Throws:
java.lang.UnsupportedOperationException
- if the removeItem is not supported.
-
removeContainerProperty
public boolean removeContainerProperty(java.lang.Object propertyId) throws java.lang.UnsupportedOperationException
Deprecated.Removes the specified Property from the underlying container and from the ordering.Note : The Property will be removed from all the Items in the Container.
- Specified by:
removeContainerProperty
in interfaceContainer
- Parameters:
propertyId
- the ID of the Property to remove.- Returns:
true
if the operation succeeded,false
if not- Throws:
java.lang.UnsupportedOperationException
- if the removeContainerProperty is not supported.
-
containsId
public boolean containsId(java.lang.Object itemId)
Deprecated.Description copied from interface:Container
Tests if the Container contains the specified Item.Filtering can hide items so that they will not be visible through the container API, and this method should respect visibility of items (i.e. only indicate visible items as being in the container) if feasible for the container.
- Specified by:
containsId
in interfaceContainer
- Parameters:
itemId
- ID the of Item to be tested- Returns:
- boolean indicating if the Container holds the specified Item
-
getItem
public Item getItem(java.lang.Object itemId)
Deprecated.Description copied from interface:Container
Gets theItem
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.
-
getItemIds
public java.util.Collection<?> 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 isContainer.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 interfaceContainer
- 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 interfaceContainer
- Parameters:
itemId
- ID of the visible Item which contains the PropertypropertyId
- ID of the Property to retrieve- Returns:
- Property with the given ID or
null
-
getContainerPropertyIds
public java.util.Collection<?> 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 interfaceContainer
- Returns:
- unmodifiable collection of Property IDs
-
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.
-
size
public int size()
Deprecated.Description copied from interface:Container
Gets the number of visible Items in the Container.Filtering can hide items so that they will not be visible through the container API.
-
addItemSetChangeListener
public void addItemSetChangeListener(Container.ItemSetChangeListener listener)
Deprecated.Description copied from interface:Container.ItemSetChangeNotifier
Adds an Item set change listener for the object.- Specified by:
addItemSetChangeListener
in interfaceContainer.ItemSetChangeNotifier
- Parameters:
listener
- listener to be added
-
addListener
@Deprecated public void addListener(Container.ItemSetChangeListener listener)
Deprecated.As of 7.0, replaced byaddItemSetChangeListener(Container.ItemSetChangeListener)
- Specified by:
addListener
in interfaceContainer.ItemSetChangeNotifier
-
removeItemSetChangeListener
public void removeItemSetChangeListener(Container.ItemSetChangeListener listener)
Deprecated.Description copied from interface:Container.ItemSetChangeNotifier
Removes the Item set change listener from the object.- Specified by:
removeItemSetChangeListener
in interfaceContainer.ItemSetChangeNotifier
- Parameters:
listener
- listener to be removed
-
removeListener
@Deprecated public void removeListener(Container.ItemSetChangeListener listener)
Deprecated.As of 7.0, replaced byremoveItemSetChangeListener(Container.ItemSetChangeListener)
- Specified by:
removeListener
in interfaceContainer.ItemSetChangeNotifier
-
addPropertySetChangeListener
public void addPropertySetChangeListener(Container.PropertySetChangeListener listener)
Deprecated.Description copied from interface:Container.PropertySetChangeNotifier
Registers a new Property set change listener for this Container.- Specified by:
addPropertySetChangeListener
in interfaceContainer.PropertySetChangeNotifier
- Parameters:
listener
- The new Listener to be registered
-
addListener
@Deprecated public void addListener(Container.PropertySetChangeListener listener)
Deprecated.As of 7.0, replaced byaddPropertySetChangeListener(Container.PropertySetChangeListener)
- Specified by:
addListener
in interfaceContainer.PropertySetChangeNotifier
-
removePropertySetChangeListener
public void removePropertySetChangeListener(Container.PropertySetChangeListener listener)
Deprecated.Description copied from interface:Container.PropertySetChangeNotifier
Removes a previously registered Property set change listener.- Specified by:
removePropertySetChangeListener
in interfaceContainer.PropertySetChangeNotifier
- Parameters:
listener
- Listener to be removed
-
removeListener
@Deprecated public void removeListener(Container.PropertySetChangeListener listener)
Deprecated.As of 7.0, replaced byremovePropertySetChangeListener(Container.PropertySetChangeListener)
- Specified by:
removeListener
in interfaceContainer.PropertySetChangeNotifier
-
addItemAfter
public Item addItemAfter(java.lang.Object previousItemId, java.lang.Object newItemId) throws java.lang.UnsupportedOperationException
Deprecated.Description copied from interface:Container.Ordered
Adds a new item after the given item.Adding an item after null item adds the item as first item of the ordered container.
- Specified by:
addItemAfter
in interfaceContainer.Ordered
- Parameters:
previousItemId
- Id of the visible item in ordered container after which to insert the new item.newItemId
- Id of the new item to be added.- Returns:
- new item or null if the operation fails.
- Throws:
java.lang.UnsupportedOperationException
- if the operation is not supported by the container- See Also:
Ordered: adding items in filtered or sorted containers
-
addItemAfter
public java.lang.Object addItemAfter(java.lang.Object previousItemId) throws java.lang.UnsupportedOperationException
Deprecated.Description copied from interface:Container.Ordered
Adds a new item after the given item.Adding an item after null item adds the item as first item of the ordered container.
- Specified by:
addItemAfter
in interfaceContainer.Ordered
- Parameters:
previousItemId
- Id of the visible item in ordered container after which to insert the new item.- Returns:
- item id the the created new item or null if the operation fails.
- Throws:
java.lang.UnsupportedOperationException
- if the operation is not supported by the container- See Also:
Ordered: adding items in filtered or sorted containers
-
-