public class ListModelEvent extends Object
ListDataModel
implementations
if anything is changed in encapsulated data.Modifier and Type | Class and Description |
---|---|
protected static class |
ListModelEvent.EventType
Event type class
It's in use because older versions of GWT don't support enums.
|
Modifier and Type | Field and Description |
---|---|
static ListModelEvent.EventType |
ADD_ITEM
item added
|
static ListModelEvent.EventType |
CLEAN
all data removed
|
static ListModelEvent.EventType |
REMOVE_ITEM
item removed
|
static ListModelEvent.EventType |
SELECT_ITEM
item selected
|
Constructor and Description |
---|
ListModelEvent(ListDataModel source,
ListModelEvent.EventType type)
Creates an instance of this class.
|
ListModelEvent(ListDataModel source,
Map<String,Integer> itemIndexes,
ListModelEvent.EventType type)
Creates an instance of this class.
|
ListModelEvent(ListDataModel source,
String itemId,
int itemIndex,
ListModelEvent.EventType type)
Creates an instance of this class.
|
Modifier and Type | Method and Description |
---|---|
String |
getItemId()
Gets a related item ID.
|
int |
getItemIndex()
Gets a related item index.
|
Map<String,Integer> |
getItemIndexes()
This method gets a map of affected item indexes mapped to their IDs.
|
ListDataModel |
getSource()
Gets an event source data model.
|
ListModelEvent.EventType |
getType()
Gets an event type that specifies what exactly happened.
|
public static final ListModelEvent.EventType ADD_ITEM
public static final ListModelEvent.EventType REMOVE_ITEM
public static final ListModelEvent.EventType CLEAN
public static final ListModelEvent.EventType SELECT_ITEM
public ListModelEvent(ListDataModel source, ListModelEvent.EventType type)
CLEAN
which don't require to specify a concrete item.source
- is a data model produced this event.type
- is an event type.public ListModelEvent(ListDataModel source, String itemId, int itemIndex, ListModelEvent.EventType type)
ADD_ITEM
, REMOVE_ITEM
or SELECT_ITEM
which require to specify a concrete item.source
- is a data model produced this event.itemId
- is a related item ID.itemIndex
- is a related item index (usually index of the item identified with itemId
.type
- is an event type.public ListModelEvent(ListDataModel source, Map<String,Integer> itemIndexes, ListModelEvent.EventType type)
ADD_ITEM
, REMOVE_ITEM
or SELECT_ITEM
which require to specify a concrete item.
use this constructor if you want to notify listeners about bulk model update.source
- is a data model produced this event.itemIndexes
- is a list of indexes mapped to their IDs. It must contain items which were affected by
model change.type
- is an event type.public ListDataModel getSource()
public String getItemId()
null
for those events which are not related to a concrete item.
If there are several affected items it gets an ID of the first one.public int getItemIndex()
-1
for those events which are not related to a concrete item.
If there are several affected items it gets an ID of the first one.public Map<String,Integer> getItemIndexes()
public ListModelEvent.EventType getType()
Copyright © 2008–2013. All rights reserved.