de.innovationgate.utils
public class CBOItem extends java.lang.Object
Constructor and Description |
---|
CBOItem(java.lang.String title,
java.lang.Object value)
Constructs a CBOItem with a title and a value
|
Modifier and Type | Method and Description |
---|---|
static void |
addAllItems(java.util.List items,
javax.swing.JComboBox box)
Adds all CBOItem objects to the options of a combo box
|
boolean |
equals(java.lang.Object obj) |
static java.lang.Object |
getSelectedValue(javax.swing.JComboBox box)
Returns the selected value of a combo box, whose options
are represented by CBOItems.
|
java.lang.String |
getTitle()
Returns the title
|
java.lang.Object |
getValue()
Returns the value
|
int |
hashCode() |
static boolean |
setSelectedValue(javax.swing.JComboBox box,
java.lang.Object value)
Sets the selected value of a combo box, whose options are represented by CBOItems.
|
static void |
sortByTitle(java.util.List items)
Sorts a list of CBOItem objects by their title
|
java.lang.String |
toString() |
public CBOItem(java.lang.String title, java.lang.Object value)
title
- value
- public static void sortByTitle(java.util.List items)
items
- The itemspublic static void addAllItems(java.util.List items, javax.swing.JComboBox box)
items
- The items to addbox
- The combo boxpublic static java.lang.Object getSelectedValue(javax.swing.JComboBox box)
box
- public static boolean setSelectedValue(javax.swing.JComboBox box, java.lang.Object value)
box
- The combo boxvalue
- The selected value. Do not specify the CBOItem to select but its value.public java.lang.String getTitle()
public java.lang.Object getValue()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object