1 | package de.uka.ipd.sdq.sensorframework.dialogs; |
2 | |
3 | import org.eclipse.jface.resource.ImageDescriptor; |
4 | import org.eclipse.jface.resource.ImageRegistry; |
5 | import org.eclipse.ui.plugin.AbstractUIPlugin; |
6 | |
7 | /** |
8 | * @author roman Compilation of the pictures used in |
9 | * de.uka.ipd.sdq.dialogs-Plugin |
10 | */ |
11 | public class DialogsImages { |
12 | |
13 | /** |
14 | * Names of images used to represent actions in ToolBar |
15 | */ |
16 | public static final String TREEROOT = "tree_root"; |
17 | |
18 | // For the toolbar images |
19 | public static ImageRegistry imageRegistry = new ImageRegistry(); |
20 | |
21 | /** |
22 | * Note: An image registry owns all of the image objects registered with it, |
23 | * and automatically disposes of them the SWT Display is disposed. |
24 | */ |
25 | static { |
26 | String iconPath = "icons/"; |
27 | |
28 | imageRegistry.put(TREEROOT, |
29 | getImageDescriptor(iconPath + TREEROOT + ".gif")); |
30 | } |
31 | |
32 | /** |
33 | * @param imageFilePath |
34 | * the relative to the root of the plug-in; the path must be |
35 | * legal |
36 | * @return an image descriptor, or null if no image could be found |
37 | */ |
38 | public static ImageDescriptor getImageDescriptor(String imageFilePath) { |
39 | return AbstractUIPlugin.imageDescriptorFromPlugin( |
40 | SensorFrameworkDialogPlugin.PLUGIN_ID, imageFilePath); |
41 | } |
42 | |
43 | } |