Community
Participate
Working Groups
I20080812-0800, was OK in 3.4 Extension point schema previews open in an internal browser, even though I've set Preferences > General > Web Browsing > Use external Web browser.
I find this rather annoying, given that there's no easy way to transfer an internal browser window to an external browser.
How are you opening the schema Markus? From where? The preference page? The editor?
One place it happens is if you right click on a extension point element in the schema editor and go to Preview reference document. In ShowDescriptionAction.showURL() we have an option to force external, but if it is false, we open up a browser using the following line: IWebBrowser browser = support.createBrowser(IWorkbenchBrowserSupport.AS_EDITOR | IWorkbenchBrowserSupport.STATUS, file.getName(), fPointID, fPointID); Looking at the browser support code, if you specify IWorkbenchBrowserSupport.AS_EDITOR it always opens in an editor. If you remove that line, it respects the user preference. Haven't seen any bad side effects from removing it.
> One place it happens is if you right click on a extension point element in the > schema editor and go to Preview reference document. Yes, I see it there, and also in the plu-in manifest editor, when select the ext. pt. name in an extension and choose "Show Description".
(In reply to comment #3) > Looking at the browser support code, if you specify > IWorkbenchBrowserSupport.AS_EDITOR it always opens in an editor. If you remove > that line, it respects the user preference. Haven't seen any bad side effects > from removing it. I think that's a bug in DefaultBrowserSupport 1.15. Line 104 should read: ((style & (AS_EDITOR | AS_VIEW)) != 0 && WebBrowserPreference... I think Plat/UA should fix this breaking change (from bug 215941).
Actually, I don't understand the reason for (style & (AS_EDITOR + AS_VIEW)) == 0 && ... in HEAD. Line 104 should be restored to: WebBrowserPreference.getBrowserChoice() != WebBrowserPreference.INTERNAL If the user said it should open in an external browser, then the style flags should not matter at all, see contract of org.eclipse.ui.browser.IWorkbenchBrowserSupport.createBrowser(int, ..): * <p> * If the user has chosen not to use the internal browser or it is not * available on the current platform, an external browser will be used and * all style parameters will be ignored. * </p> Moving to UA.
Targeting 3.5
Here's the history behind the change I made. There is a preference which specifies to use an external editor when opening a browser. There are also three flags which affect where an editor is opened: /** * Style constant (value 1<<5) indicating that the internal web * browser will be hosted in a workbench editor area. This is just a hint - * implementers of the browser support may not honor it. */ int AS_EDITOR = 1 << 5; /** * Style constant (value 1<<6) indicating that the internal web * browser will be hosted in a workbench view. This is just a hint - * implementers of the browser support may not honor it. */ int AS_VIEW = 1 << 6; /** * Style constant (value 1<<7) indicating that the external web * browser must be used even if the implementation supports internal * browsers and the user didn't set the preference to external browsers. */ int AS_EXTERNAL = 1 << 7; From reading the JavaDoc my feeling was that the flags should have higher priority than the preferences, i.e. if AS_EDITOR is specified then the document will open in an editor (if the OS supports it) regardless of the setting of the preference. Otherwise there is no way to force the document to open in an editor, regardless of the preferences. I thought that no-one would be using the AS_EDITOR flag unless they wanted the document to always open in an editor and that the old (3.4) behavior was incorrect. Having seen this bug I realize that the documentation does not specify exactly what should happen if you pass in AS_EDITOR, and there are cases where you want it to behave exactly as it did in Eclipse 3.4, where AS_EDITOR means "if the preference is not set to use an external browser open in an editor". Since my reasoning which led me to believe that this change would not break anyone was incorrect I will restore the old behavior, however I still have a need to force the editor to be opened regardless of the use external browser preference. Much as I hate to do this I may have to add yet another flag which is the opposite of AS_EXTERNAL in that it would prevent the external browser from being used.
Fixed (and without having to add any more flags).