1 19 package org.openide.actions; 20 21 import org.openide.nodes.Index; 22 import org.openide.nodes.Node; 23 import org.openide.util.HelpCtx; 24 import org.openide.util.NbBundle; 25 import org.openide.util.actions.*; 26 27 28 33 public class ReorderAction extends CookieAction { 34 protected boolean surviveFocusChange() { 35 return false; 36 } 37 38 public String getName() { 39 return NbBundle.getBundle(ReorderAction.class).getString("Reorder"); 40 } 41 42 public HelpCtx getHelpCtx() { 43 return new HelpCtx(ReorderAction.class); 44 } 45 46 protected Class [] cookieClasses() { 47 return new Class [] { Index.class }; 48 } 49 50 protected int mode() { 51 return MODE_EXACTLY_ONE; 52 } 53 54 protected void performAction(Node[] activatedNodes) { 55 Node n = activatedNodes[0]; Index order = (Index) n.getCookie(Index.class); 57 order.reorder(); 58 } 59 60 protected boolean asynchronous() { 61 return false; 62 } 63 } 64 | Popular Tags |