FileDocCategorySizeDatePackage
RootWrapper.javaAPI DocJBoss 4.2.14584Fri Jul 13 21:02:14 BST 2007org.jboss.console.navtree

RootWrapper

public class RootWrapper extends Object implements NodeWrapper
Default implementation of NodeWrapper for the first level of the tree which aggregates the first level of plugins using the "bootstrap" managed objects
see
org.jboss.console.navtree.NodeWrapper
author
Sacha Labourey.
version
$Revision: 57191 $

Revisions:

20 decembre 2002 Sacha Labourey:

  • First implementation

Fields Summary
org.jboss.console.manager.interfaces.TreeInfo
tree
NodeWrapper[]
sons
org.jboss.console.manager.interfaces.TreeNode[]
realSons
Constructors Summary
public RootWrapper(org.jboss.console.manager.interfaces.TreeInfo tree)


   // Static --------------------------------------------------------
   
   // Constructors --------------------------------------------------
     
      
   
      this.tree = tree;

      // create starting set of subnodes
      //
      Vector nodes = new Vector ();
      ManageableResource[] roots = tree.getRootResources ();
      for (int i=0; i<roots.length; i++)
      {
         ManageableResource mr = roots[i];
         TreeNode[] ns = tree.getTreesForResource (mr);
         if (ns != null && ns.length > 0)
            nodes.addAll (java.util.Arrays.asList (ns));
      }

      realSons = new TreeNode[nodes.size ()];
      sons = new NodeWrapper[nodes.size ()];

      for (int i=0; i<realSons.length; i++) 
         realSons[i] = (TreeNode)nodes.elementAt (i);
               
   
Methods Summary
public org.jboss.console.manager.interfaces.TreeActiongetAssociatedAction()

      return this.tree.getHomeAction ();
   
public java.lang.ObjectgetChild(int index)

      if (index >= sons.length)
         return null;

      if (sons[index] == null)
         sons[index] = new StdNodeWrapper(realSons[index], tree, "");

      return sons[index];
   
public intgetChildCount()

      return this.realSons.length;
   
public java.lang.StringgetDescription()

      return this.tree.getDescription ();
   
public java.lang.StringgetIconUrl()

      return this.tree.getIconUrl(); 
   
public intgetIndexOfChild(java.lang.Object child)

      for (int i=0; i<this.sons.length; i++)
      {
         if (this.sons[i] == child)
            return i;
      }
      return -1;         
   
public org.jboss.console.manager.interfaces.TreeNodeMenuEntry[]getMenuEntries()

      return this.tree.getRootMenus(); 
   
public java.lang.StringgetPath()

      return "";
   
public booleanisLeaf()

      return this.sons.length == 0;
   
public java.lang.StringtoString()

      return "JBoss Management Console";