1 package org.simantics.scl.reflection.internal;
\r
3 import org.eclipse.core.runtime.ILog;
\r
4 import org.eclipse.core.runtime.Platform;
\r
5 import org.eclipse.core.runtime.Status;
\r
6 import org.osgi.framework.Bundle;
\r
7 import org.osgi.framework.BundleActivator;
\r
8 import org.osgi.framework.BundleContext;
\r
10 public class Activator implements BundleActivator {
\r
12 private BundleContext context;
\r
14 private static Activator instance;
\r
17 public void start(BundleContext context) throws Exception {
\r
18 this.context = context;
\r
23 public void stop(BundleContext context) throws Exception {
\r
25 this.context = null;
\r
28 public BundleContext getContext() {
\r
32 public static Activator getInstance() {
\r
36 public static void logError(String description, Exception e) {
\r
37 System.err.println(description);
\r
39 e.printStackTrace();
\r
40 Bundle bundle = getInstance().getContext().getBundle();
\r
41 ILog log = Platform.getLog(bundle);
\r
42 log.log(new Status(Status.ERROR, bundle.getSymbolicName(), description, e));
\r
45 public static void logError(String description) {
\r
46 logError(description, null);
\r