01: /*******************************************************************************
02: * Copyright (c) 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.tests.views.properties.tabbed;
11:
12: import org.eclipse.jface.resource.ImageDescriptor;
13: import org.eclipse.ui.plugin.AbstractUIPlugin;
14: import org.osgi.framework.BundleContext;
15:
16: /**
17: * The main plugin class to be used in the desktop.
18: */
19: public class Activator extends AbstractUIPlugin {
20:
21: // The shared instance.
22: private static Activator plugin;
23:
24: /**
25: * The constructor.
26: */
27: public Activator() {
28: plugin = this ;
29: }
30:
31: /**
32: * This method is called upon plug-in activation
33: */
34: public void start(BundleContext context) throws Exception {
35: super .start(context);
36: }
37:
38: /**
39: * This method is called when the plug-in is stopped
40: */
41: public void stop(BundleContext context) throws Exception {
42: super .stop(context);
43: plugin = null;
44: }
45:
46: /**
47: * Returns the shared instance.
48: */
49: public static Activator getDefault() {
50: return plugin;
51: }
52:
53: /**
54: * Returns an image descriptor for the image file at the given plug-in
55: * relative path.
56: *
57: * @param path
58: * the path
59: * @return the image descriptor
60: */
61: public static ImageDescriptor getImageDescriptor(String path) {
62: return AbstractUIPlugin.imageDescriptorFromPlugin(
63: "org.eclipse.ui.tests.views.properties.tabbed", path); //$NON-NLS-1$
64: }
65: }
|