org.exolab.jms.jndiadministration
Class OpenJMSContext

java.lang.Object
  |
  +--javax.swing.tree.DefaultMutableTreeNode
        |
        +--org.exolab.jms.jndiadministration.OpenJMSContext
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.tree.MutableTreeNode, OpenJMSNode, java.io.Serializable, javax.swing.tree.TreeNode

public class OpenJMSContext
extends javax.swing.tree.DefaultMutableTreeNode
implements OpenJMSNode

This class controls all dispay characteristics and menus related to a queue/topic object. Currently only add/delete, edit and purge is supported. Add is added from the OpenJMSServer node. Only one menu is created for all queue/topics since it is modal, it can be shared by all the nodes.

Version:
$Revision: 1.6 $ $Date: 2003/08/17 01:32:23 $
Author:
Jim Mourikis
See Also:
AdminMgr, Serialized Form

Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
OpenJMSContext(java.lang.String contextName, java.lang.String parentName, javax.swing.JTree tree)
          The constructor gets its unique name for this context and a reference to its parent tree.
 
Method Summary
protected  void createCommands()
          Create the menu for all contexts and set up the Action events for each menu item.
 void displayCommands(java.awt.Rectangle loc)
          This node has been right clicked.
 boolean getAllowsChildren()
          Children are allowed for all contexts
 boolean isLeaf()
          Contexts are leaves iff they have no objects registered against them.
 java.lang.String toString()
          The unique name of this Context
 void update()
          As a performance enhancement, no child is added to the context until after it is expanded.
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpenJMSContext

public OpenJMSContext(java.lang.String contextName,
                      java.lang.String parentName,
                      javax.swing.JTree tree)
The constructor gets its unique name for this context and a reference to its parent tree.

If this is the first context call, the menu for all contexts is created.

Parameters:
contextName - This context name.
tree - The parent tree this context belongs to.
Method Detail

createCommands

protected void createCommands()
Create the menu for all contexts and set up the Action events for each menu item. Since menus are shared, the callbacks called are static. Once a menu is slected, the slected node can be determined from the parent object.

getAllowsChildren

public boolean getAllowsChildren()
Children are allowed for all contexts
Overrides:
getAllowsChildren in class javax.swing.tree.DefaultMutableTreeNode
Returns:
boolean Always returns true.

isLeaf

public boolean isLeaf()
Contexts are leaves iff they have no objects registered against them.
Overrides:
isLeaf in class javax.swing.tree.DefaultMutableTreeNode
Returns:
boolean true if no objects are registered.

update

public void update()
As a performance enhancement, no child is added to the context until after it is expanded.
Specified by:
update in interface OpenJMSNode

displayCommands

public void displayCommands(java.awt.Rectangle loc)
This node has been right clicked. The locations of this node is given by the loc object. Use this location to popup the context menu.
Specified by:
displayCommands in interface OpenJMSNode
Parameters:
The - location of this node.

toString

public java.lang.String toString()
The unique name of this Context
Specified by:
toString in interface OpenJMSNode
Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode
Returns:
String the context name


Copyright © 1999-2004 The OpenJMS Group. All Rights Reserved.