1 /*******************************************************************************2 * Copyright (c) 2004, 2005 IBM Corporation and others.3 * All rights reserved. This program and the accompanying materials4 * are made available under the terms of the Eclipse Public License v1.05 * which accompanies this distribution, and is available at6 * http://www.eclipse.org/legal/epl-v10.html7 * 8 * Contributors:9 * IBM Corporation - initial API and implementation10 *******************************************************************************/11 package org.eclipse.debug.internal.ui;12 13 import org.eclipse.core.resources.IMarker;14 import org.eclipse.debug.core.DebugPlugin;15 import org.eclipse.debug.core.model.IBreakpoint;16 import org.eclipse.jface.resource.ImageDescriptor;17 import org.eclipse.jface.text.source.Annotation;18 import org.eclipse.swt.graphics.Image;19 import org.eclipse.ui.texteditor.IAnnotationImageProvider;20 import org.eclipse.ui.texteditor.MarkerAnnotation;21 22 /**23 * Provides managed images for breakpoint annotations.24 * @since 3.025 */26 public class BreakpointImageProvider implements IAnnotationImageProvider {27 28 29 /* (non-Javadoc)30 * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getManagedImage(org.eclipse.jface.text.source.Annotation)31 */32 public Image getManagedImage(Annotation annotation) {33 if (annotation instanceof MarkerAnnotation) {34 IMarker marker = ((MarkerAnnotation)annotation).getMarker();35 if (marker != null) {36 IBreakpoint breakpoint = DebugPlugin.getDefault().getBreakpointManager().getBreakpoint(marker);37 if (breakpoint != null) {38 return DebugUIPlugin.getModelPresentation().getImage(breakpoint);39 }40 }41 }42 return null;43 }44 /* (non-Javadoc)45 * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptorId(org.eclipse.jface.text.source.Annotation)46 */47 public String getImageDescriptorId(Annotation annotation) {48 return null;49 }50 /* (non-Javadoc)51 * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptor(java.lang.String)52 */53 public ImageDescriptor getImageDescriptor(String imageDescritporId) {54 return null;55 }56 }57