org.gla.bisb.structure
Class WorkspaceScope

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.gla.bisb.structure.Category
          extended by org.gla.bisb.structure.WorkspaceScope
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable

public class WorkspaceScope
extends Category

Project hierarchy representation of the workspace. This class wraps IWorkspace resource providing ProjectScope objects for the projects. It attaches workspace change listener, which refreshes the whole project structure when something is changed. It also performs a callback for registered listeners (in our case that is ProjectBrowser view which has to be updated once the changes occur).

Author:
Vladislav Vyshemirsky

Constructor Summary
WorkspaceScope()
          The default constructor.
 
Method Summary
 void addUpdateListener(org.eclipse.core.resources.IResourceChangeListener listener)
          Allows attaching a listener to project structure changes.
 java.lang.Object[] getChildren()
          Returns the array of ProjectScopes
 java.lang.String getName()
          Returns null, as the workspace does not have a name.
 java.lang.Object getParent()
          Returns this class.
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkspaceScope

public WorkspaceScope()
The default constructor. This constructor reads the projects list from the current workspace and creates corresponding ProjectScope objects. It also attaches a listener to workspace's ResoureChanged callback.

Method Detail

addUpdateListener

public void addUpdateListener(org.eclipse.core.resources.IResourceChangeListener listener)
Allows attaching a listener to project structure changes.

Parameters:
listener - A listener class of IResourceChangeListener type

getChildren

public java.lang.Object[] getChildren()
Returns the array of ProjectScopes

Specified by:
getChildren in class Category
Returns:
An array of children.
See Also:
Category.getChildren(), ProjectScope

getParent

public java.lang.Object getParent()
Returns this class. This is because the workspace is the root of out tree.

Specified by:
getParent in class Category
Returns:
The parent node.
See Also:
Category.getParent()

getName

public java.lang.String getName()
Returns null, as the workspace does not have a name.

Specified by:
getName in class Category
Returns:
the name
See Also:
Category.getName()