net.sourceforge.jsxe
Class ActionPlugin

java.lang.Object
  extended bynet.sourceforge.jsxe.ActionPlugin
All Implemented Interfaces:
EBListener
Direct Known Subclasses:
ActionPlugin.Broken, ViewPlugin

public abstract class ActionPlugin
extends Object
implements EBListener

This defines the general interface that all plugins for jsXe must implement. There are two types of plugins, ViewPlugins and ActionPlugins. ViewPlugins specify a view that can be used to edit XML documents. ActionPlugins add actions to jsXe allowing it to do extra tasks such as XSLT transformation.

Since:
jsXe 0.3 beta
Version:
$Id: ActionPlugin.java 966 2006-06-20 19:29:38Z ian_lewis $
Author:
Ian Lewis (IanLewis@member.fsf.org)

Nested Class Summary
static class ActionPlugin.Broken
           
 
Constructor Summary
ActionPlugin()
          Constructs an ActionPlugin with the supplied values.
 
Method Summary
protected  void addAction(LocalizedAction action)
          Allows subclasses to add actions to the ActionSet for the plugin.
 ActionSet getActionSet()
          Gets the ActionSet for this plugin.
 OptionPane getOptionPane(DocumentBuffer buffer)
          Gets the option pane for setting general plugin options.
 JMenu getPluginMenu()
          Returns the menu that appears in the tools menu in jsXe.
 Properties getProperties()
          The properties to add to jsXe when the plugin is loaded.
 void handleMessage(EBMessage message)
          Handles a message sent on the EditBus.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionPlugin

public ActionPlugin()
Constructs an ActionPlugin with the supplied values.

Method Detail

getPluginMenu

public JMenu getPluginMenu()
Returns the menu that appears in the tools menu in jsXe. This can include menu items for actions that are included with the plugin. The default implementation returns null.

Returns:
the menu for this plugin.

getOptionPane

public OptionPane getOptionPane(DocumentBuffer buffer)
Gets the option pane for setting general plugin options. The default implementation returns null.

Returns:
an OptionPane for editing this plugin's options

getProperties

public Properties getProperties()
The properties to add to jsXe when the plugin is loaded. The default iplementation returns an empty properties set.

Returns:
the plugin's properties

addAction

protected void addAction(LocalizedAction action)
Allows subclasses to add actions to the ActionSet for the plugin. Normally this would be done during initialization of the plugin.

Parameters:
action - the action itself

getActionSet

public ActionSet getActionSet()
Gets the ActionSet for this plugin. These actions can be executed through menus and such.

Returns:
the ActionSet containing actions added by this plugin.

handleMessage

public void handleMessage(EBMessage message)
Description copied from interface: EBListener
Handles a message sent on the EditBus. This method must specify the type of responses the plugin will have for various subclasses of the EBMessage class. Typically this is done with one or more if blocks that test whether the message is an instance of a derived message class in which the component has an interest. For example:
 if(msg instanceof BufferUpdate) {
     // a buffer's state has changed!
 }
 else if(msg instanceof ViewUpdate) {
     // a view's state has changed!
 }
 // ... and so on

Specified by:
handleMessage in interface EBListener
Parameters:
message - The message