Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » browser widget
browser widget [message #1434643] Tue, 30 September 2014 11:38 Go to next message
Julia Kurde is currently offline Julia KurdeFriend
Messages: 79
Registered: November 2011
Location: Berlin, Germany
Member
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 #1434703 is a reply to message #1434643] Tue, 30 September 2014 13:09 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Julia,
this is a known issue in RAP. See bug:
436693: [Browser] No focus lost event when clicking a link in the Browser
https://bugs.eclipse.org/bugs/show_bug.cgi?id=436693
Focusing of Browser widget with mouse is currently not possible in RAP.
Mouse events in Browser (iframe) are absorbed by the iframe.
Best,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: browser widget [message #1435463 is a reply to message #1434703] Wed, 01 October 2014 14:27 Go to previous messageGo to next message
Julia Kurde is currently offline Julia KurdeFriend
Messages: 79
Registered: November 2011
Location: Berlin, Germany
Member
Hi Ivan,

Thanks for your answer!
So, as a workaround, I would have to (somehow) recognize the focus event from the iframe in a javascript and call a function in eclipse (which I know is possible, but need to find out again how), which activates the editor/view.
For me it is important, that the part gets activated when the user clicks into it so that the corresponding actions get activated/deactivated.

Is it possible to get the iframe focus event in the html file, which is loaded in the browser?

Best,
Julia
Re: browser widget [message #1435476 is a reply to message #1435463] Wed, 01 October 2014 14:50 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Julia,
here (https://www.eclipse.org/forums/index.php/t/771178/) is a long
discussion on the topic. We'll try to find a fix for 3.0 release.
HTH,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: browser widget [message #1435575 is a reply to message #1435476] Wed, 01 October 2014 17:58 Go to previous message
Julia Kurde is currently offline Julia KurdeFriend
Messages: 79
Registered: November 2011
Location: Berlin, Germany
Member
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
Previous Topic:Tooltip not available for custom widget
Next Topic:Clipboard
Goto Forum:
  


Current Time: Tue Feb 25 16:05:53 GMT 2020

Powered by FUDForum. Page generated in 0.04596 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top