Class PluginPreferences<T extends Options>


  • public abstract class PluginPreferences<T extends Options>
    extends java.lang.Object
    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 Detail

      • PluginPreferences

        protected PluginPreferences()
    • 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 from getTabName().

        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 from getActiveOptions().

        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 from getDisplayableOptions() so that these option values will be used in future calls to getActiveOptions().
        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 by getActiveOptions() have changed.
        Parameters:
        listener - the listener to be notified