|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface Container.Indexed
Interface for Container classes whose Item
s can be accessed by
their position in the container.
If the container is filtered or sorted, all indices refer to the filtered
and sorted view. However, the addItemAt()
methods may add
items that will be filtered out after addition or moved to another
position based on sorting.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.vaadin.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 |
Method Summary | |
---|---|
java.lang.Object |
addItemAt(int index)
Adds a new item at given index (in the filtered view). |
Item |
addItemAt(int index,
java.lang.Object newItemId)
Adds a new item at given index (in the filtered view). |
java.lang.Object |
getIdByIndex(int index)
Get the item id for the item at the position given by index . |
java.util.List<?> |
getItemIds(int startIndex,
int numberOfItems)
Get numberOfItems consecutive item ids from the
container, starting with the item id at startIndex . |
int |
indexOfId(java.lang.Object itemId)
Gets the index of the Item corresponding to the itemId. |
Methods inherited from interface com.vaadin.data.Container.Ordered |
---|
addItemAfter, addItemAfter, firstItemId, isFirstId, isLastId, lastItemId, nextItemId, prevItemId |
Methods inherited from interface com.vaadin.data.Container |
---|
addContainerProperty, addItem, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeAllItems, removeContainerProperty, removeItem, size |
Method Detail |
---|
int indexOfId(java.lang.Object itemId)
true
for the returned index: 0 <= index < size(), or
index = -1 if there is no visible item with that id in the container.
itemId
- ID of an Item in the Container
java.lang.Object getIdByIndex(int index)
index
. IndexOutOfBoundsException
if
index
is outside the range of the container. (i.e.
index < 0 || container.size()-1 < index
)
index
- the index of the requested item id
java.util.List<?> getItemIds(int startIndex, int numberOfItems)
numberOfItems
consecutive item ids from the
container, starting with the item id at startIndex
. numberOfItems
item
ids, but can contain less if the container has less items than
required to fulfill the request. The returned list must hence contain
all of the item ids from the range: startIndex
to
max(startIndex + (numberOfItems-1), container.size()-1)
. ContainerHelpers#getItemIdsUsingGetIdByIndex(int, int, Indexed)
. IllegalArgumentException
if
numberOfItems
is < 0 IndexOutOfBoundsException
if
startIndex
is outside the range of the container. (i.e.
startIndex < 0 || container.size()-1 < startIndex
)
startIndex
- the index for the first item which id to includenumberOfItems
- the number of consecutive item ids to get from the given
start index, must be >= 0
numberOfItems
== 0; not nulljava.lang.Object addItemAt(int index) throws java.lang.UnsupportedOperationException
The indices of the item currently in the given position and all the following items are incremented.
This method should apply filters to the added item after inserting
it, possibly hiding it immediately. If the container is being sorted,
the item may be added at the correct sorted position instead of the
given position. See Container.Indexed
, Container.Ordered
,
Container.SimpleFilterable
and Container.Sortable
for more information.
index
- Index (in the filtered and sorted view) to add the new
item.
java.lang.UnsupportedOperationException
- if the operation is not supported by the containerItem addItemAt(int index, java.lang.Object newItemId) throws java.lang.UnsupportedOperationException
The indexes of the item currently in the given position and all the following items are incremented.
This method should apply filters to the added item after inserting
it, possibly hiding it immediately. If the container is being sorted,
the item may be added at the correct sorted position instead of the
given position. See Container.Indexed
, Container.SimpleFilterable
and
Container.Sortable
for more information.
index
- Index (in the filtered and sorted view) at which to add
the new item.newItemId
- Id of the new item to be added.
Item
or null if the operation fails.
java.lang.UnsupportedOperationException
- if the operation is not supported by the container
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |