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 13: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 04:27 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 596
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 15: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: Thu Jul 24 06:47:01 EDT 2014

Powered by FUDForum. Page generated in 0.01617 seconds