Download "user manual"

Transcript
Oxygen XML Editor | Extending Oxygen XML Editor Using the SDK | 982
This type of plugin extension can be usually combined with a Workspace Access Plugin Extension on page 978 which
can add a custom toolbar with custom actions for opening documents from a certain source.
As an alternative, two older plugin extensions can also be used to add a toolbar action for showing a custom URL
chooser:
•
With the help of the URLChooserPluginExtension2 interface, it is possible to create your own dialog box
that works with the custom protocol. This interface provides two methods:
•
•
•
chooseURLs(StandalonePluginWorkspace workspaceAccess) - Returns a URL[] object that
contains the URLs the user decided to open with the custom protocol. You can invoke your own URL chooser
dialog box here and then return the chosen URLs having your own custom protocol. You have access to the
workspace of Oxygen XML Editor.
getMenuName() - Returns a String object that is the name of the entry added in the File menu.
With the help of the URLChooserToolbarExtension interface, it is possible to provide a toolbar entry which
is used for launching the custom URLs chooser from the URLChooserPluginExtension implementation. This
interface provides two methods:
•
•
getToolbarIcon() - Returns the javax.swing.Icon image used on the toolbar.
getToolbarTooltip() - Returns a String that is the tooltip used on the toolbar button.
Resource Locking Custom Protocol Plugin Extension
This plugin type allows the developer to work with a custom designed protocol for retrieving and storing files. It can
lock a resource on opening it in Oxygen XML Editor. This type of plugin extends the custom protocol plugin type with
resource locking support.
Such a plugin provides the following API:
•
The interface URLStreamHandlerWithLockPluginExtension - The plugin receives callbacks following
the simple protocol for resource locking and unlocking imposed by Oxygen XML Editor.
There are two additional methods that must be implemented:
•
•
getLockHandler() - Returns a LockHandler implementation class with the implementation of the lock
specific methods from the plugin.
isLockingSupported(String protocol) - Returns a boolean that is true if the plugin accepts to
manage locking for a certain URL protocol scheme like ftp, http, https, or customName.
XML Refactoring Operations Plugin Extension
This plugin type allows the developer to specify one or more directories from which the XML Refactoring operation
resources are loaded.
The RefactoringOperationsProvider extension can be used to specify the location where custom XML
Refactoring operation resources (XQuery Update script or XSLT stylesheet and Operation Descriptor files) are stored.
Oxygen XML Editor will scan the specified locations to load the custom operations when the XML Refactoring tool is
opened, and allows you to share your custom refactoring operations.
Sample XML Refactoring Operations Plugin Extension
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plugin PUBLIC "-//Oxygen Plugin" "../plugin.dtd">
<plugin
id="refactoring.operations"
name="Refactoring operations plugin"
description="Contains operation descriptors and related scripts"
version="1.0">
<extension type="RefactoringOperationsProvider">
<folder path="customDir/"/>
<folder path="customDir2"/>
</extension>
</plugin>