Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Clone a Application Window(How can we open a new Window with the same Menues and Perspective)
Clone a Application Window [message #834828] Mon, 02 April 2012 12:57 Go to next message
Tom K. is currently offline Tom K.Friend
Messages: 22
Registered: July 2009
Junior Member
How is it possible to clone the first window of a pure e4 rcp application?

it is possible to open a new Window easily and define it in the model. But we would like to have a similar action like in Eclipse IDE open new Window. Where you have again all perspectives and Menues available.

MWindow newwindow = (MWindow) modelService.find(ContextConstants.NEW_WINDOW_ID, application);
        newwindow.setVisible(true);       
        newwindow.setOnTop(true);
        newwindow.setToBeRendered(true);
        modelService.bringToTop(newwindow);


We tried as well with the clone method but we get a NPE there.

 MWindow cloneswindow = (MWindow) modelService.cloneElement(window, application);
        modelService.bringToTop(cloneswindow);


Caused by: java.lang.NullPointerException
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:383)
Re: Clone a Application Window [message #834866 is a reply to message #834828] Mon, 02 April 2012 13:52 Go to previous messageGo to next message
Eclipse UserFriend
Try putting
application.getChildren().add(cloneswindow);


before
modelService.bringToTop(cloneswindow);
Re: Clone a Application Window [message #834907 is a reply to message #834866] Mon, 02 April 2012 14:40 Go to previous message
Tom K. is currently offline Tom K.Friend
Messages: 22
Registered: July 2009
Junior Member
Cool ! It works...
Previous Topic:Saving Part State
Next Topic:Prevent last Part to close
Goto Forum:
  


Current Time: Thu Apr 25 00:59:14 GMT 2024

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

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

Back to the top