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 TestDownAction extends TreeNodeAction { 30 31 32 public TestDownAction() { 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; 48 g=n.getTestNode().owner; 49 if (g != null) { 50 if (g.get(g.getChildCount()-1) == n.getTestNode()) 51 return false; 52 } 53 return true; 54 } 55 56 63 public void performAction(TestNodeDelegate[] activatedNodes) { 64 TestNodeDelegate n = (TestNodeDelegate)(activatedNodes[0]); 65 if (n == null) return; 66 TestNodeDelegate own = (TestNodeDelegate)(n.getParent()); 67 ((TestGroup)(own.getTestNode())).downNode(n.getTestNode()); 68 } 69 70 73 public String getHelpCtx() { 74 return "Move selected node down"; 75 } 76 77 82 public String getName() { 83 return "Down shift"; 84 } 85 86 } 87 | Popular Tags |