This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 109831
Collapse All | Expand All

(-)a/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/Bundle.properties (+5 lines)
Lines 65-70 Link Here
65
TOOLTIP_DISABLED_METHOD_BREAKPOINT=Disabled Method Breakpoint
65
TOOLTIP_DISABLED_METHOD_BREAKPOINT=Disabled Method Breakpoint
66
TOOLTIP_CLASS_BREAKPOINT=Class Breakpoint
66
TOOLTIP_CLASS_BREAKPOINT=Class Breakpoint
67
TOOLTIP_DISABLED_CLASS_BREAKPOINT=Disabled Class Breakpoint
67
TOOLTIP_DISABLED_CLASS_BREAKPOINT=Disabled Class Breakpoint
68
TOOLTIP_HITCOUNT=Hit count: {0} {1}
69
TOOLTIP_CONDITION=Condition: {0}
70
TOOLTIP_HITCOUNTSTYLE_EQUAL=\=
71
TOOLTIP_HITCOUNTSTYLE_GREATER=>
72
TOOLTIP_HITCOUNTSTYLE_MULTIPLE=multiple of
68
73
69
#SourcesNodeModel
74
#SourcesNodeModel
70
CTL_SourcesModel_Column_Name_LibrarySources = {0}
75
CTL_SourcesModel_Column_Name_LibrarySources = {0}
(-)a/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/DebuggerBreakpointAnnotation.java (+73 lines)
Lines 44-51 Link Here
44
44
45
package org.netbeans.modules.debugger.jpda.projects;
45
package org.netbeans.modules.debugger.jpda.projects;
46
46
47
import java.util.ArrayList;
48
import java.util.List;
47
import org.netbeans.api.debugger.Breakpoint;
49
import org.netbeans.api.debugger.Breakpoint;
50
import org.netbeans.api.debugger.Breakpoint.HIT_COUNT_FILTERING_STYLE;
51
import org.netbeans.api.debugger.jpda.ClassLoadUnloadBreakpoint;
52
import org.netbeans.api.debugger.jpda.FieldBreakpoint;
48
import org.netbeans.api.debugger.jpda.JPDABreakpoint;
53
import org.netbeans.api.debugger.jpda.JPDABreakpoint;
54
import org.netbeans.api.debugger.jpda.LineBreakpoint;
55
import org.netbeans.api.debugger.jpda.MethodBreakpoint;
49
import org.netbeans.spi.debugger.jpda.EditorContext;
56
import org.netbeans.spi.debugger.jpda.EditorContext;
50
import org.netbeans.spi.debugger.ui.BreakpointAnnotation;
57
import org.netbeans.spi.debugger.ui.BreakpointAnnotation;
51
58
Lines 81-87 Link Here
81
        return line;
88
        return line;
82
    }
89
    }
83
    
90
    
91
    /**
92
     * Gets the condition of a breakpoint. 
93
     * @param b
94
     * @return empty {@link String} if no condition is supported. 
95
     */
96
    private String getCondition (Breakpoint b) {
97
        // Copied from org.netbeans.modules.debugger.jpda.projects.BreakpointAnnotationProvider#addAnnotationTo
98
        String condition = "";
99
        if (b instanceof LineBreakpoint) {
100
            condition = ((LineBreakpoint) b).getCondition();
101
        } else if (b instanceof FieldBreakpoint) {
102
            condition = ((FieldBreakpoint) b).getCondition();
103
        } else if (b instanceof MethodBreakpoint) {
104
            condition = ((MethodBreakpoint) b).getCondition();
105
        }
106
        return condition;
107
    }
108
109
    @Override
84
    public String getShortDescription () {
110
    public String getShortDescription () {
111
112
        List<String> list = new ArrayList<String>();
113
        //add condition if available
114
        String condition = getCondition(breakpoint);
115
        if (!condition.trim().isEmpty()) {
116
            String tooltip=NbBundle.getMessage(DebuggerBreakpointAnnotation.class, "TOOLTIP_CONDITION", condition);
117
            list.add(tooltip);
118
        }
119
120
        // add hit count if available
121
        HIT_COUNT_FILTERING_STYLE hitCountFilteringStyle = breakpoint.getHitCountFilteringStyle();
122
        if (null != hitCountFilteringStyle) {
123
            String op = "";
124
            switch (hitCountFilteringStyle) {
125
                case EQUAL:
126
                    op = NbBundle.getMessage(DebuggerBreakpointAnnotation.class, "TOOLTIP_HITCOUNTSTYLE_EQUAL");
127
                    break;
128
                case GREATER:
129
                    op = NbBundle.getMessage(DebuggerBreakpointAnnotation.class, "TOOLTIP_HITCOUNTSTYLE_GREATER");
130
                    break;
131
                case MULTIPLE:
132
                    op = NbBundle.getMessage(DebuggerBreakpointAnnotation.class, "TOOLTIP_HITCOUNTSTYLE_MULTIPLE");
133
                    break;
134
            }
135
            String tooltip=NbBundle.getMessage(DebuggerBreakpointAnnotation.class, "TOOLTIP_HITCOUNT", op, breakpoint.getHitCountFilter());
136
            list.add(tooltip);
137
        }
138
139
140
        String shortDesc = getShortDescriptionIntern();
141
        StringBuilder result = new StringBuilder();
142
        if (null!=shortDesc){
143
            result.append(shortDesc);
144
        }
145
        //append more information if available
146
        if (!list.isEmpty()){
147
            result.append("\n");
148
            for (String text : list) {
149
                result.append("\n");
150
                result.append(text);
151
            }
152
        }
153
154
        return result.toString();
155
    }
156
    
157
    private String getShortDescriptionIntern () {
85
        if (type.endsWith("_broken")) {
158
        if (type.endsWith("_broken")) {
86
            if (breakpoint.getValidity() == Breakpoint.VALIDITY.INVALID) {
159
            if (breakpoint.getValidity() == Breakpoint.VALIDITY.INVALID) {
87
                String msg = breakpoint.getValidityMessage();
160
                String msg = breakpoint.getValidityMessage();

Return to bug 109831