classpathhelper.eclipse.ui.packageview
Class PackageElement

java.lang.Object
  extended byclasspathhelper.util.AbstractTree
      extended byclasspathhelper.eclipse.ui.packageview.PackageElement
All Implemented Interfaces:
IDecorable, ITree

public class PackageElement
extends AbstractTree
implements IDecorable

Element representing a Java package. Classes are organized by package to help organize the display of class information.

Implementation Notes

This class uses lazy loading to populate its children only when it is visually expanded.

Since:
1.2
Author:
bharris

Field Summary
static java.lang.String DEFAULT_PKG_LABEL
           
 
Fields inherited from interface classpathhelper.eclipse.ui.IDecorable
BLOCKED, BLOCKED_DIFF, IGNORED, UNREFERENCED, UNRESOLVED, WONTLOAD
 
Constructor Summary
PackageElement(Package thePackage, CGClassLoader theClassLoader)
           
 
Method Summary
protected  void determineDecoration(Package pkg)
          Internal method that determines if this package needs decorations (has blocked, blocked-diff, unresolved, etc).
 void determineInitialDecorations()
          Wrapper over determineDecoration(Package) that determines the decorations for the package associated with this tree element.
 ITree[] getChildren()
          Getter for this nodes children.
 Image getIconName()
          The associated Icon.
 boolean hasChildren()
          Does this node have children.
 boolean hasUnresolved()
          Does this element have unresolved references.
 boolean hasWontLoad()
          Will this not load or does this element contain elements that won't load.
 boolean isBlocked()
          Is this element blocked (or does it contain blocked elements).
 boolean isBlockedDiffVersion()
          Is this element blocked (or does it contain blocked elements), that have a different version.
 boolean isIgnored()
          Is this element is ignored.
 boolean isUnreferenced()
          Is this element referred to by anyone?
 boolean supportingDecorations()
          Method added to allow nodes to indicate whether or not they are supporting decorations.
 java.lang.String toString()
           
 
Methods inherited from class classpathhelper.util.AbstractTree
addChild, addChildren, getParent, getRoot, removeAllChildren, removeChild, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PKG_LABEL

public static final java.lang.String DEFAULT_PKG_LABEL
See Also:
Constant Field Values
Constructor Detail

PackageElement

public PackageElement(Package thePackage,
                      CGClassLoader theClassLoader)
Parameters:
theClassLoader - The classloader loading this location.
Since:
1.2
Method Detail

determineInitialDecorations

public void determineInitialDecorations()
Wrapper over determineDecoration(Package) that determines the decorations for the package associated with this tree element.

Since:
1.2

determineDecoration

protected void determineDecoration(Package pkg)
Internal method that determines if this package needs decorations (has blocked, blocked-diff, unresolved, etc).

Parameters:
pkg -
Since:
1.2

isBlocked

public boolean isBlocked()
Description copied from interface: IDecorable
Is this element blocked (or does it contain blocked elements).

Specified by:
isBlocked in interface IDecorable
Returns:
true If this element is blocked, false if this element isn't or cannot be blocked.

isBlockedDiffVersion

public boolean isBlockedDiffVersion()
Description copied from interface: IDecorable
Is this element blocked (or does it contain blocked elements), that have a different version.

Specified by:
isBlockedDiffVersion in interface IDecorable
Returns:
true If this element is blocked, false if this element isn't or cannot be blocked.

isIgnored

public boolean isIgnored()
Description copied from interface: IDecorable
Is this element is ignored.

Specified by:
isIgnored in interface IDecorable
Returns:
true If this element is ignored, false if this element isn't or cannot be ignored.

hasUnresolved

public boolean hasUnresolved()
Description copied from interface: IDecorable
Does this element have unresolved references.

Specified by:
hasUnresolved in interface IDecorable
Returns:
true If this element has unresolved, false if this element isn't or cannot have unresolved.

isUnreferenced

public boolean isUnreferenced()
Description copied from interface: IDecorable
Is this element referred to by anyone?

Specified by:
isUnreferenced in interface IDecorable
Returns:
true if this element has no references to it (other than possibly itself), otherwise false.

supportingDecorations

public boolean supportingDecorations()
Description copied from interface: IDecorable

Method added to allow nodes to indicate whether or not they are supporting decorations. Some node types are used in multiple places and in some contexts don't require decorations. In other cases a node might indicate that they do not support decorations while they are still calculating their details.

Specified by:
supportingDecorations in interface IDecorable
Returns:
true if this node is currently supporting decorations, otherwise false

hasWontLoad

public boolean hasWontLoad()
Description copied from interface: IDecorable
Will this not load or does this element contain elements that won't load. Elements typically won't load if something they depend on won't load.

Specified by:
hasWontLoad in interface IDecorable
Returns:
true if this node has elements that won't load (possibly itself), otherwise false

getIconName

public Image getIconName()
Description copied from interface: ITree
The associated Icon.

Specified by:
getIconName in interface ITree
Returns:
The Icon for this node.

hasChildren

public boolean hasChildren()
Description copied from interface: ITree
Does this node have children.

Specified by:
hasChildren in interface ITree
Overrides:
hasChildren in class AbstractTree

getChildren

public ITree[] getChildren()
Description copied from interface: ITree
Getter for this nodes children.

Specified by:
getChildren in interface ITree
Overrides:
getChildren in class AbstractTree

toString

public java.lang.String toString()