org.jivesoftware.spark.preference
Interface Preference

All Known Implementing Classes:
ChatPreference, FileTransferPreference, LocalPreference, NotificationsPreference, SoundPreference

public interface Preference

The Preference class allows plugin developers to add their own preferences to the Spark client.


Method Summary
 void commit()
          Called whenever the preference should be saved.
 java.lang.Object getData()
          Returns the data model representing this preference.
 java.lang.String getErrorMessage()
          The error message to display if #isDataDisplayed returns false.
 javax.swing.JComponent getGUI()
          Return the UI to display whenever this preference is selected in the preference dialog.
 javax.swing.Icon getIcon()
          Return the icon to use inside the Preferences list.
 java.lang.String getListName()
          Return the title to use inside the Preferences list.
 java.lang.String getNamespace()
          Returns the associated namespace of this preference.
 java.lang.String getTitle()
          Return the title to use in the preference window.
 java.lang.String getTooltip()
          Return the tooltip to use for this preference.
 boolean isDataValid()
          Return true if the data supplied is valid, otherwise return false.
 void load()
          Called whenever the preference is invoked from the Preference list.
 void shutdown()
          Called when Spark is closing.
 

Method Detail

getTitle

java.lang.String getTitle()
Return the title to use in the preference window.

Returns:
the title to use inside the preferences list.

getIcon

javax.swing.Icon getIcon()
Return the icon to use inside the Preferences list. The standard icon size for preferences is 24x24.

Returns:
the icon to use inside the Preferences list.

getTooltip

java.lang.String getTooltip()
Return the tooltip to use for this preference. The tooltip is displayed whenever a user places their mouse cursor over the icon.

Returns:
the tooltip to display.

getListName

java.lang.String getListName()
Return the title to use inside the Preferences list. The title is displayed below and centered of the icon.

Returns:
the title to use inside the preferences list.

getNamespace

java.lang.String getNamespace()
Returns the associated namespace of this preference.

Returns:
the associated namespace of this preference.

getGUI

javax.swing.JComponent getGUI()
Return the UI to display whenever this preference is selected in the preference dialog.

Returns:
the UI to display when this preference is selected.

load

void load()
Called whenever the preference is invoked from the Preference list.


commit

void commit()
Called whenever the preference should be saved.


isDataValid

boolean isDataValid()
Return true if the data supplied is valid, otherwise return false.

Returns:
true if the data supplied is valid.

getErrorMessage

java.lang.String getErrorMessage()
The error message to display if #isDataDisplayed returns false.

Returns:
the error message to display.

getData

java.lang.Object getData()
Returns the data model representing this preference.

Returns:
the data model representing this preference.

shutdown

void shutdown()
Called when Spark is closing. This should be used to persist any information at that time.