1 19 20 package org.netbeans.modules.httpserver; 21 22 import javax.swing.Action ; 23 import org.openide.actions.PropertiesAction; 24 import org.openide.filesystems.Repository; 25 import org.openide.loaders.DataObject; 26 import org.openide.loaders.DataObjectNotFoundException; 27 import org.openide.nodes.*; 28 import org.openide.util.actions.SystemAction; 29 30 34 public class HttpServerNode extends FilterNode { 35 36 public HttpServerNode() throws DataObjectNotFoundException { 37 this (HttpServerSettings.createViewNode()); 38 } 39 40 public HttpServerNode(Node original) { 41 super(original, Children.LEAF); 42 } 43 44 public Node cloneNode() { 45 return new HttpServerNode(getOriginal()); 48 } 49 50 53 public Action [] getActions(boolean context) { 54 return new Action [] { 55 SystemAction.get(StartHttpServerAction.class), 56 SystemAction.get(StopHttpServerAction.class), 57 null, 58 SystemAction.get(PropertiesAction.class) 59 }; 60 } 61 62 63 public org.openide.nodes.Node.PropertySet[] getPropertySets () { 64 PropertySet[] ps = super.getPropertySets (); 65 for (int i = 0; i< ps.length; i++) { 66 if (Sheet.PROPERTIES.equals (ps[i].getName ())) { 67 ps[i].setValue ("helpID", HttpServerNode.class.getName ()+"_properties"); } 69 else if (Sheet.EXPERT.equals (ps[i].getName ())) { 70 ps[i].setValue ("helpID", HttpServerNode.class.getName ()+"_expert"); } 72 } 73 return ps; 74 } 75 76 } 77 | Popular Tags |