Difference between revisions of "How can I invoke the eclipse default web browser in my own plugin?"

From Eclipsepedia

Jump to: navigation, search
 
Line 6: Line 6:
 
I think you want something like...
 
I think you want something like...
  
IWorkbenchBrowserSupport support =
+
IWorkbenchBrowserSupport support =
PlatformUI.getWorkbench().getBrowserSupport();
+
  PlatformUI.getWorkbench().getBrowserSupport();
IWebBrowser browser = support.createBrowser("someId");
+
IWebBrowser browser = support.createBrowser("someId");
browser.openURL(new URL("http://www.eclipse.org"));
+
browser.openURL(new URL("http://www.eclipse.org"));
  
 
Regards,
 
Regards,
 
Rem
 
Rem

Revision as of 18:29, 24 November 2006

Allen Young wrote: > > I want to invoke the eclipse default web browser which is specified in > > "Preferences" -> "General" -> "Web Browser" in my own plugin, giving it > > a URL and make it visit that URL. How can I do this? Thanks.

I think you want something like...

IWorkbenchBrowserSupport support =
  PlatformUI.getWorkbench().getBrowserSupport();
IWebBrowser browser = support.createBrowser("someId");
browser.openURL(new URL("http://www.eclipse.org"));

Regards, Rem