Custom Protocol Plugin Extension
This type of plugin allows the developer to work with a custom designed protocol for retrieving and storing files.
It provides the following API:
- The interface URLStreamHandlerPluginExtension - There is one method
that must be implemented:
- getURLStreamHandler(String protocol) - It takes as an argument the
name of the protocol and returns a
URLStreamHandlerobject, or null if there is no URL handler for the specified protocol.
- getURLStreamHandler(String protocol) - It takes as an argument the
name of the protocol and returns a
This type of plugin extension can be usually combined with a Workspace Access Plugin Extension that 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
Stringobject that is the name of the entry added in the File menu.
- chooseURLs(StandalonePluginWorkspace workspaceAccess) - Returns a
- With the help of the URLChooserToolbarExtension interface, it is
possible to provide a toolbar entry that is used for launching the custom URLs chooser from
the URLChooserPluginExtension implementation. This interface provides two
methods:
- getToolbarIcon() - Returns the
javax.swing.Iconimage used on the toolbar. - getToolbarTooltip() - Returns a
Stringthat is the tooltip used on the toolbar button.
- getToolbarIcon() - Returns the