]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - cms/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/SlcRcpPlugin.java
Clarify SLC project structure.
[gpl/argeo-slc.git] / cms / org.argeo.slc.client.rcp / src / org / argeo / slc / client / rcp / SlcRcpPlugin.java
diff --git a/cms/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/SlcRcpPlugin.java b/cms/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/SlcRcpPlugin.java
new file mode 100644 (file)
index 0000000..d61b315
--- /dev/null
@@ -0,0 +1,39 @@
+package org.argeo.slc.client.rcp;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class SlcRcpPlugin extends AbstractUIPlugin {
+       public static final String PLUGIN_ID = "org.argeo.slc.client.rcp";
+       private static SlcRcpPlugin plugin;
+
+       public void start(BundleContext context) throws Exception {
+               super.start(context);
+               plugin = this;
+       }
+
+       public void stop(BundleContext context) throws Exception {
+               plugin = null;
+               super.stop(context);
+       }
+
+       public static SlcRcpPlugin getDefault() {
+               return plugin;
+       }
+
+       @Override
+       protected void initializeImageRegistry(ImageRegistry reg) {
+               // TODO make it configurable
+               reg.put("argeoTrayIcon",
+                               getImageDescriptor("icons/argeo-trayIcon-256.png"));
+       }
+
+       public static ImageDescriptor getImageDescriptor(String path) {
+               return imageDescriptorFromPlugin(PLUGIN_ID, path);
+       }
+}