1 19 20 package org.netbeans.modules.loaderswitcher; 21 22 import org.openide.nodes.Node; 23 import org.openide.loaders.DataObject; 24 import org.openide.util.HelpCtx; 25 import org.openide.util.actions.CookieAction; 26 import org.openide.util.NbBundle; 27 28 32 public class ChangeTypeAction extends CookieAction { 33 34 static final long serialVersionUID = 1352346576761226839L; 35 36 protected boolean surviveFocusChange () { 37 return false; 38 } 39 40 protected boolean asynchronous() { 41 return false; 42 } 43 44 48 public String getName () { 49 return org.openide.util.NbBundle.getMessage(ChangeTypeAction.class, "Change_object_type"); 50 } 51 52 55 public HelpCtx getHelpCtx () { 56 return new HelpCtx (ChangeTypeAction.class); 57 } 58 59 62 protected String iconResource () { 63 return "org/netbeans/modules/loaderswitcher/ChangeTypeAction.gif"; } 65 66 67 protected int mode() { 68 return MODE_EXACTLY_ONE; 69 } 70 71 76 protected Class [] cookieClasses () { 77 return new Class [] { org.openide.loaders.DataObject.class }; 78 } 79 80 84 protected void performAction (final Node[] activatedNodes) { 85 for (int i = 0; i < activatedNodes.length; i++) { 86 DataObject es = (DataObject)activatedNodes[i].getCookie(DataObject.class); 87 if (es != null) { 88 ObjectType.convert (es); 89 } 90 } 91 } 92 } 93 | Popular Tags |