--- a/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/Bundle.properties +++ a/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/Bundle.properties @@ -65,6 +65,11 @@ TOOLTIP_DISABLED_METHOD_BREAKPOINT=Disabled Method Breakpoint TOOLTIP_CLASS_BREAKPOINT=Class Breakpoint TOOLTIP_DISABLED_CLASS_BREAKPOINT=Disabled Class Breakpoint +TOOLTIP_HITCOUNT=Hit count: {0} {1} +TOOLTIP_CONDITION=Condition: {0} +TOOLTIP_HITCOUNTSTYLE_EQUAL=\= +TOOLTIP_HITCOUNTSTYLE_GREATER=> +TOOLTIP_HITCOUNTSTYLE_MULTIPLE=multiple of #SourcesNodeModel CTL_SourcesModel_Column_Name_LibrarySources = {0} --- a/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/DebuggerBreakpointAnnotation.java +++ a/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/DebuggerBreakpointAnnotation.java @@ -44,8 +44,15 @@ package org.netbeans.modules.debugger.jpda.projects; +import java.util.ArrayList; +import java.util.List; import org.netbeans.api.debugger.Breakpoint; +import org.netbeans.api.debugger.Breakpoint.HIT_COUNT_FILTERING_STYLE; +import org.netbeans.api.debugger.jpda.ClassLoadUnloadBreakpoint; +import org.netbeans.api.debugger.jpda.FieldBreakpoint; import org.netbeans.api.debugger.jpda.JPDABreakpoint; +import org.netbeans.api.debugger.jpda.LineBreakpoint; +import org.netbeans.api.debugger.jpda.MethodBreakpoint; import org.netbeans.spi.debugger.jpda.EditorContext; import org.netbeans.spi.debugger.ui.BreakpointAnnotation; @@ -81,7 +88,73 @@ return line; } + /** + * Gets the condition of a breakpoint. + * @param b + * @return empty {@link String} if no condition is supported. + */ + private String getCondition (Breakpoint b) { + // Copied from org.netbeans.modules.debugger.jpda.projects.BreakpointAnnotationProvider#addAnnotationTo + String condition = ""; + if (b instanceof LineBreakpoint) { + condition = ((LineBreakpoint) b).getCondition(); + } else if (b instanceof FieldBreakpoint) { + condition = ((FieldBreakpoint) b).getCondition(); + } else if (b instanceof MethodBreakpoint) { + condition = ((MethodBreakpoint) b).getCondition(); + } + return condition; + } + + @Override public String getShortDescription () { + + List list = new ArrayList(); + //add condition if available + String condition = getCondition(breakpoint); + if (!condition.trim().isEmpty()) { + String tooltip=NbBundle.getMessage(DebuggerBreakpointAnnotation.class, "TOOLTIP_CONDITION", condition); + list.add(tooltip); + } + + // add hit count if available + HIT_COUNT_FILTERING_STYLE hitCountFilteringStyle = breakpoint.getHitCountFilteringStyle(); + if (null != hitCountFilteringStyle) { + String op = ""; + switch (hitCountFilteringStyle) { + case EQUAL: + op = NbBundle.getMessage(DebuggerBreakpointAnnotation.class, "TOOLTIP_HITCOUNTSTYLE_EQUAL"); + break; + case GREATER: + op = NbBundle.getMessage(DebuggerBreakpointAnnotation.class, "TOOLTIP_HITCOUNTSTYLE_GREATER"); + break; + case MULTIPLE: + op = NbBundle.getMessage(DebuggerBreakpointAnnotation.class, "TOOLTIP_HITCOUNTSTYLE_MULTIPLE"); + break; + } + String tooltip=NbBundle.getMessage(DebuggerBreakpointAnnotation.class, "TOOLTIP_HITCOUNT", op, breakpoint.getHitCountFilter()); + list.add(tooltip); + } + + + String shortDesc = getShortDescriptionIntern(); + StringBuilder result = new StringBuilder(); + if (null!=shortDesc){ + result.append(shortDesc); + } + //append more information if available + if (!list.isEmpty()){ + result.append("\n"); + for (String text : list) { + result.append("\n"); + result.append(text); + } + } + + return result.toString(); + } + + private String getShortDescriptionIntern () { if (type.endsWith("_broken")) { if (breakpoint.getValidity() == Breakpoint.VALIDITY.INVALID) { String msg = breakpoint.getValidityMessage();