]> git.argeo.org Git - gpl/argeo-slc.git/blob - eclipse/plugins/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/ClientRcpPlugin.java
-> add a new command to automatically refresh Result Test List
[gpl/argeo-slc.git] / eclipse / plugins / org.argeo.slc.client.rcp / src / org / argeo / slc / client / rcp / ClientRcpPlugin.java
1 package org.argeo.slc.client.rcp;
2
3 import org.eclipse.jface.resource.ImageDescriptor;
4 import org.eclipse.jface.resource.ImageRegistry;
5 import org.eclipse.ui.plugin.AbstractUIPlugin;
6 import org.osgi.framework.BundleContext;
7
8 /**
9 * The activator class controls the plug-in life cycle
10 */
11 public class ClientRcpPlugin extends AbstractUIPlugin {
12
13 // The plug-in ID
14 public static final String PLUGIN_ID = "org.argeo.slc.client.rcp";
15
16 // The shared instance
17 private static ClientRcpPlugin plugin;
18
19 /**
20 * The constructor
21 */
22 public ClientRcpPlugin() {
23 }
24
25 /*
26 * (non-Javadoc)
27 *
28 * @see
29 * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
30 * )
31 */
32 public void start(BundleContext context) throws Exception {
33 super.start(context);
34 plugin = this;
35 }
36
37 /*
38 * (non-Javadoc)
39 *
40 * @see
41 * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
42 * )
43 */
44 public void stop(BundleContext context) throws Exception {
45 plugin = null;
46 super.stop(context);
47 }
48
49 /**
50 * Returns the shared instance
51 *
52 * @return the shared instance
53 */
54 public static ClientRcpPlugin getDefault() {
55 return plugin;
56 }
57
58 @Override
59 protected void initializeImageRegistry(ImageRegistry reg) {
60 reg.put("argeoTrayIcon",
61 getImageDescriptor("icons/argeo-trayIcon-256.png"));
62 }
63
64 /**
65 * Returns an image descriptor for the image file at the given plug-in
66 * relative path
67 *
68 * @param path
69 * the path
70 * @return the image descriptor
71 */
72 public static ImageDescriptor getImageDescriptor(String path) {
73 return imageDescriptorFromPlugin(PLUGIN_ID, path);
74 }
75 }