1 19 package org.openide.actions; 20 21 import org.openide.nodes.Node; 22 import org.openide.nodes.NodeOperation; 23 import org.openide.util.HelpCtx; 24 import org.openide.util.NbBundle; 25 import org.openide.util.actions.NodeAction; 26 27 28 32 public class CustomizeAction extends NodeAction { 33 protected void performAction(Node[] activatedNodes) { 34 NodeOperation.getDefault().customize(activatedNodes[0]); 35 } 36 37 protected boolean asynchronous() { 38 return false; 39 } 40 41 protected boolean enable(Node[] activatedNodes) { 42 if ((activatedNodes == null) || (activatedNodes.length != 1)) { 43 return false; 44 } 45 46 return activatedNodes[0].hasCustomizer(); 47 } 48 49 public String getName() { 50 return NbBundle.getMessage(CustomizeAction.class, "Customize"); 51 } 52 53 public HelpCtx getHelpCtx() { 54 return new HelpCtx(CustomizeAction.class); 55 } 56 } 57 | Popular Tags |