1 package org
.argeo
.suite
.workbench
;
5 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
6 import org
.eclipse
.jface
.resource
.ImageRegistry
;
7 import org
.eclipse
.swt
.graphics
.Image
;
8 import org
.eclipse
.ui
.plugin
.AbstractUIPlugin
;
9 import org
.osgi
.framework
.BundleContext
;
11 /** The activator class controls the plug-in life cycle */
12 public class AsUiPlugin
extends AbstractUIPlugin
{
14 public static final String PLUGIN_ID
= "org.argeo.suite.workbench.rap";
16 // The shared instance
17 private static AsUiPlugin plugin
;
19 private BundleContext bundleContext
;
21 /** Default constructor */
25 public void start(BundleContext context
) throws Exception
{
27 this.bundleContext
= context
;
31 public void stop(BundleContext context
) throws Exception
{
37 * Returns the shared instance
39 * @return the shared instance
41 public static AsUiPlugin
getDefault() {
45 /** Creates the image */
46 public static Image
img(String path
) {
47 return getImageDescriptor(path
).createImage();
51 * Returns an image descriptor for the image file at the given plug-in
56 * @return the image descriptor
58 public static ImageDescriptor
getImageDescriptor(String path
) {
59 return imageDescriptorFromPlugin(PLUGIN_ID
, path
);
62 public URL
imageUrl(String path
) {
63 return bundleContext
.getBundle().getResource(path
);
67 protected void initializeImageRegistry(ImageRegistry reg
) {
70 public BundleContext
getBundleContext() {