ides.api.core
Interface OptionsPane


public interface OptionsPane

The interface for modules that will appear in the Options dialog box. The OptionsWindow lets the user select from a list of sections, where each section displays a different set of controls that let the user modify the appplication settings. Each application module or plugin can register its own section by calling Hub.registerOptionsPane(OptionsPane) and providing an OptionsPane as an argument. The set of controls for the module or plugin have to appear in the JPanel that is returned by the getPane() method.

The protocol for calls to the methods in the interface is as follows:

In other words, the JPanel with the options controls should only exist in between a call to getPane() and the first disposePane() that follows it; and only during this time should calls to resetOptions() and commitOptions() be acknowledged.

Author:
Lenko Grigorov
See Also:
OptionsWindow, Hub.registerOptionsPane(OptionsPane), getTitle(), getPane(), disposePane(), resetOptions(), commitOptions()

Method Summary
 void commitOptions()
          Commit all settings from the controls in the JPanel.
 void disposePane()
          Called when it is safe to dispose of the JPanel with the settings controls.
 javax.swing.JPanel getPane()
          Returns the JPanel which contains the options controls for this OptionsPane.
 java.lang.String getTitle()
          Returns the string which will appear in the list of sections in the Optins dialog box.
 void resetOptions()
          Reset all settings of the controls in the JPanel.
 

Method Detail

getTitle

java.lang.String getTitle()
Returns the string which will appear in the list of sections in the Optins dialog box. The user will identify the options controls in this OptionsPane with this string.

Returns:
the title of the section containing this options pane
See Also:
OptionsWindow

getPane

javax.swing.JPanel getPane()
Returns the JPanel which contains the options controls for this OptionsPane. This JPanel will be displayed in the Options dialog box when the user selects the section for this options pane.

This method may be called numerous times during one session. Do not construct a new JPanel for each call unless disposePane() has been called. If disposePane() has not been called, simply pass a reference to the same object.

Returns:
the JPanel with the options controls.
See Also:
OptionsWindow, disposePane()

resetOptions

void resetOptions()
Reset all settings of the controls in the JPanel. This method will usually be invoked when the user chooses to cancel any choices they have made. The module or plugin must not change behavor.

This method may be called a number between calls to getPane(). You must not dispose of the OptionsPane after a call to this method.

Ignore if called before a call to getPane().

See Also:
getPane(), disposePane(), OptionsWindow

commitOptions

void commitOptions()
Commit all settings from the controls in the JPanel. This method will usually be invoked when the user chooses to accept any choices thay have made. The module or plugin must change behavior according to the new settings.

This method may be called a number between calls to getPane(). You must not dispose of the OptionsPane after a call to this method.

Ignore if called before a call to getPane().

See Also:
getPane(), disposePane(), OptionsWindow

disposePane

void disposePane()
Called when it is safe to dispose of the JPanel with the settings controls.

Ignore if called before a call to getPane().

See Also:
getPane(), OptionsWindow