Package jmri.util.swing
Class JCBHandle<T>
- java.lang.Object
-
- jmri.util.swing.JCBHandle<T>
-
- Type Parameters:
T- the class accepted by the JComboBox
public class JCBHandle<T> extends java.lang.Object
Wrap an object for easier null handling in a JComboBox. ("JCB" refers to JComboBox) Define aJComboBox<JCBHandle<Foo>>, then fill it with a newJCBHandle("None string")and your newJCBHandle(foo)entries.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Titem()Retrieve the handled object for this handlejava.lang.StringtoString()Display the handled item, or if there isn't one, the null-case label.
-
-
-
Method Detail
-
toString
public java.lang.String toString()
Display the handled item, or if there isn't one, the null-case label.- Overrides:
toStringin classjava.lang.Object- Returns:
- the item's String representation or the default label
-
-