Package docking.widgets.dialogs
Class StringChoices
- java.lang.Object
- 
- docking.widgets.dialogs.StringChoices
 
- 
 public class StringChoices extends java.lang.ObjectStringEnum objects represent a choice from a limited set of options.
- 
- 
Constructor SummaryConstructors Constructor Description StringChoices(StringChoices strEnum)Construct from another StringEnum instance.StringChoices(java.lang.String[] values)Construct from an array of Strings.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(java.lang.String value)Returns true if the given value is contained in this StringEnumbooleanequals(java.lang.Object obj)java.lang.StringgetSelectedValue()Returns the currently selected value.intgetSelectedValueIndex()Returns the index of the currently selected value;java.lang.String[]getValues()Returns a list of all allowed string values.inthashCode()intindexOf(java.lang.String value)Returns the index of the given value in this StringEnum; -1 if the value is not contained herein.voidsetSelectedValue(int index)Sets the current value to the object at the given position as if indexed into the array returned by getValues().voidsetSelectedValue(java.lang.String value)Sets the currentValue to the given value.java.lang.StringtoString()
 
- 
- 
- 
Constructor Detail- 
StringChoicespublic StringChoices(java.lang.String[] values) Construct from an array of Strings. The order of Strings is preserved.
 - 
StringChoicespublic StringChoices(StringChoices strEnum) Construct from another StringEnum instance.
 
- 
 - 
Method Detail- 
getValuespublic java.lang.String[] getValues() Returns a list of all allowed string values.
 - 
getSelectedValuepublic java.lang.String getSelectedValue() Returns the currently selected value.
 - 
getSelectedValueIndexpublic int getSelectedValueIndex() Returns the index of the currently selected value;
 - 
containspublic boolean contains(java.lang.String value) Returns true if the given value is contained in this StringEnum- Parameters:
- value- The value for which to search
- Returns:
- true if the given value is contained in this StringEnum
 
 - 
indexOfpublic int indexOf(java.lang.String value) Returns the index of the given value in this StringEnum; -1 if the value is not contained herein.- Parameters:
- value- The value for which to search
- Returns:
- the index of the given value in this StringEnum; -1 if the value is not contained herein.
 
 - 
setSelectedValuepublic void setSelectedValue(java.lang.String value) Sets the currentValue to the given value.- Throws:
- java.lang.IllegalArgumentException- thrown if the given value is not one of the set of allowed values.
 
 - 
setSelectedValuepublic void setSelectedValue(int index) Sets the current value to the object at the given position as if indexed into the array returned by getValues().
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object obj) - Overrides:
- equalsin class- java.lang.Object
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
- See Also:
- Object.toString()
 
 
- 
 
-