bibliothek.extension.gui.dock.preference.preferences.choice
Interface Choice

All Known Implementing Classes:
BubbleColorSchemeChoice, ButtonContentChoice, ButtonContentConditionChoice, DefaultChoice, EclipseTabChoice, TabContentFilterChoice, TabPlacementChoice, ThemeChoice

public interface Choice

A choice is a set of entries from which the user can choose one. Note that some components assume that a Choice is immutable.

Author:
Benjamin Sigg

Method Summary
 void addChoiceListener(ChoiceListener listener)
          Adds a listener to this choice.
 java.lang.String getDefaultChoice()
          Gets the standard choice.
 java.lang.String getId(int index)
          Gets a unique identifier for the index'th choice.
 java.lang.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.
 

Method Detail

addChoiceListener

void addChoiceListener(ChoiceListener listener)
Adds a listener to this choice. The listener is informed about changes of the entries of this choice.

Parameters:
listener - the new listener, not null

removeChoiceListener

void removeChoiceListener(ChoiceListener listener)
Removes the listener listener from this choice.

Parameters:
listener - the listener to remove

setController

void setController(DockController controller)
Informs this Choice that it is now used for displaying items for controller.

Parameters:
controller - the controller in whose realm this Choice is currently used, can be null

size

int size()
Gets the number of available choices.

Returns:
the number of choices

getText

java.lang.String getText(int index)
Gets a name for the index'th choice.

Parameters:
index - the index of the choice
Returns:
the name of that choice, should be human readable

getId

java.lang.String getId(int index)
Gets a unique identifier for the index'th choice.

Parameters:
index - the index of the choice
Returns:
the unique identifier

getDefaultChoice

java.lang.String getDefaultChoice()
Gets the standard choice.

Returns:
the identifier of the standard choice, null is only allowed if isNullEntryAllowed() returns true

isNullEntryAllowed

boolean isNullEntryAllowed()
Tells whether the user choose nothing.

Returns:
whether the user can choose the null identifier