Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Create UMLDiagramEditor without opening it (like in OffscreenEditPartFactory)
Create UMLDiagramEditor without opening it (like in OffscreenEditPartFactory) [message #1710223] Mon, 05 October 2015 12:25
Raimund Konnerth is currently offline Raimund KonnerthFriend
Messages: 1
Registered: October 2015
Junior Member
Hi everyone,

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!
Previous Topic:Errors on creation diagram editor (Eclipse Luna 4.4.1)
Next Topic:connection line plus rectangle
Goto Forum:

Current Time: Thu Jun 20 09:12:06 GMT 2024

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

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

Back to the top