org.homeunix.thecave.buddi.plugin.api
Class BuddiPreferencePlugin

java.lang.Object
  extended by org.homeunix.thecave.buddi.plugin.api.PreferenceAccess
      extended by org.homeunix.thecave.buddi.plugin.api.BuddiPreferencePlugin
All Implemented Interfaces:
MossPlugin
Direct Known Subclasses:
AdvancedPreferences, LocalePreferences, NetworkPreferences, PluginPreferences, ViewPreferences

public abstract class BuddiPreferencePlugin
extends PreferenceAccess
implements MossPlugin

A Buddi plugin which will be loaded into the Preferences screen. If your plugin needs user configuration, it is highly recommended to use this class to perform that. It is quite simple to do this; you need to create a JPanel of the component layout in getPreferencesPanel(), and provide the logic to load and save these values in the load() and save() methods. See the documentation for BuddiPluginPreference to see how to access the preferences file.

Author:
wyatt

Constructor Summary
BuddiPreferencePlugin()
           
 
Method Summary
 java.lang.String getDescription()
          Not used in PreferencePlugin
 Version getMaximumVersion()
          Returns the maximum program version needed to run this plugin.
 Version getMinimumVersion()
          Returns the minimum program version needed to run this plugin.
abstract  javax.swing.JPanel getPreferencesPanel()
          Create the JPanel to show in the Preferences.
 boolean isPluginActive()
          Not used in PreferencePlugin
 boolean isUseWrapper()
          If true, we put a JPanel wrapper around this JPanel, so that it keeps all the components at the top of the window, even if there is extra room.
abstract  void load()
          Loads the preferences which this panel is responsible for.
abstract  boolean save()
          Saves the preferences which this panel is responsible for.
 
Methods inherited from class org.homeunix.thecave.buddi.plugin.api.PreferenceAccess
getListPreference, getPreference, getSecurePreference, putListPreference, putPreference, putSecurePreference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.homeunix.thecave.moss.plugin.MossPlugin
getName
 

Constructor Detail

BuddiPreferencePlugin

public BuddiPreferencePlugin()
Method Detail

save

public abstract boolean save()
                      throws PluginException
Saves the preferences which this panel is responsible for. If the changes nessecitate a restart, return true; otherwise, return false.

Throws:
PluginException

load

public abstract void load()
                   throws PluginException
Loads the preferences which this panel is responsible for.

Throws:
PluginException

isUseWrapper

public boolean isUseWrapper()
If true, we put a JPanel wrapper around this JPanel, so that it keeps all the components at the top of the window, even if there is extra room. This is correct behaviour for most preference panes, especially if they contain multiple small widgets (buttons, check boxes, etc). If the panel is to contain a large widget which is to take up the entire frame (such as seen in the built in Plugins preference pane), override this and set to false.

Returns:

getPreferencesPanel

public abstract javax.swing.JPanel getPreferencesPanel()
Create the JPanel to show in the Preferences.

Returns:
A JPanel object which can be put into the Preferences panel

isPluginActive

public boolean isPluginActive()
Not used in PreferencePlugin

Specified by:
isPluginActive in interface MossPlugin
Returns:

getDescription

public java.lang.String getDescription()
Not used in PreferencePlugin

Specified by:
getDescription in interface MossPlugin
Returns:

getMaximumVersion

public Version getMaximumVersion()
Description copied from interface: MossPlugin
Returns the maximum program version needed to run this plugin. If this is null, there is no limitation on the program (not recommended unless you can guarantee that the plugin uses no API calls within the program).

Specified by:
getMaximumVersion in interface MossPlugin
Returns:
The Version object containing the maximum version number.

getMinimumVersion

public Version getMinimumVersion()
Description copied from interface: MossPlugin
Returns the minimum program version needed to run this plugin. If this is null, there is no limitation on the program (not recommended unless you can guarantee that the plugin uses no API calls within the program).

Specified by:
getMinimumVersion in interface MossPlugin
Returns:
The Version object containing the minimum version number.