KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > ide > IMarkerImageProvider


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.internal.ide;
12
13 import org.eclipse.core.resources.IMarker;
14
15 /**
16  * Clients should implement this interface when creating an
17  * extension to define images for marker dynamically.
18  * <p>
19  * The name of the class should be specified in the extension contributed
20  * to the workbench's maker image provider extension point
21  * (named <code>"org.eclipse.ui.makerImageProvider"</code>).
22  * For example, the plug-in's XML markup might contain:
23  * <pre>
24  * &LT;extension point="org.eclipse.ui.makerImageProvider"&GT;
25  * &LT;imageprovider
26  * id="com.example.myplugin.myprofiderID"
27  * makertype="com.example.myMarkerType"
28  * icon="icons/basic/view16/myGIF.gif"/&GT;
29  * &LT;/extension&GT;
30  * </pre>
31  * It can also define the image provider using the tag <code>class</code>
32  * instead of icon.
33  * </p>
34  * Either the image path specified by the tag <code>icon</code> or
35  * the path returned from <code>getImagePath</code> will be used
36  * to create the image when the following code is executed:
37  * <p><code>myMarker.getAdapter(IWorkbenchAdapter).getImageDescriptor(myMarker);</code></p>
38  */

39 public interface IMarkerImageProvider {
40     /**
41      * Returns the relative path for the image
42      * to be used for displaying an marker in the workbench.
43      * This path is relative to the plugin location
44      *
45      * Returns <code>null</code> if there is no appropriate image.
46      *
47      * @param marker The marker to get an image path for.
48      * @return String
49      *
50      */

51     public String JavaDoc getImagePath(IMarker marker);
52 }
53
Popular Tags