Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: e6c6fae287138377087ab1f8c6e718e0ca94f7f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*******************************************************************************
 * Copyright (c) 2000, 2004 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 org.eclipse.ui.texteditor;

import org.eclipse.swt.graphics.Image;

import org.eclipse.jface.resource.ImageDescriptor;

import org.eclipse.jface.text.source.Annotation;

/**
 * Provides an image for a given annotation.
 * 
 * @since 3.0
 */
public interface IAnnotationImageProvider {
	
	/**
	 * Returns the image for the given annotation or <code>null</code>. The
	 * returned image is managed by this annotation image provided. If the
	 * annotation image provider does not support managed images, clients have
	 * to manage the annotation images. For that, clients first ask for the
	 * image descriptor id for a given annotation (<code>getImageDescriptorId(Annotation)</code>)
	 * as then for the image descriptor. The image descriptor id should be used
	 * to manage the annotation images using an <code>ImageRegistry</code>.
	 * 
	 * @param annotation the annotation
	 * @return the managed image
	 */
	Image getManagedImage(Annotation annotation);
	
	/**
	 * Returns the image descriptor id of the image for the given annotation.
	 * 
	 * @param annotation the annotation
	 * @return the image descriptor id
	 */
	String getImageDescriptorId(Annotation annotation);

	/**
	 * Returns the image descriptor for the given symbolic name.
	 * 
	 * @param imageDescritporId the image descriptor id
	 * @return the image descriptor
	 */
	ImageDescriptor getImageDescriptor(String imageDescritporId);
}

Back to the top