1
/*******************************************************************************
2
* Copyright (c) 2006 Red Hat, Inc.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* Red Hat Incorporated - initial API and implementation
10
*******************************************************************************/
11
package org.eclipse.linuxtools.internal.rpmstubby;
13
import org.eclipse.jface.resource.ImageDescriptor;
14
import org.eclipse.swt.widgets.Shell;
15
import org.eclipse.ui.IWorkbenchWindow;
16
import org.eclipse.ui.plugin.AbstractUIPlugin;
17
import org.osgi.framework.BundleContext;
20
* The activator class controls the plug-in life cycle
22
public class StubbyPlugin extends AbstractUIPlugin {
24
/** The plug-in ID. */
25
public static final String PLUGIN_ID = "org.eclipse.linuxtools.internal.rpmstubby";
27
// The shared instance
28
private static StubbyPlugin plugin;
33
public StubbyPlugin() {
39
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
42
public void start(BundleContext context) throws Exception {
48
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
51
public void stop(BundleContext context) throws Exception {
57
* Returns the shared instance
59
* @return the shared instance
61
public static StubbyPlugin getDefault() {
66
* Returns an image descriptor for the image file at the given
67
* plug-in relative path
69
* @param path the path
70
* @return the image descriptor
72
public static ImageDescriptor getImageDescriptor(String path) {
73
return imageDescriptorFromPlugin(PLUGIN_ID, path);
77
* Returns active shell.
78
* @return The active workbench shell.
80
public static Shell getActiveWorkbenchShell() {
81
IWorkbenchWindow window = getDefault().getWorkbench().getActiveWorkbenchWindow();
83
return window.getShell();