org.fife.rtext.plugins.project.tree
Class AbstractWorkspaceTreeNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by org.fife.rtext.plugins.project.tree.AbstractWorkspaceTreeNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode
Direct Known Subclasses:
FileProjectEntryTreeNode, FileTreeNode, LogicalFolderProjectEntryTreeNode, PhysicalLocationTreeNode.NotYetPopulatedChild, WorkspaceRootTreeNode

public abstract class AbstractWorkspaceTreeNode
extends javax.swing.tree.DefaultMutableTreeNode

All nodes in a workspace tree extend this class.

Version:
1.0
Author:
Robert Futrell
See Also:
Serialized Form

Nested Class Summary
protected  class AbstractWorkspaceTreeNode.AddFileAction
          Action for a menu item that adds a file to this project.
protected  class AbstractWorkspaceTreeNode.AddFolderAction
          Action for a menu item that adds a folder to this project.
protected  class AbstractWorkspaceTreeNode.AddLogicalFolderAction
          Action for a menu item that adds a logical folder to this project.
protected  class AbstractWorkspaceTreeNode.DeleteAction
          Action for deleting a tree node.
protected  class AbstractWorkspaceTreeNode.MoveDownAction
          Moves this tree node "down" in the list of its parent's children.
protected  class AbstractWorkspaceTreeNode.MoveUpAction
          Moves this tree node "up" in the list of its parent's children.
protected  class AbstractWorkspaceTreeNode.OpenAction
          Opens the selected file in RText.
protected  class AbstractWorkspaceTreeNode.PropertiesAction
          Action for getting the properties of a tree node.
protected  class AbstractWorkspaceTreeNode.RefreshAction
          Refreshes the selected tree node.
protected  class AbstractWorkspaceTreeNode.RenameAction
          Action for renaming a tree node.
 
Field Summary
protected  ProjectPlugin plugin
           
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
AbstractWorkspaceTreeNode(ProjectPlugin plugin)
           
 
Method Summary
protected  java.lang.String escapeForHtml(java.lang.String text)
           
abstract  java.lang.String getDisplayName()
          Returns the name to display for this node in the workspace tree.
abstract  javax.swing.Icon getIcon()
          Returns the icon for this tree node.
abstract  java.util.List<PopupContent> getPopupActions()
           
abstract  java.lang.String getToolTipText()
           
protected abstract  void handleDelete()
           
protected abstract  void handleProperties()
           
protected abstract  void handleRename()
           
 boolean moveProjectEntityDown()
          Moves the project model entity this tree node represents "down" in its parent, if it makes logical sense to do so.
 boolean moveProjectEntityUp()
          Moves the project model entity this tree node represents "up" in its parent, if it makes logical sense to do so.
protected  boolean possiblyAddOpenInActions(java.util.List<PopupContent> actions)
          Adds menu items to open in the system's default editor and viewer applications, if we're running in Java 6 or later.
 java.lang.String toString()
           
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

plugin

protected ProjectPlugin plugin
Constructor Detail

AbstractWorkspaceTreeNode

public AbstractWorkspaceTreeNode(ProjectPlugin plugin)
Method Detail

escapeForHtml

protected java.lang.String escapeForHtml(java.lang.String text)

getDisplayName

public abstract java.lang.String getDisplayName()
Returns the name to display for this node in the workspace tree.

Returns:
The display name.

getIcon

public abstract javax.swing.Icon getIcon()
Returns the icon for this tree node.

Returns:
The icon for this tree node.

getPopupActions

public abstract java.util.List<PopupContent> getPopupActions()

getToolTipText

public abstract java.lang.String getToolTipText()

handleDelete

protected abstract void handleDelete()

handleProperties

protected abstract void handleProperties()

handleRename

protected abstract void handleRename()

moveProjectEntityDown

public boolean moveProjectEntityDown()
Moves the project model entity this tree node represents "down" in its parent, if it makes logical sense to do so. The default implementation returns false, since for most entities this operation does not make sense.

Returns:
Whether the entity was moved down.
See Also:
moveProjectEntityUp()

moveProjectEntityUp

public boolean moveProjectEntityUp()
Moves the project model entity this tree node represents "up" in its parent, if it makes logical sense to do so. The default implementation returns false, since for most entities this operation does not make sense.

Returns:
Whether the entity was moved up.
See Also:
moveProjectEntityDown()

possiblyAddOpenInActions

protected boolean possiblyAddOpenInActions(java.util.List<PopupContent> actions)
Adds menu items to open in the system's default editor and viewer applications, if we're running in Java 6 or later.

Parameters:
actions - The action list to add to.
Returns:
Whether the actions were added.

toString

public final java.lang.String toString()
Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode