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:
- SelectionPluginExtension interface
- 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 aSelectionPluginResult
object that contains the result of the processing. The String value returned by theSelectionPluginResult
object can include editor variables such as ${caret} and ${selection}. - SelectionPluginContext object
- Represents the context and provides four methods:
getSelection()
- Returns aString
that is the current selection of text.getFrame()
- Returns aFrame
that is the editing frame.getPluginWorkspace()
- Returns access to the workspace of Oxygen XML.getDocumentURL()
- Returns the URL of the currently edited document.