public static class Options.FileSelectionOption extends Options.Option<String,com.biomatters.geneious.publicapi.plugin.Options.FileSelectionPanel>
Options.ExecutableFileSelectionOption for executable files instead.XMLSerializable.OldVersionCompatible, XMLSerializable.VersionSupportTypeROOT_ELEMENT_NAME| Modifier | Constructor and Description |
|---|---|
|
Options.FileSelectionOption(org.jdom.Element element)
Constructor for XML Serialization.
|
protected |
Options.FileSelectionOption(String name,
String label,
String defaultValue,
String[] selectableFileNames,
String buttonLabel,
FilenameFilter filter)
Construct a new FileSelectionOption.
|
| Modifier and Type | Method and Description |
|---|---|
protected com.biomatters.geneious.publicapi.plugin.Options.FileSelectionPanel |
createComponent()
Create a graphical component representing this option.
|
protected String |
getExtraPersistentInformation()
Gets any information in addition to the option value that should be
persistent between instances.
|
protected String |
getPossibleValues()
Provide a descriptive string representation of possible values of this option.
|
String |
getValueFromString(String value)
Convert a String into an instance of the object type used by this option.
|
void |
restoreDefault()
Restore this option to its default value
|
void |
setAllowMultipleSelection(boolean allowMultipleSelection)
Sets whether or not selecting multiple files is allowed by this file selection option.
|
protected void |
setExtraPersistentInformation(String extras)
Sets any information in addition to the option value that should be
persistent between instances.
|
void |
setSelectionType(int fileSelectionType)
Set whether files and/or folders can be selected when browsing.
|
protected void |
setValueOnComponent(com.biomatters.geneious.publicapi.plugin.Options.FileSelectionPanel component,
String 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, getDisplayedLabel, getLabel, getName, getParentOptions, getValue, getValueAsString, getValueAsString, getVerticalWeight, handleSetEnabled, hideWarningMessage, isAdvanced, isEnabled, isFillHorizontalSpace, isProOnly, isRestoreDefaultApplies, isRestorePreferenceApplies, isSpanningComponent, isVisible, moveToOptions, removeChangeListener, setAdvanced, setAlwaysUsesDefaultPreferenceLocation, setDefaultValue, setDescription, setDisabledValue, setEnabled, setFillHorizontalSpace, setHidden, setLabelComponent, setPreferredHeight, setPreferredWidth, setProOnly, setRestoreDefaultApplies, setRestorePreferenceApplies, setShouldSaveValue, setSpanningComponent, setValue, setValue, setValueFromString, setVerticalWeight, setVisible, setWarningMessage, shouldSaveValue, toStringpublic Options.FileSelectionOption(org.jdom.Element element)
throws XMLSerializationException
XMLSerializableXMLSerializationExceptionprotected Options.FileSelectionOption(String name, String label, String defaultValue, String[] selectableFileNames, String buttonLabel, FilenameFilter filter)
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 optionselectableFileNames - A list of selectable filenames to be provided to the user.buttonLabel - The text displayed on the button instead of "Browse"filter - Filter which matches filenames which are a valid selection. This field is not serialized which means it won't work with Options.addMultipleOptions(String, Options, boolean)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<String,com.biomatters.geneious.publicapi.plugin.Options.FileSelectionPanel>public void setSelectionType(int fileSelectionType)
fileSelectionType - one of JFileChooser.FILES_AND_DIRECTORIES, JFileChooser.FILES_ONLY or JFileChooser.DIRECTORIES_ONLYpublic void setAllowMultipleSelection(boolean allowMultipleSelection)
allowMultipleSelection - true if selecting multiple files is allowedprotected String getPossibleValues()
Options.OptionOptions.ComboBoxOrRadioOption.getPossibleOptionValues() to
get possible values as a List of OptionValues.getPossibleValues in class Options.Option<String,com.biomatters.geneious.publicapi.plugin.Options.FileSelectionPanel>Options.ComboBoxOrRadioOption.getPossibleOptionValues()public String getValueFromString(String value)
Options.OptionOptions.Option.getValueAsString(Object) .getValueFromString in class Options.Option<String,com.biomatters.geneious.publicapi.plugin.Options.FileSelectionPanel>value - the string representation of the object valueprotected void setValueOnComponent(com.biomatters.geneious.publicapi.plugin.Options.FileSelectionPanel component,
String value)
Options.OptionsetValueOnComponent in class Options.Option<String,com.biomatters.geneious.publicapi.plugin.Options.FileSelectionPanel>component - a component return from Options.Option.createComponent()value - the value to set.protected String getExtraPersistentInformation()
Options.OptiongetExtraPersistentInformation in class Options.Option<String,com.biomatters.geneious.publicapi.plugin.Options.FileSelectionPanel>protected void setExtraPersistentInformation(String extras)
Options.OptionsetExtraPersistentInformation in class Options.Option<String,com.biomatters.geneious.publicapi.plugin.Options.FileSelectionPanel>extras - any additional persistent information or null if this option has none.protected com.biomatters.geneious.publicapi.plugin.Options.FileSelectionPanel 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<String,com.biomatters.geneious.publicapi.plugin.Options.FileSelectionPanel>public void restoreDefault()
Options.OptionrestoreDefault in class Options.Option<String,com.biomatters.geneious.publicapi.plugin.Options.FileSelectionPanel>