Edit online

Option Page Plugin Extension

This type of plugin extension allows you to add custom Preferences pages.

The extension must implement the ro.sync.exml.plugin.option.OptionPagePluginExtension class. The provided callbacks allows you to create a custom Swing component that will be added to the page and to react to various calls to persistently save the page settings using the OptionsStorage API.

All preferences pages that are contributed by a plugin are listed in the Preferences dialog box in the Plugins category. As long as the added preferences page has the same name as its plugin, it will be promoted to the first level of the hierarchy within the Plugins category.

The plugin.xml configuration file can specify one or more such extensions using constructs like this:
<extension type="OptionPage" class="my.pack.CustomOptionPagePluginExtension"/>

Sharing Options Through Project Files

To share options that are configured in certain plugin preferences pages, you can store them in a project file (.xpr file extension) that can easily be shared with others. To do this, perform these steps:
  1. Override ro.sync.exml.plugin.option.OptionPagePluginExtension.getProjectLevelOptionKeys() and return a set of options that need to be saved inside the project.
  2. Install the plugin in an Oxygen XML Editor instance.
  3. In the Project view, create a project or open an existing one.
  4. Open the Preferences dialog box (Options > Preferences).
  5. Configure the options in each preferences page that you want to be included in the project file and switch the storage preference to Project Options in each page.
    Note: Some pages do not have the Project Options button, since the options they host might contain sensitive data (such as passwords, for example) that is unsuitable for sharing with other users.
  6. Click OK and close the Preferences dialog box.

    All explicitly set values are now saved in the project file. You can then share the project file so that your team will have the same option configuration that you stored in the project file.
    Note: The project file extension (.xpr) must be preserved when the file is distributed to others.
    Notice: When a project is opened for the first time, a confirmation dialog box will be displayed that asks you to confirm that the project came from a trusted source. This is meant to help prevent potential security issues.