Opening multiple instances of an MTrimmedWindow complete with perspectives etc

StackOverflow https://stackoverflow.com/questions/20740891

  •  20-09-2022
  •  | 
  •  

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!

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top