Commit | Line | Data |
---|---|---|
72eda778 ASL |
1 | /*******************************************************************************\r |
2 | * Copyright (c) 2009, 2010 Ericsson\r | |
3 | * \r | |
4 | * All rights reserved. This program and the accompanying materials are\r | |
5 | * made available under the terms of the Eclipse Public License v1.0 which\r | |
6 | * accompanies this distribution, and is available at\r | |
7 | * http://www.eclipse.org/legal/epl-v10.html\r | |
8 | * \r | |
9 | * Contributors:\r | |
10 | * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation\r | |
11 | *******************************************************************************/\r | |
f6281059 ASL |
12 | package org.eclipse.linuxtools.tmf.ui.tests;\r |
13 | \r | |
14 | import org.eclipse.jface.resource.ImageDescriptor;\r | |
15 | import org.eclipse.ui.plugin.AbstractUIPlugin;\r | |
16 | import org.osgi.framework.BundleContext;\r | |
17 | \r | |
18 | /**\r | |
19 | * The activator class controls the plug-in life cycle\r | |
20 | */\r | |
3b38ea61 | 21 | @SuppressWarnings("nls")\r |
f6281059 ASL |
22 | public class TmfUITestPlugin extends AbstractUIPlugin {\r |
23 | \r | |
24 | // The plug-in ID\r | |
25 | public static final String PLUGIN_ID = "org.eclipse.linuxtools.tmf.ui.tests";\r | |
26 | \r | |
27 | // The shared instance\r | |
28 | private static TmfUITestPlugin plugin;\r | |
29 | \r | |
72eda778 ASL |
30 | // ========================================================================\r |
31 | // Constructor\r | |
32 | // ========================================================================\r | |
f6281059 ASL |
33 | public TmfUITestPlugin() {\r |
34 | }\r | |
35 | \r | |
72eda778 ASL |
36 | // ========================================================================\r |
37 | // Methods\r | |
38 | // ========================================================================\r | |
f6281059 ASL |
39 | /*\r |
40 | * (non-Javadoc)\r | |
41 | * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)\r | |
42 | */\r | |
8f50c396 | 43 | @Override\r |
f6281059 ASL |
44 | public void start(BundleContext context) throws Exception {\r |
45 | super.start(context);\r | |
46 | plugin = this;\r | |
47 | }\r | |
48 | \r | |
49 | /*\r | |
50 | * (non-Javadoc)\r | |
51 | * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)\r | |
52 | */\r | |
8f50c396 | 53 | @Override\r |
f6281059 ASL |
54 | public void stop(BundleContext context) throws Exception {\r |
55 | plugin = null;\r | |
56 | super.stop(context);\r | |
57 | }\r | |
58 | \r | |
59 | /**\r | |
60 | * Returns the shared instance\r | |
61 | *\r | |
62 | * @return the shared instance\r | |
63 | */\r | |
64 | public static TmfUITestPlugin getDefault() {\r | |
65 | return plugin;\r | |
66 | }\r | |
67 | \r | |
68 | /**\r | |
69 | * Returns an image descriptor for the image file at the given\r | |
70 | * plug-in relative path\r | |
71 | *\r | |
72 | * @param path the path\r | |
73 | * @return the image descriptor\r | |
74 | */\r | |
75 | public static ImageDescriptor getImageDescriptor(String path) {\r | |
76 | return imageDescriptorFromPlugin(PLUGIN_ID, path);\r | |
77 | }\r | |
78 | }\r |