com.extjs.gxt.ui.client.widget.selection
Interface Selectable<T extends Component>

Type Parameters:
T - the child component type
All Known Implementing Classes:
DataList, DataView, Table, Tree, TreeTable

public interface Selectable<T extends Component>

Interface for containers who's children can be selected.


Method Summary
 T getSelectedItem()
          Returns the selected item.
 java.util.List<T> getSelectedItems()
          Returns the selected items.
 void onSelectChange(T item, boolean select)
          Called when the visual state of a item is changed.
 void setSelectedItem(T item)
          Selects the item.
 void setSelectedItems(java.util.List<T> items)
          Selects the items.
 

Method Detail

getSelectedItem

T getSelectedItem()
Returns the selected item.

Returns:
the selected item

getSelectedItems

java.util.List<T> getSelectedItems()
Returns the selected items. For single-select, the last selected item is returned.

Returns:
the selected items

onSelectChange

void onSelectChange(T item,
                    boolean select)
Called when the visual state of a item is changed.

Parameters:
item - the item
select - the select state

setSelectedItem

void setSelectedItem(T item)
Selects the item. Any existing selections are cleared.

Parameters:
item - the item to select

setSelectedItems

void setSelectedItems(java.util.List<T> items)
Selects the items. Only the first item is selected for single-select. Any existing selections are cleared.

Parameters:
items - the items to select