Opening multiple instances of an MTrimmedWindow complete with perspectives etc

橙三吉。 提交于 2019-12-10 18:58:29

问题


I have defined a "main window" for my RCP app as MTrimmedWindow with perspectives, parts etc., as usual, within the Application.e4xmi.

Is it possible to open additional instances of this main window programmatically? Similar to the creation of parts from MPartDescriptors? Unfortunately only parts seem to have descriptors. I would need something like an MTrimmedWindowDescriptor (complete with content descriptors, e.g. MPerspectiveStackDescriptor) to create the model from.

It is not known in advance how many main windows will be needed. Each main window will be used to work on a specific subset of my domain data. It is a little bit similar to opening an Eclipse IDE window per project, though not as seperate processes but as separate windows within one running application.

Any ideas? Thanks!


回答1:


I think what you are supposed to do is create a Snippet in the Application.e4xmi containing the MTrimmedWindow you would like to clone. You then use EModelService.cloneSnippet to create a useable window from the snippet.

There is also EModelService.cloneElement to clone existing elements.

There is a bit more info here



来源:https://stackoverflow.com/questions/20740891/opening-multiple-instances-of-an-mtrimmedwindow-complete-with-perspectives-etc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!