Class Options.EditableComboBoxOption
- java.lang.Object
-
- com.biomatters.geneious.publicapi.plugin.Options.Option<java.lang.String,GComboBox>
-
- com.biomatters.geneious.publicapi.plugin.Options.EditableComboBoxOption
-
- All Implemented Interfaces:
XMLSerializable
- Enclosing class:
- Options
public static class Options.EditableComboBoxOption extends Options.Option<java.lang.String,GComboBox>
Like a ComboBoxOption, but besides letting the user choose one of the preconfigured default values, also allows arbitrary custom strings to be entered. Therefore, the value of this option can be an arbitrary string.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.biomatters.geneious.publicapi.documents.XMLSerializable
XMLSerializable.OldVersionCompatible, XMLSerializable.VersionSupportType
-
-
Field Summary
-
Fields inherited from interface com.biomatters.geneious.publicapi.documents.XMLSerializable
ROOT_ELEMENT_NAME
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GComboBox
createComponent()
Create a graphical component representing this option.protected java.lang.String
getExtraPersistentInformation()
Gets any information in addition to the option value that should be persistent between instances.java.lang.String
getPossibleValues()
Provide a descriptive string representation of possible values of this option.java.lang.String[]
getSelectableValues()
return the current selectable values that the option has.java.lang.String
getValueFromString(java.lang.String value)
Convert a String into an instance of the object type used by this option.void
restoreDefault()
Restore this option to its default valueprotected void
setExtraPersistentInformation(java.lang.String extras)
Sets any information in addition to the option value that should be persistent between instances.void
setSelectableValues(java.lang.String[] selectableValues)
Replace the selectable values that this Option has.protected void
setValueOnComponent(GComboBox component, java.lang.String value)
Set the value on this component.org.jdom.Element
toXML()
Convert object to a JDOM element.-
Methods inherited from class com.biomatters.geneious.publicapi.plugin.Options.Option
addChangeListener, addChildOptionsDependent, addDependent, addDependentIfNot, addLayoutDependent, fromXML, generateValidValue, getComponent, getComponentWithUnitsAndHelpButton, getDefaultValue, getDependents, getDependentsIfNot, getDescription, getDescriptionAndState, getDisplayedLabel, getHelp, getLabel, getName, getNormalizedStringValue, getParentOptions, getValue, getValueAsString, getValueAsString, getVerticalWeight, handleSetEnabled, hasComponentBeenCreated, hideWarningMessage, isAdvanced, isAlwaysUsesDefaultPreferenceLocation, isEnabled, isFillHorizontalSpace, isProOnly, isRestoreDefaultApplies, isRestorePreferenceApplies, isSpanningComponent, isVisible, moveToOptions, removeChangeListener, setAdvanced, setAlwaysUsesDefaultPreferenceLocation, setDefaultValue, setDescription, setDisabledValue, setEnabled, setFillHorizontalSpace, setHelp, setHidden, setHidden, setLabelComponent, setPreferredHeight, setPreferredWidth, setProOnly, setRestoreDefaultApplies, setRestorePreferenceApplies, setShouldSaveValue, setSpanningComponent, setValue, setValue, setValueFromString, setVerticalWeight, setVisible, setWarningMessage, shouldSaveValue, toString
-
-
-
-
Method Detail
-
toXML
public org.jdom.Element toXML()
Description copied from interface:XMLSerializable
Convert object to a JDOM element. The representation should be complete so thatXMLSerializable.fromXML(org.jdom.Element)
can completely restore the object's representation. It is recommended that the returned element useXMLSerializable.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 callXMLSerializer.classToXML(String, XMLSerializable)
which calls this method internally. PluginDocument implementations of this method may choose to throw anXMLSerializationException
, enclosed in aRuntimeException
.- Specified by:
toXML
in interfaceXMLSerializable
- Overrides:
toXML
in classOptions.Option<java.lang.String,GComboBox>
- Returns:
- object encoded as a JDOM element
-
getPossibleValues
public java.lang.String getPossibleValues()
Description copied from class:Options.Option
Provide a descriptive string representation of possible values of this option. For example, combo box and radio options should provide a list of all available values. The default implementation returns null. Radio and ComboBox options provideOptions.ComboBoxOrRadioOption.getPossibleOptionValues()
to get possible values as a List of OptionValues.- Overrides:
getPossibleValues
in classOptions.Option<java.lang.String,GComboBox>
- Returns:
- a descriptive string representation of possible values of this option or null if this option may have any String value.
- See Also:
Options.ComboBoxOrRadioOption.getPossibleOptionValues()
-
getValueFromString
public java.lang.String getValueFromString(java.lang.String value)
Description copied from class:Options.Option
Convert a String into an instance of the object type used by this option. This method should generally create a new object every time it is invoked. Only disregard this advice if you know what you are doing - e.g. it is safe to maintain an object pool and return the same object more than once if your Option's ValueType is immutable. This method is the inverse ofOptions.Option.getValueAsString(Object)
.- Specified by:
getValueFromString
in classOptions.Option<java.lang.String,GComboBox>
- Parameters:
value
- the string representation of the object value- Returns:
- the object value or the default value if the string representation is not valid.
-
setValueOnComponent
protected void setValueOnComponent(GComboBox component, java.lang.String value)
Description copied from class:Options.Option
Set the value on this component.- Specified by:
setValueOnComponent
in classOptions.Option<java.lang.String,GComboBox>
- Parameters:
component
- a component return fromOptions.Option.createComponent()
value
- the value to set.
-
getExtraPersistentInformation
protected java.lang.String getExtraPersistentInformation()
Description copied from class:Options.Option
Gets any information in addition to the option value that should be persistent between instances. For example, an editable combo box option stores a list of previous entries the user has entered. The default implementation returns null.- Overrides:
getExtraPersistentInformation
in classOptions.Option<java.lang.String,GComboBox>
- Returns:
- any additional persistent information or null if this option has none.
-
setExtraPersistentInformation
protected void setExtraPersistentInformation(java.lang.String extras)
Description copied from class:Options.Option
Sets any information in addition to the option value that should be persistent between instances. For example, an editable combo box option stores a list of previous entries the user has entered. The default implementation does nothing.- Overrides:
setExtraPersistentInformation
in classOptions.Option<java.lang.String,GComboBox>
- Parameters:
extras
- any additional persistent information or null if this option has none.
-
createComponent
protected GComboBox createComponent()
Description copied from class:Options.Option
Create a graphical component representing this option. The implementation is responsible for making sure that the returned component is initialised to the current value ofOptions.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 theOptions.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.- Specified by:
createComponent
in classOptions.Option<java.lang.String,GComboBox>
- Returns:
- a graphical component representing this option. May not be null.
-
setSelectableValues
public void setSelectableValues(java.lang.String[] selectableValues)
Replace the selectable values that this Option has. If the current value of this option is one of the previous selectable values, and is not one of the new selectable values then the current value of this option is changed to the first of the new selectable values.- Parameters:
selectableValues
- some selectable values to display in the drop down box.
-
getSelectableValues
public java.lang.String[] getSelectableValues()
return the current selectable values that the option has. The current value of this option is not guaranteed to be in this set.- Returns:
- the current selectable values that the option has
- Since:
- API 4.60 (Geneious 5.6.0)
-
restoreDefault
public void restoreDefault()
Description copied from class:Options.Option
Restore this option to its default value- Overrides:
restoreDefault
in classOptions.Option<java.lang.String,GComboBox>
-
-