Class PluginPreferences<T extends Options>
java.lang.Object
com.biomatters.geneious.publicapi.plugin.PluginPreferences<T>
Allows a plugin to provide
Options based preferences
that are displayed in the Geneious Preferences dialog.
PluginPreferences are provided by a plugin via GeneiousPlugin.getPluginPreferences().-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a listener to be notified when the options returned bygetActiveOptions()have changed.final voidapplyDisplayableOptions(T options) Applies the values of some options previously returned fromgetDisplayableOptions()so that these option values will be used in future calls togetActiveOptions().protected abstract TCreates a new instance of the options.final TGet the option values that should be used by any code that wishes to depend on these options.final TGet some options that can be displayed in user preferences.Get an icon displayed next to the name returned fromgetTabName().abstract StringGet the name displayed in the heading of the tab for these options in the preferences pane.voidRemoves a listener previously added usingaddActiveOptionsChangedListener(org.virion.jam.util.SimpleListener)
-
Constructor Details
-
PluginPreferences
protected PluginPreferences()
-
-
Method Details
-
createOptions
Creates a new instance of the options. Every invocation of this method must create a new instance - i.e. it must not return an instance previously returned from this method. As of 2008-12-3, advanced options (Options.Option.setAdvanced(boolean)are not supported by PluginPrefernces.- Returns:
- a new instance of the options
-
getTabName
Get the name displayed in the heading of the tab for these options in the preferences pane.- Returns:
- the name displayed in the heading of the tab for these options in the preferences pane.
-
getTabIcon
Get an icon displayed next to the name returned fromgetTabName(). The default implementation returns null.- Returns:
- an icon displayed next to the name returned from
getTabName()or null to display no icon.
-
getActiveOptions
Get the option values that should be used by any code that wishes to depend on these options.- Returns:
- the option values that should be used by any code that wishes to depend on these options.
-
getDisplayableOptions
Get some options that can be displayed in user preferences. The preferences implementation may change the values of these before the user applies them, hence the returned Options need to be backed by different in memory storage than those returned fromgetActiveOptions(). This method implemenation creates a new instance of options every time it is invoked.- Returns:
- some options that can be displayed in user preferences.
-
applyDisplayableOptions
Applies the values of some options previously returned fromgetDisplayableOptions()so that these option values will be used in future calls togetActiveOptions().- Parameters:
options- the option values to apply.
-
addActiveOptionsChangedListener
Adds a listener to be notified when the options returned bygetActiveOptions()have changed.- Parameters:
listener- the listener to be notified
-
removeActiveOptionsChangedListener
Removes a listener previously added usingaddActiveOptionsChangedListener(org.virion.jam.util.SimpleListener)- Parameters:
listener- the listener previously passed toaddActiveOptionsChangedListener(org.virion.jam.util.SimpleListener)
-