diff --git a/debug/org.eclipse.cdt.debug.ui/icons/obj16/eventbreakpointd_obj.gif b/debug/org.eclipse.cdt.debug.ui/icons/obj16/eventbreakpointd_obj.gif index 4a04deca138..351c43e5658 100644 Binary files a/debug/org.eclipse.cdt.debug.ui/icons/obj16/eventbreakpointd_obj.gif and b/debug/org.eclipse.cdt.debug.ui/icons/obj16/eventbreakpointd_obj.gif differ diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java index b5c48949486..028775f5885 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java @@ -79,6 +79,8 @@ public class CDebugImages { public static final String IMG_OBJS_TRACEPOINT_DISABLED = NAME_PREFIX + "trcpd_obj.gif"; //$NON-NLS-1$ public static final String IMG_OBJS_WATCHPOINT_ENABLED = NAME_PREFIX + "readwrite_obj.gif"; //$NON-NLS-1$ public static final String IMG_OBJS_WATCHPOINT_DISABLED = NAME_PREFIX + "readwrite_obj_disabled.gif"; //$NON-NLS-1$ + public static final String IMG_OBJS_EVENTBREAKPOINT_ENABLED = NAME_PREFIX + "eventbreakpoint_obj.gif"; //$NON-NLS-1$ + public static final String IMG_OBJS_EVENTBREAKPOINT_DISABLED = NAME_PREFIX + "eventbreakpointd_obj.gif"; //$NON-NLS-1$ public static final String IMG_OBJS_READ_WATCHPOINT_ENABLED = NAME_PREFIX + "read_obj.gif"; //$NON-NLS-1$ public static final String IMG_OBJS_READ_WATCHPOINT_DISABLED = NAME_PREFIX + "read_obj_disabled.gif"; //$NON-NLS-1$ public static final String IMG_OBJS_WRITE_WATCHPOINT_ENABLED = NAME_PREFIX + "write_obj.gif"; //$NON-NLS-1$ @@ -161,6 +163,8 @@ public class CDebugImages { public static final ImageDescriptor DESC_OBJS_TRACEPOINT_DISABLED = createManaged( T_DLCL, IMG_OBJS_TRACEPOINT_DISABLED ); public static final ImageDescriptor DESC_OBJS_WATCHPOINT_ENABLED = createManaged( T_OBJ, IMG_OBJS_WATCHPOINT_ENABLED ); public static final ImageDescriptor DESC_OBJS_WATCHPOINT_DISABLED = createManaged( T_OBJ, IMG_OBJS_WATCHPOINT_DISABLED ); + public static final ImageDescriptor DESC_OBJS_EVENTBREAKPOINT_ENABLED = createManaged( T_OBJ, IMG_OBJS_EVENTBREAKPOINT_ENABLED ); + public static final ImageDescriptor DESC_OBJS_EVENTBREAKPOINT_DISABLED = createManaged( T_OBJ, IMG_OBJS_EVENTBREAKPOINT_DISABLED ); public static final ImageDescriptor DESC_OBJS_READ_WATCHPOINT_ENABLED = createManaged( T_OBJ, IMG_OBJS_READ_WATCHPOINT_ENABLED ); public static final ImageDescriptor DESC_OBJS_READ_WATCHPOINT_DISABLED = createManaged( T_OBJ, IMG_OBJS_READ_WATCHPOINT_DISABLED ); public static final ImageDescriptor DESC_OBJS_WRITE_WATCHPOINT_ENABLED = createManaged( T_OBJ, IMG_OBJS_WRITE_WATCHPOINT_ENABLED ); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java index 5dfdf61c217..5355ae3e700 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java @@ -38,6 +38,7 @@ import org.eclipse.cdt.debug.core.model.ICBreakpoint; import org.eclipse.cdt.debug.core.model.ICDebugElement; import org.eclipse.cdt.debug.core.model.ICDebugElementStatus; import org.eclipse.cdt.debug.core.model.ICDebugTarget; +import org.eclipse.cdt.debug.core.model.ICEventBreakpoint; import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint; import org.eclipse.cdt.debug.core.model.ICGlobalVariable; import org.eclipse.cdt.debug.core.model.ICLineBreakpoint; @@ -332,6 +333,10 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode if ( breakpoint instanceof ICWatchpoint ) { return getWatchpointImage( (ICWatchpoint)breakpoint ); } + if ( breakpoint instanceof ICEventBreakpoint ) { + return getEventBreakpointImage( (ICEventBreakpoint)breakpoint ); + } + } catch( CoreException e ) { } @@ -381,6 +386,11 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode return getImageCache().getImageFor( new OverlayImageDescriptor( fDebugImageRegistry.get( descriptor ), computeOverlays( watchpoint ) ) ); } + protected Image getEventBreakpointImage( ICEventBreakpoint evtBreakpoint ) throws CoreException { + ImageDescriptor descriptor = evtBreakpoint.isEnabled() ? CDebugImages.DESC_OBJS_EVENTBREAKPOINT_ENABLED : CDebugImages.DESC_OBJS_EVENTBREAKPOINT_DISABLED; + return getImageCache().getImageFor( new OverlayImageDescriptor( fDebugImageRegistry.get( descriptor ), computeOverlays( evtBreakpoint ) ) ); + } + @Override public String getText( Object element ) { String bt = getBaseText( element ); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/CEventBreakpointsLabelProviderFactory.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/CEventBreakpointsLabelProviderFactory.java index b8b1db1b245..f3f58b10c41 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/CEventBreakpointsLabelProviderFactory.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/CEventBreakpointsLabelProviderFactory.java @@ -15,6 +15,7 @@ package org.eclipse.cdt.debug.ui.breakpoints; import org.eclipse.cdt.debug.core.DebugCoreMessages; import org.eclipse.cdt.debug.core.model.ICBreakpoint; import org.eclipse.cdt.debug.core.model.ICEventBreakpoint; +import org.eclipse.cdt.debug.internal.ui.CDebugModelPresentation; import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdapterFactory; @@ -30,8 +31,6 @@ import com.ibm.icu.text.MessageFormat; * Factory for event breakpoint label provider */ public class CEventBreakpointsLabelProviderFactory implements IAdapterFactory { - public static final String IMG_OBJS_EVENTBREAKPOINT_ENABLED = "icons/obj16/eventbreakpoint_obj.gif"; //$NON-NLS-1$ - public static final String IMG_OBJS_EVENTBREAKPOINT_DISABLED = "icons/obj16/eventbreakpointd_obj.gif"; //$NON-NLS-1$ private static ILabelProvider fLabelProvider = new LabelProvider() { @Override public String getText(Object element) { @@ -75,19 +74,19 @@ public class CEventBreakpointsLabelProviderFactory implements IAdapterFactory { return null; } + /** + * Returns null. We do not provide the image because it would require + * duplicating centralized code in {@link CDebugModelPresentation}, + * particularly the code that determines the proper overlays. This + * adapter is actually only called from within CDebugModelPresentation + * and we know it will do the right thing for an event breakpoint if we + * return null here. + * + * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object) + */ @Override public Image getImage(Object element) { - try { - if (element instanceof ICEventBreakpoint) { - ICEventBreakpoint eventBkpt = (ICEventBreakpoint) element; - if (eventBkpt.isEnabled()) - return CDebugUIPlugin.getDefault().getImage(IMG_OBJS_EVENTBREAKPOINT_ENABLED); - else - return CDebugUIPlugin.getDefault().getImage(IMG_OBJS_EVENTBREAKPOINT_DISABLED); - } - } catch (CoreException e) { - CDebugUIPlugin.log(e); - } + return null; } };