2010-11-09 Francois Chouinard <fchouinard@gmail.com> Contribution for Bug315307
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / TmfUiPlugin.java
1 /*******************************************************************************
2 * Copyright (c) 2009 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.ui;
14
15 import org.eclipse.linuxtools.tmf.ui.parsers.ParserProviderManager;
16 import org.eclipse.swt.graphics.Image;
17 import org.eclipse.ui.plugin.AbstractUIPlugin;
18 import org.osgi.framework.BundleContext;
19
20 /**
21 * <b><u>TmfUiPlugin</u></b>
22 * <p>
23 * The activator class controls the plug-in life cycle
24 */
25 public class TmfUiPlugin extends AbstractUIPlugin {
26
27 // ========================================================================
28 // Attributes
29 // ========================================================================
30
31 // The plug-in ID
32 public static final String PLUGIN_ID = "org.eclipse.linuxtools.tmf.ui"; //$NON-NLS-1$
33
34 // The shared instance
35 private static TmfUiPlugin plugin;
36
37 // ========================================================================
38 // Constructors
39 // ========================================================================
40
41 /**
42 * The constructor
43 */
44 public TmfUiPlugin() {
45 }
46
47 // ========================================================================
48 // Accessors
49 // ========================================================================
50
51 /**
52 * Returns the shared instance
53 *
54 * @return the shared instance
55 */
56 public static TmfUiPlugin getDefault() {
57 return plugin;
58 }
59
60 // ========================================================================
61 // Operators
62 // ========================================================================
63
64 /*
65 * (non-Javadoc)
66 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
67 */
68 @Override
69 public void start(BundleContext context) throws Exception {
70 super.start(context);
71 plugin = this;
72 ParserProviderManager.init();
73 }
74
75 /*
76 * (non-Javadoc)
77 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
78 */
79 @Override
80 public void stop(BundleContext context) throws Exception {
81 plugin = null;
82 super.stop(context);
83 }
84
85 public Image getImageFromPath(String path)
86 {
87 return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path).createImage();
88 }
89
90 }
This page took 0.032164 seconds and 5 git commands to generate.