This plugin type allows the developer to make customization of the editor menus, toolbars, and some other components by allowing or filtering them from the user interface.
Components Validation Plugin
Components Validation Plugin
This plugin type allows the developer to make
customization of the editor menus, toolbars, and some 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 a
ro.sync.exml.ComponentsValidator implementation class used for
validating the menus, toolbars, and their actions.
The interface ComponentsValidator provides methods to filter various
features from being added to the application GUI:
validateMenuOrTaggedAction(String[] menuOrActionPath) - Checks if a
menu or a tag action from a menu is allowed and returns a boolean
value. A tag is used to uniquely identifying an action. The String[]
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. The
String[] 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 a boolean value. The String
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 a
boolean 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 a boolean value. The
String argument represents the content type. You can instruct the
application to ignore content types like text / xsl or text / xquery and
the application will no longer be able to recognize them.
validateOptionPane(String optionPaneKey) - Checks if the given
options page can be added in the preferences option tree and returns a
boolean value. The String argument is the option
pane key.
validateOption(String optionKey) - Checks if the given option can
be added in the option page and returns a boolean value. The
String 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 and returns a
boolean value. The String 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 a boolean
value. The EditorTemplate argument is the editor template. An
EditorTemplate is used to create an editor for a given extension.
You can thus filter what appears in the New dialog list.
isDebuggerperspectiveAllowed() - Check if the debugger perspective
is allowed and returns a boolean value.
validateSHMarker(String marker) - Checks if the given marker is
allowed and returns a boolean value. The String
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.
Tip: The best way to decide what to filter is to observe the values the application
passes when these callbacks are called. You have to create an implementation for this
interface which lists in the console all values received by each function. Then you can decide
on the values to filter and act accordingly.