blob: 5a0e0c490569f23f008ad263fb2fb2db1f49ebda [file] [log] [blame]
package org.eclipse.wst.common.tests.validation;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.wst.common.tests.validation";
// The shared instance
private static Activator plugin;
private BundleContext _context;
public BundleContext getContext() {
return _context;
}
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
_context = context;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
/**
* Write this exception to the log.
* <p>
* We are in the transition of moving to a new approach for localized messages. This is the new
* approach for exceptions.
*
* @param e the throwable, this can be null in which case it is a nop.
*/
public void handleException(Throwable e){
if (e == null)return;
Status status = new Status(IStatus.ERROR, PLUGIN_ID, e.getLocalizedMessage(), e);
getLog().log(status);
}
}