1 19 20 package org.netbeans.modules.scripting.php.dbginterface; 21 22 import org.openide.text.Annotatable; 23 import org.openide.text.Annotation; 24 import org.openide.util.NbBundle; 25 26 27 32 public class DebuggerAnnotation extends Annotation { 33 34 35 public static final String BREAKPOINT_ANNOTATION_TYPE = "Breakpoint"; 36 public static final String DISABLED_BREAKPOINT_ANNOTATION_TYPE = "DisabledBreakpoint"; 37 public static final String CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE = "CondBreakpoint"; 38 public static final String DISABLED_CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE = "DisabledCondBreakpoint"; 39 public static final String CURRENT_LINE_ANNOTATION_TYPE = "CurrentPC"; 40 public static final String CURRENT_LINE_ANNOTATION_TYPE2 = "CurrentPC2"; 41 public static final String CURRENT_LINE_PART_ANNOTATION_TYPE = "CurrentPCLinePart"; 42 public static final String CURRENT_LINE_PART_ANNOTATION_TYPE2 = "CurrentPC2LinePart"; 43 public static final String CALL_STACK_FRAME_ANNOTATION_TYPE = "CallSite"; 44 public static final String ERROR_ANNOTATION_TYPE = "PHPError"; 45 public static final String NOTICE_ANNOTATION_TYPE = "PHPNotice"; 46 public static final String WARNING_ANNOTATION_TYPE = "PHPWarning"; 47 48 private Annotatable annotatable; 49 private String type; 50 private String message; 51 52 public DebuggerAnnotation(String type, Annotatable annotatable) { 53 this.type = type; 54 this.annotatable = annotatable; 55 attach(annotatable); 56 } 57 58 public DebuggerAnnotation(String type, Annotatable annotatable, String message) { 59 this.type = type; 60 this.annotatable = annotatable; 61 this.message = message; 62 63 attach(annotatable); 64 } 65 66 public String getAnnotationType() { 67 return type; 68 } 69 70 public String getShortDescription() { 71 if (type == BREAKPOINT_ANNOTATION_TYPE) { 72 return NbBundle.getBundle(DebuggerAnnotation.class).getString( 73 "TT_BREAKPOINT"); } else if (type == DISABLED_BREAKPOINT_ANNOTATION_TYPE) { 75 return NbBundle.getBundle(DebuggerAnnotation.class).getString( 76 "TT_DISABLED_BREAKPOINT"); } else if (type == CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE) { 78 return NbBundle.getBundle(DebuggerAnnotation.class).getString( 79 "TT_CONDITIONAL_BREAKPOINT"); } else if (type == DISABLED_CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE) { 81 return NbBundle.getBundle(DebuggerAnnotation.class).getString( 82 "TT_DISABLED_CONDITIONAL_BREAKPOINT"); } else if (type == CURRENT_LINE_ANNOTATION_TYPE) { 84 return NbBundle.getMessage(DebuggerAnnotation.class, 85 "TT_CURRENT_PC"); } else if (type == CURRENT_LINE_ANNOTATION_TYPE2) { 87 return NbBundle.getMessage(DebuggerAnnotation.class, 88 "TT_CURRENT_PC_2"); } else if (type == CURRENT_LINE_PART_ANNOTATION_TYPE) { 90 return NbBundle.getMessage(DebuggerAnnotation.class, 91 "TT_CURRENT_PC"); } else if (type == CALL_STACK_FRAME_ANNOTATION_TYPE) { 93 return NbBundle.getBundle(DebuggerAnnotation.class).getString( 94 "TT_CALLSITE"); } 96 else if (message != null) { 97 return message; 98 } 99 100 return null; 101 } 102 } 103 | Popular Tags |