Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wtp-dev] Opening the internal browser in Eclipse

Hi Chamith,

The internal browser and the API you're using to launch it are not part of WTP. Please try posting to the platform UI newsgroup, mailing list, or opening a bugzilla.

Tim deBoer

From: buddhika chamith <chamibuddhika@xxxxxxxxx>
To: wtp-dev@xxxxxxxxxxx
Date: 02/16/2009 04:10 AM
Subject: [wtp-dev] Opening the internal browser in Eclipse


I wanted to open the internal web browser to display an SVG file in my plugin. I used the following code snippet in browser invocation logic.

IWorkbenchBrowserSupport browserSupport = PluginActivator.getDefault().getWorkbench().getBrowserSupport();
IWebBrowser browser = browserSupport.createBrowser(IWorkbenchBrowserSupport.LOCATION_BAR, null,"Test", "Test");
URL url = "" URL("the file url address");

But it failed with the following exception .

org.eclipse.ui.PartInitException: Could not open a Web browser because there are none configured. Check the Web Browser preferences.
   at org.eclipse.ui.internal.browser.DefaultBrowserSupport.createBrowser(
   at org.eclipse.ui.internal.browser.WorkbenchBrowserSupport.createBrowser(

So I tried to change the preference using Window-> Preference->General->Web browser in the eclipse application. But strangely the option to select the internal browser was grayed out.

Then the next time I re-runned the eclipse application. Here I was able to  change the browser setting to use the internal browser(by default it had been selected to use the external browser) before invoking my plugin. Then again I tried to run my plugin.

Then I got the following NullPointer exception.

   at org.eclipse.ui.internal.browser.DefaultBrowserSupport.getWindowKey(
   at org.eclipse.ui.internal.browser.DefaultBrowserSupport.createBrowser(
   at org.eclipse.ui.internal.browser.WorkbenchBrowserSupport.createBrowser(

Have anyone got this kind of problem before? How can I get this to work? I'm working in Eclipse Ganymede in Ubunutu.

Chamith Buddhika.
wtp-dev mailing list

Back to the top