Decision Center API

ilog.rules.teamserver.web.tree.impl.ruleexplorer
Class IlrPackageDataProvider

java.lang.Object
  extended by ilog.rules.teamserver.web.tree.impl.ruleexplorer.IlrPackageDataProvider
All Implemented Interfaces:
IlrTreeDataProvider, ilog.rules.teamserver.web.tree.util.IlrExtendedFeature

public class IlrPackageDataProvider
extends Object
implements IlrTreeDataProvider, ilog.rules.teamserver.web.tree.util.IlrExtendedFeature

An implementation to provide the tree's model with a hierarchy of packages and its rule artifacts.

The user data of a node is an instance of IlrElementSummary, which is either a project, a package, or a rule artifact. A subclass of this class must always use an instance of IlrElementSummary as the user object of a node. The following snippet shows you how to retrieve the user data of a node:

  IlrTreeNode node = ...
  IlrElementSummary summary = (IlrElementSummary) node.getClientData();
 

See Also:
IlrElementSummary

Field Summary
protected  IlrTreeController fController
           
protected  ilog.rules.teamserver.model.IlrSessionEx fSession
           
 
Constructor Summary
IlrPackageDataProvider(IlrSession session, IlrTreeController controller)
          Creates a tree data provider for a given session and a given tree controller.
 
Method Summary
protected  List<IlrElementSummary> computeBranchRootPackages(IlrElementSummary summary)
           
 List<org.eclipse.emf.ecore.EClass> getArtifactEClasses()
          Returns a list of types to show in the tree component.
 List<IlrTreeNode> getChildren(IlrTreeNode parent)
          Returns the children of a node.
 List<IlrTreeNode> getChildren(IlrTreeNode parent, boolean refresh)
          Returns the children of a node.
 IlrTreeNode getNodeById(String id)
          Returns a node with a given ID.
 IlrTreeNode getParent(IlrTreeNode child)
          Returns the parent of a node.
 IlrTreeNode getRoot()
          Returns the root node of the tree's model.
 boolean hasChildren(IlrTreeNode node)
          Indicates if a node has children.
 boolean isIncludeProjectDependencies()
          Returns the includeProjectDependencies property.
 boolean isShowArtifacts()
          Gets the showArtifacts property.
 void removeNode(IlrTreeNode node)
          Removes a node and its children recursively in the tree's model.
 void reset()
          Resets the tree's model.
 void setArtifactEClasses(List<org.eclipse.emf.ecore.EClass> artifactEClasses)
          Sets a list of types to show in the tree component.
 void setIncludeProjectDependencies(boolean includeProjectDependencies)
          Sets the includeProjectDependencies property.
 void setShowArtifacts(boolean showArtifacts)
           Sets the showArtifacts property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ilog.rules.teamserver.web.tree.util.IlrExtendedFeature
initState, removeChildren
 

Field Detail

fController

protected IlrTreeController fController

fSession

protected ilog.rules.teamserver.model.IlrSessionEx fSession
Constructor Detail

IlrPackageDataProvider

public IlrPackageDataProvider(IlrSession session,
                              IlrTreeController controller)
Creates a tree data provider for a given session and a given tree controller.

Parameters:
session - The session
controller - The controller
See Also:
IlrTreeController
Method Detail

isShowArtifacts

public boolean isShowArtifacts()
Gets the showArtifacts property.

Returns:
true to render the artifacts in the tree component, and false otherwise. The default implementation returns false.

setShowArtifacts

public void setShowArtifacts(boolean showArtifacts)

Sets the showArtifacts property.

Parameters:
showArtifacts - true to render the artifacts in the tree component, and false otherwise.

isIncludeProjectDependencies

public boolean isIncludeProjectDependencies()
Returns the includeProjectDependencies property.

Returns:
If artifacts from dependent projects are included, true is returned. The default implementation returns false.

setIncludeProjectDependencies

public void setIncludeProjectDependencies(boolean includeProjectDependencies)
Sets the includeProjectDependencies property.

Parameters:
includeProjectDependencies - Set to true so artifacts from dependent projects are included.

getArtifactEClasses

public List<org.eclipse.emf.ecore.EClass> getArtifactEClasses()
Returns a list of types to show in the tree component.

The default implementation returns a list containing the type for class 'Package Element'. This method is relevant only if the showArtifacts attribute is set to true.

See Also:
isShowArtifacts(), setShowArtifacts(boolean), setArtifactEClasses(List)

setArtifactEClasses

public void setArtifactEClasses(List<org.eclipse.emf.ecore.EClass> artifactEClasses)
Sets a list of types to show in the tree component.

This method is relevant only if the showArtifacts attribute is set to true.

See Also:
isShowArtifacts(), setShowArtifacts(boolean), getArtifactEClasses()

reset

public void reset()
Description copied from interface: IlrTreeDataProvider
Resets the tree's model.

This method is intended to clear caches potentially used by the implementation.

Specified by:
reset in interface IlrTreeDataProvider

getChildren

public List<IlrTreeNode> getChildren(IlrTreeNode parent)
Description copied from interface: IlrTreeDataProvider
Returns the children of a node.

Specified by:
getChildren in interface IlrTreeDataProvider
Parameters:
parent - The parent node to get the children from.
Returns:
A list of IlrTreeNode.

getChildren

public List<IlrTreeNode> getChildren(IlrTreeNode parent,
                                     boolean refresh)
Returns the children of a node.

Parameters:
parent - The parent node to get the children from.
refresh - If true, the children are refreshed from the database.
Returns:
A list of IlrTreeNode.
See Also:
IlrTreeNode

computeBranchRootPackages

protected List<IlrElementSummary> computeBranchRootPackages(IlrElementSummary summary)
                                                     throws IlrApplicationException
Throws:
IlrApplicationException

getNodeById

public IlrTreeNode getNodeById(String id)
Description copied from interface: IlrTreeDataProvider
Returns a node with a given ID.

It is up to the user to manage the mapping between a node and its ID.

Specified by:
getNodeById in interface IlrTreeDataProvider
Parameters:
id - The ID of the node.
Returns:
The node with a given ID.

getParent

public IlrTreeNode getParent(IlrTreeNode child)
Description copied from interface: IlrTreeDataProvider
Returns the parent of a node.

Specified by:
getParent in interface IlrTreeDataProvider
Parameters:
child - The node to get the parent from.
Returns:
The parent node, or null if it has none or if the parent cannot be computed.

getRoot

public IlrTreeNode getRoot()
Description copied from interface: IlrTreeDataProvider
Returns the root node of the tree's model.

This node is given to the IlrTreeDataProvider.getChildren(IlrTreeNode) method to start to render the tree component.

Specified by:
getRoot in interface IlrTreeDataProvider
Returns:
The root node.

hasChildren

public boolean hasChildren(IlrTreeNode node)
Description copied from interface: IlrTreeDataProvider
Indicates if a node has children.

Specified by:
hasChildren in interface IlrTreeDataProvider
Parameters:
node - The node.
Returns:
true if the given node has children, and false otherwise.

removeNode

public void removeNode(IlrTreeNode node)
Removes a node and its children recursively in the tree's model.

Parameters:
node - The parent node of the children to remove.

Decision Center API

© Copyright IBM Corp. 1987, 2013