|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.option.OptionItem | +--y.option.EnumOptionItem
An option item for a value that is chosen from a fixed range of possible values.
Provides an editor based on JComboBox.
Field Summary |
Fields inherited from class y.option.OptionItem |
COLOR_UNDEFINED, name, UNDEFINED |
Constructor Summary | |
EnumOptionItem(String name)
Creates an empty instance of EnumOptionItem. |
|
EnumOptionItem(String name,
Object[] values,
int valueIndex)
Creates a new instance of EnumOptionItem. |
|
EnumOptionItem(String name,
Object[] values,
Object value)
Creates a new instance of EnumOptionItem. |
Method Summary | |
void |
add(Object item)
Convenience method that just calls EnumOptionItem.add(Object, Object) with item as both
of the arguments |
void |
add(Object item,
Object i18nKey)
Populates the choices for this EnumOptionItem. |
void |
addAll(Map itemI18nPairs)
This method is a convenience for the EnumOptionItem.add(Object, Object) method.
|
boolean |
adoptEditorValue()
Adopts the value from the editor component to the item. |
JComponent |
getEditor()
Returns the editor component for the this option item. |
JComponent |
getEditor(GuiFactory gf,
String parentName)
Returns the editor component for the this option item. |
Object[] |
getEnumRange()
Returns the range of possible values. |
int |
getIndex()
Returns the index of the currently set value |
Object |
getInterpretedValue()
This method can be used in conjunction with the empty constructor and the EnumOptionItem.add(Object, Object) method.
|
String |
getStringValue()
Returns the stringified value of this option item if the classType property is set, it uses the y.util.Serialization class to perform its task, otherwise it will return null. |
String |
getType()
Returns "Enum" |
Object |
getValue()
Returns the value of this option item |
void |
resetValue()
Resets the value of this item to its initial value. |
void |
setEnum(Object[] values)
Sets the range of possible values. |
void |
setEnum(Object[] values,
Object value)
Sets the range of possible values. |
void |
setInterpretedValue(Object valueObject)
This method can be used in conjunction with the empty constructor and the EnumOptionItem.add(Object, Object) method.
|
void |
setItemListener(ItemListener l)
Sets the ItemListener for the editor component being used. |
void |
setRenderer(ListCellRenderer r)
Sets the ListCellRenderer for the editor component used. |
void |
setStringValue(String value)
Sets the stringified value of this option item if the classType property is set, it uses the y.util.Serialization class to perform its task, otherwise it will return null. |
void |
setUsingIntegers(boolean use)
|
void |
setValue(Object v)
Sets the current value of this option item. |
Methods inherited from class y.option.OptionItem |
checkEditorValue, getClassType, getName, getTipText, isValueUndefined, setClassType, setTipText, setValueUndefined, wantsVisibleName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EnumOptionItem(String name, Object[] values, Object value)
name
- the name of this itemvalues
- the possible values of the optionvalue
- the initial value of the option (must be contained in values)public EnumOptionItem(String name)
EnumOptionItem.addAll(java.util.Map)
,
EnumOptionItem.add(Object)
and EnumOptionItem.add(Object, Object)
can be used to fill the Item with possible choices.
name
- the name of this itempublic EnumOptionItem(String name, Object[] values, int valueIndex)
name
- the name of this itemvalues
- the possible values of the optionvalueIndex
- the array index of the initial value.Method Detail |
public String getType()
getType
in class OptionItem
public void addAll(Map itemI18nPairs)
EnumOptionItem.add(Object, Object)
method.
For all entries in the map, the add method will be called using the keys as
the first argument and the values as the second one.
public void add(Object item)
EnumOptionItem.add(Object, Object)
with item as both
of the arguments
public void add(Object item, Object i18nKey)
EnumOptionItem.getInterpretedValue()
and EnumOptionItem.setInterpretedValue(Object)
methods. The i18nKey will be used
as the internal "value".
item
- the item that can be queried and set
using the EnumOptionItem.getInterpretedValue()
and EnumOptionItem.setInterpretedValue(Object)
methods.i18nKey
- the value as it would have been set using the 3 argument constructorpublic Object getInterpretedValue()
EnumOptionItem.add(Object, Object)
method.
It will not return the internal "value"/i18nKey, but the item, that was the
first argument of the add method.
public void setInterpretedValue(Object valueObject)
EnumOptionItem.add(Object, Object)
method.
It will set the corresponding internal "value"/i18nKey, for the item, which
has previously been passed to the add method as the first value.
public Object getValue()
OptionItem
getValue
in class OptionItem
public void setValue(Object v)
v
is of type Integer
then it's int value is considered to be the index
of the current value.
If v
is of type String
it's value will be set as current value.
setValue
in class OptionItem
public void setUsingIntegers(boolean use)
public int getIndex()
public boolean adoptEditorValue()
OptionItem
adoptEditorValue
in class OptionItem
public Object[] getEnumRange()
public void setEnum(Object[] values, Object value)
values
- the value rangevalue
- the initial valuepublic void setEnum(Object[] values)
values
- the value rangepublic void setItemListener(ItemListener l)
public void setRenderer(ListCellRenderer r)
public void resetValue()
OptionItem
resetValue
in class OptionItem
public JComponent getEditor()
OptionItem
getEditor
in class OptionItem
public JComponent getEditor(GuiFactory gf, String parentName)
OptionItem
getEditor
in class OptionItem
public void setStringValue(String value)
setStringValue
in class OptionItem
public String getStringValue()
getStringValue
in class OptionItem
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |