Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » keybindings and mouse events with a browser widget
keybindings and mouse events with a browser widget [message #991210] Mon, 17 December 2012 13:52 Go to next message
hanspeter hofer is currently offline hanspeter hofer
Messages: 4
Registered: December 2012
Junior Member
I created a custom editor widget containing a browser widget. The problem is that I can't figure out how to get mouse or keydown events to the workbench. I want to be able to bind the save-funktion of the editor to a keydown event.

I tried to use the org.eclipse.ui.binding extension point
problem: it does not work if I have the focus on the browser widget.

I tried BrowserFunctions
problem: to save the content I have to call another BrowserFunction to fetch the content of the editor. It seems that it's not possible to call a BrowserFunction in another BrowserFunction.

I thought of firing an event via qooxdoo to force the workbench to save the open file via the command org.eclipse.ui.file.save, but I'm not sure how to do it. I can't access the the rap functions, because the browser widget is encapsulated by an iframe.

Another Problem which may be related to the iframe is the fact that the workbench doesn't receive clicks on the iframe(browser widget). For example if I create a menu via a BrowserFunction the menu does not close until I click an the menu or outside the iframe.

I would be very happy if someone could show me a solution.
Re: keybindings and mouse events with a browser widget [message #991287 is a reply to message #991210] Tue, 18 December 2012 06:00 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim Buschtoens
Messages: 246
Registered: July 2009
Senior Member
Hi.

> I tried BrowserFunctions
> problem: to save the content I have to call another BrowserFunction to
> fetch the content of the editor. It seems that it's not possible to call
> a BrowserFunction in another BrowserFunction.

I'm not exactly sure how your custom widget works, but calling a
BrowserFunction within a BrowserFunction shouldn't be necessary. Either
send all the data you need within the first BrowserFunction (they take
multiple arguments), or (much less optimal) use Browser#evaluate to get it.

Greetings,
Tim

--
Tim Buschtöns

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: keybindings and mouse events with a browser widget [message #992440 is a reply to message #991287] Fri, 21 December 2012 11:31 Go to previous messageGo to next message
hanspeter hofer is currently offline hanspeter hofer
Messages: 4
Registered: December 2012
Junior Member
Thx, I created a Browserfunction with an argument for the content of the editor and it works, but I have to specify the keybinding twice(editor + workbench).

I could not solve the menu problem though. If I create a Menu it does not close when I click on the browserwidget. Any ideas on this problem?
Re: keybindings and mouse events with a browser widget [message #997625 is a reply to message #992440] Mon, 07 January 2013 05:16 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim Buschtoens
Messages: 246
Registered: July 2009
Senior Member
Hi.

> I could not solve the menu problem though. If I create a Menu it does
> not close when I click on the browserwidget. Any ideas on this problem?

Assuming you mean a SWT popup Menu, this is a problem that can currently
not be worked around. However, we are aware that Browser and custom
widgets may cause such issues and plan to fix this in the near future.

Greetings,
Tim


--
Tim Buschtöns

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: keybindings and mouse events with a browser widget [message #1017304 is a reply to message #997625] Mon, 11 March 2013 10:51 Go to previous message
hanspeter hofer is currently offline hanspeter hofer
Messages: 4
Registered: December 2012
Junior Member
As an workaround I created a BrowserFunction to set the focus as well as closing the menu if the Browser is already focused.

editorNode.addEventListener('mousedown', function(e) {
  if( e.button != 2 ){
    setFocusFunction();
  }
}, false); 
Previous Topic:TreeViewer : how to set focus on a particular cell
Next Topic:SettingStore vs java.util.preferences
Goto Forum:
  


Current Time: Fri May 24 06:27:28 EDT 2013

Powered by FUDForum. Page generated in 0.02037 seconds