private static String getAnnotationType(JPDABreakpoint b, boolean isConditional) { boolean isInvalid = b.getValidity() == VALIDITY.INVALID; String annotationType; if (b instanceof LineBreakpoint) { 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); } else if (b instanceof FieldBreakpoint) { annotationType = b.isEnabled () ? EditorContext.FIELD_BREAKPOINT_ANNOTATION_TYPE : EditorContext.DISABLED_FIELD_BREAKPOINT_ANNOTATION_TYPE; } else if (b instanceof MethodBreakpoint) { annotationType = b.isEnabled () ? EditorContext.METHOD_BREAKPOINT_ANNOTATION_TYPE : EditorContext.DISABLED_METHOD_BREAKPOINT_ANNOTATION_TYPE; } else { throw new IllegalStateException(b.toString()); } if (isInvalid && b.isEnabled ()) annotationType += "_broken"; return annotationType; }
private static boolean isAnnotatable(Breakpoint b) { return (b instanceof LineBreakpoint || b instanceof FieldBreakpoint || b instanceof MethodBreakpoint) && !((JPDABreakpoint) b).isHidden(); }
public void breakpointAdded(Breakpoint breakpoint) { if (isAnnotatable(breakpoint)) { JPDABreakpoint b = (JPDABreakpoint) breakpoint; b.addPropertyChangeListener (this); RequestProcessor.getDefault().post(new AnnotationRefresh(b, false, true)); if (b instanceof LineBreakpoint) { LineBreakpoint lb = (LineBreakpoint) b; LineTranslations.getTranslations().registerForLineUpdates(lb); } } }
public void breakpointRemoved(Breakpoint breakpoint) { if (isAnnotatable(breakpoint)) { JPDABreakpoint b = (JPDABreakpoint) breakpoint; b.removePropertyChangeListener (this); RequestProcessor.getDefault().post(new AnnotationRefresh(b, true, false)); if (b instanceof LineBreakpoint) { LineBreakpoint lb = (LineBreakpoint) b; LineTranslations.getTranslations().unregisterFromLineUpdates(lb); } } }
boolean isConditional = condition.trim().length() > 0 || b.getHitCountFilteringStyle() != null; String annotationType = getAnnotationType(b, isConditional, breakpointsActive); DataObject dataObject;
/** Creates new form LineBreakpointPanel */ public ActionsPanel (JPDABreakpoint b) { breakpoint = b; initComponents (); cbSuspend.addItem (java.util.ResourceBundle.getBundle("org/netbeans/modules/debugger/jpda/ui/breakpoints/Bundle").getString("LBL_CB_Actions_Panel_Suspend_None")); cbSuspend.addItem (java.util.ResourceBundle.getBundle("org/netbeans/modules/debugger/jpda/ui/breakpoints/Bundle").getString("LBL_CB_Actions_Panel_Suspend_Current")); cbSuspend.addItem (java.util.ResourceBundle.getBundle("org/netbeans/modules/debugger/jpda/ui/breakpoints/Bundle").getString("LBL_CB_Actions_Panel_Suspend_All")); switch (b.getSuspend ()) { case JPDABreakpoint.SUSPEND_NONE: cbSuspend.setSelectedIndex (0); break; case JPDABreakpoint.SUSPEND_EVENT_THREAD: cbSuspend.setSelectedIndex (1); break; case JPDABreakpoint.SUSPEND_ALL: cbSuspend.setSelectedIndex (2); break; } if (b.getPrintText () != null) tfPrintText.setText (b.getPrintText ()); tfPrintText.setPreferredSize(new Dimension( 30*tfPrintText.getFontMetrics(tfPrintText.getFont()).charWidth('W'), tfPrintText.getPreferredSize().height)); tfPrintText.setCaretPosition(0); }
@Override public void breakpointAdded(Breakpoint breakpoint) { if (BreakpointAnnotationProvider.isAnnotatable(breakpoint)) { JPDABreakpoint b = (JPDABreakpoint) breakpoint; b.addPropertyChangeListener (this); getAnnotationProvider().postAnnotationRefresh(b, false, true); if (b instanceof LineBreakpoint) { LineBreakpoint lb = (LineBreakpoint) b; LineTranslations.getTranslations().registerForLineUpdates(lb); } } }
@Override public void breakpointRemoved(Breakpoint breakpoint) { if (BreakpointAnnotationProvider.isAnnotatable(breakpoint)) { JPDABreakpoint b = (JPDABreakpoint) breakpoint; b.removePropertyChangeListener (this); getAnnotationProvider().postAnnotationRefresh(b, true, false); if (b instanceof LineBreakpoint) { LineBreakpoint lb = (LineBreakpoint) b; LineTranslations.getTranslations().unregisterFromLineUpdates(lb); } } }
boolean isConditional = condition.trim().length() > 0 || b.getHitCountFilteringStyle() != null; String annotationType = getAnnotationType(b, isConditional, breakpointsActive); DataObject dataObject;
private static String getAnnotationType(JPDABreakpoint b, boolean isConditional, boolean active) { boolean isInvalid = b.getValidity() == VALIDITY.INVALID; String annotationType; if (b instanceof LineBreakpoint) { annotationType = b.isEnabled () ? (isConditional ? EditorContext.CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE : EditorContext.BREAKPOINT_ANNOTATION_TYPE) : EditorContext.DISABLED_BREAKPOINT_ANNOTATION_TYPE); } else if (b instanceof FieldBreakpoint) { annotationType = b.isEnabled () ? EditorContext.FIELD_BREAKPOINT_ANNOTATION_TYPE : EditorContext.DISABLED_FIELD_BREAKPOINT_ANNOTATION_TYPE; } else if (b instanceof MethodBreakpoint) { annotationType = b.isEnabled () ? EditorContext.METHOD_BREAKPOINT_ANNOTATION_TYPE : EditorContext.DISABLED_METHOD_BREAKPOINT_ANNOTATION_TYPE; } else if (b instanceof ClassLoadUnloadBreakpoint) { annotationType = b.isEnabled() ? EditorContext.CLASS_BREAKPOINT_ANNOTATION_TYPE : EditorContext.DISABLED_CLASS_BREAKPOINT_ANNOTATION_TYPE; } else if (isInvalid && b.isEnabled ()) { annotationType += "_broken"; // NOI18N
@Override public void breakpointAdded(Breakpoint breakpoint) { if (BreakpointAnnotationProvider.isAnnotatable(breakpoint)) { JPDABreakpoint b = (JPDABreakpoint) breakpoint; b.addPropertyChangeListener (this); getAnnotationProvider().postAnnotationRefresh(b, false, true); if (b instanceof LineBreakpoint) { LineBreakpoint lb = (LineBreakpoint) b; LineTranslations.getTranslations().registerForLineUpdates(lb); } } }
static boolean isAnnotatable(Breakpoint b) { return (b instanceof LineBreakpoint || b instanceof FieldBreakpoint || b instanceof MethodBreakpoint || b instanceof ClassLoadUnloadBreakpoint) && !((JPDABreakpoint) b).isHidden(); }
@Override public void breakpointRemoved(Breakpoint breakpoint) { if (BreakpointAnnotationProvider.isAnnotatable(breakpoint)) { JPDABreakpoint b = (JPDABreakpoint) breakpoint; b.removePropertyChangeListener (this); getAnnotationProvider().postAnnotationRefresh(b, true, false); if (b instanceof LineBreakpoint) { LineBreakpoint lb = (LineBreakpoint) b; LineTranslations.getTranslations().unregisterFromLineUpdates(lb); } } }
private static String getAnnotationType(JPDABreakpoint b, boolean isConditional, boolean active) { boolean isInvalid = b.getValidity() == VALIDITY.INVALID; String annotationType; if (b instanceof LineBreakpoint) { annotationType = b.isEnabled () ? (isConditional ? EditorContext.CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE : EditorContext.BREAKPOINT_ANNOTATION_TYPE) : EditorContext.DISABLED_BREAKPOINT_ANNOTATION_TYPE); } else if (b instanceof FieldBreakpoint) { annotationType = b.isEnabled () ? EditorContext.FIELD_BREAKPOINT_ANNOTATION_TYPE : EditorContext.DISABLED_FIELD_BREAKPOINT_ANNOTATION_TYPE; } else if (b instanceof MethodBreakpoint) { annotationType = b.isEnabled () ? EditorContext.METHOD_BREAKPOINT_ANNOTATION_TYPE : EditorContext.DISABLED_METHOD_BREAKPOINT_ANNOTATION_TYPE; } else if (b instanceof ClassLoadUnloadBreakpoint) { annotationType = b.isEnabled() ? EditorContext.CLASS_BREAKPOINT_ANNOTATION_TYPE : EditorContext.DISABLED_CLASS_BREAKPOINT_ANNOTATION_TYPE; } else if (isInvalid && b.isEnabled ()) { annotationType += "_broken"; // NOI18N
JPDABreakpoint b = (JPDABreakpoint) breakpoint; if (!annotatedBreakpoints.contains(b)) { b.addPropertyChangeListener (this); breakpointToAnnotations.put(b, new Annotation[] {}); if (b instanceof LineBreakpoint) {
static boolean isAnnotatable(Breakpoint b) { return (b instanceof LineBreakpoint || b instanceof FieldBreakpoint || b instanceof MethodBreakpoint || b instanceof ClassLoadUnloadBreakpoint) && !((JPDABreakpoint) b).isHidden(); }
boolean isInvalid = b.getValidity() == VALIDITY.INVALID; String annotationType; if (b instanceof LineBreakpoint) { annotationType = b.isEnabled () ? (isConditional ? EditorContext.CONDITIONAL_BREAKPOINT_ANNOTATION_TYPE : EditorContext.BREAKPOINT_ANNOTATION_TYPE) : EditorContext.DISABLED_BREAKPOINT_ANNOTATION_TYPE); } else if (b instanceof FieldBreakpoint) { annotationType = b.isEnabled () ? EditorContext.FIELD_BREAKPOINT_ANNOTATION_TYPE : EditorContext.DISABLED_FIELD_BREAKPOINT_ANNOTATION_TYPE; } else if (b instanceof MethodBreakpoint) { annotationType = b.isEnabled () ? EditorContext.METHOD_BREAKPOINT_ANNOTATION_TYPE : EditorContext.DISABLED_METHOD_BREAKPOINT_ANNOTATION_TYPE; return null; if (isInvalid && b.isEnabled ()) annotationType += "_broken";