|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.scopemvc.model.basic.BasicModel | +--org.scopemvc.model.collection.ListModelAdaptor
Used to present a list of ListModelSource
s as an active BasicModel.
Useful when initialising SComboBox
or SList
with a static list of data.
This will propagate ModelChangeEvents from sublists that are
ModelChangeEventSources. Note that this adaptor registers as a listener with
such sublists: it may be necessary to manually unregister with removeModelChangeListeners()
if an adaptor is no longer needed.
The adaptor can present its ListModelSources as a sorted list if a Comparator
is passed to setComparator(java.util.Comparator)
or all list elements implement Comparable
and setSorted(boolean)
is called.
Field Summary | |
static Selector |
LIST_SELECTOR
TODO: describe of the Field |
static Selector |
LIST_SIZE_SELECTOR
TODO: describe of the Field |
Fields inherited from interface org.scopemvc.core.ModelChangeTypes |
ACCESS_CHANGED, VALUE_ADDED, VALUE_CHANGED, VALUE_REMOVED |
Constructor Summary | |
ListModelAdaptor(ListModelSource listSource)
Constructor for the ListModelAdaptor object |
|
ListModelAdaptor(ListModelSource[] listSources)
Constructor for the ListModelAdaptor object |
Method Summary | |
java.lang.Object |
getElementAt(int inIndex)
Gets the element at |
java.util.List |
getList()
Gets the list |
int |
getSize()
Gets the size |
boolean |
isSorted()
Gets the sorted |
protected void |
loadList()
TODO: document the method |
void |
modelChanged(ModelChangeEvent inEvent)
TODO: document the method |
void |
removeModelChangeListeners()
TODO: document the method |
void |
setComparator(java.util.Comparator inComparator)
Sets the comparator |
void |
setSorted(boolean inSorted)
Sets the sorted |
Methods inherited from class org.scopemvc.model.basic.BasicModel |
addModelChangeListener, fireModelChange, listenNewSubmodel, makeActive, removeModelChangeListener, unlistenOldSubmodel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Selector LIST_SELECTOR
public static final Selector LIST_SIZE_SELECTOR
Constructor Detail |
public ListModelAdaptor(ListModelSource[] listSources)
listSources
- TODO: Describe the Parameterpublic ListModelAdaptor(ListModelSource listSource)
listSource
- TODO: Describe the ParameterMethod Detail |
public java.util.List getList()
public int getSize()
public java.lang.Object getElementAt(int inIndex)
inIndex
- TODO: Describe the Parameter
public boolean isSorted()
public void setSorted(boolean inSorted)
inSorted
- The new sorted valuepublic void setComparator(java.util.Comparator inComparator)
inComparator
- The new comparator valuepublic void removeModelChangeListeners()
public void modelChanged(ModelChangeEvent inEvent)
modelChanged
in interface ModelChangeListener
modelChanged
in class BasicModel
inEvent
- TODO: Describe the Parameterprotected void loadList()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |