Bug 94019 - [Browser] Need API: IWorkbenchBrowserSupport.isInternalWebBrowserAvailable()
Summary: [Browser] Need API: IWorkbenchBrowserSupport.isInternalWebBrowserAvailable()
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Dejan Glozic CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks: 90793
  Show dependency tree
 
Reported: 2005-05-06 18:52 EDT by Dejan Glozic CLA
Modified: 2005-05-09 11:43 EDT (History)
2 users (show)

See Also:


Attachments
API implementation (5.20 KB, patch)
2005-05-07 22:07 EDT, Dejan Glozic CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dejan Glozic CLA 2005-05-06 18:52:50 EDT
Michael, Tim, I know it is a bit late but I have a use case in Help where I 
need to know if the browser support can show documents 'in place' i.e. using 
internal browser widget. If true, I would ask the editor to show the document 
in place, otherwise I would go to Help and ask to show the document in a 
separate help window.

The use case here is that I don't want to use external browser support for 
help documents because users would loose the context. In the workbench window, 
it makes sense to show the document only because the context (search results, 
All Topics, Related Topics etc.) is also visible next to it.

In order to do this, I need to be able to ask IWorkbenchBrowserSupport if 
internal browser is possible without actually creating one. 

There is no real work involved to do this for the several reasons:

1) The fallback implementation in the workbench would return 'false' all the 
time
2) The 'reference' implementation that Tim is providing already has this 
method on WebBrowserUtil class.
3) We can add the method to AbstractWorkbenchBrowserSupport that is meant to 
be extended without breaking anybody because we can provide the default
implementation (return false).

Here is the proposed method for IWorkbenchBrowserSupport:

/**
 * Tests whether web browser as an SWT widget can be created in this
 * workbench instance. If this method returns <code>false</code>,
 * browser styles <code>AS_EDITOR</code> and <code>AS_VIEW</code>
 * will be ignored and external browser will always be created.
 *
 * @return <code>true</code> if internal web browser can be created on
 * this platform, <code>false</code> otherwise.
 */
 boolean isInternalWebBrowserAvailable();
Comment 1 Dejan Glozic CLA 2005-05-06 18:54:00 EDT
It goes without saying that I will be providing org.eclipse.ui.workbench patch 
for this.
Comment 2 Jim des Rivieres CLA 2005-05-07 08:28:27 EDT
This API change makes good sense.

Suggested rewording of second sentence:
"If this method returns <code>false</code>, <code>createBrowser</code> would 
ignore browser styles <code>AS_EDITOR</code> and <code>AS_VIEW</code> and 
always create an external browser."



Comment 3 Dejan Glozic CLA 2005-05-07 22:07:40 EDT
Created attachment 20807 [details]
API implementation

Implemented - ready for release.
Comment 4 Dejan Glozic CLA 2005-05-07 22:21:47 EDT
Hey - I just realized I have commit rights :-). I synchronized by force of 
habbit and released without thinking only to find out 15 minutes later that 
org.eclipse.ui.workbench no longer shows outgoing changes :-).

In that case, this defects is done.
Comment 5 Dejan Glozic CLA 2005-05-07 22:22:07 EDT
Closing as fixed.
Comment 6 Michael Van Meekeren CLA 2005-05-09 11:35:43 EDT
regarding comment #4, dejan, no offense but I'm a little worried that Denis may
have mixed up some of the UI rights.  It is important (in the big picture) what
we know who can commit to which projects.  I am going to investigate.
Comment 7 Dejan Glozic CLA 2005-05-09 11:41:36 EDT
No problem.
Comment 8 Dejan Glozic CLA 2005-05-09 11:43:28 EDT
No problem.