|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.extjs.gxt.ui.client.widget.selection.AbstractSelectionModel<C,T>
C
- the container typeT
- the container item typepublic abstract class AbstractSelectionModel<C extends Container<T>,T extends Component>
Concrete selection model. 3 selection models are supported:
Field Summary | |
---|---|
protected C |
container
|
protected KeyNav |
keyNav
|
protected boolean |
locked
|
protected Style.SelectionMode |
mode
|
protected boolean |
multiSelect
|
protected java.util.List<T> |
selected
|
protected T |
selectedItem
|
protected java.util.List<T> |
selectedPreRender
|
protected boolean |
simpleSelect
|
protected boolean |
singleSelect
|
Constructor Summary | |
---|---|
AbstractSelectionModel()
Creates a new single-select selection model. |
|
AbstractSelectionModel(Style.SelectionMode mode)
Creates a new selection model. |
Method Summary | |
---|---|
void |
bind(C container)
Binds the selection model to the container. |
protected ContainerEvent |
createContainerEvent(Container container)
|
protected void |
createKeyNav(Container tree)
|
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. |
protected void |
deselectAll(boolean supressEvent)
|
protected void |
doDeselect(Items<T> items)
|
protected void |
doMultiSelect(T item,
ContainerEvent ce)
|
protected void |
doSelect(Items<T> items,
boolean keepExisting,
boolean supressEvent)
|
protected void |
doSelectChange(T item,
boolean select)
|
protected void |
doSingleSelect(T item,
int index,
ContainerEvent ce)
|
protected void |
fireSelectionChanged()
|
T |
getSelectedItem()
Returns the selected item. |
java.util.List<T> |
getSelectedItems()
Returns the selected items. |
Style.SelectionMode |
getSelectionMode()
Returns the selection mode. |
void |
handleEvent(ContainerEvent e)
Sent when an event that the listener has registered for occurs. |
protected void |
hookPreRender(T item,
boolean select)
|
boolean |
isLocked()
Returns true if selections are locked. |
boolean |
isSelected(T item)
Returns true if the item is selcted. |
protected T |
next()
|
protected void |
onDoubleClick(ContainerEvent ce)
|
protected void |
onKeyDown(ContainerEvent ce)
|
protected void |
onKeyLeft(ContainerEvent ce)
|
protected void |
onKeyRight(ContainerEvent ce)
|
protected void |
onKeyUp(ContainerEvent ce)
|
protected void |
onMouseDown(ContainerEvent ce)
|
protected void |
onRemove(ContainerEvent ce)
|
protected void |
onRender()
|
protected void |
onSelectChange(T item,
boolean select)
|
protected T |
previous()
|
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. |
void |
setLocked(boolean locked)
Sets whether selections are locked. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected T extends Component selectedItem
protected java.util.List<T extends Component> selected
protected java.util.List<T extends Component> selectedPreRender
protected C extends Container<T> container
protected KeyNav keyNav
protected Style.SelectionMode mode
protected boolean singleSelect
protected boolean simpleSelect
protected boolean multiSelect
protected boolean locked
Constructor Detail |
---|
public AbstractSelectionModel()
public AbstractSelectionModel(Style.SelectionMode mode)
mode
- the selection modeMethod Detail |
---|
public void bind(C container)
SelectionModel
bind
in interface SelectionModel<C extends Container<T>,T extends Component>
container
- the containerpublic void deselect(int index)
SelectionModel
deselect
in interface SelectionModel<C extends Container<T>,T extends Component>
index
- the index of the item to be deselectedpublic void deselect(int start, int end)
SelectionModel
deselect
in interface SelectionModel<C extends Container<T>,T extends Component>
start
- the start indexend
- the end indexpublic void deselect(java.util.List<T> items)
SelectionModel
deselect
in interface SelectionModel<C extends Container<T>,T extends Component>
items
- the itempublic void deselect(T... items)
SelectionModel
deselect
in interface SelectionModel<C extends Container<T>,T extends Component>
items
- the items to deselectpublic void deselect(T item)
SelectionModel
deselect
in interface SelectionModel<C extends Container<T>,T extends Component>
item
- the item to be deselectedpublic void deselectAll()
SelectionModel
deselectAll
in interface SelectionModel<C extends Container<T>,T extends Component>
public T getSelectedItem()
SelectionModel
getSelectedItem
in interface SelectionModel<C extends Container<T>,T extends Component>
public java.util.List<T> getSelectedItems()
SelectionModel
getSelectedItems
in interface SelectionModel<C extends Container<T>,T extends Component>
public Style.SelectionMode getSelectionMode()
public void handleEvent(ContainerEvent e)
Listener
handleEvent
in interface Listener<ContainerEvent>
e
- the event which occurredpublic boolean isLocked()
public boolean isSelected(T item)
SelectionModel
isSelected
in interface SelectionModel<C extends Container<T>,T extends Component>
item
- the item
public void refresh()
SelectionModel
refresh
in interface SelectionModel<C extends Container<T>,T extends Component>
public void select(int index, boolean keepExisting)
SelectionModel
select
in interface SelectionModel<C extends Container<T>,T extends Component>
index
- the index of the item to be selectedkeepExisting
- true to keep existing selectedpublic void select(int start, int end, boolean keepExisting)
SelectionModel
select
in interface SelectionModel<C extends Container<T>,T extends Component>
start
- the start indexend
- the end indexkeepExisting
- true to keep existing selectedpublic void select(java.util.List<T> items, boolean keepExisting)
SelectionModel
select
in interface SelectionModel<C extends Container<T>,T extends Component>
items
- the items to selectkeepExisting
- true to keep existing selectedpublic void select(boolean keepExisting, T... items)
SelectionModel
select
in interface SelectionModel<C extends Container<T>,T extends Component>
keepExisting
- true to keep existing selecteditems
- the itemspublic void select(T item, boolean keepExisting)
SelectionModel
select
in interface SelectionModel<C extends Container<T>,T extends Component>
item
- the itemkeepExisting
- true to keep existing selectedpublic void selectAll()
SelectionModel
selectAll
in interface SelectionModel<C extends Container<T>,T extends Component>
public void setLocked(boolean locked)
locked
- true to lockprotected ContainerEvent createContainerEvent(Container container)
protected void createKeyNav(Container tree)
protected void deselectAll(boolean supressEvent)
protected void doDeselect(Items<T> items)
protected void doMultiSelect(T item, ContainerEvent ce)
protected void doSelect(Items<T> items, boolean keepExisting, boolean supressEvent)
protected void doSelectChange(T item, boolean select)
protected void doSingleSelect(T item, int index, ContainerEvent ce)
protected void fireSelectionChanged()
protected void hookPreRender(T item, boolean select)
protected T next()
protected void onMouseDown(ContainerEvent ce)
protected void onDoubleClick(ContainerEvent ce)
protected void onKeyDown(ContainerEvent ce)
protected void onKeyLeft(ContainerEvent ce)
protected void onKeyRight(ContainerEvent ce)
protected void onKeyUp(ContainerEvent ce)
protected void onRemove(ContainerEvent ce)
protected void onRender()
protected void onSelectChange(T item, boolean select)
protected T previous()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |