FileDocCategorySizeDatePackage
DefaultTreeInfo.javaAPI DocJBoss 4.2.15507Fri Jul 13 21:02:14 BST 2007org.jboss.console.manager.interfaces.impl

DefaultTreeInfo

public class DefaultTreeInfo extends Object implements org.jboss.console.manager.interfaces.TreeInfo
see
author
Sacha Labourey.
version
$Revision: 57191 $

Revisions:

December 16, 2002 Sacha Labourey:

  • First implementation

Fields Summary
protected org.jboss.console.manager.interfaces.ManageableResource[]
roots
protected HashMap
resources
protected org.jboss.console.manager.interfaces.TreeAction
homeAction
protected String
jbossVersion
protected long
version
protected org.jboss.console.manager.interfaces.TreeNodeMenuEntry[]
rootMenus
protected String
iconUrl
Constructors Summary
public DefaultTreeInfo()

   
   // Static --------------------------------------------------------
   
   // Constructors --------------------------------------------------
   
      
   
      Package jbossPackage = Package.getPackage("org.jboss");
      jbossVersion = jbossPackage.getImplementationTitle() + " " +
               jbossPackage.getImplementationVersion();

   
Methods Summary
public synchronized voidaddTreeToResource(org.jboss.console.manager.interfaces.ManageableResource resource, org.jboss.console.manager.interfaces.TreeNode tree)

      ArrayList content = (ArrayList)resources.get (resource);
      if (content == null || content.size () == 0)
      {
         content = new ArrayList ();
         resources.put (resource, content);
      }       
      
      if (!content.contains (tree))
         content.add (tree);
   
public java.lang.StringgetDescription()

      return jbossVersion;
   
public org.jboss.console.manager.interfaces.TreeActiongetHomeAction()

      return this.homeAction;      
   
public java.lang.StringgetIconUrl()

      return this.iconUrl;
   
public org.jboss.console.manager.interfaces.TreeNodeMenuEntry[]getRootMenus()

      return this.rootMenus;
   
public org.jboss.console.manager.interfaces.ManageableResource[]getRootResources()

      return this.roots;
   
public longgetTreeVersion()

      return this.version;
   
public synchronized org.jboss.console.manager.interfaces.TreeNode[]getTreesForResource(org.jboss.console.manager.interfaces.ManageableResource resource)

      ArrayList content = (ArrayList)resources.get (resource);
      if (content == null || content.size () == 0)
         return null;
      else
      {
         TreeNode[] result = new TreeNode[content.size ()];
         return (TreeNode[])content.toArray (result);
      }
   
public voidsetHomeAction(org.jboss.console.manager.interfaces.TreeAction homeAction)

      this.homeAction = homeAction;
   
public voidsetIconUrl(java.lang.String url)

      this.iconUrl = url;
   
public voidsetRootMenus(org.jboss.console.manager.interfaces.TreeNodeMenuEntry[] menus)

      this.rootMenus = menus;
   
public voidsetRootResources(org.jboss.console.manager.interfaces.ManageableResource[] roots)

      this.roots = roots;
   
public voidsetTreeVersion(long version)

      this.version = version;
   
public java.lang.StringtoString()

      String result = "Root: " + roots + "\n" ;
      
      Iterator iter = resources.keySet ().iterator ();
      while (iter.hasNext ())
      {         
         ManageableResource key = (ManageableResource)iter.next();
         ArrayList content = (ArrayList)resources.get (key);
         
         result+="  Key: " + key + "\n";
         
         for (int i = 0; i < content.size(); i++)
         {
            result += "    Value: " + content.get(i);
         }
      
         result+="  ----\n";

      }
      return result;