1 48 49 50 package org.exolab.jms.tools.admin; 51 52 import java.awt.event.ActionEvent ; 53 import java.awt.event.ActionListener ; 54 55 import javax.swing.JMenuItem ; 56 import javax.swing.JOptionPane ; 57 import javax.swing.JPopupMenu ; 58 import javax.swing.JTree ; 59 60 61 69 public class OpenJMSQueue 70 extends OpenJMSObject { 71 72 80 public OpenJMSQueue(String name, JTree tree) { 81 super(name, tree); 82 } 83 84 91 protected void createCommands() { 92 _commands = new JPopupMenu (); 93 JMenuItem m = new JMenuItem ("Delete Queue"); 94 m.addActionListener(new ActionListener () { 95 96 public void actionPerformed(ActionEvent evt) { 97 deleteQueue(); 98 } 99 } 100 ); 101 _commands.add(m); 102 } 103 104 107 public void update() { 108 } 109 110 120 static private void deleteQueue() { 121 OpenJMSQueue This = (OpenJMSQueue) getInstanceSelected(); 122 QueryDialog.instance().display 123 ("Are you sure you want to delete \nselected Queue: " 124 + This._name); 125 if (org.exolab.jms.tools.admin.QueryDialog.instance().isConfirmed()) { 126 if (AbstractAdminConnection.instance().removeDestination( 127 This._name)) { 128 This.removeFromParent(); 129 This.refresh(); 130 } else { 131 JOptionPane.showMessageDialog 132 (_tree, "Failed to destroy Queue", 133 "Destroy Queue Error", JOptionPane.ERROR_MESSAGE); 134 } 135 } 136 } 137 138 } | Popular Tags |