01: /*******************************************************************************
02: * Copyright (c) 2005, 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.performance;
11:
12: import org.eclipse.ui.plugin.*;
13: import org.eclipse.jface.resource.ImageDescriptor;
14: import org.osgi.framework.BundleContext;
15:
16: /**
17: * The main plugin class to be used in the desktop.
18: */
19: public class UIPerformancePlugin extends AbstractUIPlugin {
20:
21: //The shared instance.
22: private static UIPerformancePlugin plugin;
23:
24: /**
25: * The constructor.
26: */
27: public UIPerformancePlugin() {
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: * @return the shared instance.
50: */
51: public static UIPerformancePlugin getDefault() {
52: return plugin;
53: }
54:
55: /**
56: * Returns an image descriptor for the image file at the given
57: * plug-in relative path.
58: *
59: * @param path the path
60: * @return the image descriptor
61: */
62: public static ImageDescriptor getImageDescriptor(String path) {
63: return AbstractUIPlugin.imageDescriptorFromPlugin(
64: "org.eclipse.ui.tests.performance", path);
65: }
66: }
|