org.fife.rtext.plugins.tools
Class ToolPlugin

java.lang.Object
  extended by org.fife.ui.app.AbstractPlugin
      extended by org.fife.ui.app.GUIPlugin
          extended by org.fife.rtext.plugins.tools.ToolPlugin
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener, GUIApplicationConstants, Plugin, DockableWindowConstants

public class ToolPlugin
extends GUIPlugin
implements java.beans.PropertyChangeListener

A plugin that adds tool support to RText.

Version:
1.0
Author:
Robert Futrell

Field Summary
protected static java.util.ResourceBundle msg
           
 
Fields inherited from interface org.fife.ui.app.GUIApplicationConstants
OS_LINUX, OS_MAC_OSX, OS_OTHER, OS_WINDOWS
 
Fields inherited from interface org.fife.ui.dockablewindows.DockableWindowConstants
BOTTOM, FLOATING, LEFT, RIGHT, TOP
 
Constructor Summary
ToolPlugin(AbstractPluggableGUIApplication app)
          Constructor.
 
Method Summary
 Tool getActiveTool()
          Returns the currently running tool, if any.
 ToolDockableWindow getDockableWindow()
          Returns the dockable window for the tool plugin.
 PluginOptionsDialogPanel getOptionsDialogPanel()
          Returns an options panel for use in an Options dialog.
 java.lang.String getPluginAuthor()
          Returns the author of the plugin.
 javax.swing.Icon getPluginIcon()
          Returns the icon to display beside the name of this plugin in the application's interface.
 java.lang.String getPluginName()
          Returns the name of the plugin.
 java.lang.String getPluginVersion()
          Returns the version of the plugin.
 java.io.File getToolDir()
          Returns the directory that tool definitions are saved to.
 void install(AbstractPluggableGUIApplication app)
          Called just after a plugin is added to a GUI application.
 void propertyChange(java.beans.PropertyChangeEvent e)
          
 void savePreferences()
          Called when the GUI application is shutting down.
 boolean uninstall()
          Called just before this Plugin is removed from an GUIApplication.
 
Methods inherited from class org.fife.ui.app.GUIPlugin
dockableWindowIterator, getDockableWindow, lookAndFeelChanged, putDockableWindow
 
Methods inherited from class org.fife.ui.app.AbstractPlugin
getOptionsDialogPanelParentPanelID, setOptionsDialogPanelParentPanelID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

msg

protected static final java.util.ResourceBundle msg
Constructor Detail

ToolPlugin

public ToolPlugin(AbstractPluggableGUIApplication app)
Constructor.

Parameters:
app - The parent RText application.
Method Detail

getActiveTool

public Tool getActiveTool()
Returns the currently running tool, if any. This method should only be called on the EDT.

Returns:
The currently running tool, or null if a tool isn't running.

getDockableWindow

public ToolDockableWindow getDockableWindow()
Returns the dockable window for the tool plugin.

Returns:
The dockable window.

getOptionsDialogPanel

public PluginOptionsDialogPanel getOptionsDialogPanel()
Returns an options panel for use in an Options dialog. This panel should contain all options pertaining to this plugin.

Specified by:
getOptionsDialogPanel in interface Plugin
Returns:
The options panel.

getPluginAuthor

public java.lang.String getPluginAuthor()
Returns the author of the plugin.

Specified by:
getPluginAuthor in interface Plugin
Returns:
The author.

getPluginIcon

public javax.swing.Icon getPluginIcon()
Returns the icon to display beside the name of this plugin in the application's interface.

Specified by:
getPluginIcon in interface Plugin
Returns:
The icon for this plugin. This value may be null to represent no icon.

getPluginName

public java.lang.String getPluginName()
Returns the name of the plugin.

Specified by:
getPluginName in interface Plugin
Returns:
The plugin name.

getPluginVersion

public java.lang.String getPluginVersion()
Returns the version of the plugin.

Specified by:
getPluginVersion in interface Plugin
Returns:
The version number of this plugin.

getToolDir

public java.io.File getToolDir()
Returns the directory that tool definitions are saved to.

Returns:
The directory.

install

public void install(AbstractPluggableGUIApplication app)
Called just after a plugin is added to a GUI application. If this is a GUIPlugin, it has already been added visually. Plugins should use this method to register any listeners to the GUI application and do any other necessary setup.

Specified by:
install in interface Plugin
Parameters:
app - The application to which this plugin was just added.
See Also:
Plugin.uninstall()

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)

Specified by:
propertyChange in interface java.beans.PropertyChangeListener

savePreferences

public void savePreferences()
Called when the GUI application is shutting down. When this method is called, the Plugin should save any preferences.

Specified by:
savePreferences in interface Plugin

uninstall

public boolean uninstall()
Called just before this Plugin is removed from an GUIApplication. This gives the plugin a chance to clean up any loose ends (kill any threads, close any files, remove listeners, etc.).

Specified by:
uninstall in interface Plugin
Returns:
Whether the uninstall went cleanly.
See Also:
Plugin.install(org.fife.ui.app.AbstractPluggableGUIApplication)