bibliothek.extension.gui.dock.preference.preferences.choice
Interface ChoiceExtension<V>

Type Parameters:
V - the kind of objects this choice offers

public interface ChoiceExtension<V>

An extension to a Choice, adding more options to the choice.

Author:
Benjamin Sigg

Field Summary
static Path CHOICE_EXTENSION
          The name of this extension
static String CHOICE_PARAMETER
          The parameter containing the choise that is extended
 
Method Summary
 V getChoice(int index)
          Gets the index'th value of this choice.
 String getDefaultChoice()
          Overrides 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 isTextKey(int index)
          Tells whether getText(int) for index index returns a key for the TextManager or is just ordinary text.
 int size()
          Gets the number of available choices.
 

Field Detail

CHOICE_EXTENSION

static final Path CHOICE_EXTENSION
The name of this extension


CHOICE_PARAMETER

static final String CHOICE_PARAMETER
The parameter containing the choise that is extended

See Also:
Constant Field Values
Method Detail

size

int size()
Gets the number of available choices.

Returns:
the number of choices

getText

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

isTextKey

boolean isTextKey(int index)
Tells whether getText(int) for index index returns a key for the TextManager or is just ordinary text.

Parameters:
index - the index of the item
Returns:
whether the text is a key or not

getId

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

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

getChoice

V getChoice(int index)
Gets the index'th value of this choice.

Parameters:
index - the index of the choice
Returns:
the value of the choice

getDefaultChoice

String getDefaultChoice()
Overrides the standard choice.

Returns:
the identifier of the standard choice, null indicates that this extension does not override the default choices