browser widget [message #1434643] |
Tue, 30 September 2014 07:38  |
Eclipse User |
|
|
|
Hello,
I'm using a org.eclipse.swt.browser.Browser in a view simply like this:
@Override
public void createPartControl(Composite parent) {
Browser browser = new Browser(parent, SWT.NONE);
}
Now, when this view is NOT the active part in the workbench, and the user clicks in this view (=clicks somewhere in the browser) the view should be activated, but is NOT!
The same view in a RCP application gets activated in this situation.
The same behavior applies for the browser placed in an editor.
In the RAP application, the browser just does not recognize any MouseDown events when the view/editor is not the active part in the workbench.
Is there a way to activate the view/editor when the user clicks in the browser?
Thanks for your help!
Julia
PS: I'm working with Eclipse Luna and RAP 2.3.
|
|
|
|
|
|
Re: browser widget [message #1435575 is a reply to message #1435476] |
Wed, 01 October 2014 13:58  |
Eclipse User |
|
|
|
OK... this hack works:
1) in HTML file:
document.body.onclick = function(){ focusBrowserFunction(); }
(actually the click event calls the function many times without being necessary,
but the body element has no focus event)
2) in createPartControl of editor/view:
new BrowserFunction(browser, "focusBrowserFunction") {
@Override
public Object function(Object[] arguments) {
// System.out.println("browserFunction...");
browser.setFocus();
return null;
}
};
Good luck for fixing this professionally in 3.0!
Best,
Julia
|
|
|
Powered by
FUDForum. Page generated in 0.04229 seconds