org.symbian.tools.mtw.ui/src/org/symbian/tools/mtw/ui/Activator.java
changeset 454 38d6944cff88
equal deleted inserted replaced
452:68002774437e 454:38d6944cff88
       
     1 package org.symbian.tools.mtw.ui;
       
     2 
       
     3 import org.eclipse.core.runtime.IStatus;
       
     4 import org.eclipse.core.runtime.Status;
       
     5 import org.eclipse.ui.plugin.AbstractUIPlugin;
       
     6 import org.osgi.framework.BundleContext;
       
     7 
       
     8 /**
       
     9  * The activator class controls the plug-in life cycle
       
    10  */
       
    11 public class Activator extends AbstractUIPlugin {
       
    12 
       
    13 	// The plug-in ID
       
    14 	public static final String PLUGIN_ID = "org.symbian.tools.mtw.ui"; //$NON-NLS-1$
       
    15 
       
    16 	// The shared instance
       
    17 	private static Activator plugin;
       
    18 	
       
    19 	/**
       
    20 	 * The constructor
       
    21 	 */
       
    22 	public Activator() {
       
    23 	}
       
    24 
       
    25 	/*
       
    26 	 * (non-Javadoc)
       
    27 	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
       
    28 	 */
       
    29 	public void start(BundleContext context) throws Exception {
       
    30 		super.start(context);
       
    31 		plugin = this;
       
    32 	}
       
    33 
       
    34 	/*
       
    35 	 * (non-Javadoc)
       
    36 	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
       
    37 	 */
       
    38 	public void stop(BundleContext context) throws Exception {
       
    39 		plugin = null;
       
    40 		super.stop(context);
       
    41 	}
       
    42 
       
    43 	/**
       
    44 	 * Returns the shared instance
       
    45 	 *
       
    46 	 * @return the shared instance
       
    47 	 */
       
    48 	public static Activator getDefault() {
       
    49 		return plugin;
       
    50 	}
       
    51 
       
    52     public static void log(String message, Exception e) {
       
    53         getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, e));
       
    54     }
       
    55 
       
    56     public static void log(Exception e) {
       
    57         log(null, e);
       
    58     }
       
    59 
       
    60 }