org.exolab.jms.tools.admin
Class OpenJMSConsumer

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

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

This class controls all dispay characteristics and menus related to a consumer. Currently only add, delete and edit are allowed. Add is added from the QueueTopic handler. Only one menu is created for all consumers since it is modal, it can be shared by all the consumer nodes. The menu is moved and displayed underneath the node that activated it.

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

Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
OpenJMSConsumer(java.lang.String consumerName, javax.swing.JTree tree)
          The constructor gets its unique name for this consumer plus a reference to its parent tree.
 
Method Summary
protected  void createCommands()
          Create the menu for all consumers and set up the Action events for each menu item.
 void displayCommands(java.awt.Rectangle loc)
          This node has been right clicked.
 boolean getAllowsChildren()
          No children are allowed for consumers at this point.
 boolean isLeaf()
          All consumers are leaves in the tree for this release.
 java.lang.String toString()
          The unique name of this consumer.
 void update()
          This method is defined by the interface, but is not required by consumers for this release.
 
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

OpenJMSConsumer

public OpenJMSConsumer(java.lang.String consumerName,
                       javax.swing.JTree tree)
The constructor gets its unique name for this consumer plus a reference to its parent tree.

If this is the first consumer call the menu for all consumers is created.

Parameters:
consumerName - This consumers unique name.
tree - The parent tree this consumer belons to.
Method Detail

createCommands

protected void createCommands()
Create the menu for all consumers 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()
No children are allowed for consumers at this point.
Overrides:
getAllowsChildren in class javax.swing.tree.DefaultMutableTreeNode
Returns:
boolean Always returns false.

isLeaf

public boolean isLeaf()
All consumers are leaves in the tree for this release.
Overrides:
isLeaf in class javax.swing.tree.DefaultMutableTreeNode
Returns:
boolean Always returns true.

update

public void update()
This method is defined by the interface, but is not required by consumers for this release.
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 consumer message menu.
Specified by:
displayCommands in interface OpenJMSNode
Parameters:
The - location of this Consumer node.

toString

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


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