9
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
2
|
17 |
package com.nokia.carbide.cpp;
|
|
18 |
|
|
19 |
import org.eclipse.ui.plugin.*;
|
|
20 |
import org.eclipse.jface.resource.ImageDescriptor;
|
|
21 |
import org.osgi.framework.BundleContext;
|
|
22 |
|
|
23 |
/**
|
|
24 |
* The main plugin class to be used in the desktop.
|
|
25 |
*/
|
|
26 |
public class ProductPlugin extends AbstractUIPlugin {
|
|
27 |
|
|
28 |
//The shared instance.
|
|
29 |
private static ProductPlugin plugin;
|
|
30 |
|
|
31 |
/**
|
|
32 |
* The constructor.
|
|
33 |
*/
|
|
34 |
public ProductPlugin() {
|
|
35 |
plugin = this;
|
|
36 |
}
|
|
37 |
|
|
38 |
/**
|
|
39 |
* This method is called upon plug-in activation
|
|
40 |
*/
|
|
41 |
public void start(BundleContext context) throws Exception {
|
|
42 |
super.start(context);
|
|
43 |
}
|
|
44 |
|
|
45 |
/**
|
|
46 |
* This method is called when the plug-in is stopped
|
|
47 |
*/
|
|
48 |
public void stop(BundleContext context) throws Exception {
|
|
49 |
super.stop(context);
|
|
50 |
plugin = null;
|
|
51 |
}
|
|
52 |
|
|
53 |
/**
|
|
54 |
* Returns the shared instance.
|
|
55 |
*/
|
|
56 |
public static ProductPlugin getDefault() {
|
|
57 |
return plugin;
|
|
58 |
}
|
|
59 |
|
|
60 |
/**
|
|
61 |
* Returns an image descriptor for the image file at the given
|
|
62 |
* plug-in relative path.
|
|
63 |
*
|
|
64 |
* @param path the path
|
|
65 |
* @return the image descriptor
|
|
66 |
*/
|
|
67 |
public static ImageDescriptor getImageDescriptor(String path) {
|
|
68 |
return AbstractUIPlugin.imageDescriptorFromPlugin("com.nokia.carbide.cpp", path); //$NON-NLS-1$
|
|
69 |
}
|
|
70 |
}
|