1 19 20 29 30 package org.netbeans.modules.web.monitor.client; 31 32 import org.openide.util.actions.CallableSystemAction; 33 import org.openide.util.HelpCtx; 34 import org.openide.util.NbBundle; 35 import org.openide.windows.Mode; 36 import org.openide.windows.WindowManager; 37 38 39 public class MonitorAction extends CallableSystemAction { 40 41 static transient Controller controller = null; 42 private static final boolean debug = false; 43 44 public MonitorAction() { 45 } 46 47 protected static Controller getController() { 48 return Controller.getInstance(); 49 } 50 51 public String getName () { 52 return NbBundle.getBundle(MonitorAction.class).getString("MON_HTTP_Transaction_13"); 53 } 54 55 public HelpCtx getHelpCtx () { 56 return new HelpCtx (MonitorAction.class); 57 } 58 59 protected String iconResource () { 60 return "org/netbeans/modules/web/monitor/client/icons/menuitem.gif"; 62 } 63 64 protected boolean asynchronous() { 65 return false; 66 } 67 68 73 74 public void performAction() { 75 openTransactionView(); 76 } 77 78 static void addTransaction(String id) { 79 if(!TransactionView.getInstance().isOpened()) { 80 boolean initialized = TransactionView.getInstance().isInitialized(); 81 openTransactionView(); 84 if (!initialized) { 85 return; 86 } 87 } 88 Controller.getInstance().addTransaction(id); 90 } 91 92 private static void openTransactionView() { 93 94 TransactionView tv = TransactionView.getInstance(); 95 WindowManager wm = WindowManager.getDefault(); 96 Mode mode = wm.findMode(tv); 97 98 if(mode == null) { 99 mode = wm.findMode("output"); if(mode != null) { 101 mode.dockInto(tv); 102 } 103 } 104 tv.open(); 105 tv.requestVisible(); 106 tv.requestActive(); 107 } 108 109 public static void log(String s) { 110 log("MonitorAction::" + s); } 112 } 113 114 | Popular Tags |