org.bibalex.daf.commongui.datamodels
Class ComboBoxDataModel.ComboBoxObject

java.lang.Object
  extended by org.bibalex.daf.commongui.datamodels.ComboBoxDataModel.ComboBoxObject
Enclosing class:
ComboBoxDataModel

public class ComboBoxDataModel.ComboBoxObject
extends java.lang.Object

This Class represents a ComboBox item. Each object has an ID (Database identifier) and not the index in the combobox list and a value that is displayed to the user.

Author:
Fadi.Edward

Field Summary
 int id
          The DataBase ID of the item.
 java.lang.String value
          The displayed value of the item.
 
Constructor Summary
ComboBoxDataModel.ComboBoxObject(int id, java.lang.String value)
          Constructor
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares 2 objects, the comparison is done based on their IDs.
 java.lang.String toString()
          Implementing the toString method overrides the one implemented in object to be able to control the displayed values in the ComboBox list.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public int id
The DataBase ID of the item.


value

public java.lang.String value
The displayed value of the item.

Constructor Detail

ComboBoxDataModel.ComboBoxObject

public ComboBoxDataModel.ComboBoxObject(int id,
                                        java.lang.String value)
Constructor

Parameters:
id - Database Identifier.
value - String displayed in the ComboBox.
Method Detail

toString

public java.lang.String toString()
Implementing the toString method overrides the one implemented in object to be able to control the displayed values in the ComboBox list.

Overrides:
toString in class java.lang.Object
Returns:
A String representing the value to be displayed.

equals

public boolean equals(java.lang.Object obj)
Compares 2 objects, the comparison is done based on their IDs. Allows a correct change seleceted Item, as before changing the selection, the ComboBox object compares the old value with the new one.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The Object used in the comparison.
Returns:
true if equal, false otherwise.