com.borland.primetime.node
Class LightweightNode

java.lang.Object
  |
  +--com.borland.primetime.node.Node
        |
        +--com.borland.primetime.node.LightweightNode
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
FolderNode, PackageNode

public abstract class LightweightNode
extends Node

Each LightweightNode instance provides a container to organize files of a project and which is generally recorded in a saved Project file.


Fields inherited from class com.borland.primetime.node.Node
EMPTY_ARRAY, nodeListeners
 
Constructor Summary
LightweightNode(Project project, Node parent, java.lang.String name)
          All LightweightNode subtypes must expose this constructor signature.
 
Method Summary
static LightweightNode createLightweightNode(java.lang.String type, Project project, Node parent, java.lang.String name)
          Create an instance of a LightweightNode given a registered type.
static java.lang.Class findLightweightNodeClass(java.lang.String type)
          Map from the given type to a registered LightweightNode class.
static java.lang.String findLightweightNodeType(Node node)
          Finds a LightweightNode for the given Node instance.
 java.lang.String getDisplayName()
          Returns name of this Node.
 java.lang.String getName()
          Returns the current name.
 boolean isUserRenamable()
          Override this method if you want to allow the user to rename.
static void registerLightweightNodeClass(java.lang.String type, java.lang.Class nodeClass)
          Registers a LightweightNode type as part of the OpenTools API.
 void setName(java.lang.String name)
          Rename using the given new name.
 
Methods inherited from class com.borland.primetime.node.Node
addNodeListener, check, compareTo, dumpNodes, dumpNodes, dumpNodes, equals, fireNodeRenamed, getChildren, getDisplayChildren, getDisplayIcon, getDisplaySequence, getLongDisplayName, getNodeID, getParent, getProject, getProperties, getProperty, getProperty, getProperty, hasChildren, hasDisplayChildren, hashCode, isModified, isPersistant, makePersistant, removeNodeListener, setParent, setProperty, setProperty, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LightweightNode

public LightweightNode(Project project,
                       Node parent,
                       java.lang.String name)
All LightweightNode subtypes must expose this constructor signature.
Parameters:
project - The project (must not be null) that the node belongs to.
parent - The immediate parent (may be null and must be in same project).
name - Name of the Node.
Method Detail

isUserRenamable

public boolean isUserRenamable()
Override this method if you want to allow the user to rename.
Returns:
Always returns false.

getName

public java.lang.String getName()
Returns the current name.
Returns:
Returns last set name.

setName

public void setName(java.lang.String name)
Rename using the given new name.
Parameters:
name - Name to set.

registerLightweightNodeClass

public static void registerLightweightNodeClass(java.lang.String type,
                                                java.lang.Class nodeClass)
Registers a LightweightNode type as part of the OpenTools API.
Parameters:
type - Type of node.
nodeClass - Class which implements given Node type.

findLightweightNodeType

public static java.lang.String findLightweightNodeType(Node node)
Finds a LightweightNode for the given Node instance.
Parameters:
Instance - of a Node.
Returns:
Returns type (guaranteed not null) for a LightweightNode.

findLightweightNodeClass

public static java.lang.Class findLightweightNodeClass(java.lang.String type)
Map from the given type to a registered LightweightNode class.
Parameters:
type - LightweightNode type.

createLightweightNode

public static LightweightNode createLightweightNode(java.lang.String type,
                                                    Project project,
                                                    Node parent,
                                                    java.lang.String name)
Create an instance of a LightweightNode given a registered type.
Parameters:
type - LightweightNode type (must not be null).
project - Project (must not be null) to which the new Node will belong.
parent - Parent (may be null) for this Node.
name - Name (must not be null) for this Node.
Returns:
A valid LightweightNode object, or null if the relevant LightweightNode class is not registered.

getDisplayName

public java.lang.String getDisplayName()
Returns name of this Node.
Overrides:
getDisplayName in class Node
Returns:
Returns name.