Author: rob.stryker(a)jboss.com
Date: 2011-01-13 00:57:12 -0500 (Thu, 13 Jan 2011)
New Revision: 28187
Added:
workspace/rstryker/hudson/plugins/org.jboss.tools.hudson.manager.ui/src/org/jboss/tools/hudson/manager/ui/HudsonSharedImages.java
Log:
more hudson stuff for nick
Added:
workspace/rstryker/hudson/plugins/org.jboss.tools.hudson.manager.ui/src/org/jboss/tools/hudson/manager/ui/HudsonSharedImages.java
===================================================================
---
workspace/rstryker/hudson/plugins/org.jboss.tools.hudson.manager.ui/src/org/jboss/tools/hudson/manager/ui/HudsonSharedImages.java
(rev 0)
+++
workspace/rstryker/hudson/plugins/org.jboss.tools.hudson.manager.ui/src/org/jboss/tools/hudson/manager/ui/HudsonSharedImages.java 2011-01-13
05:57:12 UTC (rev 28187)
@@ -0,0 +1,45 @@
+package org.jboss.tools.hudson.manager.ui;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+public class HudsonSharedImages {
+
+ // image ids
+ public static final String GREY_BALL = "icons/grey.gif"; //$NON-NLS-1$
+ public static final String RED_BALL = "icons/red.gif"; //$NON-NLS-1$
+ public static final String BLUE_BALL = "icons/blue.gif";//$NON-NLS-1$
+ public static final String YELLOW_BALL = "icons/yellow.gif";//$NON-NLS-1$
+ public static final String PROGRESS = "icons/pview.gif";//$NON-NLS-1$
+ public static final String GEAR = "icons/gear.gif";//$NON-NLS-1$
+ public static final String SERVER = "icons/computer.gif";//$NON-NLS-1$
+
+
+ static {
+ register(Activator.getDefault().getImageRegistry());
+ }
+
+ public static void register(ImageRegistry registry) {
+ registerImages(registry, new String[] {
+ GEAR, GREY_BALL, RED_BALL, BLUE_BALL,
+ YELLOW_BALL, PROGRESS, SERVER
+ });
+ }
+
+ private static void registerImages (ImageRegistry reg, String ids[]) {
+ for (int i = 0; i < ids.length; i++)
+ reg.put(ids[i], AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID,
ids[i]));
+ }
+
+ // helper methods
+ public static Image getImage (String id) {
+ return Activator.getDefault().getImageRegistry().get(id);
+ }
+
+ public static ImageDescriptor getImageDescriptor (String id) {
+ return Activator.getDefault().getImageRegistry().getDescriptor(id);
+ }
+
+}
\ No newline at end of file
Show replies by date