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

AdminTreeBrowser

public class AdminTreeBrowser extends Object
Holder of the browser tree and associated handlers. Can then be embedded in any code such as applet code. Specific actions are handled through a TreeContext callback object used to communicate between this object and its container.
see
org.jboss.console.navtree.TreeContext
see
AppletBrowser
author
Sacha Labourey.
version
$Revision: 57191 $

Fields Summary
TreeContext
ctx
ConsoleTreeModel
tm
TreeCellRenderer
cellRenderer
TreeSelectionListener
selectionListener
OpenNodeAccounter
openNodeAccounter
String
webHost
public static final String
RIGHT_FRAME_NAME
private JTree
tree
Constructors Summary
public AdminTreeBrowser(TreeContext ctx)
Creates new form AppletTreeBrowser

   
        
        
   
      this.ctx = ctx;      
      
      tm = new ConsoleTreeModel (ctx);
      cellRenderer = new TreeCellRenderer (ctx);
      //selectionListener = new SelectionListener ();
      
      initComponents ();
      
      openNodeAccounter  = new OpenNodeAccounter(getTree());
      
      //getTree().addTreeSelectionListener (selectionListener);
      getTree().addMouseListener (new PopupMenuMgr());
      //getTree().addTreeExpansionListener (openNodeAccounter);
      getTree().getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION);
      ToolTipManager.sharedInstance().registerComponent(getTree());      
   
Methods Summary
public TreeCellRenderergetCellRenderer()

      return this.cellRenderer;
   
public javax.swing.event.TreeSelectionListenergetSelectionListener()

      return this.selectionListener;
   
public javax.swing.JTreegetTree()

      return this.tree;
   
public javax.swing.tree.TreeModelgetTreeModel()

      return this.tm;
   
private voidinitComponents()
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.

      tree = new javax.swing.JTree();

      tree.setCellRenderer(getCellRenderer());
      tree.setModel(getTreeModel());
      tree.setAutoscrolls(true);

   
public voidrefreshTree(boolean force)

      try
      {
         this.tm.refreshTree (force);
      }
      catch (Exception displayed)
      {
         displayed.printStackTrace();
      }