JAPI 0.9.0
Yet another Java API
API Documentation

net.sf.japi.swing.prefs
Interface Prefs

All Known Implementing Classes:
AbstractPrefs, KeyStrokePrefs, ProxyPrefs

public interface Prefs

Interface that is to be implemented by classes that provide preferences.

Often, implementations of this interface will subclass JComponent or JPanel. In that case getEditComponent() will return this. AbstractPrefs provides a useful basic implementation of this interface.

Author:
Christian Hujer

Method Summary
 void apply()
          Apply the changes in the UI to get into effect / be stored.
 void defaults()
          Revert the preferences to the default values.
 JComponent getEditComponent()
          Provide a component for editing the prefs.
 String getHelpText()
          Provide help (HTML).
 URL getHelpURL()
          Provide help.
 String getLabelText()
          Provide text to be displayed as title for this prefs module.
 Icon getListLabelIcon()
          Provide an icon to be displayed in the list where the user can choose amongst preferences.
 String getListLabelText()
          Provide a label to be displayed in the list where the user can choose amongst preferences.
 boolean isChanged()
          Check whether there are unsaved changes.
 void revert()
          Revert the preferences to the previously stored settings.
 

Method Detail

apply

void apply()
Apply the changes in the UI to get into effect / be stored.


defaults

void defaults()
Revert the preferences to the default values.


getEditComponent

JComponent getEditComponent()
Provide a component for editing the prefs. The edit component MUST NOT automatically change preferences itself. Preferences MUST only changed when the method apply() is invoked.

Returns:
component for editing the prefs

getHelpText

String getHelpText()
Provide help (HTML). This method will only be queried if getHelpURL() returns null. This method may return null as well, which means that this prefs does not provide any help.

Returns:
help text (HTML) or null

getHelpURL

URL getHelpURL()
Provide help. This method may return null in which case the method getHelpText() will be queried instead.

Returns:
help url or null

getLabelText

String getLabelText()
Provide text to be displayed as title for this prefs module.

Returns:
title of this prefs module

getListLabelIcon

Icon getListLabelIcon()
Provide an icon to be displayed in the list where the user can choose amongst preferences.

Returns:
icon to be displayed in the list or null if no icon is available

getListLabelText

String getListLabelText()
Provide a label to be displayed in the list where the user can choose amongst preferences.

Returns:
text to be displayed in the list

isChanged

boolean isChanged()
Check whether there are unsaved changes.

Returns:
true if there are unsaved changes, otherwise false

revert

void revert()
Revert the preferences to the previously stored settings.


JAPI
Yet another Java API
API Documentation

© 2005-2006 Christian Hujer. All rights reserved. See copyright