aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin/data/Container.java
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/main/java/com/vaadin/data/Container.java')
-rw-r--r--server/src/main/java/com/vaadin/data/Container.java198
1 files changed, 99 insertions, 99 deletions
diff --git a/server/src/main/java/com/vaadin/data/Container.java b/server/src/main/java/com/vaadin/data/Container.java
index 746139ecb5..6832a57b06 100644
--- a/server/src/main/java/com/vaadin/data/Container.java
+++ b/server/src/main/java/com/vaadin/data/Container.java
@@ -1,12 +1,12 @@
/*
* Copyright 2000-2014 Vaadin Ltd.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -29,7 +29,7 @@ import com.vaadin.data.util.filter.UnsupportedFilterException;
* {@link Item}s, but it imposes certain constraints on its contents. These
* constraints state the following:
* </p>
- *
+ *
* <ul>
* <li>All Items in the Container must have the same number of Properties.
* <li>All Items in the Container must have the same Property ID's (see
@@ -39,7 +39,7 @@ import com.vaadin.data.util.filter.UnsupportedFilterException;
* <li>All Items within a container are uniquely identified by their non-null
* IDs.
* </ul>
- *
+ *
* <p>
* The Container can be visualized as a representation of a relational database
* table. Each Item in the Container represents a row in the table, and all
@@ -47,18 +47,18 @@ import com.vaadin.data.util.filter.UnsupportedFilterException;
* that as with the cells in a database table, no Property in a Container may be
* empty, though they may contain <code>null</code> values.
* </p>
- *
+ *
* <p>
* Note that though uniquely identified, the Items in a Container are not
* necessarily {@link Container.Ordered ordered} or {@link Container.Indexed
* indexed}.
* </p>
- *
+ *
* <p>
* Containers can derive Item ID's from the item properties or use other,
* container specific or user specified identifiers.
* </p>
- *
+ *
* <p>
* If a container is {@link Filterable filtered} or {@link Sortable sorted},
* most of the the methods of the container interface and its subinterfaces
@@ -67,16 +67,16 @@ import com.vaadin.data.util.filter.UnsupportedFilterException;
* See individual method javadoc for exceptions to this (adding and removing
* items).
* </p>
- *
+ *
* <p>
* <img src=doc-files/Container_full.gif>
* </p>
- *
+ *
* <p>
* The Container interface is split to several subinterfaces so that a class can
* implement only the ones it needs.
* </p>
- *
+ *
* @author Vaadin Ltd
* @since 3.0
*/
@@ -88,7 +88,7 @@ public interface Container extends Serializable {
* returned.
* <p>
* Containers should not return Items that are filtered out.
- *
+ *
* @param itemId
* ID of the {@link Item} to retrieve
* @return the {@link Item} with the given ID or <code>null</code> if the
@@ -99,7 +99,7 @@ public interface Container extends Serializable {
/**
* Gets the ID's of all Properties stored in the Container. The ID's cannot
* be modified through the returned collection.
- *
+ *
* @return unmodifiable collection of Property IDs
*/
public Collection<?> getContainerPropertyIds();
@@ -115,7 +115,7 @@ public interface Container extends Serializable {
* <p>
* Calling this method for large lazy containers can be an expensive
* operation and should be avoided when practical.
- *
+ *
* @return unmodifiable collection of Item IDs
*/
public Collection<?> getItemIds();
@@ -125,7 +125,7 @@ public interface Container extends Serializable {
* Container. If the Container does not contain the item or it is filtered
* out, or the Container does not have the Property, <code>null</code> is
* returned.
- *
+ *
* @param itemId
* ID of the visible Item which contains the Property
* @param propertyId
@@ -136,7 +136,7 @@ public interface Container extends Serializable {
/**
* Gets the data type of all Properties identified by the given Property ID.
- *
+ *
* @param propertyId
* ID identifying the Properties
* @return data type of the Properties
@@ -148,7 +148,7 @@ public interface Container extends Serializable {
* <p>
* Filtering can hide items so that they will not be visible through the
* container API.
- *
+ *
* @return number of Items in the Container
*/
public int size();
@@ -160,7 +160,7 @@ public interface Container extends Serializable {
* 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.
- *
+ *
* @param itemId
* ID the of Item to be tested
* @return boolean indicating if the Container holds the specified Item
@@ -169,17 +169,17 @@ public interface Container extends Serializable {
/**
* Creates a new Item with the given ID in the Container.
- *
+ *
* <p>
* The new Item is returned, and it is ready to have its Properties
* modified. Returns <code>null</code> if the operation fails or the
* Container already contains a Item with the given ID.
* </p>
- *
+ *
* <p>
* This functionality is optional.
* </p>
- *
+ *
* @param itemId
* ID of the Item to be created
* @return Created new Item, or <code>null</code> in case of a failure
@@ -191,17 +191,17 @@ public interface Container extends Serializable {
/**
* Creates a new Item into the Container, and assign it an automatic ID.
- *
+ *
* <p>
* The new ID is returned, or <code>null</code> if the operation fails.
* After a successful call you can use the {@link #getItem(Object ItemId)
* <code>getItem</code>}method to fetch the Item.
* </p>
- *
+ *
* <p>
* This functionality is optional.
* </p>
- *
+ *
* @return ID of the newly created Item, or <code>null</code> in case of a
* failure
* @throws UnsupportedOperationException
@@ -212,16 +212,16 @@ public interface Container extends Serializable {
/**
* Removes the Item identified by <code>ItemId</code> from the Container.
- *
+ *
* <p>
* Containers that support filtering should also allow removing an item that
* is currently filtered out.
* </p>
- *
+ *
* <p>
* This functionality is optional.
* </p>
- *
+ *
* @param itemId
* ID of the Item to remove
* @return <code>true</code> if the operation succeeded, <code>false</code>
@@ -237,7 +237,7 @@ public interface Container extends Serializable {
* type and default value of the new Property are given as parameters.
* <p>
* This functionality is optional.
- *
+ *
* @param propertyId
* ID of the Property
* @param type
@@ -258,7 +258,7 @@ public interface Container extends Serializable {
* Note that the Property will be removed from all Items in the Container.
* <p>
* This functionality is optional.
- *
+ *
* @param propertyId
* ID of the Property to remove
* @return <code>true</code> if the operation succeeded, <code>false</code>
@@ -272,12 +272,12 @@ public interface Container extends Serializable {
/**
* Removes all Items from the Container.
- *
+ *
* <p>
* Note that Property ID and type information is preserved. This
* functionality is optional.
* </p>
- *
+ *
* @return <code>true</code> if the operation succeeded, <code>false</code>
* if not
* @throws UnsupportedOperationException
@@ -288,7 +288,7 @@ public interface Container extends Serializable {
/**
* Interface for Container classes whose {@link Item}s can be traversed in
* order.
- *
+ *
* <p>
* If the container is filtered or sorted, the traversal applies to the
* filtered and sorted view.
@@ -307,7 +307,7 @@ public interface Container extends Serializable {
* Gets the ID of the Item following the Item that corresponds to
* <code>itemId</code>. If the given Item is the last or not found in
* the Container, <code>null</code> is returned.
- *
+ *
* @param itemId
* ID of a visible Item in the Container
* @return ID of the next visible Item or <code>null</code>
@@ -318,7 +318,7 @@ public interface Container extends Serializable {
* Gets the ID of the Item preceding the Item that corresponds to
* <code>itemId</code>. If the given Item is the first or not found in
* the Container, <code>null</code> is returned.
- *
+ *
* @param itemId
* ID of a visible Item in the Container
* @return ID of the previous visible Item or <code>null</code>
@@ -327,14 +327,14 @@ public interface Container extends Serializable {
/**
* Gets the ID of the first Item in the Container.
- *
+ *
* @return ID of the first visible Item in the Container
*/
public Object firstItemId();
/**
* Gets the ID of the last Item in the Container..
- *
+ *
* @return ID of the last visible Item in the Container
*/
public Object lastItemId();
@@ -342,7 +342,7 @@ public interface Container extends Serializable {
/**
* Tests if the Item corresponding to the given Item ID is the first
* Item in the Container.
- *
+ *
* @param itemId
* ID of an Item in the Container
* @return <code>true</code> if the Item is first visible item in the
@@ -353,7 +353,7 @@ public interface Container extends Serializable {
/**
* Tests if the Item corresponding to the given Item ID is the last Item
* in the Container.
- *
+ *
* @return <code>true</code> if the Item is last visible item in the
* Container, <code>false</code> if not
*/
@@ -365,9 +365,9 @@ public interface Container extends Serializable {
* Adding an item after null item adds the item as first item of the
* ordered container.
* </p>
- *
+ *
* @see Ordered Ordered: adding items in filtered or sorted containers
- *
+ *
* @param previousItemId
* Id of the visible item in ordered container after which to
* insert the new item.
@@ -385,9 +385,9 @@ public interface Container extends Serializable {
* Adding an item after null item adds the item as first item of the
* ordered container.
* </p>
- *
+ *
* @see Ordered Ordered: adding items in filtered or sorted containers
- *
+ *
* @param previousItemId
* Id of the visible item in ordered container after which to
* insert the new item.
@@ -431,7 +431,7 @@ public interface Container extends Serializable {
* <p>
* Sorting a container can irreversibly change the order of its items or
* only change the order temporarily, depending on the container.
- *
+ *
* @param propertyId
* Array of container property IDs, whose values are used to
* sort the items in container as primary, secondary, ...
@@ -450,7 +450,7 @@ public interface Container extends Serializable {
/**
* Gets the container property IDs which can be used to sort the items.
- *
+ *
* @return the IDs of the properties that can be used for sorting the
* container
*/
@@ -474,7 +474,7 @@ public interface Container extends Serializable {
* Gets the index of the Item corresponding to the itemId. The following
* is <code>true</code> for the returned index: 0 <= index < size(), or
* index = -1 if there is no visible item with that id in the container.
- *
+ *
* @param itemId
* ID of an Item in the Container
* @return index of the Item, or -1 if (the filtered and sorted view of)
@@ -486,7 +486,7 @@ public interface Container extends Serializable {
* Get the item id for the item at the position given by
* <code>index</code>.
* <p>
- *
+ *
* @param index
* the index of the requested item id
* @return the item id of the item at the given index
@@ -512,7 +512,7 @@ public interface Container extends Serializable {
* <p>
* For quick migration to new API see:
* {@link ContainerHelpers#getItemIdsUsingGetIdByIndex(int, int, Indexed)}
- *
+ *
* @param startIndex
* the index for the first item which id to include
* @param numberOfItems
@@ -520,7 +520,7 @@ public interface Container extends Serializable {
* start index, must be >= 0
* @return List containing the requested item ids or empty list if
* <code>numberOfItems</code> == 0; not null
- *
+ *
* @throws IllegalArgumentException
* if <code>numberOfItems</code> is < 0
* @throws IndexOutOfBoundsException
@@ -528,7 +528,7 @@ public interface Container extends Serializable {
* container. (i.e.
* <code>startIndex &lt; 0 || container.size()-1 &lt; startIndex</code>
* )
- *
+ *
* @since 7.0
*/
public List<?> getItemIds(int startIndex, int numberOfItems);
@@ -546,7 +546,7 @@ public interface Container extends Serializable {
* given position. See {@link Indexed}, {@link Ordered},
* {@link Filterable} and {@link Sortable} for more information.
* </p>
- *
+ *
* @param index
* Index (in the filtered and sorted view) to add the new
* item.
@@ -569,7 +569,7 @@ public interface Container extends Serializable {
* given position. See {@link Indexed}, {@link Filterable} and
* {@link Sortable} for more information.
* </p>
- *
+ *
* @param index
* Index (in the filtered and sorted view) at which to add
* the new item.
@@ -585,28 +585,28 @@ public interface Container extends Serializable {
/**
* An <code>Event</code> object specifying information about the added
* items.
- *
+ *
* @since 7.4
*/
public interface ItemAddEvent extends ItemSetChangeEvent {
/**
* Gets the item id of the first added item.
- *
+ *
* @return item id of the first added item
*/
public Object getFirstItemId();
/**
* Gets the index of the first added item.
- *
+ *
* @return index of the first added item
*/
public int getFirstIndex();
/**
* Gets the number of the added items.
- *
+ *
* @return the number of added items.
*/
public int getAddedItemsCount();
@@ -615,27 +615,27 @@ public interface Container extends Serializable {
/**
* An <code>Event</code> object specifying information about the removed
* items.
- *
+ *
* @since 7.4
*/
public interface ItemRemoveEvent extends ItemSetChangeEvent {
/**
* Gets the item id of the first removed item.
- *
+ *
* @return item id of the first removed item
*/
public Object getFirstItemId();
/**
* Gets the index of the first removed item.
- *
+ *
* @return index of the first removed item
*/
public int getFirstIndex();
/**
* Gets the number of the removed items.
- *
+ *
* @return the number of removed items
*/
public int getRemovedItemsCount();
@@ -648,7 +648,7 @@ public interface Container extends Serializable {
* hierarchically. This means that the Items in the container belong in a
* tree-like structure, with the following quirks:
* </p>
- *
+ *
* <ul>
* <li>The Item structure may have more than one root elements
* <li>The Items in the hierarchy can be declared explicitly to be able or
@@ -660,7 +660,7 @@ public interface Container extends Serializable {
/**
* Gets the IDs of all Items that are children of the specified Item.
* The returned collection is unmodifiable.
- *
+ *
* @param itemId
* ID of the Item whose children the caller is interested in
* @return An unmodifiable {@link java.util.Collection collection}
@@ -671,7 +671,7 @@ public interface Container extends Serializable {
/**
* Gets the ID of the parent Item of the specified Item.
- *
+ *
* @param itemId
* ID of the Item whose parent the caller wishes to find out.
* @return the ID of the parent Item. Will be <code>null</code> if the
@@ -683,7 +683,7 @@ public interface Container extends Serializable {
* Gets the IDs of all Items in the container that don't have a parent.
* Such items are called <code>root</code> Items. The returned
* collection is unmodifiable.
- *
+ *
* @return An unmodifiable {@link java.util.Collection collection}
* containing IDs of all root elements of the container
*/
@@ -697,11 +697,11 @@ public interface Container extends Serializable {
* also possible to detach a node from the hierarchy (and thus make it
* root) by setting the parent <code>null</code>.
* </p>
- *
+ *
* <p>
* This operation is optional.
* </p>
- *
+ *
* @param itemId
* ID of the item to be set as the child of the Item
* identified with <code>newParentId</code>
@@ -716,7 +716,7 @@ public interface Container extends Serializable {
/**
* Tests if the Item with given ID can have children.
- *
+ *
* @param itemId
* ID of the Item in the container whose child capability is
* to be tested
@@ -738,12 +738,12 @@ public interface Container extends Serializable {
* {@link #setParent(Object itemId, Object newParentId)}or
* {@link com.vaadin.data.Container#removeItem(Object itemId)}.
* </p>
- *
+ *
* <p>
* This operation is optional. If it is not implemented, the method
* always returns <code>false</code>.
* </p>
- *
+ *
* @param itemId
* ID of the Item in the container whose child capability is
* to be set
@@ -763,7 +763,7 @@ public interface Container extends Serializable {
* at least one unless it is empty. The
* {@link #getParent(Object itemId)} method always returns
* <code>null</code> for root Items.
- *
+ *
* @param itemId
* ID of the Item whose root status is to be tested
* @return <code>true</code> if the specified Item is a root,
@@ -777,12 +777,12 @@ public interface Container extends Serializable {
* or if it is a leaf. The {@link #getChildren(Object itemId)} method
* always returns <code>null</code> for leaf Items.
* </p>
- *
+ *
* <p>
* Note that being a leaf does not imply whether or not an Item is
* allowed to have children.
* </p>
- *
+ *
* @param itemId
* ID of the Item to be tested
* @return <code>true</code> if the specified Item has children,
@@ -795,11 +795,11 @@ public interface Container extends Serializable {
* Removes the Item identified by <code>ItemId</code> from the
* Container.
* </p>
- *
+ *
* <p>
* Note that this does not remove any children the item might have.
* </p>
- *
+ *
* @param itemId
* ID of the Item to remove
* @return <code>true</code> if the operation succeeded,
@@ -846,7 +846,7 @@ public interface Container extends Serializable {
* The functionality of SimpleFilterable can be implemented using the
* {@link Filterable} API and {@link SimpleStringFilter}.
* </p>
- *
+ *
* @since 5.0 (renamed from Filterable to SimpleFilterable in 6.6)
*/
public interface SimpleFilterable extends Container, Serializable {
@@ -864,7 +864,7 @@ public interface Container extends Serializable {
* <p>
* If a container has multiple filters, only items accepted by all
* filters are visible.
- *
+ *
* @param propertyId
* Property for which the filter is applied to.
* @param filterString
@@ -885,7 +885,7 @@ public interface Container extends Serializable {
/**
* Remove all filters from the given property.
- *
+ *
* @param propertyId
* for which to remove filters
*/
@@ -908,16 +908,16 @@ public interface Container extends Serializable {
* An {@link Filter} should implement {@link #equals(Object)} and
* {@link #hashCode()} correctly to avoid duplicate filter registrations
* etc.
- *
+ *
* @see Filterable
- *
+ *
* @since 6.6
*/
public interface Filter extends Serializable {
/**
* Check if an item passes the filter (in-memory filtering).
- *
+ *
* @param itemId
* identifier of the item being filtered; may be null when
* the item is being added to the container
@@ -933,10 +933,10 @@ public interface Container extends Serializable {
/**
* Check if a change in the value of a property can affect the filtering
* result. May always return true, at the cost of performance.
- *
+ *
* If the filter cannot determine whether it may depend on the property
* or not, should return true.
- *
+ *
* @param propertyId
* @return true if the filtering result may/does change based on changes
* to the property identified by propertyId
@@ -977,12 +977,12 @@ public interface Container extends Serializable {
* at index 0, at index {@link com.vaadin.data.Container#size()} or at an
* undefined position is up to the implementation.
* </p>
- *
+ *
* <p>
* This API replaces the old Filterable interface, renamed to
* {@link SimpleFilterable} in Vaadin 6.6.
* </p>
- *
+ *
* @since 6.6
*/
public interface Filterable extends Container, Serializable {
@@ -991,7 +991,7 @@ public interface Container extends Serializable {
* <p>
* If a container has multiple filters, only items accepted by all
* filters are visible.
- *
+ *
* @throws UnsupportedFilterException
* if the filter is not supported by the container
*/
@@ -1013,7 +1013,7 @@ public interface Container extends Serializable {
/**
* Returns the filters which have been applied to the container
- *
+ *
* @return A collection of filters which have been applied to the
* container. An empty collection if no filters have been
* applied.
@@ -1030,7 +1030,7 @@ public interface Container extends Serializable {
/**
* Sets the Container that serves as the data source of the viewer.
- *
+ *
* @param newDataSource
* The new data source Item
*/
@@ -1038,7 +1038,7 @@ public interface Container extends Serializable {
/**
* Gets the Container serving as the data source of the viewer.
- *
+ *
* @return data source Container
*/
public Container getContainerDataSource();
@@ -1066,14 +1066,14 @@ public interface Container extends Serializable {
/**
* An <code>Event</code> object specifying the Container whose Item set has
* changed (items added, removed or reordered).
- *
+ *
* A simple property value change is not an item set change.
*/
public interface ItemSetChangeEvent extends Serializable {
/**
* Gets the Property where the event occurred.
- *
+ *
* @return source of the event
*/
public Container getContainer();
@@ -1090,7 +1090,7 @@ public interface Container extends Serializable {
/**
* Lets the listener know a Containers visible (filtered and/or sorted,
* if applicable) Item set has changed.
- *
+ *
* @param event
* change event text
*/
@@ -1105,7 +1105,7 @@ public interface Container extends Serializable {
* <p>
* An item set change refers to addition, removal or reordering of items in
* the container. A simple property value change is not an item set change.
- *
+ *
* <p>
* Note: The general Java convention is not to explicitly declare that a
* class generates events, but to directly define the
@@ -1119,7 +1119,7 @@ public interface Container extends Serializable {
/**
* Adds an Item set change listener for the object.
- *
+ *
* @param listener
* listener to be added
*/
@@ -1135,7 +1135,7 @@ public interface Container extends Serializable {
/**
* Removes the Item set change listener from the object.
- *
+ *
* @param listener
* listener to be removed
*/
@@ -1165,7 +1165,7 @@ public interface Container extends Serializable {
/**
* Retrieves the Container whose contents have been modified.
- *
+ *
* @return Source Container of the event.
*/
public Container getContainer();
@@ -1185,7 +1185,7 @@ public interface Container extends Serializable {
/**
* Notifies this listener that the set of property IDs supported by the
* Container has changed.
- *
+ *
* @param event
* Change event.
*/
@@ -1200,14 +1200,14 @@ public interface Container extends Serializable {
* that it will generate a <code>PropertySetChangeEvent</code> when the set
* of property IDs supported by the container is modified.
* </p>
- *
+ *
* <p>
* A property set change means the addition, removal or other structural
* changes to the properties of a container. Changes concerning the set of
* items in the container and their property values are not property set
* changes.
* </p>
- *
+ *
* <p>
* Note that the general Java convention is not to explicitly declare that a
* class generates events, but to directly define the
@@ -1221,7 +1221,7 @@ public interface Container extends Serializable {
/**
* Registers a new Property set change listener for this Container.
- *
+ *
* @param listener
* The new Listener to be registered
*/
@@ -1237,7 +1237,7 @@ public interface Container extends Serializable {
/**
* Removes a previously registered Property set change listener.
- *
+ *
* @param listener
* Listener to be removed
*/