X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=eclipse%2Fplugins%2Forg.argeo.slc.client.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2FClientUiPlugin.java;fp=eclipse%2Fplugins%2Forg.argeo.slc.client.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2FClientUiPlugin.java;h=c1043c4358a32e0728c949e5924ff31930d636a5;hb=a181e3d059185a9dc108e81f38c66f48f4e4aac8;hp=8552b50be82dc71b5dba80eb4ac618e43ea19163;hpb=e9e32f3294118e8289ca21034a7bd799ec91048d;p=gpl%2Fargeo-slc.git diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/ClientUiPlugin.java b/eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/ClientUiPlugin.java index 8552b50be..c1043c435 100644 --- a/eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/ClientUiPlugin.java +++ b/eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/ClientUiPlugin.java @@ -1,88 +1,35 @@ package org.argeo.slc.client.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; import org.osgi.framework.BundleContext; -/** - * The activator class controls the plug-in life cycle - */ +/** The activator class controls the plug-in life cycle */ public class ClientUiPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.argeo.slc.client.ui"; - - // The shared instance + public static final String ID = "org.argeo.slc.client.ui"; private static ClientUiPlugin plugin; - private BundleContext bundleContext; - - /** - * The constructor - */ - public ClientUiPlugin() { - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext - * ) - */ public void start(BundleContext context) throws Exception { super.start(context); - this.bundleContext = context; plugin = this; } - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext - * ) - */ public void stop(BundleContext context) throws Exception { plugin = null; super.stop(context); } - /** - * Returns the shared instance - * - * @return the shared instance - */ public static ClientUiPlugin getDefault() { return plugin; } - /** - * Returns an image descriptor for the image file at the given plug-in - * relative path - * - * @param path - * the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } - - @Override - protected void initializeImageRegistry(ImageRegistry reg) { - reg.put("agent", getImageDescriptor("icons/agent.gif")); - reg.put("executionModule", getImageDescriptor("icons/module.png")); - reg.put("folder", getImageDescriptor("icons/folder.gif")); - reg.put("flow", getImageDescriptor("icons/flow.png")); - reg.put("processes", getImageDescriptor("icons/processes.gif")); - reg.put("passedTest", getImageDescriptor("icons/passed.gif")); - reg.put("failedTest", getImageDescriptor("icons/error.gif")); + /** Creates the image */ + public static Image img(String path) { + return getImageDescriptor(path).createImage(); } - public BundleContext getBundleContext() { - return bundleContext; + public static ImageDescriptor getImageDescriptor(String path) { + return imageDescriptorFromPlugin(ID, path); } - }