From 95c4443423aebc10ba841cc3e9b80f3f37f124a4 Mon Sep 17 00:00:00 2001 From: robekras Date: Mon, 11 Feb 2013 20:15:59 +0100 Subject: [PATCH] 1) Readded the lost BreakpointImageProvider.java Signed-off-by: robekras --- .../phpeditor/BreakpointImageProvider.java | 64 ++++++++++++++++++++ 1 files changed, 64 insertions(+), 0 deletions(-) create mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/BreakpointImageProvider.java diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/BreakpointImageProvider.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/BreakpointImageProvider.java new file mode 100644 index 0000000..b57d14d --- /dev/null +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/BreakpointImageProvider.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright (c) 2000, 2003 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package net.sourceforge.phpeclipse.phpeditor; + +import org.eclipse.core.resources.IMarker; +import org.eclipse.debug.ui.DebugUITools; +import org.eclipse.debug.ui.IDebugModelPresentation; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.text.source.Annotation; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.texteditor.IAnnotationImageProvider; +import org.eclipse.ui.texteditor.MarkerAnnotation; + +/** + * BreakpointImageProvider + * + * @since 3.0 + */ +public class BreakpointImageProvider implements IAnnotationImageProvider { + + private IDebugModelPresentation fPresentation; + + /* + * @see org.eclipse.jface.text.source.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); + } + + return null; + } + + /* + * @see org.eclipse.jface.text.source.IAnnotationImageProvider#getImageDescriptorId(org.eclipse.jface.text.source.Annotation) + */ + public String getImageDescriptorId(Annotation annotation) { + return null; + } + + /* + * @see org.eclipse.jface.text.source.IAnnotationImageProvider#getImageDescriptor(java.lang.String) + */ + public ImageDescriptor getImageDescriptor(String imageDescritporId) { + return null; + } + + private IDebugModelPresentation getPresentation() { + if (fPresentation == null) + fPresentation = DebugUITools.newDebugModelPresentation(); + return fPresentation; + } +} -- 1.7.1