core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/Activator.java
author dadubrow
Thu, 20 May 2010 13:54:19 -0500
changeset 1378 9a387b0094c7
parent 1377 40401ea8b1fd
child 1634 c8405758cfd4
permissions -rw-r--r--
move p2 policy code to component definition in com.nokia.carbide.cpp product plugin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    17
package com.nokia.carbide.discovery.ui;
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    18
1363
dfbd4576cd61 move url to server.properties
dadubrow
parents: 1360
diff changeset
    19
import org.eclipse.core.runtime.IStatus;
dfbd4576cd61 move url to server.properties
dadubrow
parents: 1360
diff changeset
    20
import org.eclipse.core.runtime.Status;
1360
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    21
import org.eclipse.jface.resource.ImageDescriptor;
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    22
import org.eclipse.ui.plugin.AbstractUIPlugin;
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    23
import org.osgi.framework.BundleContext;
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    24
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    25
/**
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    26
 * The activator class controls the plug-in life cycle
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    27
 */
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    28
public class Activator extends AbstractUIPlugin {
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    29
	// The plug-in ID
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    30
	public static final String PLUGIN_ID = "com.nokia.carbide.discovery.ui"; //$NON-NLS-1$
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    31
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    32
	// The shared instance
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    33
	private static Activator plugin;
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    34
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    35
	/**
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    36
	 * The constructor
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    37
	 */
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    38
	public Activator() {
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    39
	}
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    40
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    41
	/*
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    42
	 * (non-Javadoc)
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    43
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    44
	 */
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    45
	public void start(BundleContext context) throws Exception {
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    46
		super.start(context);
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    47
	}
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    48
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    49
	/*
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    50
	 * (non-Javadoc)
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    51
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    52
	 */
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    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
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    55
		plugin = null;
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    56
	}
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    57
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    58
	/**
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    59
	 * Returns the shared instance
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    60
	 *
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    61
	 * @return the shared instance
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    62
	 */
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    63
	public static Activator getDefault() {
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    64
		return plugin;
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    65
	}
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    66
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    67
	/**
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    68
	 * Returns an image descriptor for the image file at the given
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    69
	 * plug-in relative path
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    70
	 *
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    71
	 * @param path the path
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    72
	 * @return the image descriptor
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    73
	 */
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    74
	public static ImageDescriptor getImageDescriptor(String path) {
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    75
		return imageDescriptorFromPlugin(PLUGIN_ID, path);
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    76
	}
1363
dfbd4576cd61 move url to server.properties
dadubrow
parents: 1360
diff changeset
    77
dfbd4576cd61 move url to server.properties
dadubrow
parents: 1360
diff changeset
    78
	/**
dfbd4576cd61 move url to server.properties
dadubrow
parents: 1360
diff changeset
    79
	 * Log to error log
dfbd4576cd61 move url to server.properties
dadubrow
parents: 1360
diff changeset
    80
	 * @param message
dfbd4576cd61 move url to server.properties
dadubrow
parents: 1360
diff changeset
    81
	 * @param t
dfbd4576cd61 move url to server.properties
dadubrow
parents: 1360
diff changeset
    82
	 */
dfbd4576cd61 move url to server.properties
dadubrow
parents: 1360
diff changeset
    83
	public static void logError(String message, Throwable t) {
dfbd4576cd61 move url to server.properties
dadubrow
parents: 1360
diff changeset
    84
		getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, message, t));
dfbd4576cd61 move url to server.properties
dadubrow
parents: 1360
diff changeset
    85
	}
1360
b609311b7b1c initial commit
dadubrow
parents:
diff changeset
    86
}