Components Validation Plugin Extension
This plugin type allows the developer to customize the editor menus, toolbars, and
other components by allowing or filtering them from the user interface.
This plugin provides the following API:
- The interface
ComponentsValidatorPluginExtension
- There is one method that must be implemented:getComponentsValidator()
- Returns aro.sync.exml.ComponentsValidator
implementation class used for validating the menus, toolbars, and their actions.
- The
ComponentsValidator
interface provides methods to filter various features from being added to the GUI of Oxygen XML Editor plugin:validateMenuOrTaggedAction(String[] menuOrActionPath)
- Checks if a menu or a tag action from a menu is allowed and returns aboolean
value. A tag is used to uniquely identifying an action. TheString[]
argument is the tag of the menu / action and the tags of its parent menus if any.validateToolbarTaggedAction(String[] toolbarOrAction)
- Checks if an action from a toolbar is allowed and returns a boolean value. TheString[]
argument is the tag of the action from a toolbar and the tag of its parent toolbar if any.validateComponent(String key)
- Checks if the given component is allowed and returns aboolean
value. TheString
argument is the tag identifying the component. You can remove toolbars entirely using this callback.validateAccelAction(String category, String tag)
- Checks if the given accelerator action is allowed to appear in the GUI and returns aboolean
value. An accelerator action can be uniquely identified so it will be removed both from toolbars or menus. The first argument represents the action category, the second is the tag of the action.validateContentType(String contentType)
- Checks if the given content type is allowed and returns aboolean
value. TheString
argument represents the content type. You can instruct Oxygen XML Editor plugin to ignore content types such astext / xsl
ortext / xquery
.validateOptionPane(String optionPaneKey)
- Checks if the given options page can be added in the preferences option tree and returns aboolean
value. TheString
argument is the option pane key.validateOption(String optionKey)
- Checks if the given option can be added in the option page and returns aboolean
value. TheString
argument is the option key. This method is mostly used for internal use and it is not called for each option in a preferences page.validateLibrary(String library)
- Checks if the given library is allowed to appear listed in the About dialog box and returns aboolean
value. TheString
argument is the library. This method is mostly for internal use.validateNewEditorTemplate(EditorTemplate editorTemplate)
- Checks if the given template for a new editor is allowed and returns aboolean
value. TheEditorTemplate
argument is the editor template. AnEditorTemplate
is used to create an editor for a given extension. You can thus filter what appears in the list of the New dialog box.isDebuggerperspectiveAllowed()
- Check if the debugger perspective is allowed and returns aboolean
value.validateSHMarker(String marker)
- Checks if the given marker is allowed and returns aboolean
value. TheString
argument represents the syntax highlight marker to be checked. If you decide to filter certain content types, you can also filter the syntax highlight options so that the content type is no longer present in the Preferences options tree.validateToolbarComposite(String toolbarCompositeTag)
- Checks if the toolbar composite is available. A toolbar composite is a toolbar component such as a drop-down menu.
Tip
The best way to decide what to filter is to observe the values that Oxygen XML Editor plugin passes when
these callbacks are called. You have to create an implementation for this interface
that
lists in the console all values received by each function. Then you can decide on
the values
to filter and act accordingly.