| /******************************************************************************* |
| * Copyright (c) 2011-2014 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: |
| * Eugen Neufeld - initial API and implementation |
| ******************************************************************************/ |
| package org.eclipse.emf.ecp.view.internal.table.swt; |
| |
| import org.eclipse.core.runtime.IStatus; |
| import org.eclipse.core.runtime.Plugin; |
| import org.eclipse.core.runtime.Status; |
| import org.osgi.framework.BundleContext; |
| |
| /** |
| * Activator for this plugin. |
| * |
| * @author Eugen Neufeld |
| * |
| */ |
| public class Activator extends Plugin { |
| |
| private static final String PLUGIN_ID = "org.eclipse.emf.ecp.view.table.ui.swt"; //$NON-NLS-1$ |
| private static Activator instance; |
| |
| /** |
| * Returns the instance. |
| * |
| * @return the {@link Activator} instance. |
| */ |
| public static Activator getInstance() { |
| return instance; |
| } |
| |
| @Override |
| public void start(BundleContext bundleContext) throws Exception { |
| instance = this; |
| super.start(bundleContext); |
| } |
| |
| @Override |
| public void stop(BundleContext bundleContext) throws Exception { |
| instance = null; |
| super.stop(bundleContext); |
| } |
| |
| /** |
| * Logs a {@link Throwable}. |
| * |
| * @param t the {@link Throwable} to log |
| */ |
| public void log(Throwable t) { |
| getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, t.getMessage(), t)); |
| } |
| |
| /** |
| * Logs a message with the given {@link IStatus}. |
| * |
| * @param severity the {@link IStatus} severity to log |
| * @param message the message to log |
| */ |
| public void log(int severity, String message) { |
| getLog().log(new Status(severity, PLUGIN_ID, message)); |
| } |
| |
| } |