KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > eclipse > console > utils > EclipseImages


1 package org.hibernate.eclipse.console.utils;
2
3 import java.net.URL JavaDoc;
4
5 import org.eclipse.jface.resource.ImageDescriptor;
6 import org.eclipse.swt.graphics.Image;
7
8 public class EclipseImages {
9
10     static EclipseImageMap map = null;
11     
12     /** Declare Common paths */
13     protected static URL JavaDoc ICON_BASE_URL = null;
14
15     /**
16      * Returns the <code>Image<code> identified by the given key,
17      * or <code>null</code> if it does not exist.
18      *
19      * @param key Description of the Parameter
20      * @return The image value
21      */

22     public static Image getImage(String JavaDoc key) {
23         return getMap().getImage(key);
24     }
25
26     private static EclipseImageMap getMap() {
27         if(map==null) {
28             map = new EclipseImageMap();
29         }
30         return map;
31     }
32
33     /**
34      * Returns the <code>ImageDescriptor<code> identified by the given key,
35      * or <code>null</code> if it does not exist.
36      *
37      * @param key Description of the Parameter
38      * @return The imageDescriptor value
39      */

40     public static ImageDescriptor getImageDescriptor(String JavaDoc key) {
41         return getMap().getImageDescriptor(key);
42     }
43
44 }
45
Popular Tags