|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.common.generic.description.DescriptionObjectImpl
org.openbp.common.generic.description.DisplayObjectImpl
org.openbp.jaspira.option.Option
public abstract class Option
This is the abstract class for all options. A option has viewable Components - the OptionWidgets. If the option has to be able to shown in a tollbar or somthing else it has to return diverent Widges! Every Option has a name and a displayname, where the displayname is used to name the option in diferent languages. The option value kan read by the OptionMgr. If you need the value of a option you have to ask vor it at the OptionMgr. If the Option value has changed a OptionChangedEvent will signal the change. to recognize this you have to install a Listener at the JaspiraEventMgr.
| Field Summary | |
|---|---|
static int |
DFLT_PRIORITY
Default priority = 50 |
static java.util.Comparator |
priorityComparator
Comperator for option ans optiongroups |
static java.lang.String |
PROPERTY_CONDITION
Property id for the conditional expression |
static java.lang.String |
PROPERTY_HEADING
Resource id for the option heading |
static java.lang.String |
PROPERTY_ICON
Resource id for the icon |
static java.lang.String |
PROPERTY_OPTION_PARENT
Resource id for the option parent |
static java.lang.String |
PROPERTY_PRIO
Resource id for the option priority |
static java.lang.String |
PROPERTY_TYPE
Resource id for the option type |
static java.lang.String |
TYPE_GROUP
Option type: Option group |
static java.lang.String |
TYPE_OPTION
Option type: Regular option |
static java.lang.String |
TYPE_SUB_GROUP
Option type: Group of options which will displayed in a page and not as own option tree node |
| Fields inherited from interface org.openbp.common.generic.Copyable |
|---|
COPY_DEEP, COPY_FIRST_LEVEL, COPY_SHALLOW |
| Constructor Summary | |
|---|---|
Option(ResourceCollection res,
java.lang.String optionName,
java.lang.Object defaultValue)
Resource constructor. |
|
Option(java.lang.String optionName,
java.lang.String displayName,
java.lang.String description,
java.lang.Object defaultValue,
java.lang.String type,
Option parent,
int prio)
Value constructor. |
|
| Method Summary | |
|---|---|
protected void |
addOptionChild(Option opt)
Adds a child option. |
java.util.Enumeration |
children()
|
abstract OptionWidget |
createOptionWidget()
Returns the widget for this option. |
boolean |
getAllowsChildren()
|
OptionWidget |
getCachedOptionWidget()
Returns the cached widget for this option. |
javax.swing.tree.TreeNode |
getChildAt(int childIndex)
|
int |
getChildCount()
|
java.lang.String |
getCondition()
Gets the conditional expression that determines if the plugin should be active. |
java.lang.Object |
getDefaultValue()
Returns the default value of the option. |
java.lang.String |
getHeading()
Gets the option heading (title of the option widget). |
javax.swing.Icon |
getIcon()
Returns icon of the otion. |
int |
getIndex(javax.swing.tree.TreeNode node)
|
java.util.SortedSet |
getOptionChildren()
Returns the child options of this option. |
javax.swing.tree.TreeNode |
getParent()
|
int |
getPriority()
Returns the priority of the option. |
java.lang.String |
getType()
Returns the type of the option. |
java.lang.Object |
getValue()
Gets the value of the Option. |
void |
install()
Installs the option width the option manager. |
boolean |
isLeaf()
|
abstract java.lang.Object |
loadFromString(java.lang.String cryptString)
Deserializes the option value from a string. |
protected java.lang.Object |
loadOptionValue()
Loads the option value from the setting manager. |
protected void |
removeOptionChild(Option opt)
Removes a child option. |
void |
resetCachedOptionWidget()
Resets the cached widget for this option. |
protected void |
saveOptionValue()
Saves the option value. |
abstract java.lang.String |
saveToString()
Serializes the option value to a string. |
void |
setValue(java.lang.Object o)
Sets the value of this option. |
java.lang.String |
toString()
Gets the display name so it can be displayed directly by the default JTree. |
void |
uninstall()
Uninstalls the option from the option manager. |
| 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 |
| Field Detail |
|---|
public static final java.util.Comparator priorityComparator
public static final java.lang.String PROPERTY_ICON
public static final java.lang.String PROPERTY_TYPE
public static final java.lang.String PROPERTY_PRIO
public static final java.lang.String PROPERTY_HEADING
public static final java.lang.String PROPERTY_OPTION_PARENT
public static final java.lang.String PROPERTY_CONDITION
public static final java.lang.String TYPE_OPTION
public static final java.lang.String TYPE_GROUP
public static final java.lang.String TYPE_SUB_GROUP
public static final int DFLT_PRIORITY
| Constructor Detail |
|---|
public Option(ResourceCollection res,
java.lang.String optionName,
java.lang.Object defaultValue)
res - Resource defining the optionoptionName - Name of the optiondefaultValue - Default Value of the option
public Option(java.lang.String optionName,
java.lang.String displayName,
java.lang.String description,
java.lang.Object defaultValue,
java.lang.String type,
Option parent,
int prio)
optionName - Name of the optiondisplayName - Display name of the optiondescription - Description of the optiondefaultValue - Default Value of the optiontype - Option type (TYPE_OPTION/TYPE_GROUP)parent - Option parent or nullprio - Priority of the option| Method Detail |
|---|
public void install()
public void uninstall()
public java.lang.String toString()
toString in class DescriptionObjectImplpublic abstract OptionWidget createOptionWidget()
public abstract java.lang.String saveToString()
SettingUtil class.
loadFromString(java.lang.String).public abstract java.lang.Object loadFromString(java.lang.String cryptString)
SettingUtil class.
cryptString - A string representing the option value or null
This value corresponds to the value returned by saveToString().
public OptionWidget getCachedOptionWidget()
public void resetCachedOptionWidget()
getCachedOptionWidget() will create a new widget.
public javax.swing.Icon getIcon()
public java.lang.String getType()
TYPE_OPTION/TYPE_GROUPpublic int getPriority()
public java.lang.String getCondition()
public java.lang.String getHeading()
public java.lang.Object getDefaultValue()
public java.lang.Object getValue()
public void setValue(java.lang.Object o)
o - The option valuepublic java.util.SortedSet getOptionChildren()
Option objects)protected void saveOptionValue()
protected java.lang.Object loadOptionValue()
protected void addOptionChild(Option opt)
opt - the new child optionprotected void removeOptionChild(Option opt)
opt - the option to removepublic javax.swing.tree.TreeNode getChildAt(int childIndex)
getChildAt in interface javax.swing.tree.TreeNodeTreeNode.getChildAt(int)public int getChildCount()
getChildCount in interface javax.swing.tree.TreeNodeTreeNode.getChildCount()public javax.swing.tree.TreeNode getParent()
getParent in interface javax.swing.tree.TreeNodeTreeNode.getParent()public int getIndex(javax.swing.tree.TreeNode node)
getIndex in interface javax.swing.tree.TreeNodeTreeNode.getIndex(javax.swing.tree.TreeNode)public boolean getAllowsChildren()
getAllowsChildren in interface javax.swing.tree.TreeNodeTreeNode.getAllowsChildren()public boolean isLeaf()
isLeaf in interface javax.swing.tree.TreeNodeTreeNode.isLeaf()public java.util.Enumeration children()
children in interface javax.swing.tree.TreeNodeTreeNode.children()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||