KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > actions > OpenBrowserUtil


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.jdt.internal.ui.actions;
12
13 import java.net.URL JavaDoc;
14
15 import org.eclipse.swt.custom.BusyIndicator;
16 import org.eclipse.swt.widgets.Display;
17
18 import org.eclipse.ui.PlatformUI;
19
20 public class OpenBrowserUtil {
21     
22     public static void open(final URL JavaDoc url, Display display, final String JavaDoc dialogTitle) {
23         display.syncExec(new Runnable JavaDoc() {
24             public void run() {
25                 internalOpen(url, dialogTitle);
26             }
27         });
28     }
29     
30     private static void internalOpen(final URL JavaDoc url, String JavaDoc title) {
31         BusyIndicator.showWhile(null, new Runnable JavaDoc() {
32             public void run() {
33                 PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(url.toExternalForm() + "?noframes=true"); //$NON-NLS-1$
34
}
35         });
36     }
37 }
38
Popular Tags