Class PluginPreferences<T extends Options>
- java.lang.Object
-
- com.biomatters.geneious.publicapi.plugin.PluginPreferences<T>
-
public abstract class PluginPreferences<T extends Options> extends java.lang.Object
Allows a plugin to provideOptions
based preferences that are displayed in the Geneious Preferences dialog. PluginPreferences are provided by a plugin viaGeneiousPlugin.getPluginPreferences()
.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PluginPreferences()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addActiveOptionsChangedListener(org.virion.jam.util.SimpleListener listener)
Adds a listener to be notified when the options returned bygetActiveOptions()
have changed.void
applyDisplayableOptions(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 T
createOptions()
Creates a new instance of the options.T
getActiveOptions()
Get the option values that should be used by any code that wishes to depend on these options.T
getDisplayableOptions()
Get some options that can be displayed in user preferences.javax.swing.Icon
getTabIcon()
Get an icon displayed next to the name returned fromgetTabName()
.abstract java.lang.String
getTabName()
Get the name displayed in the heading of the tab for these options in the preferences pane.void
removeActiveOptionsChangedListener(org.virion.jam.util.SimpleListener listener)
Removes a listener previously added usingaddActiveOptionsChangedListener(org.virion.jam.util.SimpleListener)
-
-
-
Method Detail
-
createOptions
protected abstract T 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
public abstract java.lang.String 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
public javax.swing.Icon 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
public final T 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
public final T 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
public final void applyDisplayableOptions(T options)
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
public void addActiveOptionsChangedListener(org.virion.jam.util.SimpleListener listener)
Adds a listener to be notified when the options returned bygetActiveOptions()
have changed.- Parameters:
listener
- the listener to be notified
-
removeActiveOptionsChangedListener
public void removeActiveOptionsChangedListener(org.virion.jam.util.SimpleListener listener)
Removes a listener previously added usingaddActiveOptionsChangedListener(org.virion.jam.util.SimpleListener)
- Parameters:
listener
- the listener previously passed toaddActiveOptionsChangedListener(org.virion.jam.util.SimpleListener)
-
-