KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > launcher > RunWorkbenchAction


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation 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
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.ui.launcher;
12
13 import org.eclipse.debug.core.ILaunchManager;
14 import org.eclipse.jface.action.Action;
15 import org.eclipse.jface.viewers.StructuredSelection;
16 import org.eclipse.pde.ui.launcher.EclipseLaunchShortcut;
17 import org.eclipse.swt.custom.BusyIndicator;
18 import org.eclipse.ui.PlatformUI;
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 JavaDoc() {
30                     public void run() {
31                         shortcut.launch(new StructuredSelection(),
32                                 ILaunchManager.RUN_MODE);
33                         notifyResult(true);
34                     }
35                 });
36     }
37 }
38
Popular Tags