blob: 159f01c6bd9fc9b74bdc318323e8f616619a78c8 [file] [log] [blame]
/**
* Copyright (c) 2011, 2014 - Cristiano GaviĆ£o (Brazil), 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 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:
* Cristiano Gaviao - Initial implementation
*/
package org.eclipse.osbp.dsl.eclipse.ui;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IStartup;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import com.google.inject.Injector;
public class OSBPUiActivator extends AbstractUIPlugin implements IStartup {
// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.osbp.dsl.eclipse.ui"; //$NON-NLS-1$
// The shared instance
private static OSBPUiActivator plugin;
private Injector childInjector;
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@Override
public void stop(BundleContext context) throws Exception {
childInjector = null;
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static OSBPUiActivator getInstance() {
return plugin;
}
@Override
public void earlyStartup() {
}
/**
* Returns an image descriptor for the image file at the given plug-in
* relative path
*
* @param path
* the path
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
}