KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > ui > TeamImages


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.team.ui;
12
13 import org.eclipse.core.runtime.IExtension;
14 import org.eclipse.jface.resource.ImageDescriptor;
15 import org.eclipse.team.internal.ui.TeamUIPlugin;
16
17 /**
18  * TeamImages provides convenience methods for accessing shared images
19  * provided by the <i>org.eclipse.team.ui</i> plug-in.
20  * <p>
21  * This class provides <code>ImageDescriptor</code>s for each named image in
22  * {@link ISharedImages}. All <code>Image</code> objects created from the
23  * provided descriptors are managed the caller and must be disposed appropriately.
24  * </p>
25  * <p>
26  * This class is not intended to be subclassed or instantiated by clients
27  * @since 2.0
28  */

29 public class TeamImages {
30     /**
31      * Returns the image descriptor for the given image ID.
32      * Returns <code>null</code> if there is no such image.
33      *
34      * @param id the identifier for the image to retrieve
35      * @return the image descriptor associated with the given ID
36      */

37     public static ImageDescriptor getImageDescriptor(String JavaDoc id) {
38         return TeamUIPlugin.getImageDescriptor(id);
39     }
40     /**
41      * Convenience method to get an image descriptor for an extension.
42      *
43      * @param extension the extension declaring the image
44      * @param subdirectoryAndFilename the path to the image
45      * @return the image descriptor for the extension
46      */

47     public static ImageDescriptor getImageDescriptorFromExtension(IExtension extension, String JavaDoc subdirectoryAndFilename) {
48         return TeamUIPlugin.getImageDescriptorFromExtension(extension, subdirectoryAndFilename);
49     }
50 }
51
Popular Tags