Changing plug-in settings individually

In addition to its installation each plug-in can be configured individually per user. With class PluginManagerDialog all loaded plug-ins are displayed and can be configured. PluginManagerDialog is shown with the help of class ManagePluginsAction which is registered with respective menu item of SimplyHTML's plug-in menu.

ManagePluginDialog is the GUI representation of plug-in manipulation methods actually provided by class AbstractPlugin. It uses the methods each plug-in class has to provide through implementing interface SHTMLPlugin to display and change settings such as whether or not the plug-in is active or where it shall dock. Class AbstractPlugin provides an implementation of interface SHTMLPlugin which persistently stores the settings made in MangagePluginDialog automatically. To do so, an additional class Prefs is used, which is introduced in this stage 5 of SimplyHTML (see below).

Class Prefs

Class Prefs provides a simple approach to store user settings persistently. It maintains a Hastable of key/value pairs through a set of getter/setter methods. Whenever the Hashtable is changed, it is serialized to a file. Upon construction of class Prefs the serialized Hashtable is read from disk. If none is found a new and empty one is created. The preferences file created by class Prefs is named SimplyHTML.prf and is stored in the directory pointed to by expression System.getProperty("user.home") which usually references the home directory of the user currently logged in.

By using the home directory of the user preferences can be stored individually per user.