1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.debug.ui;
13 import org.eclipse.core.resources.IMarker;
14 import org.eclipse.debug.ui.DebugUITools;
15 import org.eclipse.debug.ui.IDebugModelPresentation;
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;
23 * BreakpointImageProvider
27 public class BreakpointImageProvider implements IAnnotationImageProvider {
29 private IDebugModelPresentation fPresentation;
32 * @see org.eclipse.jface.text.source.IAnnotationImageProvider#getManagedImage(org.eclipse.jface.text.source.Annotation)
34 public Image getManagedImage(Annotation annotation) {
35 if (annotation instanceof MarkerAnnotation) {
36 MarkerAnnotation markerAnnotation = (MarkerAnnotation) annotation;
37 IMarker marker = markerAnnotation.getMarker();
38 if (marker != null && marker.exists())
39 return getPresentation().getImage(marker);
46 * @see org.eclipse.jface.text.source.IAnnotationImageProvider#getImageDescriptorId(org.eclipse.jface.text.source.Annotation)
48 public String getImageDescriptorId(Annotation annotation) {
53 * @see org.eclipse.jface.text.source.IAnnotationImageProvider#getImageDescriptor(java.lang.String)
55 public ImageDescriptor getImageDescriptor(String imageDescritporId) {
59 private IDebugModelPresentation getPresentation() {
60 if (fPresentation == null)
61 fPresentation = DebugUITools.newDebugModelPresentation();