Skip to main content
summaryrefslogtreecommitdiffstats
blob: 6431385e556653735d9a6509013f5498112fc923 (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
/*******************************************************************************
 * 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 Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.team.ui;

import org.eclipse.core.runtime.IExtension;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.team.internal.ui.TeamUIPlugin;

/**
 * TeamImages provides convenience methods for accessing shared images
 * provided by the <i>org.eclipse.team.ui</i> plug-in.
 * <p>
 * This class provides <code>ImageDescriptor</code>s for each named image in 
 * {@link ISharedImages}.  All <code>Image</code> objects created from the 
 * provided descriptors are managed the caller and must be disposed appropriately. 
 * </p>
 * <p>
 * This class is not intended to be sublcassed or instantiated by clients
 * @since 2.0
 */
public class TeamImages {
	/**
	 * Returns the image descriptor for the given image ID.
	 * Returns <code>null</code> if there is no such image.
	 * 
	 * @param id  the identifier for the image to retrieve
	 * @return the image descriptor associated with the given ID
	 */
	public static ImageDescriptor getImageDescriptor(String id) {
		return TeamUIPlugin.getImageDescriptor(id);
	}	
	/**
	 * Convenience method to get an image descriptor for an extension.
	 * 
	 * @param extension  the extension declaring the image
	 * @param subdirectoryAndFilename the path to the image
	 * @return the image descriptor for the extension
	 */
	public static ImageDescriptor getImageDescriptorFromExtension(IExtension extension, String subdirectoryAndFilename) {
		return TeamUIPlugin.getImageDescriptorFromExtension(extension, subdirectoryAndFilename);
	}
}

Back to the top