|Create UMLDiagramEditor without opening it (like in OffscreenEditPartFactory) [message #1710223]
||Mon, 05 October 2015 12:25
| Raimund Konnerth
Registered: October 2015
I'm developing a plugin for IBM RSA, which generates some models, but when opening the CompositeStructureDiagrams the layout is very messy (due to the number of nodes and edges).
In order to solve the layouting, I'm using the layouting algorithms from project KIELER, but for this to work I need to pass the layouter an IWorkbenchPart object.
My current implementation does the following things:
UMLModeler.getUMLDiagramHelper().openDiagramEditor(diagram); // opening the Diagram Editor for the specific diagram.
IWorkbenchPart workbenchPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart(); // getting the active editor
// this also works
//IEditorPart workbenchPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); // getting the active editor
DiagramLayoutEngine.INSTANCE.layout(activeEditor, null, layoutConfig); // performing layouting
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeEditor(workbenchPart , true); // saving and closing the editor
The problem with this is that I have quite a few diagrams, so opening, layouting and closing all of them takes too much time and also is annoying to the end user because of the flashing in the Workbench.
I was wondering if I can create or register somehow the editors for the different diagrams to the EditorService and iterate through them without opening them. I've found a similar approach, the OffscreenEditPartFactory which can create a DiagramEditPart to the given the Diagram without opening an editor. But I need a way to create the DiagramEditor without opening it.
If I missed some detail, please let me know!
Thank you very much for any help!
Powered by FUDForum
. Page generated in 0.01753 seconds