|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sencha.gxt.data.shared.Store<M>
com.sencha.gxt.data.shared.ListStore<M>
M - the model typepublic class ListStore<M>
List-like client side cache for elements. All operations are
performed on the currently visible set of elements.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.sencha.gxt.data.shared.Store |
|---|
Store.Change<M,V>, Store.PropertyChange<M,V>, Store.Record, Store.StoreFilter<M>, Store.StoreSortInfo<M> |
| Constructor Summary | |
|---|---|
ListStore(ModelKeyProvider<? super M> keyProvider)
Creates a new store. |
|
| Method Summary | |
|---|---|
void |
add(int index,
M item)
Like add(M), except the item will be inserted at the given index in the visible items. |
void |
add(M item)
Adds the given item to the end of the list. |
boolean |
addAll(java.util.Collection<? extends M> items)
Adds all items to the end of the list. |
boolean |
addAll(int index,
java.util.Collection<? extends M> items)
Adds all items at the given position. |
void |
applySort(boolean suppressEvent)
Tells the store to re-apply sort settings and to fire an event when complete. |
void |
clear()
Removes all items from the store. |
M |
findModelWithKey(java.lang.String key)
Finds the model with the given key, using ModelKeyProvider as
necessary. |
M |
get(int index)
Gets the given item from the list. |
java.util.List<M> |
getAll()
Returns a list of all items contained in the store. |
int |
indexOf(M item)
Gets the position of the item in the set of visible items. |
M |
remove(int index)
A ListStore acts like a Java List, and stuff is arranged in a linear fashion, so it may be advantageous to remove based on index. |
boolean |
remove(M model)
Removes the given item, visible or not, from the store. |
void |
replaceAll(java.util.List<M> newItems)
Replaces all the items in the store with given list of new items. |
int |
size()
Returns the number of visible items. |
java.util.List<M> |
subList(int start,
int end)
Creates a new list containing references to the items in the specified range. |
void |
update(M item)
Replaces the item that matches the key of the given item, and fires a StoreUpdateEvent to indicate that this change has occurred. |
| Methods inherited from class com.sencha.gxt.data.shared.Store |
|---|
addFilter, addSortInfo, addSortInfo, addStoreAddHandler, addStoreClearHandler, addStoreDataChangeHandler, addStoreFilterHandler, addStoreHandlers, addStoreRecordChangeHandler, addStoreRemoveHandler, addStoreSortHandler, addStoreUpdateHandler, clearSortInfo, commitChanges, findModel, fireEvent, getFilters, getKeyProvider, getModifiedRecords, getRecord, getSortInfo, hasMatchingKey, hasRecord, isAutoCommit, isEnableFilters, isFiltered, rejectChanges, removeFilter, removeFilters, setAutoCommit, setEnableFilters |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ListStore(ModelKeyProvider<? super M> keyProvider)
keyProvider - the key provider| Method Detail |
|---|
public void add(int index,
M item)
index - - the index in the visible items. Must be a valid index, in
the range [0,size()). If the store is sorted, the index will be
ignoreditem - the item to be addedpublic void add(M item)
item - the item to be addedpublic boolean addAll(java.util.Collection<? extends M> items)
items - the items to be added
public boolean addAll(int index,
java.util.Collection<? extends M> items)
index - the insert indexitems - the items to be added
public void applySort(boolean suppressEvent)
StoreStore.addSortInfo(StoreSortInfo),
Store.addSortInfo(int, StoreSortInfo), and Store.clearSortInfo().
applySort in class Store<M>suppressEvent - true to suppress event from firingpublic void clear()
Store
public M findModelWithKey(java.lang.String key)
StoreModelKeyProvider as
necessary.
findModelWithKey in class Store<M>key - the key of the model to find
public M get(int index)
index - the specified index.
public java.util.List<M> getAll()
Store
getAll in class Store<M>public int indexOf(M item)
item - the visible item
public M remove(int index)
index - the index of the item to removepublic boolean remove(M model)
model - model to remove
public void replaceAll(java.util.List<M> newItems)
newItems - the new contents of the storepublic int size()
public java.util.List<M> subList(int start,
int end)
start - the starting indexend - the ending index
public void update(M item)
StoreStoreUpdateEvent to indicate that this change has occurred.
This will not cause the sort or filter to be re-applied to the object.
update in class Store<M>item - the new item to take its place in the Store.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||