org.bibalex.daf.commongui.datamodels
Class UIListEditableModel.ListObject

java.lang.Object
  extended by org.bibalex.daf.commongui.datamodels.UIListEditableModel.ListObject
Enclosing class:
UIListEditableModel

public class UIListEditableModel.ListObject
extends java.lang.Object

This class in used to maintain the Object in the list, an ID to identify the record and a value to be displayed are maintained.

Author:
Fadi.Edward

Field Summary
 int id
          The identifying value of the record, can be used later to link back to the DataTable.
 java.lang.String value
          The displayed value in the JList.
 
Constructor Summary
UIListEditableModel.ListObject(int id, java.lang.String value)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares 2 ListObjects, used when changing selection as the JList needs to compare old and new selected Items upon change of selection.
 java.lang.String toString()
          Overrides the toString method of the Object, to gain control on the displayed value on the list.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public int id
The identifying value of the record, can be used later to link back to the DataTable.


value

public java.lang.String value
The displayed value in the JList.

Constructor Detail

UIListEditableModel.ListObject

public UIListEditableModel.ListObject(int id,
                                      java.lang.String value)
Constructor.

Parameters:
id - The identifying value of the record, can be used later to link back to the DataTable.
value - The displayed value in the JList.
Method Detail

toString

public java.lang.String toString()
Overrides the toString method of the Object, to gain control on the displayed value on the list.

Overrides:
toString in class java.lang.Object
Returns:
The value to be displayed on the List.

equals

public boolean equals(java.lang.Object obj)
Compares 2 ListObjects, used when changing selection as the JList needs to compare old and new selected Items upon change of selection. The comparison is implemented based on the ID.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The ListObject to compare to.
Returns:
true if equal, false otherwise.