blob: 8d368d5344693ca02435a81bf876080d8f0f1b95 [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*/
package org.eclipse.osbp.ide.core.ui.softwarefactory;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.xtext.ui.shared.SharedStateModule;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.util.Modules;
import org.eclipse.osbp.ide.core.ui.softwarefactory.extender.ModelExtenderModule;
public class CoreUiActivator extends AbstractUIPlugin {
public static final String PLUGIN_ID = "org.eclipse.osbp.ide.core.ui.softwarefactory"; //$NON-NLS-1$
private static final Logger LOGGER = LoggerFactory
.getLogger(CoreUiActivator.class);
private static CoreUiActivator plugin;
private Injector injector;
public static CoreUiActivator getDefault() {
return plugin;
}
public Injector getInjector() {
if (injector == null) {
injector = Guice.createInjector(Modules.override(
new SharedStateModule()).with(
new ModelExtenderModule()));
}
return injector;
}
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this; // NOSONAR
}
@Override
public void stop(BundleContext context) throws Exception {
plugin = null; // NOSONAR
injector = null;
super.stop(context);
}
}