Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » How to implement the 'New window' command (org.eclipse.ui.window.newWindow)
How to implement the 'New window' command (org.eclipse.ui.window.newWindow) [message #1007618] Wed, 06 February 2013 18:19 Go to next message
Vladimir Tsichevski is currently offline Vladimir Tsichevski
Messages: 2
Registered: February 2013
Junior Member
Hi,

how can I implement the built-in 'New window' command (id=org.eclipse.ui.window.newWindow) in e4?

Regards,
Vladimir
Re: How to implement the 'New window' command (org.eclipse.ui.window.newWindow) [message #1007715 is a reply to message #1007618] Thu, 07 February 2013 09:27 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 597
Registered: December 2010
Senior Member

This handler should work if you want to clone the window. If not create a brand new window through the factories.

 @Execute
	public void execute(MApplication app, MWindow win){
		app.getChildren().add(EcoreUtil.copy((EObject)win));
	}
Re: How to implement the 'New window' command (org.eclipse.ui.window.newWindow) [message #1007865 is a reply to message #1007715] Thu, 07 February 2013 20:02 Go to previous message
Vladimir Tsichevski is currently offline Vladimir Tsichevski
Messages: 2
Registered: February 2013
Junior Member
Thank you, Sopot! It works! You code needs just one more cast:
@Execute
  public void execute(MApplication app, MWindow win){
    app.getChildren().add((MWindow) EcoreUtil.copy((EObject)win));
  }
Previous Topic:Variables in e4xmi
Next Topic:Handled tool item - visible when
Goto Forum:
  


Current Time: Wed Oct 01 22:19:29 GMT 2014

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

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