1 19 20 package org.netbeans.tests.j2eeserver.plugin.registry; 21 22 import org.openide.nodes.*; 23 import org.openide.util.actions.*; 24 import java.util.*; 25 import org.netbeans.tests.j2eeserver.plugin.jsr88.*; 26 27 31 public class ManagerNode extends AbstractNode { 32 static java.util.Collection bogusNodes = java.util.Arrays.asList(new Node[] { Node.EMPTY, Node.EMPTY }); 33 34 public ManagerNode(DepManager manager) { 35 super(new MyChildren(bogusNodes)); 36 setDisplayName("Original:"+manager.getName()); 37 setIconBase("org/netbeans/tests/j2eeserver/plugin/registry/manager"); 38 } 39 40 public javax.swing.Action [] getActions(boolean context) { 41 return new javax.swing.Action [] { 42 SystemAction.get(ManagerAction.class) 43 }; 44 } 45 46 public PropertySet[] getPropertySets() { 47 Sheet sheet = Sheet.createDefault(); 48 Sheet.Set ps = sheet.get(Sheet.PROPERTIES); 49 ps.put(new PropertySupport.ReadWrite( 52 "ManagerHome", String .class, 54 "Manager Home", 55 "Home of manager") { 56 public Object getValue() { 57 return "Madison"; 58 } 59 public void setValue(Object home) { 60 } 61 }); 62 return new PropertySet[] { ps }; 63 } 64 65 public static class MyChildren extends Children.Array { 66 public MyChildren(Collection nodes) { 67 super(nodes); 68 } 69 } 70 71 public static class ManagerAction extends NodeAction { 72 public String getName () { return "Manager Action"; } 73 74 protected boolean enable(Node[] activatedNodes) { 75 return true; 76 } 77 78 public org.openide.util.HelpCtx getHelpCtx() { 79 return org.openide.util.HelpCtx.DEFAULT_HELP; 80 } 81 82 protected void performAction(Node[] activatedNodes) { 83 System.out.println("Some one called Manager?"); 84 } 85 } 86 } 87 | Popular Tags |