|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.AbstractListModel | +--org.objectweb.jac.aspects.gui.LessAbstractListModel
Base class for ListModel and ComboBoxModel.
Field Summary |
Fields inherited from class javax.swing.AbstractListModel |
listenerList |
Constructor Summary | |
LessAbstractListModel()
Construct a new abstract list model which is independent from any collection. |
|
LessAbstractListModel(CollectionItem collection,
Object substance)
Construct a new abstract list model in which the values depend on a collection's values. |
Method Summary | |
void |
addObject(Object object)
Adds an object in the list. |
void |
addObject(Object object,
String label)
Add an object in the list with a given label to be displayed. |
void |
close()
Unregisters the model from the event it is currently listening to. |
CollectionItem |
getCollection()
Get the collection item represented by the model |
Object |
getElementAt(int row)
Returns the element at a given row. |
Object |
getObject(int index)
Gets the object at a given index. |
int |
getRowCount()
Gets the list element count. |
int |
getSize()
Gets the list size (same as getRowCount ). |
int |
indexOf(Object object)
Returns the index of an object in the collection |
boolean |
isCellEditable(int row,
int column)
Tells if this cell is directly editable (always returns false for the moment). |
void |
objectUpdated(Object substance,
Object param)
The callback method. |
void |
onAdd(Object substance,
CollectionItem collection,
Object value,
Object added,
Object param)
Upcalled when an item is added in a collection. |
void |
onChange(Object substance,
CollectionItem collection,
Object value,
Object param)
Upcalled when the collection is changed (with a set or other methods such as clear, removeAll, addAll, ...). |
void |
onRemove(Object substance,
CollectionItem collection,
Object value,
Object removed,
Object param)
Upcalled when an item is removed from a collection. |
void |
setNullLabel(String label)
Sets the default label to be used for a null reference. |
void |
sort()
sort the list alphabetically by label |
protected void |
unregisterViews()
Unregister ourself as a view on all objects of the collection |
Methods inherited from class javax.swing.AbstractListModel |
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LessAbstractListModel()
public LessAbstractListModel(CollectionItem collection, Object substance)
collection
- the substance collectionsubstance
- the object that holds the collection's valueMethod Detail |
public CollectionItem getCollection()
CollectionModel
getCollection
in interface CollectionModel
public void setNullLabel(String label)
label
- label for nullpublic void addObject(Object object)
object
- the object to addaddObject(Object,String)
,
setNullLabel(String)
public void addObject(Object object, String label)
object
- the object to addlabel
- the label to be displayed for the objectaddObject(Object)
public int getRowCount()
getRowCount
in interface CollectionModel
public Object getElementAt(int row)
getElementAt
in interface ListModel
public int getSize()
getRowCount
).
getSize
in interface ListModel
public Object getObject(int index)
getObject
in interface CollectionModel
index
- a row indexpublic int indexOf(Object object)
CollectionModel
indexOf
in interface CollectionModel
object
- the object whose index to find
public boolean isCellEditable(int row, int column)
public void objectUpdated(Object substance, Object param)
ObjectUpdate
objectUpdated
in interface ObjectUpdate
substance
- the updated objectparam
- extra dataViewControlWrapper.registerObject(Wrappee,ObjectUpdate,Object)
public void sort()
protected void unregisterViews()
public void close()
Model
close
in interface Model
public void onChange(Object substance, CollectionItem collection, Object value, Object param)
CollectionUpdate
onChange
in interface CollectionUpdate
substance
- the object of which a field was updatedcollection
- the updated collectionvalue
- the new collectionparam
- extra dataViewControlWrapper.registerCollection(Wrappee,CollectionItem,CollectionUpdate,Object)
public void onAdd(Object substance, CollectionItem collection, Object value, Object added, Object param)
CollectionUpdate
onAdd
in interface CollectionUpdate
substance
- the object of which a collection was updatedcollection
- the updated collectionvalue
- the collection's valueadded
- the value added to the collectionparam
- extra data (e.g. index)ViewControlWrapper.registerCollection(Wrappee,CollectionItem,CollectionUpdate,Object)
public void onRemove(Object substance, CollectionItem collection, Object value, Object removed, Object param)
CollectionUpdate
onRemove
in interface CollectionUpdate
substance
- the object of which a collection was updatedcollection
- the updated collectionvalue
- the collection's valueremoved
- the removed itemparam
- extra data (e.g. index)ViewControlWrapper.registerCollection(Wrappee,CollectionItem,CollectionUpdate,Object)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |