01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2006 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU General Public License as published by the
09: * Free Software Foundation; either version 2 of the License, or (at your option)
10: * any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15: * for more details.
16: *
17: * You should have received a copy of the GNU General Public License along with
18: * this program; if not, write to the Free Software Foundation, Inc.,
19: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: *
21: *
22: * $Id$
23: */
24: package com.bostechcorp.cbesb.ui.format.editor;
25:
26: import org.eclipse.jface.resource.ImageDescriptor;
27: import org.eclipse.ui.plugin.AbstractUIPlugin;
28: import org.osgi.framework.BundleContext;
29:
30: /**
31: * The activator class controls the plug-in life cycle
32: */
33: public class Activator extends AbstractUIPlugin {
34:
35: // The plug-in ID
36: public static final String PLUGIN_ID = "com.bostechcorp.cbesb.ui.format.editor";
37:
38: // The shared instance
39: private static Activator plugin;
40:
41: /**
42: * The constructor
43: */
44: public Activator() {
45: }
46:
47: /*
48: * (non-Javadoc)
49: * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
50: */
51: public void start(BundleContext context) throws Exception {
52: super .start(context);
53:
54: plugin = this ;
55: }
56:
57: /*
58: * (non-Javadoc)
59: * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
60: */
61: public void stop(BundleContext context) throws Exception {
62: plugin = null;
63: super .stop(context);
64: }
65:
66: /**
67: * Returns the shared instance
68: *
69: * @return the shared instance
70: */
71: public static Activator getDefault() {
72: return plugin;
73: }
74:
75: /**
76: * Returns an image descriptor for the image file at the given
77: * plug-in relative path
78: *
79: * @param path the path
80: * @return the image descriptor
81: */
82: public static ImageDescriptor getImageDescriptor(String path) {
83: return imageDescriptorFromPlugin(PLUGIN_ID, path);
84: }
85: }
|