public interface Choice
Choice
is immutable.Modifier and Type | Method and Description |
---|---|
void |
addChoiceListener(ChoiceListener listener)
Adds a listener to this choice.
|
String |
getDefaultChoice()
Gets the standard choice.
|
String |
getId(int index)
Gets a unique identifier for the
index 'th choice. |
String |
getText(int index)
Gets a name for the
index 'th choice. |
boolean |
isNullEntryAllowed()
Tells whether the user choose nothing.
|
void |
removeChoiceListener(ChoiceListener listener)
Removes the listener
listener from this choice. |
void |
setController(DockController controller)
Informs this
Choice that it is now used for displaying items for
controller . |
int |
size()
Gets the number of available choices.
|
void addChoiceListener(ChoiceListener listener)
listener
- the new listener, not null
void removeChoiceListener(ChoiceListener listener)
listener
from this choice.listener
- the listener to removevoid setController(DockController controller)
Choice
that it is now used for displaying items for
controller
.controller
- the controller in whose realm this Choice
is currently
used, can be null
int size()
String getText(int index)
index
'th choice.index
- the index of the choiceString getId(int index)
index
'th choice.index
- the index of the choiceString getDefaultChoice()
null
is only
allowed if isNullEntryAllowed()
returns true
boolean isNullEntryAllowed()
null
identifier