1 16 17 package org.mc4j.console.connection; 18 19 import org.mc4j.ems.connection.bean.EmsBean; 20 import org.openide.nodes.Node; 21 import org.openide.util.HelpCtx; 22 import org.openide.util.actions.NodeAction; 23 import org.openide.windows.IOProvider; 24 import org.openide.windows.OutputWriter; 25 26 import java.util.SortedSet ; 27 28 33 public class StatsIntrospectorAction extends NodeAction { 34 35 protected void performAction(Node[] nodes) { 36 ConnectionNode node = (ConnectionNode)nodes[0]; 37 38 OutputWriter w = IOProvider.getDefault().getIO("Stats Output", true).getOut(); 39 40 SortedSet <EmsBean> beans = node.getEmsConnection().getBeans(); 41 42 for (EmsBean bean : beans) { 43 if (bean.getAttribute("Stats") != null) { 44 w.println("\t" + bean.getBeanName().getCanonicalName()); 45 } 46 } 47 } 48 49 50 protected boolean enable(Node[] nodes) { 51 return ((nodes.length == 1) && 52 (nodes[0] instanceof ConnectionNode) && 53 (((ConnectionNode)nodes[0]).isConnected())); 54 } 55 56 public String getName() { 57 return "Print Stats Nodes"; 58 } 59 60 protected String iconResource() { 61 return null; 62 } 63 64 public HelpCtx getHelpCtx() { 65 return HelpCtx.DEFAULT_HELP; 66 } 69 70 } 71 | Popular Tags |