Decision Center API

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

java.lang.Object
  extended by ilog.rules.teamserver.web.tree.impl.ruleexplorer.IlrRuleExplorerDataProvider
All Implemented Interfaces:
ilog.rules.teamserver.web.event.ContentChangeListener, ilog.rules.teamserver.web.event.SelectionChangeListener, ilog.rules.teamserver.web.event.SmartViewCreatedListener, IlrTreeDataProvider, ilog.rules.teamserver.web.tree.util.IlrExtendedFeature, EventListener

public class IlrRuleExplorerDataProvider
extends Object
implements IlrTreeDataProvider, ilog.rules.teamserver.web.tree.util.IlrExtendedFeature, ilog.rules.teamserver.web.event.SelectionChangeListener, ilog.rules.teamserver.web.event.ContentChangeListener, ilog.rules.teamserver.web.event.SmartViewCreatedListener

An implementation to provide the tree's model with the smart views as in Decision Center.

The user data of a node is an instance of the IlrNodeData abstract class. The following current implementations are supported:

The following snippet shows you how to retrieve the user data of a node:

  IlrTreeNode node = ...
  IlrNodeData nodeData = (IlrNodeData) node.getClientData();
  if (nodeData instanceof IlrSmartViewNodeData) {
    IlrSmartView smartView = ((IlrSmartViewNodeData) nodeData).getSmartView();
    // ...
  } else if (clientData instanceof IlrFeatureNodeData) {
    EStructuralFeature feature = ((IlrFeatureNodeData) nodeData).getFeature();
    // ...
    Object value = ((IlrFeatureNodeData) nodeData).getValue();
  } else if (clientData instanceof IlrElementNodeData) {
    IlrElementSummary summary = ((IlrElementNodeData) nodeData).getElement();
    // ...
  }
 

See Also:
IlrNodeData, IlrSmartViewNodeData, IlrElementNodeData, IlrElementSummary

Constructor Summary
IlrRuleExplorerDataProvider(IlrRuleExplorerController treeController)
          Creates a tree data provider for a given tree controller.
 
Method Summary
 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 isShowArtifacts()
          Gets the showArtifacts property.
 void refresh(IlrTreeNode node)
          Refreshes the children of a given node recursively.
 void reset()
          Resets the tree's model.
 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
 
Methods inherited from interface ilog.rules.teamserver.web.event.SelectionChangeListener
selectionChange
 
Methods inherited from interface ilog.rules.teamserver.web.event.ContentChangeListener
contentChange
 
Methods inherited from interface ilog.rules.teamserver.web.event.SmartViewCreatedListener
smartViewCreated
 

Constructor Detail

IlrRuleExplorerDataProvider

public IlrRuleExplorerDataProvider(IlrRuleExplorerController treeController)
Creates a tree data provider for a given tree controller.

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

isShowArtifacts

public boolean isShowArtifacts()
Gets the showArtifacts property.

Returns:
true to render the rule 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 rule artifacts in the tree component, and false otherwise.

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.

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

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.

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

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.

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.

refresh

public void refresh(IlrTreeNode node)
             throws IlrApplicationException
Refreshes the children of a given node recursively.

Throws:
IlrApplicationException
Parameters:
node - The node where to start to refresh.

Decision Center API

© Copyright IBM Corp. 1987, 2013