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