001: /*******************************************************************************
002: * Copyright (c) 2000, 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.jdt.ui;
011:
012: import org.eclipse.swt.graphics.Image;
013:
014: import org.eclipse.jface.resource.ImageDescriptor;
015:
016: import org.eclipse.jdt.internal.ui.JavaPluginImages;
017:
018: /**
019: * Standard images provided by the Java UI plug-in. This class offers access to the
020: * standard images in two forms:
021: * <ul>
022: * <li>Use <code>ISharedImages.getImage(IMG_OBJS_<i>FOO</i>)</code>
023: * to access the shared standard <code>Image</code> object (caller must not
024: * dispose of image).</li>
025: * <li>Use <code>ISharedImages.getImageDescriptor(IMG_OBJS_<i>FOO</i>)</code>
026: * to access the standard <code>ImageDescriptor</code> object (caller is
027: * responsible for disposing of any <code>Image</code> objects it creates using
028: * this descriptor).</li>
029: * </ul>
030: * <p>
031: * This interface is not intended to be implemented by clients.
032: * </p>
033: */
034: public interface ISharedImages {
035:
036: /**
037: * Key to access the shared image or image descriptor for a Java compilation unit.
038: */
039: public static final String IMG_OBJS_CUNIT = JavaPluginImages.IMG_OBJS_CUNIT;
040:
041: /**
042: * Key to access the shared image or image descriptor for a Java class file.
043: */
044: public static final String IMG_OBJS_CFILE = JavaPluginImages.IMG_OBJS_CFILE;
045:
046: /**
047: * Key to access the shared image or image descriptor for a JAR archive.
048: */
049: public static final String IMG_OBJS_JAR = JavaPluginImages.IMG_OBJS_JAR;
050:
051: /**
052: * Key to access the shared image or image descriptor for a JAR with source.
053: * @since 3.0
054: */
055: public static final String IMG_OBJS_JAR_WITH_SOURCE = JavaPluginImages.IMG_OBJS_JAR_WSRC;
056:
057: /**
058: * Key to access the shared image or image descriptor for external archives.
059: * @since 2.1
060: */
061: public static final String IMG_OBJS_EXTERNAL_ARCHIVE = JavaPluginImages.IMG_OBJS_EXTJAR;
062:
063: /**
064: * Key to access the shared image or image descriptor for external archives with source.
065: * @since 2.1
066: */
067: public static final String IMG_OBJS_EXTERNAL_ARCHIVE_WITH_SOURCE = JavaPluginImages.IMG_OBJS_EXTJAR_WSRC;
068:
069: /**
070: * Key to access the shared image or image descriptor for a classpath variable entry.
071: * @since 3.2
072: */
073: public static final String IMG_OBJS_CLASSPATH_VAR_ENTRY = JavaPluginImages.IMG_OBJS_ENV_VAR;
074:
075: /**
076: * Key to access the shared image or image descriptor for a library (class path container).
077: * @since 3.0
078: */
079: public static final String IMG_OBJS_LIBRARY = JavaPluginImages.IMG_OBJS_LIBRARY;
080:
081: /**
082: * Key to access the shared image or image descriptor for a package fragment root.
083: * @since 3.0
084: */
085: public static final String IMG_OBJS_PACKFRAG_ROOT = JavaPluginImages.IMG_OBJS_PACKFRAG_ROOT;
086:
087: /**
088: * Key to access the shared image or image descriptor for a package.
089: */
090: public static final String IMG_OBJS_PACKAGE = JavaPluginImages.IMG_OBJS_PACKAGE;
091:
092: /**
093: * Key to access the shared image or image descriptor for an empty package.
094: * @since 3.0
095: */
096: public static final String IMG_OBJS_EMPTY_PACKAGE = JavaPluginImages.IMG_OBJS_EMPTY_PACKAGE;
097:
098: /**
099: * Key to access the shared image or image descriptor for a logical package.
100: * @since 3.0
101: */
102: public static final String IMG_OBJS_LOGICAL_PACKAGE = JavaPluginImages.IMG_OBJS_LOGICAL_PACKAGE;
103:
104: /**
105: * Key to access the shared image or image descriptor for an empty logical package.
106: * @since 3.0
107: */
108: public static final String IMG_OBJS_EMPTY_LOGICAL_PACKAGE = JavaPluginImages.IMG_OBJS_EMPTY_LOGICAL_PACKAGE;
109:
110: /**
111: * Key to access the shared image or image descriptor for a class.
112: */
113: public static final String IMG_OBJS_CLASS = JavaPluginImages.IMG_OBJS_CLASS;
114:
115: /**
116: * Key to access the shared image or image descriptor for a class with default visibility.
117: * @since 3.0
118: */
119: public static final String IMG_OBJS_CLASS_DEFAULT = JavaPluginImages.IMG_OBJS_CLASS_DEFAULT;
120:
121: /**
122: * Key to access the shared image or image descriptor for a public inner class.
123: * @since 3.0
124: */
125: public static final String IMG_OBJS_INNER_CLASS_PUBLIC = JavaPluginImages.IMG_OBJS_INNER_CLASS_PUBLIC;
126:
127: /**
128: * Key to access the shared image or image descriptor for a inner class with default visibility.
129: * @since 3.0
130: */
131: public static final String IMG_OBJS_INNER_CLASS_DEFAULT = JavaPluginImages.IMG_OBJS_INNER_CLASS_DEFAULT;
132:
133: /**
134: * Key to access the shared image or image descriptor for a protected inner class.
135: * @since 3.0
136: */
137: public static final String IMG_OBJS_INNER_CLASS_PROTECTED = JavaPluginImages.IMG_OBJS_INNER_CLASS_PROTECTED;
138:
139: /**
140: * Key to access the shared image or image descriptor for a private inner class.
141: * @since 3.0
142: */
143: public static final String IMG_OBJS_INNER_CLASS_PRIVATE = JavaPluginImages.IMG_OBJS_INNER_CLASS_PRIVATE;
144:
145: /**
146: * Key to access the shared image or image descriptor for an interface.
147: */
148: public static final String IMG_OBJS_INTERFACE = JavaPluginImages.IMG_OBJS_INTERFACE;
149:
150: /**
151: * Key to access the shared image or image descriptor for an interface with default visibility.
152: * @since 3.0
153: */
154: public static final String IMG_OBJS_INTERFACE_DEFAULT = JavaPluginImages.IMG_OBJS_INTERFACE_DEFAULT;
155:
156: /**
157: * Key to access the shared image or image descriptor for a public inner interface.
158: * @since 3.0
159: */
160: public static final String IMG_OBJS_INNER_INTERFACE_PUBLIC = JavaPluginImages.IMG_OBJS_INNER_INTERFACE_PUBLIC;
161:
162: /**
163: * Key to access the shared image or image descriptor for an inner interface with default visibility.
164: * @since 3.0
165: */
166: public static final String IMG_OBJS_INNER_INTERFACE_DEFAULT = JavaPluginImages.IMG_OBJS_INNER_INTERFACE_DEFAULT;
167:
168: /**
169: * Key to access the shared image or image descriptor for a protected inner interface.
170: * @since 3.0
171: */
172: public static final String IMG_OBJS_INNER_INTERFACE_PROTECTED = JavaPluginImages.IMG_OBJS_INNER_INTERFACE_PROTECTED;
173:
174: /**
175: * Key to access the shared image or image descriptor for a private inner interface.
176: * @since 3.0
177: */
178: public static final String IMG_OBJS_INNER_INTERFACE_PRIVATE = JavaPluginImages.IMG_OBJS_INNER_INTERFACE_PRIVATE;
179:
180: /** Key to access the shared image or image descriptor for a package declaration. */
181: public static final String IMG_OBJS_PACKDECL = JavaPluginImages.IMG_OBJS_PACKDECL;
182:
183: /** Key to access the shared image or image descriptor for an import container. */
184: public static final String IMG_OBJS_IMPCONT = JavaPluginImages.IMG_OBJS_IMPCONT;
185:
186: /** Key to access the shared image or image descriptor for an import statement. */
187: public static final String IMG_OBJS_IMPDECL = JavaPluginImages.IMG_OBJS_IMPDECL;
188:
189: /** Key to access the shared image or image descriptor for a public member. */
190: public static final String IMG_OBJS_PUBLIC = JavaPluginImages.IMG_MISC_PUBLIC;
191:
192: /** Key to access the shared image or image descriptor for a protected member. */
193: public static final String IMG_OBJS_PROTECTED = JavaPluginImages.IMG_MISC_PROTECTED;
194:
195: /** Key to access the shared image or image descriptor for a private member. */
196: public static final String IMG_OBJS_PRIVATE = JavaPluginImages.IMG_MISC_PRIVATE;
197:
198: /** Key to access the shared image or image descriptor for class members with default visibility. */
199: public static final String IMG_OBJS_DEFAULT = JavaPluginImages.IMG_MISC_DEFAULT;
200:
201: /**
202: * Key to access the shared image or image descriptor for a public field.
203: * @since 3.0
204: */
205: public static final String IMG_FIELD_PUBLIC = JavaPluginImages.IMG_FIELD_PUBLIC;
206:
207: /**
208: * Key to access the shared image or image descriptor for a protected field.
209: * @since 3.0
210: */
211: public static final String IMG_FIELD_PROTECTED = JavaPluginImages.IMG_FIELD_PROTECTED;
212:
213: /**
214: * Key to access the shared image or image descriptor for a private field.
215: * @since 3.0
216: */
217: public static final String IMG_FIELD_PRIVATE = JavaPluginImages.IMG_FIELD_PRIVATE;
218:
219: /**
220: * Key to access the shared image or image descriptor for a field with default visibility.
221: * @since 3.0
222: */
223: public static final String IMG_FIELD_DEFAULT = JavaPluginImages.IMG_FIELD_DEFAULT;
224:
225: /**
226: * Key to access the shared image or image descriptor for a local variable.
227: * @since 3.0
228: */
229: public static final String IMG_OBJS_LOCAL_VARIABLE = JavaPluginImages.IMG_OBJS_LOCAL_VARIABLE;
230:
231: /**
232: * Key to access the shared image or image descriptor for a enum type.
233: * @since 3.1
234: */
235: public static final String IMG_OBJS_ENUM = JavaPluginImages.IMG_OBJS_ENUM;
236:
237: /**
238: * Key to access the shared image or image descriptor for a enum type
239: * with default visibility.
240: * @since 3.1
241: */
242: public static final String IMG_OBJS_ENUM_DEFAULT = JavaPluginImages.IMG_OBJS_ENUM_DEFAULT;
243:
244: /**
245: * Key to access the shared image or image descriptor for a enum type
246: * with protected visibility.
247: * @since 3.1
248: */
249: public static final String IMG_OBJS_ENUM_PROTECTED = JavaPluginImages.IMG_OBJS_ENUM_PROTECTED;
250:
251: /**
252: * Key to access the shared image or image descriptor for a enum type
253: * with private visibility.
254: * @since 3.1
255: */
256: public static final String IMG_OBJS_ENUM_PRIVATE = JavaPluginImages.IMG_OBJS_ENUM_PRIVATE;
257:
258: /**
259: * Key to access the shared image or image descriptor for a annotation type.
260: * @since 3.1
261: */
262: public static final String IMG_OBJS_ANNOTATION = JavaPluginImages.IMG_OBJS_ANNOTATION;
263:
264: /**
265: * Key to access the shared image or image descriptor for a annotation type
266: * with default visibility.
267: * @since 3.1
268: */
269: public static final String IMG_OBJS_ANNOTATION_DEFAULT = JavaPluginImages.IMG_OBJS_ANNOTATION_DEFAULT;
270:
271: /**
272: * Key to access the shared image or image descriptor for a annotation type
273: * with protected visibility.
274: * @since 3.1
275: */
276: public static final String IMG_OBJS_ANNOTATION_PROTECTED = JavaPluginImages.IMG_OBJS_ANNOTATION_PROTECTED;
277:
278: /**
279: * Key to access the shared image or image descriptor for a annotation type
280: * with private visibility.
281: * @since 3.1
282: */
283: public static final String IMG_OBJS_ANNOTATION_PRIVATE = JavaPluginImages.IMG_OBJS_ANNOTATION_PRIVATE;
284:
285: /**
286: * Key to access the shared image or image descriptor for javadoc tags.
287: * @since 3.2
288: */
289: public static final String IMG_OBJS_JAVADOCTAG = JavaPluginImages.IMG_OBJS_JAVADOCTAG;
290:
291: /**
292: * Returns the shared image managed under the given key.
293: * <p>
294: * Note that clients <b>must not</b> dispose the image returned by this method.
295: * </p>
296: *
297: * @param key the image key; one of the <code>IMG_OBJS_* </code> constants
298: * @return the shared image managed under the given key, or <code>null</code>
299: * if none
300: */
301: public Image getImage(String key);
302:
303: /**
304: * Returns the image descriptor managed under the given key.
305: *
306: * @param key the image key; one of the <code>IMG_OBJS_* </code> constants
307: * @return the image descriptor managed under the given key, or <code>null</code>
308: * if none
309: */
310: public ImageDescriptor getImageDescriptor(String key);
311: }
|