01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui.launcher;
11:
12: import org.eclipse.debug.core.ILaunchManager;
13: import org.eclipse.jface.action.Action;
14: import org.eclipse.jface.viewers.StructuredSelection;
15: import org.eclipse.pde.ui.launcher.EclipseLaunchShortcut;
16: import org.eclipse.swt.custom.BusyIndicator;
17: import org.eclipse.ui.PlatformUI;
18:
19: /**
20: * Action for launching the workbench using the
21: * shortcut. This action is suitable for referencing from
22: * welcome and cheat sheet files.
23: */
24: public class RunWorkbenchAction extends Action {
25: public void run() {
26: final EclipseLaunchShortcut shortcut = new EclipseLaunchShortcut();
27: BusyIndicator.showWhile(PlatformUI.getWorkbench()
28: .getActiveWorkbenchWindow().getShell().getDisplay(),
29: new Runnable() {
30: public void run() {
31: shortcut.launch(new StructuredSelection(),
32: ILaunchManager.RUN_MODE);
33: notifyResult(true);
34: }
35: });
36: }
37: }
|