classpathhelper.eclipse.ui.locationsview
Class ClassPathElement

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

public class ClassPathElement
extends AbstractTree
implements IDecorable

Visual Tree node representing a location on the classpath.

Since:
1.0
Author:
bharris

Field Summary
 
Fields inherited from interface classpathhelper.eclipse.ui.IDecorable
BLOCKED, BLOCKED_DIFF, IGNORED, UNREFERENCED, UNRESOLVED, WONTLOAD
 
Constructor Summary
ClassPathElement(Location theLocation, CGClassLoader theClassLoader)
           
 
Method Summary
protected  void determineFinalDecorations()
          Method called to determine the decorations that require most of the classpath to be resolved.
protected  void determineInitialDecorations()
          Method that determines how this classpath element should be decorated.
 ITree[] getChildren()
          Getter for this nodes children.
 Image getIconName()
          The associated Icon.
 boolean hasChildren()
          Does this node have children.
 boolean hasUnresolved()
          Getter method indicating whether or not this location contains unresolved classes.
 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()
          Getter for the ignored flag on the underlying location.
 boolean isUnreferenced()
          Is this element referred to by anyone?
protected  void loadDependentLocations()
          Loads the dependent locations.
protected  void loadNotFoundDependentClassNames()
          Loads the not found classes.
protected  void loadReferencedBy()
          Internal method for loading up all the locations that refer to this location.
protected  void setUnreferenced(boolean unreferenced)
          Setter for flag indicating whether or not this jar/folder contains class that are unreferenced by classes from any other jar/folder.
protected  void setUnresolved(boolean unresolved)
          Setter for the flag indicating whether or not this location has classes with unresolved dependencies.
 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
 

Constructor Detail

ClassPathElement

public ClassPathElement(Location theLocation,
                        CGClassLoader theClassLoader)
Parameters:
theLocation - The location corresponding to this visual tree node.
Since:
1.0
Method Detail

determineInitialDecorations

protected void determineInitialDecorations()
Method that determines how this classpath element should be decorated.

Since:
1.0

determineFinalDecorations

protected void determineFinalDecorations()

Method called to determine the decorations that require most of the classpath to be resolved. This method is called after all locations have been traversed meaning that most classes have already been loaded.

This method is seperated out from determineInitialDecorations() to provide a better UI experience. Since the decorations determined in this method require all classes loaded, determining them in advanced would keep reported progress at 0% while 99% of the work gets done.

Since:
1.0

loadReferencedBy

protected void loadReferencedBy()
Internal method for loading up all the locations that refer to this location.

Since:
1.0

loadNotFoundDependentClassNames

protected void loadNotFoundDependentClassNames()
Loads the not found classes.

Since:
1.0

loadDependentLocations

protected void loadDependentLocations()
Loads the dependent locations.

Since:
1.0

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()
Getter for the ignored flag on the underlying location.

Specified by:
isIgnored in interface IDecorable
Returns:
true If this location is ignored on the classpath, otherwise false.
Since:
1.0

hasUnresolved

public boolean hasUnresolved()
Getter method indicating whether or not this location contains unresolved classes.

Specified by:
hasUnresolved in interface IDecorable
Returns:
true if this location contains unresolved classes, otherwise false
Since:
1.0

setUnresolved

protected void setUnresolved(boolean unresolved)
Setter for the flag indicating whether or not this location has classes with unresolved dependencies.

Parameters:
unresolved - The unresolved flag.
Since:
1.0

setUnreferenced

protected void setUnreferenced(boolean unreferenced)
Setter for flag indicating whether or not this jar/folder contains class that are unreferenced by classes from any other jar/folder.

Parameters:
unreferenced - The new value.
Since:
1.0

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()