org.exolab.jms.tools.admin
Class OpenJMSDestination

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

public abstract class OpenJMSDestination
extends javax.swing.tree.DefaultMutableTreeNode
implements OpenJMSNode

This is the base class for all destination nodes. A destination is either a queue or a topic.

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

Field Summary
protected  javax.swing.JPopupMenu commands_
           
protected  boolean commandsCreated_
           
protected static java.text.SimpleDateFormat dateFormat_
           
protected  java.lang.String destinationName_
           
protected  boolean isExplored_
           
protected  boolean isLeaf_
           
protected static javax.swing.JTree tree_
           
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
OpenJMSDestination(java.lang.String destinationName, javax.swing.JTree tree)
          The constructor gets its unique name for this queue/topic and a reference to its parent tree.
 
Method Summary
protected abstract  void createCommands()
          Create the menu for all queue/topics 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 queue/topics
protected static OpenJMSDestination getInstanceSelected()
          Get the particular instance of the queue/topic that has been selected.
 boolean isLeaf()
          Queue/Topics are leaves iff they have no consumers registered against them.
protected  void refresh()
          This node has changed.
 java.lang.String toString()
          The unique name of this queue/topic.
 
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
 
Methods inherited from interface org.exolab.jms.tools.admin.OpenJMSNode
update
 

Field Detail

destinationName_

protected java.lang.String destinationName_

isLeaf_

protected boolean isLeaf_

isExplored_

protected boolean isExplored_

commands_

protected javax.swing.JPopupMenu commands_

commandsCreated_

protected boolean commandsCreated_

dateFormat_

protected static java.text.SimpleDateFormat dateFormat_

tree_

protected static javax.swing.JTree tree_
Constructor Detail

OpenJMSDestination

public OpenJMSDestination(java.lang.String destinationName,
                          javax.swing.JTree tree)
The constructor gets its unique name for this queue/topic and a reference to its parent tree.

If this is the first queue/topic call, the menu for all queue/topics is created.

Parameters:
destinationName - This queue/topic name.
tree - The parent tree this queue/topic belongs to.
Method Detail

createCommands

protected abstract void createCommands()
Create the menu for all queue/topics 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 queue/topics
Overrides:
getAllowsChildren in class javax.swing.tree.DefaultMutableTreeNode
Returns:
boolean Always returns true.

isLeaf

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

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 queue/topic 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 queue/topic.
Specified by:
toString in interface OpenJMSNode
Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode
Returns:
String the queue/topic name.

refresh

protected void refresh()
This node has changed. Inform the parent tree that it needs to be re-drawn.

getInstanceSelected

protected static OpenJMSDestination getInstanceSelected()
Get the particular instance of the queue/topic that has been selected.
Returns:
OpenJMSDestination the instance selected.


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