Package ro.sync.exml.plugin.option
Class OptionPagePluginExtension
java.lang.Object
ro.sync.exml.plugin.option.OptionPagePluginExtension
- All Implemented Interfaces:
PluginExtension
@API(type=EXTENDABLE,
src=PUBLIC)
public abstract class OptionPagePluginExtension
extends Object
implements PluginExtension
Class used to create plugin option page extension. It receives callbacks for
saving options, restoring default options and loading options.
The GUI for this option page must be built in order to associated the options
with their corresponding GUI components.
- Since:
- 15
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
apply
(PluginWorkspace pluginWorkspace) This method is called when "Apply" or "OK" button are pressed in from the GUI option page.Get the help URL for this page.getKey()
Retrieves the option page key.String[]
The options that will be saved inside the project file when this page is switched to project level inside the preferences dialog.abstract String
getTitle()
Retrieves the option page title.abstract JComponent
init
(PluginWorkspace pluginWorkspace) Initializes the GUI for the option page and loads the stored option values.
This method may be called multiple times on the same "OptionPagePluginExtension" implementation.
For example it's called when the end user cancels the "Preferences" dialog and you need to reload your custom UI settings from the options storage.
So you could for example create the custom Swing component only when the first "init" is called and on subsequent calls return the already created component.
But on each "init" callback you always need to reload your page's GUI settings (e.g.abstract void
This method is called when "Restore defaults" button is pressed from the GUI option page.
-
Constructor Details
-
OptionPagePluginExtension
public OptionPagePluginExtension()
-
-
Method Details
-
apply
This method is called when "Apply" or "OK" button are pressed in from the GUI option page. All options associated with the option page must be saved on this method.- Parameters:
pluginWorkspace
- Access the entire workspace of Oxygen. It can be used to retrieve theOptionsStorage
and perform options save operations on it.
-
restoreDefaults
public abstract void restoreDefaults()This method is called when "Restore defaults" button is pressed from the GUI option page. All options associated with the option page must be restored to their default values. -
getTitle
Retrieves the option page title.- Returns:
- The option page title used in GUI.
-
getKey
Retrieves the option page key. Can be overridden in order to pass the returned value toGlobalOptionsStorage.showPreferencesPages(String[], String, boolean)
, which is used for displaying the preferences dialog with certain pages in the table of contents.- Returns:
- The option page key.
- Since:
- 17.1
-
init
Initializes the GUI for the option page and loads the stored option values.
This method may be called multiple times on the same "OptionPagePluginExtension" implementation.
For example it's called when the end user cancels the "Preferences" dialog and you need to reload your custom UI settings from the options storage.
So you could for example create the custom Swing component only when the first "init" is called and on subsequent calls return the already created component.
But on each "init" callback you always need to reload your page's GUI settings (e.g. checkboxes) from the option stored in the options storage. (ro.sync.exml.workspace.api.PluginWorkspace.getOptionsStorage()).
If certain settings can also be changed in other parts of the code, on the first "init" callback you can add an options storage listener (ro.sync.exml.workspace.api.options.WSOptionsStorage.addOptionListener(WSOptionListener)) and update your UI's settings
when the stored keys are changed in other parts of the code.- Parameters:
pluginWorkspace
- Access the entire workspace of Oxygen. It can be used to retrieve theOptionsStorage
and perform options save/load operations it.- Returns:
- The GUI component of the option page.
-
getProjectLevelOptionKeys
The options that will be saved inside the project file when this page is switched to project level inside the preferences dialog.- Returns:
- The options presented in this page.
- Since:
- 24.0
-
getHelpPageURL
Get the help URL for this page. Use null if no help page is available for the dialog (no help is shown).- Returns:
- the help URL for this page. If not needed please return null.
- Since:
- 27.1
**************************************
EXPERIMENTAL - Subject to change
**************************************
Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.
-