Selection Plugin Extension
This type of plugin allows you to manage selections of text.
A selection plugin can be applied to both XML and non-XML documents. The plugin is started by making a selection in the editor, then selecting the corresponding menu item from the Plugins submenu in the contextual menu of Text mode.
This plugin type provides the following API:
- The interface SelectionPluginExtension - The context containing the selected text is passed to the extension and the processed result is going to replace the initial selection. The process(GeneralPluginContext) method must return a SelectionPluginResult object that contains the result of the processing. The String value returned by the SelectionPluginResult object can include editor variables such as ${caret} and ${selection}.
- The SelectionPluginContext object represents the context. It
provides four methods:
- getSelection() - Returns a
Stringthat is the current selection of text. - getFrame() - Returns a
Framethat is the editing frame. - getPluginWorkspace() - Returns access to the workspace of Oxygen XML Developer.
- getDocumentURL() - Returns the URL of the current edited document.
- getSelection() - Returns a