/** * Gets the condition of a breakpoint. * @param b The breakpoint * @return The condition or empty {@link String} if no condition is supported. */ static String getCondition(Breakpoint b) { if (!(b instanceof JPDABreakpoint)) { return ""; // e.g. JSP breakpoints } if (b instanceof LineBreakpoint) { return ((LineBreakpoint) b).getCondition(); } else if (b instanceof FieldBreakpoint) { return ((FieldBreakpoint) b).getCondition(); } else if (b instanceof MethodBreakpoint) { return ((MethodBreakpoint) b).getCondition(); } else if (b instanceof ClassLoadUnloadBreakpoint) { return ""; } else { throw new IllegalStateException(b.toString()); } }
/** * Gets the condition of a breakpoint. * @param b The breakpoint * @return The condition or empty {@link String} if no condition is supported. */ static String getCondition(Breakpoint b) { if (!(b instanceof JPDABreakpoint)) { return ""; // e.g. JSP breakpoints } if (b instanceof LineBreakpoint) { return ((LineBreakpoint) b).getCondition(); } else if (b instanceof FieldBreakpoint) { return ((FieldBreakpoint) b).getCondition(); } else if (b instanceof MethodBreakpoint) { return ((MethodBreakpoint) b).getCondition(); } else if (b instanceof ClassLoadUnloadBreakpoint) { return ""; } else { throw new IllegalStateException(b.toString()); } }
/** * Adds annotation to url:line where the given breakpoint is set. * * @param b breakpoint to annotate * * @return annotation or <code>null</code>, when the annotation can not be * created at the url:line where the given breakpoint is set. */ public static Object annotate(LineBreakpoint b) { String url = b.getURL(); int lineNumber = b.getLineNumber(); if (lineNumber < 1) { return null; } String condition = b.getCondition(); boolean isConditional = (condition != null) && !condition.trim().equals(""); // NOI18N String annotationType = b.isEnabled() ? (isConditional ? EditorContext.CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE : EditorContext.BREAKPOINT_ANNOTATION_TYPE) : (isConditional ? EditorContext.DISABLED_CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE : EditorContext.DISABLED_BREAKPOINT_ANNOTATION_TYPE); return annotate(url, lineNumber, annotationType, b); } }
condition = ((LineBreakpoint) b).getCondition(); } else if (b instanceof FieldBreakpoint) { condition = ((FieldBreakpoint) b).getCondition();
/** Creates new form LineBreakpointPanel */ public LineBreakpointPanel (LineBreakpoint b) { breakpoint = b; initComponents (); String url = b.getURL(); try { URI uri = new URI(url); tfFileName.setText(uri.getPath()); } catch (Exception e) { tfFileName.setText(url); } tfFileName.setPreferredSize(new Dimension( 30*tfFileName.getFontMetrics(tfFileName.getFont()).charWidth('W'), tfFileName.getPreferredSize().height)); tfLineNumber.setText(Integer.toString(b.getLineNumber())); conditionsPanel = new ConditionsPanel(); setupConditionPane(); conditionsPanel.showClassFilter(false); conditionsPanel.setCondition(b.getCondition()); conditionsPanel.setHitCountFilteringStyle(b.getHitCountFilteringStyle()); conditionsPanel.setHitCount(b.getHitCountFilter()); cPanel.add(conditionsPanel, "Center"); actionsPanel = new ActionsPanel (b); pActions.add (actionsPanel, "Center"); }
public static Object annotate ( LineBreakpoint b ) { String url = b.getURL (); int lineNumber = b.getLineNumber (); if (lineNumber < 1) return null; String condition = b.getCondition (); boolean isConditional = (condition != null) && !"".equals (condition.trim ()); // NOI18N boolean isInvalid = b.getValidity() == VALIDITY.INVALID; String annotationType = b.isEnabled () ? (isConditional ? EditorContext.CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE : EditorContext.BREAKPOINT_ANNOTATION_TYPE) : (isConditional ? EditorContext.DISABLED_CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE : EditorContext.DISABLED_BREAKPOINT_ANNOTATION_TYPE); if (isInvalid && b.isEnabled ()) annotationType += "_broken"; return getContext().annotate ( url, lineNumber, annotationType, null ); }
URLs = new String[] { ((LineBreakpoint) b).getURL () }; lineNumbers = new int[] { ((LineBreakpoint) b).getLineNumber() }; condition = ((LineBreakpoint) b).getCondition(); } else if (b instanceof FieldBreakpoint) { String className = ((FieldBreakpoint) b).getClassName();