org.jSyncManager.Client

Class AbstractSettingsPanel

Implemented Interfaces:
ActionListener
Known Direct Subclasses:
ConnectionPanel, jConduitsPanel

public abstract class AbstractSettingsPanel
extends JPanel
implements ActionListener

The Abstract Settings Panel. This class is the abstract parent of all settings panels.

Field Summary

protected JEditorPane
pluginDescription
An editor pane to hold the plug-ins description.
protected JComponent
pluginDescriptionComponent
A handle to the plug-in descriptions component.
protected JPanel
pluginSelectionPanel
The plug-in selection panel.
protected HashMap
pluginSettingsHashMap
A hash map for storing plug-in settings.
protected JPanel
pluginSettingsPanel
The plug-in settings panel.
protected RegistrationData
preferences
A handle to the application preferences object.
protected Object
previousSelectedPlugin
A handle to the previously selected plug-in.

Constructor Summary

AbstractSettingsPanel(RegistrationData preferences)
Creates a new Abstract Settings Panel.

Method Summary

void
actionPerformed(ActionEvent e)
A method to process action events.
protected abstract void
addPluginSettings(PluginSettings settings)
Add the specified plug-in settings object to this panel.
protected JComponent
buildPluginDescriptionComponent()
Creates a JEditorPane to hold
protected abstract JPanel
buildPluginSelectionPanel()
Builds the plug-in selection panel.
protected JPanel
buildPluginSettingsPanel()
Build a JPanel to hold information about an installed plugin.
Dimension
getPreferredSize()
This is overriden so that the preferred size is the largest preferred size of any PluginSettings objects that have been added.
protected abstract Object
getSelectedPlugin()
Retreives a handle to the selected plug-in.
abstract void
handleActionEvent(ActionEvent e)
An abstract method to allow sub-classes to process action events.
void
showSelectedPluginSettings(Object pluginName)
Once a plugin has been selected, show the settings for it.

Field Details

pluginDescription

protected JEditorPane pluginDescription
An editor pane to hold the plug-ins description.

pluginDescriptionComponent

protected JComponent pluginDescriptionComponent
A handle to the plug-in descriptions component.

pluginSelectionPanel

protected JPanel pluginSelectionPanel
The plug-in selection panel.

pluginSettingsHashMap

protected HashMap pluginSettingsHashMap
A hash map for storing plug-in settings.

pluginSettingsPanel

protected JPanel pluginSettingsPanel
The plug-in settings panel.

preferences

protected RegistrationData preferences
A handle to the application preferences object.

previousSelectedPlugin

protected Object previousSelectedPlugin
A handle to the previously selected plug-in.

Constructor Details

AbstractSettingsPanel

public AbstractSettingsPanel(RegistrationData preferences)
Creates a new Abstract Settings Panel.
Parameters:
preferences - a handle to the active application settings object.

Method Details

actionPerformed

public final void actionPerformed(ActionEvent e)
A method to process action events.
Parameters:
e - the Action Event that triggered this method.

addPluginSettings

protected abstract void addPluginSettings(PluginSettings settings)
Add the specified plug-in settings object to this panel.
Parameters:
settings - the PluginSettings object to add to this panel.

buildPluginDescriptionComponent

protected JComponent buildPluginDescriptionComponent()
Creates a JEditorPane to hold
Returns:
the created component containing the description.

buildPluginSelectionPanel

protected abstract JPanel buildPluginSelectionPanel()
Builds the plug-in selection panel.
Returns:
the constructed plug-in selection panel.

buildPluginSettingsPanel

protected JPanel buildPluginSettingsPanel()
Build a JPanel to hold information about an installed plugin.
Returns:
the constructed JPanel object.

getPreferredSize

public Dimension getPreferredSize()
This is overriden so that the preferred size is the largest preferred size of any PluginSettings objects that have been added. This ensures that the JPanel is large enough to accomodate all plugins without resizing.
Returns:
the preferred size for this component as a Dimension object.

getSelectedPlugin

protected abstract Object getSelectedPlugin()
Retreives a handle to the selected plug-in.
Returns:
a handle to the selected plug-in.

handleActionEvent

public abstract void handleActionEvent(ActionEvent e)
An abstract method to allow sub-classes to process action events. As this parent class needs to process certain events, sub-classes that also need to handle their own events should implement this method instead of actionPerformed. After this class procosses the event, it will be passed onto the subclass through this method.
Parameters:
e - the Action Event that needs to be processed.

showSelectedPluginSettings

public void showSelectedPluginSettings(Object pluginName)
Once a plugin has been selected, show the settings for it.
Parameters:
pluginName - the plug-in to display.