Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » Focusing windows(How to do it?)
icon8.gif  Focusing windows [message #903324] Thu, 23 August 2012 03:43 Go to next message
Eclipse UserFriend
Im new i ll just say hello to u Smile

problem:

I did a loginWindow (visible=true)and i have workWindow which (visible=false).When somebody login it's change visible , but i lost focus on workWindow.
I dono how to fix this Sad

this is my code:

 
 MTrimmedWindow workingWindow = (MTrimmedWindow) app.getChildren().get(0);
 MTrimmedWindow loginWindow = (MTrimmedWindow) app.getChildren().get(1);

 loginWindow.setVisible(false);
 workingWindow.setVisible(true);
				

Re: Focusing windows [message #903549 is a reply to message #903324] Fri, 24 August 2012 05:07 Go to previous messageGo to next message
Eclipse UserFriend
IMHO you have in addition to use the PartService. See http://www.vogella.com/articles/Eclipse4Services/article.html#selectedservices_partservice for an example.
Re: Focusing windows [message #903579 is a reply to message #903324] Fri, 24 August 2012 08:01 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for replay Lars.

I was so laughing when i was writing this code i know it is for sure bad code but... it works Razz

first i did that tutorial and grab parts but i did grab only parts from visible TrimmedWindow (code compile from URI class-part named LoginScreen.java ).

I tried to do the same thing but in other URI class by Dependency Injection (first i made
eventBroker.post("ChangeVisble", new Object()); 


then in other URI class

void injectWindowState(@UIEventTopic("ChangeVisble") Object obj) {
		changeVisible();
		MTrimmedWindow workingWindow = (MTrimmedWindow) app.getChildren()
				.get(0);
		MTrimmedWindow loginWindow = (MTrimmedWindow) app.getChildren().get(1);
		loginWindow.setVisible(false);
		workingWindow.setVisible(true);
		
		MPart detailsTodoPart = partService.findPart("e4test.part.calendar1");
		detailsTodoPart.setVisible(true);
		partService.showPart(detailsTodoPart, PartState.VISIBLE); 
		


And it works !!! Smile


Re: Focusing windows [message #903586 is a reply to message #903579] Fri, 24 August 2012 08:28 Go to previous messageGo to next message
Eclipse UserFriend
Unfortunately it is currently not bad code, but required code. Please issue your voice on Bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=372211.
Re: Focusing windows [message #904408 is a reply to message #903586] Tue, 28 August 2012 07:36 Go to previous messageGo to next message
Eclipse UserFriend
Hi Lars,

I get the following Message for your Link: '372211.' is not a valid bug number.

I have the same problem like arek.. i will try now his workaround
Re: Focusing windows [message #904409 is a reply to message #903586] Tue, 28 August 2012 07:37 Go to previous messageGo to next message
Eclipse UserFriend
Hi Lars,

I get the following Message for your Link: '372211.' is not a valid bug number.

I have the same problem like arek.. i will try now his workaround
Re: Focusing windows [message #904413 is a reply to message #904408] Tue, 28 August 2012 07:43 Go to previous messageGo to next message
Eclipse UserFriend
Wink try without the dot at the end....

https://bugs.eclipse.org/bugs/show_bug.cgi?id=372211
Re: Focusing windows [message #904496 is a reply to message #904413] Tue, 28 August 2012 10:34 Go to previous messageGo to next message
Eclipse UserFriend
time for vacation...
Re: Focusing windows [message #904651 is a reply to message #904496] Tue, 28 August 2012 18:04 Go to previous message
Eclipse UserFriend
okay.. the workaround above doesn't work for me...

instead of that i send a force Focus on the SWT Shell..


MWindow pluginDialog = (MWindow) service.find(LOGIN_WINDOW_NAME, application);
MWindow windowModel = (MWindow) service.find(MAIN_WINDOW_NAME, application);

// close the plugin dialog
pluginDialog.setVisible(false);
pluginDialog.setToBeRendered(false);
pluginDialog.setOnTop(false);
//open main window
service.bringToTop(windowModel);
windowModel.setOnTop(true);
windowModel.setVisible(true);
//works, but dirty :/
((Shell)windowModel.getWidget()).forceActive();

Previous Topic:Uninstalled Model Addon Show Error continuously.
Next Topic:take advantage of e4 ContextFunction
Goto Forum:
  


Current Time: Tue Jul 08 17:15:42 EDT 2025

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

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

Back to the top