M - the model type contained within the storepublic abstract class AbstractStoreSelectionModel<M> extends Object implements StoreSelectionModel<M>, HasBeforeSelectionHandlers<M>, HasSelectionHandlers<M>, SelectionChangedEvent.HasSelectionChangedHandlers<M>
| Constructor and Description |
|---|
AbstractStoreSelectionModel() |
| Modifier and Type | Method and Description |
|---|---|
HandlerRegistration |
addBeforeSelectionHandler(BeforeSelectionHandler<M> handler) |
HandlerRegistration |
addSelectionChangedHandler(SelectionChangedEvent.SelectionChangedHandler<M> handler)
Adds a
SelectionChangedEvent.SelectionChangedHandler handler for
SelectionChangedEvent events. |
HandlerRegistration |
addSelectionHandler(SelectionHandler<M> handler) |
void |
bind(Store<M> 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(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.
|
void |
fireEvent(GwtEvent<?> event) |
M |
getSelectedItem()
Returns the selected item.
|
List<M> |
getSelectedItems()
Returns the selected items.
|
List<M> |
getSelection() |
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.
|
void |
refresh()
Refreshes the current selections.
|
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(List<M> items,
boolean keepExisting)
Selects the items.
|
void |
select(M item,
boolean keepExisting)
Selects the item.
|
void |
selectAll()
Selects all items.
|
void |
setLocked(boolean locked)
True to lock the selection model.
|
void |
setSelection(List<M> selection) |
void |
setSelectionMode(Style.SelectionMode selectionMode)
Sets the selection mode.
|
public HandlerRegistration addBeforeSelectionHandler(BeforeSelectionHandler<M> handler)
addBeforeSelectionHandler in interface HasBeforeSelectionHandlers<M>public HandlerRegistration addSelectionChangedHandler(SelectionChangedEvent.SelectionChangedHandler<M> handler)
SelectionChangedEvent.HasSelectionChangedHandlersSelectionChangedEvent.SelectionChangedHandler handler for
SelectionChangedEvent events.addSelectionChangedHandler in interface SelectionChangedEvent.HasSelectionChangedHandlers<M>handler - the handlerpublic HandlerRegistration addSelectionHandler(SelectionHandler<M> handler)
addSelectionHandler in interface HasSelectionHandlers<M>public void bind(Store<M> store)
StoreSelectionModelbind in interface StoreSelectionModel<M>store - the bound storepublic void deselect(int index)
StoreSelectionModeldeselect in interface StoreSelectionModel<M>index - the index of the item to be deselectedpublic void deselect(int start,
int end)
StoreSelectionModeldeselect in interface StoreSelectionModel<M>start - the start indexend - the end indexpublic void deselect(List<M> items)
StoreSelectionModeldeselect in interface StoreSelectionModel<M>items - the itempublic void deselect(M... items)
StoreSelectionModeldeselect in interface StoreSelectionModel<M>items - the items to deselectpublic void deselect(M item)
StoreSelectionModeldeselect in interface StoreSelectionModel<M>item - the item to be deselectedpublic void deselectAll()
StoreSelectionModeldeselectAll in interface StoreSelectionModel<M>public void fireEvent(GwtEvent<?> event)
fireEvent in interface HasHandlerspublic M getSelectedItem()
StoreSelectionModelgetSelectedItem in interface StoreSelectionModel<M>public List<M> getSelectedItems()
StoreSelectionModelgetSelectedItems in interface StoreSelectionModel<M>public Style.SelectionMode getSelectionMode()
StoreSelectionModelgetSelectionMode in interface StoreSelectionModel<M>public boolean isLocked()
public boolean isSelected(M item)
StoreSelectionModelisSelected in interface StoreSelectionModel<M>item - the itempublic void refresh()
StoreSelectionModelrefresh in interface StoreSelectionModel<M>public void select(boolean keepExisting,
M... items)
StoreSelectionModelselect in interface StoreSelectionModel<M>keepExisting - true to keep existing selecteditems - the itemspublic void select(int index,
boolean keepExisting)
StoreSelectionModelselect in interface StoreSelectionModel<M>index - the index of the item to be selectedkeepExisting - true to keep existing selectedpublic void select(int start,
int end,
boolean keepExisting)
StoreSelectionModelselect in interface StoreSelectionModel<M>start - the start indexend - the end indexkeepExisting - true to keep existing selectedpublic void select(List<M> items, boolean keepExisting)
StoreSelectionModelselect in interface StoreSelectionModel<M>items - the items to selectkeepExisting - true to keep existing selectedpublic void select(M item, boolean keepExisting)
StoreSelectionModelselect in interface StoreSelectionModel<M>item - the itemkeepExisting - true to keep existing selectedpublic void selectAll()
StoreSelectionModelselectAll in interface StoreSelectionModel<M>public void setLocked(boolean locked)
locked - true to lockpublic void setSelectionMode(Style.SelectionMode selectionMode)
StoreSelectionModelThe selection model supports 3 different selection modes:
setSelectionMode in interface StoreSelectionModel<M>selectionMode - the selection modeCopyright © 2012. All Rights Reserved.