1 /******************************************************************************* 2 * Copyright (c) 2000, 2005 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.ui.texteditor; 12 13 import org.eclipse.swt.graphics.Image; 14 15 import org.eclipse.jface.resource.ImageDescriptor; 16 17 import org.eclipse.jface.text.source.Annotation; 18 19 /** 20 * Provides an image for a given annotation. 21 * 22 * @since 3.0 23 */ 24 public interface IAnnotationImageProvider { 25 26 /** 27 * Returns the image for the given annotation or <code>null</code>. The 28 * returned image is managed by this annotation image provided. If the 29 * annotation image provider does not support managed images, clients have 30 * to manage the annotation images. For that, clients first ask for the 31 * image descriptor id for a given annotation (<code>getImageDescriptorId(Annotation)</code>) 32 * as then for the image descriptor. The image descriptor id should be used 33 * to manage the annotation images using an <code>ImageRegistry</code>. 34 * 35 * @param annotation the annotation 36 * @return the managed image 37 */ 38 Image getManagedImage(Annotation annotation); 39 40 /** 41 * Returns the image descriptor id of the image for the given annotation. 42 * 43 * @param annotation the annotation 44 * @return the image descriptor id 45 */ 46 String getImageDescriptorId(Annotation annotation); 47 48 /** 49 * Returns the image descriptor for the given symbolic name. 50 * 51 * @param imageDescritporId the image descriptor id 52 * @return the image descriptor 53 */ 54 ImageDescriptor getImageDescriptor(String imageDescritporId); 55 } 56