public class IlrPackageDataProvider extends java.lang.Object implements IlrTreeDataProvider, ilog.rules.teamserver.web.tree.util.IlrExtendedFeature
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();
IlrElementSummary| Modifier and Type | Field and Description |
|---|---|
protected IlrTreeController |
fController |
protected ilog.rules.teamserver.model.IlrSessionEx |
fSession |
| Constructor and Description |
|---|
IlrPackageDataProvider(IlrSession session,
IlrTreeController controller)
Creates a tree data provider for a given session and a given tree controller.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.util.List<IlrElementSummary> |
computeBranchRootPackages(IlrElementSummary summary) |
java.util.List<org.eclipse.emf.ecore.EClass> |
getArtifactEClasses()
Returns a list of types to show in the tree component.
|
java.util.List<IlrTreeNode> |
getChildren(IlrTreeNode parent)
Returns the children of a node.
|
java.util.List<IlrTreeNode> |
getChildren(IlrTreeNode parent,
boolean refresh)
Returns the children of a node.
|
IlrTreeNode |
getNodeById(java.lang.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(java.util.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. |
protected IlrTreeController fController
protected ilog.rules.teamserver.model.IlrSessionEx fSession
public IlrPackageDataProvider(IlrSession session, IlrTreeController controller)
session - The sessioncontroller - The controllerIlrTreeControllerpublic boolean isShowArtifacts()
showArtifacts property.
true to render the artifacts in the tree component, and false otherwise. The default implementation returns false.public void setShowArtifacts(boolean showArtifacts)
Sets the showArtifacts property.
showArtifacts - true to render the artifacts in the tree component, and false otherwise.public boolean isIncludeProjectDependencies()
includeProjectDependencies property.true is returned.
The default implementation returns false.public void setIncludeProjectDependencies(boolean includeProjectDependencies)
includeProjectDependencies property.includeProjectDependencies - Set to true so artifacts
from dependent projects are included.public java.util.List<org.eclipse.emf.ecore.EClass> getArtifactEClasses()
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.
public void setArtifactEClasses(java.util.List<org.eclipse.emf.ecore.EClass> artifactEClasses)
This method is relevant only if the showArtifacts attribute is set to true.
public void reset()
IlrTreeDataProviderThis method is intended to clear caches potentially used by the implementation.
reset in interface IlrTreeDataProviderpublic java.util.List<IlrTreeNode> getChildren(IlrTreeNode parent)
IlrTreeDataProvidergetChildren in interface IlrTreeDataProviderparent - The parent node to get the children from.IlrTreeNode.public java.util.List<IlrTreeNode> getChildren(IlrTreeNode parent, boolean refresh)
parent - The parent node to get the children from.refresh - If true, the children are refreshed from the database.IlrTreeNode.IlrTreeNodeprotected java.util.List<IlrElementSummary> computeBranchRootPackages(IlrElementSummary summary) throws IlrApplicationException
IlrApplicationExceptionpublic IlrTreeNode getNodeById(java.lang.String id)
IlrTreeDataProviderIt is up to the user to manage the mapping between a node and its ID.
getNodeById in interface IlrTreeDataProviderid - The ID of the node.public IlrTreeNode getParent(IlrTreeNode child)
IlrTreeDataProvidergetParent in interface IlrTreeDataProviderchild - The node to get the parent from.null if it has none or if the parent cannot be computed.public IlrTreeNode getRoot()
IlrTreeDataProvider
This node is given to the IlrTreeDataProvider.getChildren(IlrTreeNode) method to start to render the tree component.
getRoot in interface IlrTreeDataProviderpublic boolean hasChildren(IlrTreeNode node)
IlrTreeDataProviderhasChildren in interface IlrTreeDataProvidernode - The node.true if the given node has children, and false otherwise.public void removeNode(IlrTreeNode node)
node - The parent node of the children to remove.© Copyright IBM Corp. 1987, 2017