public static final class Options.MultipleOptions extends Object implements XMLSerializable
Options.addMultipleOptions(String, Options, boolean)
and provides methods to access the current values (getValues()) and to add change listeners
(addChangeListener(org.virion.jam.util.SimpleListener) and to
change the enabled state setEnabled(boolean).XMLSerializable.OldVersionCompatible, XMLSerializable.VersionSupportTypeROOT_ELEMENT_NAME| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(SimpleListener listener)
Add a listener to be notified when any of the values or number of values
for these multiple options change.
|
Options |
addValue(boolean fireChangeListeners)
Clone and add a new copy of the master options to these multiple options.
|
void |
fromXML(org.jdom.Element element)
Restore the object from the JDOM Element returned by
XMLSerializable.toXML(). |
JComponent |
getComponent()
Get a component used to display these multiple options.
|
Options |
getMasterOptions()
Returns the options that were used to construct this MultipleOptions.
|
List<Options> |
getValues()
Get all the current values for a set of multiple options.
|
boolean |
isEnabled()
Determine if these MultipleOptions appear enabled.
|
void |
removeChangeListener(SimpleListener listener)
Removes a listener previously added using
addChangeListener(org.virion.jam.util.SimpleListener). |
void |
removeValue(Options value)
Removes one of the multiple options terms.
|
void |
restoreDefaults()
Restores these MultipleOptions to their default value (i.e.
|
void |
setCurrentValuesAsDefaults()
Sets the current values of these multiple options as the default values.
|
void |
setEnabled(boolean enabled)
Sets the enabled state of all these MultipleOptions.
|
void |
setVisible(boolean visible)
Sets the visibility of the graphical component that displays these multiple options and
makes appropriate changes to the size of the window (if any) that contains the graphical component.
|
org.jdom.Element |
toXML()
Convert object to a JDOM element.
|
public List<Options> getValues()
Options.getValueAsString(String). See the documentation in Options.addMultipleOptions(String, Options, boolean) for details.Options.addMultipleOptions(String, Options, boolean)Options.addMultipleOptions(String, Options, boolean)public void addChangeListener(SimpleListener listener)
listener - the listener to be notifiedpublic void removeChangeListener(SimpleListener listener)
addChangeListener(org.virion.jam.util.SimpleListener).listener - the listener previously provided to addChangeListener(org.virion.jam.util.SimpleListener).public void setEnabled(boolean enabled)
enabled - whether or not these MultipleOptions should be enabled.public void setVisible(boolean visible)
visible - whether or not the graphical component that displays these multiple options should be visible.public boolean isEnabled()
setEnabled(boolean)
which is true by default)
and if all their parent options appear enabled.public Options addValue(boolean fireChangeListeners)
fireChangeListeners - whether to fire the value change listeners for the multiple optionspublic void removeValue(Options value)
addValue(boolean) shortly
after or things may behave weirdly.value - the value to remove. This should be one of the values returned from getValues()public JComponent getComponent()
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 XMLSerializablepublic void fromXML(org.jdom.Element element)
throws XMLSerializationException
XMLSerializableXMLSerializable.toXML().
This method generally should not be called directly. Instead, you should usually call
XMLSerializer.classFromXML(org.jdom.Element)
or XMLSerializer.classFromXML(org.jdom.Element, Class)
which calls this method internally.
It is optional to implement this method. Instead of implementing an empty constructor and implementing
this method properly, the implementation may instead
throw an UnsupportedOperationException and implement a constructor
that takes a single Element as a parameter.
This allows for cleaner code such as support for final fields in the XMLSerializable class.
The element parameter should not be modified since it may be reused. If you need a modified version of it,
take a copy with Element.clone().fromXML in interface XMLSerializableelement - representation from a previous call to XMLSerializable.toXML()XMLSerializationException - if the Element can't be converted into this type of objectpublic void restoreDefaults()
public void setCurrentValuesAsDefaults()
public Options getMasterOptions()
Options.Options inside the Options, but do not add any further options.#MultipleOptions(String, Options, boolean)