KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > jellytools > modules > junit > nodes > JUnitNode


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.jellytools.modules.junit.nodes;
21
22 /*
23  * JUnitNode.java
24  *
25  * Created on 2/6/03 2:21 PM
26  */

27
28 import org.netbeans.jellytools.actions.*;
29 import org.netbeans.jellytools.modules.junit.actions.*;
30 import org.netbeans.jellytools.nodes.Node;
31 import javax.swing.tree.TreePath JavaDoc;
32 import java.awt.event.KeyEvent JavaDoc;
33 import org.netbeans.jemmy.operators.JTreeOperator;
34
35 /** JUnitNode Class
36  * @author dave */

37 public class JUnitNode extends Node {
38
39     private static final Action createTestsAction = new CreateTestsAction();
40     private static final Action executeTestAction = new ExecuteTestAction();
41     private static final Action openTestAction = new OpenTestAction();
42     private static final Action propertiesAction = new PropertiesAction();
43
44     /** creates new JUnitNode
45      * @param tree JTreeOperator of tree
46      * @param treePath String tree path */

47     public JUnitNode(JTreeOperator tree, String JavaDoc treePath) {
48         super(tree, treePath);
49     }
50
51     /** creates new JUnitNode
52      * @param tree JTreeOperator of tree
53      * @param treePath TreePath of node */

54     public JUnitNode(JTreeOperator tree, TreePath JavaDoc treePath) {
55         super(tree, treePath);
56     }
57
58     /** creates new JUnitNode
59      * @param parent parent Node
60      * @param treePath String tree path from parent Node */

61     public JUnitNode(Node parent, String JavaDoc treePath) {
62         super(parent, treePath);
63     }
64
65     /** tests popup menu items for presence */
66     public void verifyPopup() {
67         verifyPopup(new Action[]{
68             createTestsAction,
69             executeTestAction,
70             openTestAction,
71             propertiesAction
72         });
73     }
74
75     /** performs CreateTestsAction with this node */
76     public void createTests() {
77         createTestsAction.perform(this);
78     }
79
80     /** performs ExecuteTestAction with this node */
81     public void executeTest() {
82         executeTestAction.perform(this);
83     }
84
85     /** performs OpenTestAction with this node */
86     public void openTest() {
87         openTestAction.perform(this);
88     }
89
90     /** performs PropertiesAction with this node */
91     public void properties() {
92         propertiesAction.perform(this);
93     }
94 }
95
Popular Tags