Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » e4 rcp focus on window(How to bring one of windows of my application to front (make it active/focus))
e4 rcp focus on window [message #940456] Thu, 11 October 2012 12:50 Go to next message
Xiuang Lee is currently offline Xiuang Lee
Messages: 9
Registered: October 2012
Junior Member
I have to create multiwindowed e4 app. All my windows are collected in a map. I'm trying to focus on one of the windows programmaticaly:

MWindow window = windows.get("window number one");
EModelService service = window.getContext().get(EModelService.class);
service.bringToTop(window);


It does not help: nothing happens. Think, I missunderstand this method.

How to bring window to top, I mean - focus on this window/make it active?


Thanks in advance, Xiuang.
Re: e4 rcp focus on window [message #941058 is a reply to message #940456] Fri, 12 October 2012 03:23 Go to previous messageGo to next message
Xiuang Lee is currently offline Xiuang Lee
Messages: 9
Registered: October 2012
Junior Member
Today I tried:

- partService.showPart on window's inner part
- window.setOnTop(true);
- window.getContext().activate()

Still, nothing brought window to the front. Help is very appreciated.
Re: e4 rcp focus on window [message #941181 is a reply to message #941058] Fri, 12 October 2012 05:22 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 596
Registered: December 2010
Senior Member

bringToTop should work in theory. If not this sounds like a bug. In the mean time :
((Shell) mWindow.getWidget()).forceFocus();
should do the trick, though ugly. I'll follow this up however.
Re: e4 rcp focus on window [message #941242 is a reply to message #941181] Fri, 12 October 2012 06:28 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de Alwis
Messages: 163
Registered: January 2012
Senior Member

Set it as the MApplication's selected element?

Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Re: e4 rcp focus on window [message #941246 is a reply to message #941242] Fri, 12 October 2012 06:30 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 596
Registered: December 2010
Senior Member

bringToTop does that. Or is supposed to at least.
Re: e4 rcp focus on window [message #941293 is a reply to message #941181] Fri, 12 October 2012 07:21 Go to previous messageGo to next message
Xiuang Lee is currently offline Xiuang Lee
Messages: 9
Registered: October 2012
Junior Member
forceFocus() worked! So, there's a bug in EModelService.bringToTop()
Re: e4 rcp focus on window [message #941376 is a reply to message #941293] Fri, 12 October 2012 09:13 Go to previous message
Sopot Cela is currently offline Sopot Cela
Messages: 596
Registered: December 2010
Senior Member

Follow up: http://bugs.eclipse.org/391780
Previous Topic:NPE for typed command parameter
Next Topic:Re: Getting the Workbench in e4?
Goto Forum:
  


Current Time: Fri Jul 25 11:28:36 EDT 2014

Powered by FUDForum. Page generated in 0.03546 seconds