|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.extjs.gxt.ui.client.event.BaseObservable
com.extjs.gxt.ui.client.widget.selection.AbstractStoreSelectionModel<M>
M
- the model type contained within the storepublic abstract class AbstractStoreSelectionModel<M extends ModelData>
Abstract base class for store based selection models.
BaseEvent.setCancelled(boolean)
.
Field Summary | |
---|---|
protected M |
lastSelected
|
protected boolean |
locked
|
protected java.util.List<M> |
selected
|
protected Style.SelectionMode |
selectionMode
|
protected Store<M> |
store
|
protected StoreListener<M> |
storeListener
|
Constructor Summary | |
---|---|
AbstractStoreSelectionModel()
|
Method Summary | |
---|---|
void |
addSelectionChangedListener(SelectionChangedListener<M> listener)
Add a selection changed listener. |
void |
bind(Store store)
Binds the store to the selection model. |
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<M> items)
Deselects the items. |
void |
deselect(M... items)
Deselects the items. |
void |
deselect(M item)
Deselects the item. |
void |
deselectAll()
Deselects all selections. |
protected void |
doDeselect(java.util.List<M> models,
boolean supressEvent)
|
protected void |
doMultiSelect(java.util.List<M> models,
boolean keepExisting,
boolean supressEvent)
|
protected void |
doSelect(java.util.List<M> models,
boolean keepExisting,
boolean supressEvent)
|
protected void |
doSingleSelect(M model,
boolean supressEvent)
|
protected void |
fireSelectionChange()
|
protected M |
getLastFocused()
|
M |
getSelectedItem()
Returns the selected item. |
java.util.List<M> |
getSelectedItems()
Returns the selected items. |
java.util.List<M> |
getSelection()
Returns the current selection. |
Style.SelectionMode |
getSelectionMode()
Returns the selection mode. |
boolean |
isLocked()
Returns true if the selection model is locked. |
boolean |
isSelected(M item)
Returns true if the item is selected. |
protected void |
onAdd(java.util.List<? extends M> models)
|
protected void |
onClear(StoreEvent<M> se)
|
protected void |
onLastFocusChanged(M oldFocused,
M newFocused)
|
protected void |
onRemove(M model)
|
protected abstract void |
onSelectChange(M model,
boolean select)
|
protected void |
onUpdate(M model)
|
void |
refresh()
Refreshes the current selections. |
void |
removeSelectionListener(SelectionChangedListener<M> listener)
Removes a selection changed listener. |
void |
select(boolean keepExisting,
M... 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<M> items,
boolean keepExisting)
Selects the items. |
void |
select(M item,
boolean keepExisting)
Selects the item. |
void |
selectAll()
Selects all items. |
protected void |
setLastFocused(M lastFocused)
|
void |
setLocked(boolean locked)
True to lock the selection model. |
void |
setSelection(java.util.List<M> selection)
Sets the current selection for this selection provider. |
void |
setSelectionMode(Style.SelectionMode selectionMode)
Sets the selection mode. |
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable |
---|
addListener, callListener, fireEvent, fireEvent, getFiresEvents, getListeners, hasActiveEvent, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected M extends ModelData lastSelected
protected boolean locked
protected java.util.List<M extends ModelData> selected
protected Style.SelectionMode selectionMode
protected Store<M extends ModelData> store
protected StoreListener<M extends ModelData> storeListener
Constructor Detail |
---|
public AbstractStoreSelectionModel()
Method Detail |
---|
public void addSelectionChangedListener(SelectionChangedListener<M> listener)
SelectionProvider
addSelectionChangedListener
in interface SelectionProvider<M extends ModelData>
listener
- a selection changed listenerpublic void bind(Store store)
StoreSelectionModel
bind
in interface StoreSelectionModel<M extends ModelData>
store
- the bound storepublic void deselect(int index)
StoreSelectionModel
deselect
in interface StoreSelectionModel<M extends ModelData>
index
- the index of the item to be deselectedpublic void deselect(int start, int end)
StoreSelectionModel
deselect
in interface StoreSelectionModel<M extends ModelData>
start
- the start indexend
- the end indexpublic void deselect(java.util.List<M> items)
StoreSelectionModel
deselect
in interface StoreSelectionModel<M extends ModelData>
items
- the itempublic void deselect(M... items)
StoreSelectionModel
deselect
in interface StoreSelectionModel<M extends ModelData>
items
- the items to deselectpublic void deselect(M item)
StoreSelectionModel
deselect
in interface StoreSelectionModel<M extends ModelData>
item
- the item to be deselectedpublic void deselectAll()
StoreSelectionModel
deselectAll
in interface StoreSelectionModel<M extends ModelData>
public M getSelectedItem()
StoreSelectionModel
getSelectedItem
in interface StoreSelectionModel<M extends ModelData>
public java.util.List<M> getSelectedItems()
StoreSelectionModel
getSelectedItems
in interface StoreSelectionModel<M extends ModelData>
public java.util.List<M> getSelection()
SelectionProvider
getSelection
in interface SelectionProvider<M extends ModelData>
public Style.SelectionMode getSelectionMode()
StoreSelectionModel
getSelectionMode
in interface StoreSelectionModel<M extends ModelData>
public boolean isLocked()
public boolean isSelected(M item)
StoreSelectionModel
isSelected
in interface StoreSelectionModel<M extends ModelData>
item
- the item
public void refresh()
StoreSelectionModel
refresh
in interface StoreSelectionModel<M extends ModelData>
public void removeSelectionListener(SelectionChangedListener<M> listener)
SelectionProvider
removeSelectionListener
in interface SelectionProvider<M extends ModelData>
listener
- a selection changed listenerpublic void select(boolean keepExisting, M... items)
StoreSelectionModel
select
in interface StoreSelectionModel<M extends ModelData>
keepExisting
- true to keep existing selecteditems
- the itemspublic void select(int index, boolean keepExisting)
StoreSelectionModel
select
in interface StoreSelectionModel<M extends ModelData>
index
- the index of the item to be selectedkeepExisting
- true to keep existing selectedpublic void select(int start, int end, boolean keepExisting)
StoreSelectionModel
select
in interface StoreSelectionModel<M extends ModelData>
start
- the start indexend
- the end indexkeepExisting
- true to keep existing selectedpublic void select(java.util.List<M> items, boolean keepExisting)
StoreSelectionModel
select
in interface StoreSelectionModel<M extends ModelData>
items
- the items to selectkeepExisting
- true to keep existing selectedpublic void select(M item, boolean keepExisting)
StoreSelectionModel
select
in interface StoreSelectionModel<M extends ModelData>
item
- the itemkeepExisting
- true to keep existing selectedpublic void selectAll()
StoreSelectionModel
selectAll
in interface StoreSelectionModel<M extends ModelData>
public void setLocked(boolean locked)
locked
- true to lockpublic void setSelection(java.util.List<M> selection)
SelectionProvider
setSelection
in interface SelectionProvider<M extends ModelData>
selection
- the new selectionpublic void setSelectionMode(Style.SelectionMode selectionMode)
StoreSelectionModel
The selection model supports 3 different selection modes:
setSelectionMode
in interface StoreSelectionModel<M extends ModelData>
selectionMode
- the selection modeprotected void doDeselect(java.util.List<M> models, boolean supressEvent)
protected void doMultiSelect(java.util.List<M> models, boolean keepExisting, boolean supressEvent)
protected void doSelect(java.util.List<M> models, boolean keepExisting, boolean supressEvent)
protected void doSingleSelect(M model, boolean supressEvent)
protected void fireSelectionChange()
protected M getLastFocused()
protected void onAdd(java.util.List<? extends M> models)
protected void onClear(StoreEvent<M> se)
protected void onLastFocusChanged(M oldFocused, M newFocused)
protected void onRemove(M model)
protected abstract void onSelectChange(M model, boolean select)
protected void onUpdate(M model)
protected void setLastFocused(M lastFocused)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |