| /** |
| * 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 v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * 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); |
| } |
| } |