geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r370730 - /geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java
Date Fri, 20 Jan 2006 04:43:17 GMT
Author: sppatel
Date: Thu Jan 19 20:43:12 2006
New Revision: 370730

URL: http://svn.apache.org/viewcvs?rev=370730&view=rev
Log:
image registry support

Modified:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java?rev=370730&r1=370729&r2=370730&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/internal/GeronimoUIPlugin.java
Thu Jan 19 20:43:12 2006
@@ -16,8 +16,13 @@
 package org.apache.geronimo.ui.internal;
 
 import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
 
 import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 
 /**
@@ -31,6 +36,8 @@
 	private static String iconLocation;
 
 	private static GeronimoUIPlugin singleton;
+	
+	protected Map imageDescriptors = new HashMap();
 
 	/**
 	 * The constructor.
@@ -62,4 +69,34 @@
 		}
 		return iconLocation;
 	}
+	
+	/**
+	 * Return the image with the given key from the image registry.
+	 * @param key java.lang.String
+	 * @return org.eclipse.jface.parts.IImage
+	 */
+	public static Image getImage(String key) {
+		return getInstance().getImageRegistry().get(key);
+	}
+
+	/**
+	 * Return the image with the given key from the image registry.
+	 * @param key java.lang.String
+	 * @return org.eclipse.jface.parts.IImage
+	 */
+	public static ImageDescriptor getImageDescriptor(String key) {
+		try {
+			getInstance().getImageRegistry();
+			return (ImageDescriptor) getInstance().imageDescriptors.get(key);
+		} catch (Exception e) {
+			return null;
+		}
+	}
+	
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
+     */
+    protected void initializeImageRegistry(ImageRegistry reg) {
+       
+    }
 }



Mime
View raw message