org.fife.rtext.plugins.project
Class ProjectPlugin

java.lang.Object
  extended by org.fife.ui.app.AbstractPlugin
      extended by org.fife.ui.app.GUIPlugin
          extended by org.fife.rtext.plugins.project.ProjectPlugin
All Implemented Interfaces:
GUIApplicationConstants, Plugin, DockableWindowConstants

public class ProjectPlugin
extends GUIPlugin

A plugin that adds a very simple "project" system into RText.

Version:
1.0
Author:
Robert Futrell

Field Summary
static java.lang.String PROPERTY_INITIAL_WORKSPACE
          System property that, if defined, overrides the workspace initially opened by this property.
 
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
ProjectPlugin(AbstractPluggableGUIApplication app)
           
 
Method Summary
 org.fife.rtext.plugins.project.ProjectWindow getDockableWindow()
          Returns the dockable window for this 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.
 RText getRText()
          Returns the parent RText instance.
 WorkspaceTree getTree()
          Returns the tree view of the active workspace.
 Workspace getWorkspace()
          Returns the active workspace.
 java.io.File getWorkspacesDir()
          Returns the directory that workspaces are saved to.
 void insertTreeNodeInto(javax.swing.tree.MutableTreeNode child, javax.swing.tree.MutableTreeNode parent)
          Adds a new child to the parent tree node.
 void insertTreeNodeInto(javax.swing.tree.MutableTreeNode child, javax.swing.tree.MutableTreeNode parent, int index)
          Adds a new child to the parent tree node.
 void install(AbstractPluggableGUIApplication app)
          Called just after a plugin is added to a GUI application.
 void moveTreeNodeDown(AbstractWorkspaceTreeNode node)
          Moves a tree node down in its parent's list of children, if possible.
 void moveTreeNodeUp(AbstractWorkspaceTreeNode node)
          Moves a tree node up in its parent's list of children, if possible.
 void refreshTree(javax.swing.tree.TreeNode fromNode)
          Refreshes the workspace tree from the specified node down.
 void refreshWorkspaceName()
          Refreshes the workspace name displayed in the dockable window.
 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

PROPERTY_INITIAL_WORKSPACE

public static final java.lang.String PROPERTY_INITIAL_WORKSPACE
System property that, if defined, overrides the workspace initially opened by this property. Should be the full path to the workspace XML file.

See Also:
Constant Field Values
Constructor Detail

ProjectPlugin

public ProjectPlugin(AbstractPluggableGUIApplication app)
Method Detail

getDockableWindow

public org.fife.rtext.plugins.project.ProjectWindow getDockableWindow()
Returns the dockable window for this plugin.

Returns:
This plugin's 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.

Returns:
The options panel.

getPluginAuthor

public java.lang.String getPluginAuthor()
Returns the author of the 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.

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.

Returns:
The plugin name.

getPluginVersion

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

Returns:
The version number of this plugin.

getRText

public RText getRText()
Returns the parent RText instance.

Returns:
The parent RText instance.

getTree

public WorkspaceTree getTree()
Returns the tree view of the active workspace.

Returns:
The tree view.

getWorkspacesDir

public java.io.File getWorkspacesDir()
Returns the directory that workspaces are saved to.

Returns:
The directory.

getWorkspace

public Workspace getWorkspace()
Returns the active workspace.

Returns:
The active workspace, or null if none.

insertTreeNodeInto

public void insertTreeNodeInto(javax.swing.tree.MutableTreeNode child,
                               javax.swing.tree.MutableTreeNode parent)
Adds a new child to the parent tree node.

Parameters:
child - The new child node.
parent - The parent node.
See Also:
insertTreeNodeInto(MutableTreeNode, MutableTreeNode, int)

insertTreeNodeInto

public void insertTreeNodeInto(javax.swing.tree.MutableTreeNode child,
                               javax.swing.tree.MutableTreeNode parent,
                               int index)
Adds a new child to the parent tree node.

Parameters:
child - The new child node.
parent - The parent node.
index - The index at which to insert the child node.
See Also:
insertTreeNodeInto(MutableTreeNode, MutableTreeNode)

install

public void install(AbstractPluggableGUIApplication app)
Description copied from interface: Plugin
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.

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

moveTreeNodeDown

public void moveTreeNodeDown(AbstractWorkspaceTreeNode node)
Moves a tree node down in its parent's list of children, if possible.

Parameters:
node - The node to move down.
See Also:
moveTreeNodeUp(AbstractWorkspaceTreeNode)

moveTreeNodeUp

public void moveTreeNodeUp(AbstractWorkspaceTreeNode node)
Moves a tree node up in its parent's list of children, if possible.

Parameters:
node - The node to move up.
See Also:
moveTreeNodeDown(AbstractWorkspaceTreeNode)

refreshWorkspaceName

public void refreshWorkspaceName()
Refreshes the workspace name displayed in the dockable window.


refreshTree

public void refreshTree(javax.swing.tree.TreeNode fromNode)
Refreshes the workspace tree from the specified node down.

Parameters:
fromNode - The node to start the refreshing from.

savePreferences

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


uninstall

public boolean uninstall()
Description copied from interface: Plugin
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.).

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