blob: 5398725c8158829f1919f39c3285b9d3bd7ca753 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009 xored software, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* xored software, Inc. - initial API and Implementation (Alex Panchenko)
*******************************************************************************/
package org.eclipse.dltk.formatter;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.BundleContext;
public class DLTKFormatterPlugin extends Plugin {
public static final String PLUGIN_ID = "org.eclipse.dltk.formatter"; //$NON-NLS-1$
private static DLTKFormatterPlugin plugin;
public static DLTKFormatterPlugin getDefault() {
return plugin;
}
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
public static void error(String message) {
getDefault().getLog()
.log(
new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK,
message, null));
}
public static void error(String message, Throwable t) {
getDefault().getLog().log(
new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, message, t));
}
/**
* @param e
*/
public static void error(Throwable t) {
error(t.toString(), t);
}
}