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