|
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 "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 */ |
|
17 |
|
18 |
|
19 package com.nokia.testfw.sut.help; |
|
20 |
|
21 import org.eclipse.ui.plugin.*; |
|
22 import org.eclipse.jface.resource.ImageDescriptor; |
|
23 import org.osgi.framework.BundleContext; |
|
24 |
|
25 /** |
|
26 * The main plugin class to be used in the desktop. |
|
27 */ |
|
28 public class HelpPlugin extends AbstractUIPlugin { |
|
29 |
|
30 //The shared instance. |
|
31 private static HelpPlugin plugin; |
|
32 |
|
33 /** |
|
34 * The constructor. |
|
35 */ |
|
36 public HelpPlugin() { |
|
37 plugin = this; |
|
38 } |
|
39 |
|
40 /** |
|
41 * This method is called upon plug-in activation |
|
42 */ |
|
43 public void start(BundleContext context) throws Exception { |
|
44 super.start(context); |
|
45 } |
|
46 |
|
47 /** |
|
48 * This method is called when the plug-in is stopped |
|
49 */ |
|
50 public void stop(BundleContext context) throws Exception { |
|
51 super.stop(context); |
|
52 plugin = null; |
|
53 } |
|
54 |
|
55 /** |
|
56 * Returns the shared instance. |
|
57 */ |
|
58 public static HelpPlugin getDefault() { |
|
59 return plugin; |
|
60 } |
|
61 |
|
62 /** |
|
63 * Returns an image descriptor for the image file at the given |
|
64 * plug-in relative path. |
|
65 * |
|
66 * @param path the path |
|
67 * @return the image descriptor |
|
68 */ |
|
69 public static ImageDescriptor getImageDescriptor(String path) { |
|
70 return AbstractUIPlugin.imageDescriptorFromPlugin("com.nokia.testfw.sut.help", path); |
|
71 } |
|
72 } |