1
/*******************************************************************************
2
* Copyright (c) 2006-2009 Wind River Systems, Inc. and others.
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
* Ted R Williams (Wind River Systems, Inc.) - initial implementation
10
*******************************************************************************/
12
package org.eclipse.cdt.debug.ui.memory.transport;
14
import org.eclipse.swt.widgets.Shell;
15
import org.eclipse.ui.IWorkbenchWindow;
16
import org.eclipse.ui.PlatformUI;
17
import org.eclipse.ui.plugin.AbstractUIPlugin;
19
public class MemoryTransportPlugin extends AbstractUIPlugin
21
private static final String PLUGIN_ID = "org.eclipse.cdt.debug.ui.memory.transport"; //$NON-NLS-1$
23
private static MemoryTransportPlugin plugin;
25
public MemoryTransportPlugin()
32
* Returns the shared instance.
34
public static MemoryTransportPlugin getDefault() {
39
* Returns the unique identifier for this plugin.
41
public static String getUniqueIdentifier() {
46
* Returns the currently active workbench window shell or <code>null</code>
49
* @return the currently active workbench window shell or <code>null</code>
51
public static Shell getShell() {
52
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
54
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
55
if (windows.length > 0) {
56
return windows[0].getShell();
60
return window.getShell();