|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.pcauto.gui.table.ProxyEntityList
The ProxyEntityList implements the EntityList
interface
which describes the functions that must be provided for
managing entities within an ordered list. This container allows for operations
to manage entities(for example, to add or remove entities) and to add and
remove event listeners that listen for changes in this ProxyEntityList
.
This class serves as a bridge between an EntityList
and a List
.
Users can quickly utilize the EntityTable
to display and manipulate
their existing List
data by using this ProxyEntityList
.
Note: Problems may result if the List
is manipulated natively
(not through ProxyEntityList
or EntityTable
).
Constructor Summary | |
ProxyEntityList()
Constructs a new ProxyEntityList . |
|
ProxyEntityList(java.lang.Object prototype)
Constructs a new ProxyEntityList using the given prototype. |
|
ProxyEntityList(java.lang.Object prototype,
java.util.List list)
Constructs a new ProxyEntityList using the given prototype,
and List of entries. |
Method Summary | |
boolean |
addEntity(java.lang.Object entityInstance)
Adds a new entity to this EntityList . |
void |
addEntityListListener(EntityListListener e)
Adds a listener for list change events. |
protected java.lang.reflect.Method |
findMethod(java.lang.Class type,
java.lang.String name,
java.lang.Class[] classes)
|
protected void |
fireListChanged(EntityListEvent e)
Generates a list changed event based on the event that occurred. |
int |
getCount()
Returns the number of entities stored in this EntityList . |
java.lang.Object |
getDefaultEntity()
Returns an entity instance containing desirable default values. |
java.lang.Object |
getEntity(int index)
Returns the entity instance stored in the specified position. |
java.util.List |
getList()
Returns the list containing all the entities in the table. |
java.lang.Object |
getNewDefaultEntity()
Returns a new instance of the entity being managed by this Entitylist. |
java.lang.Object |
getNewEntity()
Returns a new instance of the entity being managed by this Entitylist. |
boolean |
insertEntity(int index,
java.lang.Object entityValue)
Inserts an entity into this EntityList. |
boolean |
moveEntity(int startIndex,
int endIndex,
int newIndex)
Moves entities starting from the start index, to the end index, to a new location starting at the new index given. |
boolean |
removeEntity(int index)
Removes the specified entity. |
void |
removeEntityListListener(EntityListListener e)
Removes an entity list listener so that list changes will not trigger events for that listener. |
void |
replaceAll(EntityList v)
Replaces all the current entities with those given by the EntityList parameter. |
void |
setDefaultEntity(java.lang.Object prototype)
Sets the entity that contains desirable default values. |
boolean |
setEntity(int index,
java.lang.Object entityInstance)
Replaces the entity instance at the specified index. |
void |
setList(java.util.List list)
Replaces the current entities inside this container with the entities in the list parameter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ProxyEntityList()
ProxyEntityList
.
public ProxyEntityList(java.lang.Object prototype)
ProxyEntityList
using the given prototype.
The prototype is a sample entity. It will be used when calling
getNewEntity to return a new entity instance of the same type
as the prototype parameter.
prototype
- the prototype to usepublic ProxyEntityList(java.lang.Object prototype, java.util.List list)
ProxyEntityList
using the given prototype,
and List
of entries.
The prototype is a sample entity. It will be used when calling
getNewEntity to return a new entity instance of the same type
as the prototype parameter. The List
is used to initialize
the entities for this ProxyEntityList
.
prototype
- the prototypelist
- the List
of entitiesMethod Detail |
public java.util.List getList()
List
containing the entitiespublic void setList(java.util.List list)
list
- the List
containing the new entitiespublic int getCount()
EntityList
EntityList
.
getCount
in interface EntityList
public java.lang.Object getEntity(int index)
EntityList
getEntity
in interface EntityList
index
- position from which to get the entity
Object
entity at the specified positionpublic boolean setEntity(int index, java.lang.Object entityInstance) throws EntityListException
EntityList
setEntity
in interface EntityList
index
- the position of the entity to be replacedentityInstance
- the Object instance which will replace the original
EntityListException
- on EntityList events. It is used to
communicate events to the user.public java.lang.Object getNewEntity()
EntityList
getNewEntity
in interface EntityList
Object
reference to the new entity instancepublic java.lang.Object getNewDefaultEntity()
EntityList
getNewDefaultEntity
in interface EntityList
Object
reference to the new entity instancepublic java.lang.Object getDefaultEntity()
EntityList
getDefaultEntity
in interface EntityList
public void setDefaultEntity(java.lang.Object prototype)
EntityList
setDefaultEntity
in interface EntityList
prototype
- the Object
representing the entity holding
the desirable valuespublic boolean addEntity(java.lang.Object entityInstance) throws EntityListException
EntityList
EntityList
. The entity
is placed at the end of this EntityList
.
addEntity
in interface EntityList
entityInstance
- the Object to add
EntityListException
- on EntityList events. It is used to
communicate events to the user.public boolean insertEntity(int index, java.lang.Object entityValue) throws EntityListException
EntityList
insertEntity
in interface EntityList
index
- the index where the entity object will be placedentityValue
- the Object to insert
EntityListException
- on EntityList events. It is used to
communicate events to the user.public boolean moveEntity(int startIndex, int endIndex, int newIndex) throws EntityListException
EntityList
moveEntity
in interface EntityList
startIndex
- the index of the first entity to moveendIndex
- index of the last entity to movenewIndex
- the destination index
EntityListException
- on EntityList events. It is used to
communicate events to the user.public boolean removeEntity(int index) throws EntityListException
EntityList
removeEntity
in interface EntityList
index
- the index of the entity to remove
EntityListException
- on EntityList events. It is used to
communicate events to the user.public void addEntityListListener(EntityListListener e)
EntityList
addEntityListListener
in interface EntityList
e
- the EntityListListener to addpublic void removeEntityListListener(EntityListListener e)
EntityList
removeEntityListListener
in interface EntityList
e
- the EntityListListener to removepublic void replaceAll(EntityList v)
EntityList
replaceAll
in interface EntityList
v
- the EntityList holding the new entitiesprotected void fireListChanged(EntityListEvent e)
e
- the EntityListEvent
that occurredprotected java.lang.reflect.Method findMethod(java.lang.Class type, java.lang.String name, java.lang.Class[] classes) throws java.lang.NoSuchMethodException, java.lang.SecurityException
java.lang.NoSuchMethodException
java.lang.SecurityException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |