A
selection plugin can be applied to both an XML document and a non-XML document. It works as
follows: the user makes a selection in the editor, displays the contextual menu, and selects
from the Plugins submenu the item corresponding to the
plugin.
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 which contains
the result of the processing. The String value returned by the
SelectionPluginResult object can include editor variables
like ${caret} and ${selection}.
- The SelectionPluginContext object represents the context. It
provides four methods:
- getSelection() - Returns a String that
is the current selection of text.
- getFrame() - Returns a Frame that is the
currently editing frame.
- getPluginWorkspace() - Returns access to the application
workspace.
- getDocumentURL() - Returns the URL of the current edited
document.