1 19 package org.netbeans.test.editor.app.gui.actions; 20 21 import org.netbeans.test.editor.app.core.*; 22 import org.netbeans.test.editor.app.gui.tree.TestNodeDelegate; 23 24 29 public class TestUpAction extends TreeNodeAction { 30 31 32 public TestUpAction() { 33 } 34 35 41 public boolean enable(TestNodeDelegate[] activatedNodes) { 42 if (activatedNodes.length == 0) return false; 43 if (activatedNodes.length > 1) return false; 44 TestNodeDelegate n = activatedNodes[0]; 45 if (n.getTestNode() instanceof Test) return false; 46 TestGroup g; 47 g=n.getTestNode().owner; 48 if (g != null) { 49 if (g.get(0) == n.getTestNode()) 50 return false; 51 } 52 return true; 53 } 54 55 62 public void performAction(TestNodeDelegate[] activatedNodes) { 63 TestNodeDelegate n = (TestNodeDelegate)(activatedNodes[0]); 64 if (n == null) return; 65 TestNodeDelegate own = (TestNodeDelegate)(n.getParent()); 66 ((TestGroup)(own.getTestNode())).upNode(n.getTestNode()); 67 } 68 69 72 public String getHelpCtx() { 73 return "Move selected node up."; 74 } 75 76 81 public String getName() { 82 return "Up shift"; 83 } 84 85 } 86 | Popular Tags |