public static class Options.BooleanOption extends Options.Option<Boolean,JCheckBox>
Options.addBooleanOption.XMLSerializable.OldVersionCompatible, XMLSerializable.VersionSupportTypeROOT_ELEMENT_NAME| Modifier | Constructor and Description |
|---|---|
protected |
Options.BooleanOption(org.jdom.Element e)
Constructor for XML Serialization.
|
protected |
Options.BooleanOption(String name,
String label,
Boolean defaultValue)
Construct a new Boolean option
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDependent(Options.Option dependent,
boolean requireOn)
Makes another option's enabled state depend on this boolean option being on or off.
|
void |
addDependent(Options.Option dependent,
boolean requireOn,
boolean layoutCheckboxNextToDependent)
Makes another option's enabled state depend on this boolean option being on or off.
|
protected JCheckBox |
createComponent()
Create a graphical component representing this option.
|
String |
getDisplayedLabel()
Get a label displayed next to this option.
|
protected String |
getPossibleValues()
Provide a descriptive string representation of possible values of this option.
|
Boolean |
getValueFromString(String value)
Convert a String into an instance of the object type used by this option.
|
protected void |
setValueOnComponent(JCheckBox component,
Boolean value)
Set the value on this component.
|
org.jdom.Element |
toXML()
Convert object to a JDOM element.
|
addChangeListener, addChildOptionsDependent, addDependent, fromXML, generateValidValue, getComponent, getDefaultValue, getDescription, getDescriptionAndState, getExtraPersistentInformation, getLabel, getName, getParentOptions, getValue, getValueAsString, getValueAsString, getVerticalWeight, handleSetEnabled, hideWarningMessage, isAdvanced, isEnabled, isFillHorizontalSpace, isProOnly, isRestoreDefaultApplies, isRestorePreferenceApplies, isSpanningComponent, isVisible, moveToOptions, removeChangeListener, restoreDefault, setAdvanced, setAlwaysUsesDefaultPreferenceLocation, setDefaultValue, setDescription, setDisabledValue, setEnabled, setExtraPersistentInformation, setFillHorizontalSpace, setHidden, setLabelComponent, setPreferredHeight, setPreferredWidth, setProOnly, setRestoreDefaultApplies, setRestorePreferenceApplies, setShouldSaveValue, setSpanningComponent, setValue, setValue, setValueFromString, setVerticalWeight, setVisible, setWarningMessage, shouldSaveValue, toStringprotected Options.BooleanOption(org.jdom.Element e)
throws XMLSerializationException
XMLSerializableXMLSerializationExceptionprotected Options.BooleanOption(String name, String label, Boolean defaultValue)
name - the name to be used for referencing this option. For example from scripts or source code which wish to programmatically get or set the value of this option.
Names should be in standard Java variable name style eg. "myAwesomeOption".label - a label describing this option to be displayed to the user. eg. "My Awesome Option"defaultValue - the default value for this optionpublic String getDisplayedLabel()
Options.OptionOptions.Option.getLabel()
except for BooleanOption which does not display a label next to the check box.getDisplayedLabel in class Options.Option<Boolean,JCheckBox>public Boolean getValueFromString(String value)
Options.OptionOptions.Option.getValueAsString(Object) .getValueFromString in class Options.Option<Boolean,JCheckBox>value - the string representation of the object valueprotected JCheckBox createComponent()
Options.OptionOptions.Option.getValue().
The implementation is also responsible for making sure that the returned component
listens to any changes made to itself and
reflects those changes in the value of this option
using the Options.Option.setValue(Object) method.
This method will only be called once for each instance of an Option.
After it has been called, getComponent() will return a cached copy of it.createComponent in class Options.Option<Boolean,JCheckBox>protected String getPossibleValues()
Options.OptionOptions.ComboBoxOrRadioOption.getPossibleOptionValues() to
get possible values as a List of OptionValues.getPossibleValues in class Options.Option<Boolean,JCheckBox>Options.ComboBoxOrRadioOption.getPossibleOptionValues()protected void setValueOnComponent(JCheckBox component, Boolean value)
Options.OptionsetValueOnComponent in class Options.Option<Boolean,JCheckBox>component - a component return from Options.Option.createComponent()value - the value to set.public void addDependent(Options.Option dependent, boolean requireOn)
Options.Option.setDisabledValue(Object) which can be useful for making a BooleanOption
return false (or true) from Options.Option.getValue() when it is disabled as
a result of being a dependent of another BooleanOption.dependent - the option whose enabled state will changerequireOn - If this parameter is true then dependent will be enabled when this option is true (and disabled when this option is false)
If this parameter is false then dependent will be enabled when this option is false (and disabled when this option is true)public void addDependent(Options.Option dependent, boolean requireOn, boolean layoutCheckboxNextToDependent)
Options.Option.setDisabledValue(Object) which can be useful for making a BooleanOption
return false (or true) from Options.Option.getValue() when it is disabled as
a result of being a dependent of another BooleanOption.dependent - the option whose enabled state will changelayoutCheckboxNextToDependent - if true, the checkbox for this option will be layed out to the left of the label for the dependent optionrequireOn - If this parameter is true then dependent will be enabled when this option is true (and disabled when this option is false)
If this parameter is false then dependent will be enabled when this option is false (and disabled when this option is true)public org.jdom.Element toXML()
XMLSerializableXMLSerializable.fromXML(org.jdom.Element) can completely
restore the objects representation.
It is recommended that the returned element use XMLSerializable.ROOT_ELEMENT_NAME as its name,
in which case it must not define an attribute called "type". In this case,
fromXML, will be called with an element whose name may differ from the element
return from this function. This recommendation allows a more compact representation
of the XML can be stored.
This method generally should not be called directly. Instead, you should usually call
XMLSerializer.classToXML(String, XMLSerializable)
which calls this method internally.
PluginDocument implementations of this method may choose to throw an XMLSerializationException,
enclosed in a RuntimeException.toXML in interface XMLSerializabletoXML in class Options.Option<Boolean,JCheckBox>