author | dadubrow |
Thu, 20 May 2010 13:54:19 -0500 | |
changeset 1378 | 9a387b0094c7 |
parent 1377 | 40401ea8b1fd |
child 1634 | c8405758cfd4 |
permissions | -rw-r--r-- |
1377
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
1 |
/* |
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
3 |
* All rights reserved. |
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
8 |
* |
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
9 |
* Initial Contributors: |
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
11 |
* |
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
12 |
* Contributors: |
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
13 |
* |
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
14 |
* Description: |
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
15 |
* |
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
16 |
*/ |
1360 | 17 |
package com.nokia.carbide.discovery.ui; |
18 |
||
1363 | 19 |
import org.eclipse.core.runtime.IStatus; |
20 |
import org.eclipse.core.runtime.Status; |
|
1360 | 21 |
import org.eclipse.jface.resource.ImageDescriptor; |
22 |
import org.eclipse.ui.plugin.AbstractUIPlugin; |
|
23 |
import org.osgi.framework.BundleContext; |
|
24 |
||
25 |
/** |
|
26 |
* The activator class controls the plug-in life cycle |
|
27 |
*/ |
|
28 |
public class Activator extends AbstractUIPlugin { |
|
29 |
// The plug-in ID |
|
30 |
public static final String PLUGIN_ID = "com.nokia.carbide.discovery.ui"; //$NON-NLS-1$ |
|
31 |
||
32 |
// The shared instance |
|
33 |
private static Activator plugin; |
|
34 |
||
35 |
/** |
|
36 |
* The constructor |
|
37 |
*/ |
|
38 |
public Activator() { |
|
39 |
} |
|
40 |
||
41 |
/* |
|
42 |
* (non-Javadoc) |
|
43 |
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) |
|
44 |
*/ |
|
45 |
public void start(BundleContext context) throws Exception { |
|
46 |
super.start(context); |
|
47 |
} |
|
48 |
||
49 |
/* |
|
50 |
* (non-Javadoc) |
|
51 |
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) |
|
52 |
*/ |
|
53 |
public void stop(BundleContext context) throws Exception { |
|
1377
40401ea8b1fd
move p2 policy code to discovery plugin for now + add system property for disabling unsigned check
dadubrow
parents:
1363
diff
changeset
|
54 |
super.stop(context); |
1360 | 55 |
plugin = null; |
56 |
} |
|
57 |
||
58 |
/** |
|
59 |
* Returns the shared instance |
|
60 |
* |
|
61 |
* @return the shared instance |
|
62 |
*/ |
|
63 |
public static Activator getDefault() { |
|
64 |
return plugin; |
|
65 |
} |
|
66 |
||
67 |
/** |
|
68 |
* Returns an image descriptor for the image file at the given |
|
69 |
* plug-in relative path |
|
70 |
* |
|
71 |
* @param path the path |
|
72 |
* @return the image descriptor |
|
73 |
*/ |
|
74 |
public static ImageDescriptor getImageDescriptor(String path) { |
|
75 |
return imageDescriptorFromPlugin(PLUGIN_ID, path); |
|
76 |
} |
|
1363 | 77 |
|
78 |
/** |
|
79 |
* Log to error log |
|
80 |
* @param message |
|
81 |
* @param t |
|
82 |
*/ |
|
83 |
public static void logError(String message, Throwable t) { |
|
84 |
getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, message, t)); |
|
85 |
} |
|
1360 | 86 |
} |