ComponentsValidatorPluginExtension
allow developers to make
customization of the Editor's menus, toolbars and some other components by allowing or
filtering them from the user interface. There is one method that has to be implemented:
getComponentsValidator()
- returns a
ro.sync.exml.ComponentsValidator implementation class
use for validate the menus, toolbars and their actions.
The ComponentsValidator
provides methods to filter various
features from being added to the application GUI:
validateMenuOrTaggedAction(String[] menuOrActionPath)
-
boolean - check if an menu or a tag action from an menu
is allowed. 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)
-
boolean - check if an action from a toolbar is allowed. The
String[] argument is the tag of the action from a toolbar and the tag
of its parent toolbar if any.
validateComponent(String key)
-
boolean - check if the given component is allowed. The
String argument is the tag identifying the component. You can remove
toolbars entirely using this callback.
validateAccelAction(String category, String tag)
-
boolean - check if the given accelerator action is
allowed to appear in the GUI. An accelerator action can be uniquely identified so it
will be removed both from toolbars or menus. The first argument represent the action
category, the second is the tag of the action.
validateContentType(String contentType)
-
boolean - check if the given content type is allowed.
The String argument represent the content type. You can instruct the
application to ignore content types like or "text/xsl" or "text/xquery" and the
application will no longer be able to recognize them.
validateOptionPane(String optionPaneKey)
-
boolean - check if the given options page can be add in
the application Preferences option tree. The String argument is the
option pane key.
validateOption(String optionKey)
-
boolean - check if the given option can be add in the
option page. The String argument is the option key. This method is
mostly used for internal used and will not get called for each option in a
preferences page.
validateLibrary(String library)
-
boolean - check if the given library is allowed to
appear listed in the About dialog. The String argument is the library.
This method is mostly for internal use.
validateNewEditorTemplate(EditorTemplate
editorTemplate)
- boolean - check if the
given template for a new editor is allowed. The EditorTemplate argument
is the editor template. An EditorTemplate is used to create a new
editor for a given extension. You can thus filter what appears in the "New"->From
Templates dialog list.
isDebuggerperspectiveAllowed()
-
boolean - check if the debugger perspective is
allowed.
validateSHMarker(String marker)
-
boolean - check if the given marker is allowed. The
String argument represent 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 that 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 need 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. |