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.core.cookies.PackCookie; 23 import org.netbeans.test.editor.app.gui.tree.TestNodeDelegate; 24 25 30 public class TestPackAction extends TreeNodeAction { 31 32 33 public TestPackAction() { 34 } 35 36 42 public boolean enable(TestNodeDelegate[] activatedNodes) { 43 boolean ret=false; 44 for (int i=0;i < activatedNodes.length;i++) { 45 PackCookie pc = (PackCookie) (activatedNodes[i].getTestNode().getCookie(PackCookie.class)); 46 47 if (pc == null) { 48 return false; 49 } else if (!pc.isPacked()) { 50 ret = true; 51 } 52 } 53 return ret; 54 } 55 56 63 public void performAction(TestNodeDelegate[] activatedNodes) { 64 for(int i=0;i < activatedNodes.length;i++) { 65 PackCookie pc = (PackCookie) activatedNodes[i].getTestNode().getCookie(PackCookie.class); 66 67 if (pc != null && !pc.isPacked()) { 68 pc.pack(); 69 } 70 } 71 } 72 73 76 public String getHelpCtx() { 77 return "Pack Log Actions into String actions"; 78 } 79 80 85 public String getName() { 86 return "Pack"; 87 } 88 89 } 90 | Popular Tags |