1 /*******************************************************************************
2 * Copyright (c) 2000, 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpeclipse.wiki.preferences;
13 import net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin;
15 import org.eclipse.core.runtime.IExtension;
16 import org.eclipse.jface.resource.ImageDescriptor;
17 import org.eclipse.ui.ISharedImages;
20 * TeamImages provides convenience methods for accessing shared images
21 * provided by the <i>org.eclipse.team.ui</i> plug-in.
23 * This class provides <code>ImageDescriptor</code>s for each named image in
24 * {@link ISharedImages}. All <code>Image</code> objects created from the
25 * provided descriptors are managed the caller and must be disposed appropriately.
29 public class TeamImages {
31 * Returns the image descriptor for the given image ID.
32 * Returns <code>null</code> if there is no such image.
34 * @param id the identifier for the image to retrieve
35 * @return the image descriptor associated with the given ID
37 public static ImageDescriptor getImageDescriptor(String id) {
38 return WikiEditorPlugin.getImageDescriptor(id);
41 * Convenience method to get an image descriptor for an extension.
43 * @param extension the extension declaring the image
44 * @param subdirectoryAndFilename the path to the image
45 * @return the image descriptor for the extension
47 public static ImageDescriptor getImageDescriptorFromExtension(IExtension extension, String subdirectoryAndFilename) {
48 return WikiEditorPlugin.getImageDescriptorFromExtension(extension, subdirectoryAndFilename);