From cd72e6b58ff20b9b87e711925f694ac36147edb9 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Mon, 21 Sep 2009 14:56:13 +0000 Subject: [PATCH] [289755] Update our BreakpointImageProvider to match the platform behaviour. I'm keeping this class instead of using the platform one directly because I expect to change it as part of the tracepoint work of bug 284286 --- .../internal/ui/BreakpointImageProvider.java | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/BreakpointImageProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/BreakpointImageProvider.java index 18509d34a9d..aafb62eeb32 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/BreakpointImageProvider.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/BreakpointImageProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2006 QNX Software Systems and others. + * Copyright (c) 2009 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,8 +11,9 @@ package org.eclipse.cdt.debug.internal.ui; import org.eclipse.core.resources.IMarker; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugModelPresentation; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.model.IBreakpoint; +import org.eclipse.debug.internal.ui.DebugUIPlugin; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.text.source.Annotation; import org.eclipse.swt.graphics.Image; @@ -25,17 +26,18 @@ import org.eclipse.ui.texteditor.MarkerAnnotation; */ public class BreakpointImageProvider implements IAnnotationImageProvider { - private IDebugModelPresentation fPresentation; - /* (non-Javadoc) * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getManagedImage(org.eclipse.jface.text.source.Annotation) */ public Image getManagedImage( Annotation annotation ) { if ( annotation instanceof MarkerAnnotation ) { - MarkerAnnotation markerAnnotation = (MarkerAnnotation)annotation; - IMarker marker = markerAnnotation.getMarker(); - if ( marker != null && marker.exists() ) - return getPresentation().getImage( marker ); + IMarker marker = ((MarkerAnnotation)annotation).getMarker(); + if ( marker != null && marker.exists() ) { + IBreakpoint breakpoint = DebugPlugin.getDefault().getBreakpointManager().getBreakpoint( marker ); + if ( breakpoint != null ) { + return DebugUIPlugin.getModelPresentation().getImage( breakpoint ); + } + } } return null; } @@ -53,10 +55,4 @@ public class BreakpointImageProvider implements IAnnotationImageProvider { public ImageDescriptor getImageDescriptor( String imageDescritporId ) { return null; } - - private IDebugModelPresentation getPresentation() { - if ( fPresentation == null ) - fPresentation = DebugUITools.newDebugModelPresentation(); - return fPresentation; - } }