D - The class name of the model object backing this list model.public class JDOListModel<D extends JDOObject> extends ListModel<D>
© Copyright 2008 Sans Pareil Technologies, Inc.
| Modifier | Constructor and Description |
|---|---|
protected |
JDOListModel()
Default constructor.
|
|
JDOListModel(Collection<D> data,
String field)
Create a new instance of the list model for the specified collection
of persistent model objects.
|
|
JDOListModel(D model,
String field)
Create a new instance of the list model using the specified values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(D model)
Add the specified value object to the list model.
|
void |
addAll(Collection<D> ndata)
Add the specified collection of objects to the model.
|
protected Object |
getObjectId(D model)
Return the persistent object id for the persistent object specified.
|
protected Object |
getObjectId(int index)
Return the persistent object id for the object at the specified index
in
ListModel.data. |
int |
indexById(Object oid)
Return the index of the specified persistent object id.
|
protected void |
init(D model)
Initialise the list model using the dummy instance.
|
void |
remove(D model)
Remove the specified model object from the list model.
|
get, getData, getObject, getValue, getValue, indexByName, setData, sizeaddListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getEventListenerList, removeListDataListenerprotected JDOListModel()
public JDOListModel(D model, String field)
model - An empty model object used to automatically initialise
the list model through standard queries to the data store. This is
necessiated by poor generics implementation in java.field - The name of the field in the model object used to
display in the list component.public JDOListModel(Collection<D> data, String field)
data - The collection of objects to represent.field - The field in the model object whose value is to be
displayed in the list component.protected void init(D model)
model - The model object used for introspection.protected Object getObjectId(int index)
ListModel.data.index - The index of the model object.getObjectId( JDOObject )protected Object getObjectId(D model)
model - The model object whose persistent object id is to be
retrieved.public int indexById(Object oid)
oid - The persistent object id for the model object.public void addAll(Collection<D> ndata)
idMap.addAll in class ListModel<D extends JDOObject>ndata - The collection of objects to add to ListModel.data.ListModel.addAll(java.util.Collection<D>),
getObjectId(int)public void add(D model)
idMap.add in class ListModel<D extends JDOObject>model - The model object that is to be added to this list model.ListModel.add(D)