blob: 7186836413345eb4af5ff7c048205486613ee651 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Lucas Koehler - initial API and implementation
******************************************************************************/
package org.eclipse.emf.ecp.internal.view.template.model;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.eclipse.emfforms.spi.common.report.ReportService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
/**
* The Class Activator.
*
* @author Lucas Koehler
* @since 1.6
*/
public class Activator extends Plugin {
/**
* The constant holding the id of this plugin.
*/
public static final String PLUGIN_ID = "org.eclipse.emf.ecp.view.template.model"; //$NON-NLS-1$
private static Activator plugin;
private ServiceReference<ReportService> reportServiceReference;
// BEGIN SUPRESS CATCH EXCEPTION
/**
* {@inheritDoc}
*
* @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
*/
@Override
public void start(BundleContext bundleContext) throws Exception {
super.start(bundleContext);
plugin = this;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
@Override
public void stop(BundleContext bundleContext) throws Exception {
plugin = null;
super.stop(bundleContext);
}
// END SUPRESS CATCH EXCEPTION
/**
* Returns the instance of this Activator.
*
* @return the saved instance
*/
public static Activator getDefault() {
return plugin;
}
/**
* Logs a {@link Throwable}.
*
* @param t the {@link Throwable} to log
*/
public static void log(Throwable t) {
getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, t.getMessage(), t));
}
}