com.extjs.gxt.ui.client.widget
Class Items<T extends Component>

java.lang.Object
  extended by com.extjs.gxt.ui.client.widget.Items<T>
Type Parameters:
T - the child type

public class Items<T extends Component>
extends java.lang.Object

A selection of items in a container. The selection can be specified with an index, a range, a single item, an array, and a list.


Constructor Summary
Items(int index)
          Creates a items instance with a single item.
Items(int start, int end)
          Creates a items instance with a range.
Items(java.util.List<T> items)
          Creates a items instance with a list.
Items(T... item)
          Createa a items instance with 1 to many items.
 
Method Summary
 T getItem(Container c)
          Returns the first matching item from the specified container.
 java.util.List<T> getItems(Container c)
          Returns the matching items from the specified container.
 boolean isSingle()
          Returns true if there is a single selected item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Items

public Items(int index)
Creates a items instance with a single item.

Parameters:
index - the index of the item

Items

public Items(int start,
             int end)
Creates a items instance with a range.

Parameters:
start - the start index
end - the end index

Items

public Items(java.util.List<T> items)
Creates a items instance with a list.

Parameters:
items - the list of items

Items

public Items(T... item)
Createa a items instance with 1 to many items.

Parameters:
item - the varargs items
Method Detail

getItem

public T getItem(Container c)
Returns the first matching item from the specified container.

Parameters:
c - the container
Returns:
the matching item

getItems

public java.util.List<T> getItems(Container c)
Returns the matching items from the specified container.

Parameters:
c - the container
Returns:
the selected items

isSingle

public boolean isSingle()
Returns true if there is a single selected item.

Returns:
true for single, false otherwise