KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > ant > debugger > DebuggerAnnotation


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.ant.debugger;
21
22 import org.openide.text.Annotatable;
23 import org.openide.text.Annotation;
24 import org.openide.text.Line;
25 import org.openide.util.NbBundle;
26
27
28 /**
29  * Debugger Annotation class.
30  *
31  * @author Jan Jancura
32  */

33 public class DebuggerAnnotation extends Annotation {
34
35     /** Annotation type constant. */
36     public static final String JavaDoc BREAKPOINT_ANNOTATION_TYPE =
37         new String JavaDoc ("Breakpoint");
38     /** Annotation type constant. */
39     public static final String JavaDoc DISABLED_BREAKPOINT_ANNOTATION_TYPE =
40         new String JavaDoc ("DisabledBreakpoint");
41     /** Annotation type constant. */
42     public static final String JavaDoc CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE =
43         new String JavaDoc ("CondBreakpoint");
44     /** Annotation type constant. */
45     public static final String JavaDoc DISABLED_CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE =
46         new String JavaDoc ("DisabledCondBreakpoint");
47     /** Annotation type constant. */
48     public static final String JavaDoc CURRENT_LINE_ANNOTATION_TYPE =
49         new String JavaDoc ("CurrentPC");
50     /** Annotation type constant. */
51     public static final String JavaDoc CURRENT_LINE_ANNOTATION_TYPE2 =
52         new String JavaDoc ("CurrentPC2");
53     /** Annotation type constant. */
54     public static final String JavaDoc CURRENT_LINE_PART_ANNOTATION_TYPE =
55         new String JavaDoc ("CurrentPCLinePart");
56     /** Annotation type constant. */
57     public static final String JavaDoc CURRENT_LINE_PART_ANNOTATION_TYPE2 =
58         new String JavaDoc ("CurrentPC2LinePart");
59     /** Annotation type constant. */
60     public static final String JavaDoc CALL_STACK_FRAME_ANNOTATION_TYPE =
61         new String JavaDoc ("CallSite");
62
63     private Annotatable annotatable;
64     private String JavaDoc type;
65     
66     
67     public DebuggerAnnotation (String JavaDoc type, Annotatable annotatable) {
68         this.type = type;
69         this.annotatable = annotatable;
70         attach (annotatable);
71     }
72     
73     public String JavaDoc getAnnotationType () {
74         return type;
75     }
76     
77     public String JavaDoc getShortDescription () {
78         if (type == BREAKPOINT_ANNOTATION_TYPE)
79             return NbBundle.getBundle (DebuggerAnnotation.class).getString
80                 ("TOOLTIP_BREAKPOINT"); // NOI18N
81
else
82         if (type == DISABLED_BREAKPOINT_ANNOTATION_TYPE)
83             return NbBundle.getBundle (DebuggerAnnotation.class).getString
84                 ("TOOLTIP_DISABLED_BREAKPOINT"); // NOI18N
85
else
86         if (type == CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE)
87             return NbBundle.getBundle (DebuggerAnnotation.class).getString
88                 ("TOOLTIP_CONDITIONAL_BREAKPOINT"); // NOI18N
89
else
90         if (type == DISABLED_CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE)
91             return NbBundle.getBundle (DebuggerAnnotation.class).getString
92                 ("TOOLTIP_DISABLED_CONDITIONAL_BREAKPOINT"); // NOI18N
93
else
94         if (type == CURRENT_LINE_ANNOTATION_TYPE)
95             return NbBundle.getMessage
96                 (DebuggerAnnotation.class, "TOOLTIP_CURRENT_PC"); // NOI18N
97
else
98         if (type == CURRENT_LINE_ANNOTATION_TYPE2)
99             return NbBundle.getMessage
100                 (DebuggerAnnotation.class, "TOOLTIP_CURRENT_PC_2"); // NOI18N
101
else
102         if (type == CURRENT_LINE_PART_ANNOTATION_TYPE)
103             return NbBundle.getMessage
104                     (DebuggerAnnotation.class, "TOOLTIP_CURRENT_PC"); // NOI18N
105
else
106         if (type == CALL_STACK_FRAME_ANNOTATION_TYPE)
107             return NbBundle.getBundle (DebuggerAnnotation.class).getString
108                 ("TOOLTIP_CALLSITE"); // NOI18N
109
return null;
110     }
111 }
112
Popular Tags