1) Readded the lost BreakpointImageProvider.java
authorrobekras <robert.kraske@weihenstephan.org>
Mon, 11 Feb 2013 19:15:59 +0000 (20:15 +0100)
committerrobekras <robert.kraske@weihenstephan.org>
Mon, 11 Feb 2013 19:17:01 +0000 (20:17 +0100)
Signed-off-by: robekras <robert.kraske@weihenstephan.org>

net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/BreakpointImageProvider.java [new file with mode: 0644]

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 (file)
index 0000000..b57d14d
--- /dev/null
@@ -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;
+       }
+}