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)
Adds a
SelectionChangedEvent.SelectionChangedHandler handler for SelectionChangedEvent events. |
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.HasSelectionChangedHandlers
SelectionChangedEvent.SelectionChangedHandler
handler for
SelectionChangedEvent
events.addSelectionChangedHandler
in interface SelectionChangedEvent.HasSelectionChangedHandlers<M>
handler
- the handlerpublic HandlerRegistration addSelectionHandler(SelectionHandler<M> handler)
SelectionChangedEvent.SelectionChangedHandler
handler for SelectionChangedEvent
events.addSelectionHandler
in interface HasSelectionHandlers<M>
handler
- the handlerpublic void bind(Store<M> store)
StoreSelectionModel
bind
in interface StoreSelectionModel<M>
store
- the bound storepublic void deselect(int index)
StoreSelectionModel
deselect
in interface StoreSelectionModel<M>
index
- the index of the item to be deselectedpublic void deselect(int start, int end)
StoreSelectionModel
deselect
in interface StoreSelectionModel<M>
start
- the start indexend
- the end indexpublic void deselect(List<M> items)
StoreSelectionModel
deselect
in interface StoreSelectionModel<M>
items
- the itempublic void deselect(M... items)
StoreSelectionModel
deselect
in interface StoreSelectionModel<M>
items
- the items to deselectpublic void deselect(M item)
StoreSelectionModel
deselect
in interface StoreSelectionModel<M>
item
- the item to be deselectedpublic void deselectAll()
StoreSelectionModel
deselectAll
in interface StoreSelectionModel<M>
public void fireEvent(GwtEvent<?> event)
fireEvent
in interface HasHandlers
public M getSelectedItem()
StoreSelectionModel
getSelectedItem
in interface StoreSelectionModel<M>
public List<M> getSelectedItems()
StoreSelectionModel
getSelectedItems
in interface StoreSelectionModel<M>
public Style.SelectionMode getSelectionMode()
StoreSelectionModel
getSelectionMode
in interface StoreSelectionModel<M>
public boolean isLocked()
public boolean isSelected(M item)
StoreSelectionModel
isSelected
in interface StoreSelectionModel<M>
item
- the itempublic void refresh()
StoreSelectionModel
refresh
in interface StoreSelectionModel<M>
public void select(boolean keepExisting, M... items)
StoreSelectionModel
select
in interface StoreSelectionModel<M>
keepExisting
- true to keep existing selecteditems
- the itemspublic void select(int index, boolean keepExisting)
StoreSelectionModel
select
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)
StoreSelectionModel
select
in interface StoreSelectionModel<M>
start
- the start indexend
- the end indexkeepExisting
- true to keep existing selectedpublic void select(List<M> items, boolean keepExisting)
StoreSelectionModel
select
in interface StoreSelectionModel<M>
items
- the items to selectkeepExisting
- true to keep existing selectedpublic void select(M item, boolean keepExisting)
StoreSelectionModel
select
in interface StoreSelectionModel<M>
item
- the itemkeepExisting
- true to keep existing selectedpublic void selectAll()
StoreSelectionModel
selectAll
in interface StoreSelectionModel<M>
public void setLocked(boolean locked)
locked
- true to lockpublic void setSelectionMode(Style.SelectionMode selectionMode)
StoreSelectionModel
The selection model supports 3 different selection modes:
setSelectionMode
in interface StoreSelectionModel<M>
selectionMode
- the selection modeCopyright © 2015. All rights reserved.