KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > junit > output > CallstackFrameNode


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.modules.junit.output;
21 import java.awt.event.ActionEvent JavaDoc;
22 import java.io.File JavaDoc;
23 import java.io.IOException JavaDoc;
24 import javax.swing.AbstractAction JavaDoc;
25 import javax.swing.Action JavaDoc;
26 import org.netbeans.api.java.classpath.ClassPath;
27 import org.netbeans.api.project.FileOwnerQuery;
28 import org.netbeans.api.project.Project;
29 import org.netbeans.api.project.SourceGroup;
30 import org.netbeans.modules.junit.wizards.Utils;
31 import org.netbeans.spi.java.classpath.support.ClassPathSupport;
32 import org.openide.ErrorManager;
33 import org.openide.cookies.EditorCookie;
34 import org.openide.filesystems.FileObject;
35 import org.openide.filesystems.FileUtil;
36 import org.openide.loaders.DataObject;
37 import org.openide.loaders.DataObjectNotFoundException;
38 import org.openide.nodes.AbstractNode;
39 import org.openide.nodes.Children;
40 import org.openide.nodes.Node;
41 import org.openide.text.Line;
42
43 /**
44  *
45  * @author Marian Petras
46  */

47 final class CallstackFrameNode extends AbstractNode {
48     
49     /** */
50     private final String JavaDoc frameInfo;
51     
52     /** Creates a new instance of CallstackFrameNode */
53     public CallstackFrameNode(final String JavaDoc frameInfo) {
54         this(frameInfo, null);
55     }
56     
57     /**
58      * Creates a new instance of CallstackFrameNode
59      *
60      * @param frameInfo line of a callstack, e.g. <code>foo.bar.Baz:314</code>
61      * @param displayName display name for the node, or <code>null</code>
62      * to use the default display name for the given
63      * callstack frame info
64      */

65     public CallstackFrameNode(final String JavaDoc frameInfo,
66                               final String JavaDoc displayName) {
67         super(Children.LEAF);
68         setDisplayName(displayName != null
69                        ? displayName
70                        : "at " + frameInfo); //NOI18N
71
setIconBaseWithExtension(
72                 "org/netbeans/modules/junit/output/res/empty.gif"); //NOI18N
73

74         this.frameInfo = frameInfo;
75     }
76     
77     /**
78      */

79     public Action JavaDoc getPreferredAction() {
80         return new JumpAction(this, frameInfo);
81     }
82     
83 }
84
Popular Tags