]> git.argeo.org Git - gpl/argeo-slc.git/blob - eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/ClientUiPlugin.java
Adapt SlcExecution for RCP
[gpl/argeo-slc.git] / eclipse / plugins / org.argeo.slc.client.ui / src / org / argeo / slc / client / ui / ClientUiPlugin.java
1 package org.argeo.slc.client.ui;
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 ClientUiPlugin extends AbstractUIPlugin {
12
13 // The plug-in ID
14 public static final String PLUGIN_ID = "org.argeo.slc.client.ui";
15
16 // The shared instance
17 private static ClientUiPlugin plugin;
18
19 private BundleContext bundleContext;
20
21 /**
22 * The constructor
23 */
24 public ClientUiPlugin() {
25 }
26
27 /*
28 * (non-Javadoc)
29 *
30 * @see
31 * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
32 * )
33 */
34 public void start(BundleContext context) throws Exception {
35 super.start(context);
36 this.bundleContext = context;
37 plugin = this;
38 }
39
40 /*
41 * (non-Javadoc)
42 *
43 * @see
44 * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
45 * )
46 */
47 public void stop(BundleContext context) throws Exception {
48 plugin = null;
49 super.stop(context);
50 }
51
52 /**
53 * Returns the shared instance
54 *
55 * @return the shared instance
56 */
57 public static ClientUiPlugin getDefault() {
58 return plugin;
59 }
60
61 /**
62 * Returns an image descriptor for the image file at the given plug-in
63 * relative path
64 *
65 * @param path
66 * the path
67 * @return the image descriptor
68 */
69 public static ImageDescriptor getImageDescriptor(String path) {
70 return imageDescriptorFromPlugin(PLUGIN_ID, path);
71 }
72
73 @Override
74 protected void initializeImageRegistry(ImageRegistry reg) {
75 reg.put("agent", getImageDescriptor("icons/computer.png"));
76 reg.put("executionModule", getImageDescriptor("icons/archive.png"));
77 reg.put("folder", getImageDescriptor("icons/folder.png"));
78 //reg.put("flow", getImageDescriptor("icons/slc-launch.gif"));
79 reg.put("flow", getImageDescriptor("icons/system.png"));
80 }
81
82 public BundleContext getBundleContext() {
83 return bundleContext;
84 }
85
86 }