Decision Center API

ilog.rules.teamserver.web.tree.webc
Class IlrWTree

java.lang.Object
  extended by ilog.webui.dhtml.IlxWContainer
      extended by ilog.webui.dhtml.IlxWComponent
          extended by ilog.rules.teamserver.web.tree.webc.IlrWTree
All Implemented Interfaces:
ilog.webui.dhtml.IlxWConstants, ilog.webui.dhtml.IlxWCSSModelProvider, ilog.webui.dhtml.IlxWDependencyProvider, ilog.webui.dhtml.IlxWJSObject, Serializable

public class IlrWTree
extends IlxWComponent

IlrWTree represents a tree component.

The input of the tree is an IlrTreeController instance.

The following code example shows how to create a tree and use it as a value editor:

   public void buildTree() { 
     IlrTreeContoller controller = new IlrTreeController() {
       public IlrTreeDataProvider getTreeDataProvider() {
         return new IlrPreLoadedDataProvider {
           protected IlrTreeNode createRoot() {
             return new IlrPreLoadedTreeNode(null, "root");
           }
           protected void preloadModel(IlrPreLoadedTreeNode root) {
             IlrPreLoadedTreeNode node1 = new IlrPreLoadedTreeNode(root, "node1");
             IlrPreLoadedTreeNode node2 = new IlrPreLoadedTreeNode(root, "node2");
             IlrPreLoadedTreeNode node12 = new IlrPreLoadedTreeNode(node1, "node12");
             // ...
           }
         }
       }
    }
    controller.setTreeListener(new IlrDefaultTreeListener() {
      // Implements methods to listen to the tree (expansion, selection, ...)
    });
    
    IlrWTree tree = new IlrWTree(controller); 
    // To use the tree as a value editor, call the following method.
    IlrWTree.registerTreeAsValueEditor(tree);
 
 

See Also:
IlrTreeController, IlrPreLoadedTreeNode, IlrPreLoadedDataProvider, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class ilog.webui.dhtml.IlxWComponent
IlxWComponent.DynamicStyleMap
 
Field Summary
protected  String styleClass
           
protected  IlrTreeController treeController
           
protected  ilog.rules.teamserver.web.tree.util.IlrDojoTreeWriter treeWriter
           
 
Fields inherited from class ilog.webui.dhtml.IlxWContainer
listenerList
 
Constructor Summary
IlrWTree(IlrTreeController treeController)
          Constructs an IlrWTree instance.
 
Method Summary
 IlrTreeController getTreeController()
          Returns the tree controller.
protected  void printComponent(IlxWPort port)
          Prints the HTML code that will display the graphical representation of this component.
static void registerTreeAsValueEditor(IlrWTree tree)
          Registers a tree as a value editor.
protected  void selectionChanged(IlxWPort port, IlrWTree tree, IlrTreeNode node)
          Invoked when a tree component is selected.
 
Methods inherited from class ilog.webui.dhtml.IlxWComponent
addPropertyChangeListener, addPropertyChangeListener, detach, doPrint, firePropertyChange, firePropertyChange, getName, getRealHtmlTagName, getStyle, invalidate, isInvalidated, notifyDependencies, print, removePropertyChangeListener, removePropertyChangeListener, setName, validate
 
Methods inherited from class ilog.webui.dhtml.IlxWContainer
add, add, getAttribute, getAttributeNames, getComponent, getComponentCount, getComponentNamed, getComponents, getManager, getParent, getUserAgentRules, indexOf, isAncestorOf, remove, remove, removeAll, removeAttribute, setAttribute, setAuthorRules, setFinalizer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

treeController

protected IlrTreeController treeController

treeWriter

protected ilog.rules.teamserver.web.tree.util.IlrDojoTreeWriter treeWriter

styleClass

protected String styleClass
Constructor Detail

IlrWTree

public IlrWTree(IlrTreeController treeController)
Constructs an IlrWTree instance.

Parameters:
treeController - The tree controller that mediates between the tree model and the tree.
See Also:
IlrTreeController
Method Detail

getTreeController

public IlrTreeController getTreeController()
Returns the tree controller.

Returns:
The tree controller.

printComponent

protected void printComponent(IlxWPort port)
                       throws IOException
Description copied from class: IlxWComponent
Prints the HTML code that will display the graphical representation of this component. This method is called by the IlxWComponent.print(ilog.webui.dhtml.IlxWPort) method.

Specified by:
printComponent in class IlxWComponent
Throws:
IOException
Parameters:
port - The port on which the component will be printed.
See Also:
IlxWComponent.print(ilog.webui.dhtml.IlxWPort)

selectionChanged

protected void selectionChanged(IlxWPort port,
                                IlrWTree tree,
                                IlrTreeNode node)
Invoked when a tree component is selected.

Parameters:
port - The port where the web components are printed in the HTML page.
tree - The tree.
node - The node selected.

registerTreeAsValueEditor

public static void registerTreeAsValueEditor(IlrWTree tree)
Registers a tree as a value editor. This method is called if you attempt to use this tree in a value editor.

Parameters:
tree - The tree to register.

Decision Center API

© Copyright IBM Corp. 1987, 2013