com.extjs.gxt.ui.client.widget.selection
Interface SelectionModel<C extends Container<T>,T extends Component>

Type Parameters:
C - the selection container type
T - the item type
All Known Implementing Classes:
AbstractSelectionModel, DataListSelectionModel, DataView.DataViewSelectionModel, TableSelectionModel, TreeSelectionModel

public interface SelectionModel<C extends Container<T>,T extends Component>

Base interface for selection models. Defines the minimum methods required by a selection model.


Method Summary
 void bind(C container)
          Binds the selection model to the container.
 void deselect(int index)
          Deselects the item at the given index.
 void deselect(int start, int end)
          Deselects the range.
 void deselect(java.util.List<T> items)
          Deselects the items.
 void deselect(T... items)
          Deselects the items.
 void deselect(T item)
          Deselects the item.
 void deselectAll()
          Deselects all selections.
 T getSelectedItem()
          Returns the selected item.
 java.util.List<T> getSelectedItems()
          Returns the selected items.
 boolean isSelected(T item)
          Returns true if the item is selcted.
 void refresh()
          Refreshes the current selections.
 void select(boolean keepExisting, T... items)
          Selects the items.
 void select(int index, boolean keepExisting)
          Selects the item at the given index.
 void select(int start, int end, boolean keepExisting)
          Selects the range.
 void select(java.util.List<T> items, boolean keepExisting)
          Selects the items.
 void select(T item, boolean keepExisting)
          Selects the item.
 void selectAll()
          Selects all items.
 

Method Detail

bind

void bind(C container)
Binds the selection model to the container.

Parameters:
container - the container

deselect

void deselect(int index)
Deselects the item at the given index.

Parameters:
index - the index of the item to be deselected

deselect

void deselect(int start,
              int end)
Deselects the range.

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

deselect

void deselect(java.util.List<T> items)
Deselects the items.

Parameters:
items - the item

deselect

void deselect(T... items)
Deselects the items.

Parameters:
items - the items to deselect

deselect

void deselect(T item)
Deselects the item.

Parameters:
item - the item to be deselected

deselectAll

void deselectAll()
Deselects all selections.


getSelectedItem

T getSelectedItem()
Returns the selected item.


getSelectedItems

java.util.List<T> getSelectedItems()
Returns the selected items.


isSelected

boolean isSelected(T item)
Returns true if the item is selcted.

Parameters:
item - the item
Returns:
true if selected

refresh

void refresh()
Refreshes the current selections.


select

void select(int index,
            boolean keepExisting)
Selects the item at the given index.

Parameters:
index - the index of the item to be selected
keepExisting - true to keep existing selected

select

void select(int start,
            int end,
            boolean keepExisting)
Selects the range.

Parameters:
start - the start index
end - the end index
keepExisting - true to keep existing selected

select

void select(java.util.List<T> items,
            boolean keepExisting)
Selects the items. Selects the first item for single-select.

Parameters:
items - the items to select
keepExisting - true to keep existing selected

select

void select(boolean keepExisting,
            T... items)
Selects the items. Selects the first item for single-select.

Parameters:
keepExisting - true to keep existing selected
items - the items

select

void select(T item,
            boolean keepExisting)
Selects the item.

Parameters:
item - the item
keepExisting - true to keep existing selected

selectAll

void selectAll()
Selects all items.