com.tekann.codegen.pda
Class ComboBoxItem

java.lang.Object
  extended by com.tekann.codegen.pda.ComboBoxItem

public class ComboBoxItem
extends java.lang.Object

This class represents a ComboBox item.
You can set the showKey flag in order to view the key together to the value in each item.

Author:
Evandro Rathke

Field Summary
static java.lang.String KEY_SEPARATOR
          Separator for key - value when isShowKey is true.
 
Constructor Summary
ComboBoxItem(java.lang.Object key)
          Constructor passing an Object key as argument.
ComboBoxItem(java.lang.Object key, java.lang.Object value)
          Constructor passing an Object key and an Object value as argument.
ComboBoxItem(java.lang.String key)
          Constructor passing a key String as argument.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Tests it the passed object is equal to this.
 java.lang.Object getKey()
          Gets the item's key.
 java.lang.Object getValue()
          Gets the item's value.
 boolean isShowKey()
          Returns showKey flag.
 void setKey(java.lang.Object key)
          Sets the item's key.
 void setShowKey(boolean showKey)
          Sets the showKey flag.
 void setValue(java.lang.Object value)
          Sets the item's value.
 java.lang.String toString()
          Show this item's description in the following format:
key - value
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_SEPARATOR

public static java.lang.String KEY_SEPARATOR
Separator for key - value when isShowKey is true.

Constructor Detail

ComboBoxItem

public ComboBoxItem(java.lang.Object key)
Constructor passing an Object key as argument.

Parameters:
key -

ComboBoxItem

public ComboBoxItem(java.lang.Object key,
                    java.lang.Object value)
Constructor passing an Object key and an Object value as argument.

Parameters:
key -
value -

ComboBoxItem

public ComboBoxItem(java.lang.String key)
Constructor passing a key String as argument.

Parameters:
key -
Method Detail

equals

public boolean equals(java.lang.Object obj)
Tests it the passed object is equal to this. If the passed one is a ComboBoxItem then its key is compared, otherwise the obj is compared to this.key.

Overrides:
equals in class java.lang.Object
Returns:
A boolean representing if it's equal or not

getKey

public java.lang.Object getKey()
Gets the item's key.

Returns:
The key.

getValue

public java.lang.Object getValue()
Gets the item's value.

Returns:
The value

setKey

public void setKey(java.lang.Object key)
Sets the item's key.

Parameters:
key -

setShowKey

public void setShowKey(boolean showKey)
Sets the showKey flag.

Parameters:
showKey -

isShowKey

public boolean isShowKey()
Returns showKey flag.

Returns:
The showKey flag.

setValue

public void setValue(java.lang.Object value)
Sets the item's value.

Parameters:
value -

toString

public java.lang.String toString()
Show this item's description in the following format:
key - value

Overrides:
toString in class java.lang.Object
Returns:
A String representing the ComboBoxItem