blob: 7cd313f70e6812a9b187062565b672d2563537b7 [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2006, 2017 Stephan Wahlbrink and others.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.internal.nico.core;
import org.osgi.framework.BundleContext;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.eclipse.statet.nico.core.NicoCore;
/**
* The activator class controls the plug-in life cycle
*/
public class NicoCorePlugin extends Plugin {
public static final int INTERNAL_ERROR = 100;
public static final int EXTERNAL_ERROR = 105;
private static NicoCorePlugin instance;
/**
* Returns the shared plug-in instance
*
* @return the shared instance
*/
public static NicoCorePlugin getInstance() {
return instance;
}
public static void log(final IStatus status) {
getInstance().getLog().log(status);
}
public static void logError(final int code, final String message, final Throwable e) {
log(new Status(IStatus.ERROR, NicoCore.BUNDLE_ID, code, message, e));
}
/**
* The constructor
*/
public NicoCorePlugin() {
instance= this;
}
@Override
public void start(final BundleContext context) throws Exception {
super.start(context);
}
@Override
public void stop(final BundleContext context) throws Exception {
instance= null;
super.stop(context);
}
}