com.borland.jbuilder.node
Class PackageNode

java.lang.Object
  |
  +--com.borland.primetime.node.Node
        |
        +--com.borland.primetime.node.LightweightNode
              |
              +--com.borland.jbuilder.node.PackageNode
All Implemented Interfaces:
java.lang.Comparable

public class PackageNode
extends LightweightNode

PackageNode instances represent Java packages as logical containers whose display children are determined dynamically based on project paths. Note that the process of determining a PackageNode's display children is quite expensive. The results should be cached by the caller and refreshed on demand.


Field Summary
static java.lang.String TYPE
          Name which this Node uses when registering as a LightWeightNode type.
 
Fields inherited from class com.borland.primetime.node.Node
EMPTY_ARRAY, nodeListeners
 
Constructor Summary
PackageNode(Project project, Node parent, java.lang.String name)
          All LightweightNode subtypes must expose this constructor signature.
 
Method Summary
 Node[] getDisplayChildren()
          This routine returns the children of this node.
 javax.swing.Icon getDisplayIcon()
          Return the icon used for this type of file.
 java.lang.String getDisplayName()
          Returns display name depending on mode (where a hard-code name may be returned) and whether normal or short names have been configured.
 int getDisplaySequence()
          Returns display sequence to help in sorting.
 java.lang.String getLongDisplayName()
          Returns a more descriptive name suitable for use as a tooltip in the project pane.
 int getMode()
          Returns the mode used to search for package contents.
 boolean hasDisplayChildren()
          Returns whether this node has any display children.
static void initOpenTool(byte majorVersion, byte minorVersion)
          OpenTool initialization.
 void setMode(int mode)
          Sets the mode used to search for package contents.
 void setShortName(boolean shortName)
          Sets the type of name to return, either short name (if using PackageNode as an element in an hiearchical tree) or normal (full package name).
 
Methods inherited from class com.borland.primetime.node.LightweightNode
createLightweightNode, findLightweightNodeClass, findLightweightNodeType, getName, isUserRenamable, registerLightweightNodeClass, setName
 
Methods inherited from class com.borland.primetime.node.Node
addNodeListener, check, compareTo, dumpNodes, dumpNodes, dumpNodes, equals, fireNodeRenamed, getChildren, getNodeID, getParent, getProject, getProperties, getProperty, getProperty, getProperty, hasChildren, 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
 

Field Detail

TYPE

public static final java.lang.String TYPE
Name which this Node uses when registering as a LightWeightNode type.
Constructor Detail

PackageNode

public PackageNode(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

initOpenTool

public static void initOpenTool(byte majorVersion,
                                byte minorVersion)
OpenTool initialization.
Parameters:
majorVersion - Major release number for which OpenTool is being initialized.
minorVersion - Minor release number for which OpenTool is being initialized.

getMode

public int getMode()
Returns the mode used to search for package contents. The valid mode values are defined as MODE constants in JBProject.
Returns:
Returns mode implementing.

setMode

public void setMode(int mode)
Sets the mode used to search for package contents. The valid mode values are defined as MODE constants in JBProject.
Parameters:
mode - Which mode to implement.

setShortName

public void setShortName(boolean shortName)
Sets the type of name to return, either short name (if using PackageNode as an element in an hiearchical tree) or normal (full package name).
Parameters:
shortName - Set true to use short name.

getDisplayName

public java.lang.String getDisplayName()
Returns display name depending on mode (where a hard-code name may be returned) and whether normal or short names have been configured.
Overrides:
getDisplayName in class LightweightNode
Returns:
Returns display name.

getLongDisplayName

public java.lang.String getLongDisplayName()
Returns a more descriptive name suitable for use as a tooltip in the project pane.
Overrides:
getLongDisplayName in class Node
Returns:
Tooltip text.

getDisplaySequence

public int getDisplaySequence()
Returns display sequence to help in sorting.
Overrides:
getDisplaySequence in class Node
Returns:
Returns number appropriate to this node type.

getDisplayIcon

public javax.swing.Icon getDisplayIcon()
Return the icon used for this type of file.
Overrides:
getDisplayIcon in class Node
Returns:
The icon for this file type.

getDisplayChildren

public Node[] getDisplayChildren()
This routine returns the children of this node. return Returns array of Nodes depending on mode.
Overrides:
getDisplayChildren in class Node
Following copied from class: com.borland.primetime.node.Node
Returns:
An array of Node instances, or an empty array if no such nodes exist.

hasDisplayChildren

public boolean hasDisplayChildren()
Returns whether this node has any display children.
Overrides:
hasDisplayChildren in class Node
Returns:
Always returns true if parent is a JBProject.