|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.client.gui.panel.ChoiceItem<T>
public class ChoiceItem<T>
Can be used as a single choice for the
choice dialog.
| Field Summary | |
|---|---|
private boolean |
enabled
|
private T |
object
|
private java.lang.String |
text
|
| Constructor Summary | |
|---|---|
ChoiceItem(java.lang.String text,
T object)
Creates a new ChoiceItem with the
given object. |
|
ChoiceItem(java.lang.String text,
T object,
boolean enable)
Creates a new ChoiceItem with the
given object. |
|
ChoiceItem(T object)
Creates a new ChoiceItem with the
given object. |
|
| Method Summary | |
|---|---|
int |
getChoice()
Gets the choice as an int. |
T |
getObject()
Gets the Object contained by this choice. |
boolean |
isEnabled()
Checks if the option should be enabled or not |
java.lang.String |
toString()
Gets a textual presentation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String text
private T object
private boolean enabled
| Constructor Detail |
|---|
public ChoiceItem(java.lang.String text,
T object,
boolean enable)
ChoiceItem with the
given object.
text - The text that should be used to represent
this choice.object - The Object contained by this
choice.enable - Sets if the option should be enabled or not
public ChoiceItem(java.lang.String text,
T object)
ChoiceItem with the
given object.
text - The text that should be used to represent
this choice.object - The Object contained by this
choice.public ChoiceItem(T object)
ChoiceItem with the
given object.
object - The Object contained by this
choice.| Method Detail |
|---|
public T getObject()
Object contained by this choice.
Object.public int getChoice()
int.
java.lang.ClassCastException - if the object is
not an Integer.public boolean isEnabled()
public java.lang.String toString()
toString in class java.lang.Objecttext set in the constructor.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||