Skip to main content


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 16:50 Go to next message
Xiuang Lee is currently offline Xiuang LeeFriend
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 07:23 Go to previous messageGo to next message
Xiuang Lee is currently offline Xiuang LeeFriend
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 09:22 Go to previous messageGo to next message
Eclipse UserFriend
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 10:28 Go to previous messageGo to next message
Eclipse UserFriend
Set it as the MApplication's selected element?
Re: e4 rcp focus on window [message #941246 is a reply to message #941242] Fri, 12 October 2012 10:30 Go to previous messageGo to next message
Eclipse UserFriend
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 11:21 Go to previous messageGo to next message
Xiuang Lee is currently offline Xiuang LeeFriend
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 13:13 Go to previous message
Eclipse UserFriend
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: Wed Apr 24 19:55:53 GMT 2024

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

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

Back to the top