org.openbp.jaspira.option
Class SelectionOption

java.lang.Object
  extended by org.openbp.common.generic.description.DescriptionObjectImpl
      extended by org.openbp.common.generic.description.DisplayObjectImpl
          extended by org.openbp.jaspira.option.Option
              extended by org.openbp.jaspira.option.SelectionOption
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, javax.swing.tree.TreeNode, Copyable, DescriptionObject, Displayable, DisplayObject, Validatable
Direct Known Subclasses:
ItemBrowserPlugin.ItemBrowserOptions.NewModelGeneratorDefaultDirectoriesOption, ModelerOptionPlugin.ModelerOptions.DataLinkAutoconnectorOption, ModelerOptionPlugin.ModelerOptions.GridTypeOption, ModelerOptionPlugin.ModelerOptions.ShadowOption, SkinPlugin.SkinOptions.SkinOption

public class SelectionOption
extends Option

A selection option provides a selection of values either as selection field widget.

Author:
Heiko Erhardt
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.openbp.jaspira.option.Option
DFLT_PRIORITY, priorityComparator, PROPERTY_CONDITION, PROPERTY_HEADING, PROPERTY_ICON, PROPERTY_OPTION_PARENT, PROPERTY_PRIO, PROPERTY_TYPE, TYPE_GROUP, TYPE_OPTION, TYPE_SUB_GROUP
 
Fields inherited from interface org.openbp.common.generic.Copyable
COPY_DEEP, COPY_FIRST_LEVEL, COPY_SHALLOW
 
Constructor Summary
SelectionOption(ResourceCollection res, java.lang.String optionName, java.lang.Object defaultValue, java.lang.String[] valueNames, java.lang.Object[] values)
          Resource constructor.
 
Method Summary
 OptionWidget createOptionWidget()
          Returns the widget for this option.
 java.lang.Object loadFromString(java.lang.String s)
          Deserializes the option value from a string.
 java.lang.String saveToString()
          Serializes the option value to a string.
 
Methods inherited from class org.openbp.jaspira.option.Option
addOptionChild, children, getAllowsChildren, getCachedOptionWidget, getChildAt, getChildCount, getCondition, getDefaultValue, getHeading, getIcon, getIndex, getOptionChildren, getParent, getPriority, getType, getValue, install, isLeaf, loadOptionValue, removeOptionChild, resetCachedOptionWidget, saveOptionValue, setValue, toString, uninstall
 
Methods inherited from class org.openbp.common.generic.description.DisplayObjectImpl
copyFrom, getDisplayName, getDisplayText, setDisplayName
 
Methods inherited from class org.openbp.common.generic.description.DescriptionObjectImpl
clone, compareTo, getDescription, getDescriptionEscape, getDescriptionText, getName, setDescription, setDescriptionEscape, setName, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openbp.common.generic.description.DescriptionObject
clone, getDescription, getDescriptionText, getName, setDescription, setName
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

SelectionOption

public SelectionOption(ResourceCollection res,
                       java.lang.String optionName,
                       java.lang.Object defaultValue,
                       java.lang.String[] valueNames,
                       java.lang.Object[] values)
Resource constructor.

Parameters:
res - Resource defining the option
optionName - Name of the option
defaultValue - Default Value of the option
valueNames - Value resource name list
values - Value list
Method Detail

createOptionWidget

public OptionWidget createOptionWidget()
Description copied from class: Option
Returns the widget for this option.

Specified by:
createOptionWidget in class Option
Returns:
The widget
See Also:
Option.createOptionWidget()

saveToString

public java.lang.String saveToString()
Description copied from class: Option
Serializes the option value to a string. This string value will be used to save the option using the SettingUtil class.

Specified by:
saveToString in class Option
Returns:
A string representing the option value
This value corresponds to the value expected by Option.loadFromString(java.lang.String).
See Also:
Option.saveToString()

loadFromString

public java.lang.Object loadFromString(java.lang.String s)
Description copied from class: Option
Deserializes the option value from a string. This string value will be used to save the option using the SettingUtil class.

Specified by:
loadFromString in class Option
Parameters:
s - A string representing the option value or null This value corresponds to the value returned by Option.saveToString().
Returns:
The option value
See Also:
Option.loadFromString(String)


Copyright © 2011. All Rights Reserved.