|
Re: How to get all Editparts from a Sirius Diagram [message #1736880 is a reply to message #1736797] |
Mon, 04 July 2016 07:35 |
|
Le 01/07/2016 22:00, Matt Se a écrit :
> Hi all,
Hi.
For information, if you have Sirius-specific questions the should be
posted in the Sirius forum: https://www.eclipse.org/forums/index.php/f/262/.
> I want to perform some gmf requests (eg: Arrange all) programatically. I
> would need the Editparts (for the container Elements) of my Diagram. Is
> it possible to retrieve them from my org.eclipse.sirius.diagram.DDiagram
> and how do I accomplish that?
It would be possible, but more cumbersome to navigate "backwards" from
the DDiagram to GMF's Diagram to the DiagramEditPart.
> Respectively whats the proper way to
> access the Editparts of my Sirius Diagram?
>
> I tried the following, but I'm kinda lost now:
> DDiagramEditPart dDiagramEditPart = null;
> IEditorPart editor = EclipseUIUtil.getActiveEditor();
> if (editor instanceof DiagramEditor) {
> DiagramEditor diagramEditor = (DiagramEditor) editor;
> DiagramEditPart diagramEditPart =
> diagramEditor.getDiagramEditPart();
From this DiagramEditPart, you can look at
org.eclipse.sirius.diagram.ui.tools.internal.layout.LayoutUtil.arrange(DiagramEditPart)
to launch the "Arrange All" action. It's technically internal, but only
a few lines of simple code, so you can reproduce it in your code without
worry.
Regards,
Pierre-Charles David
--
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.02907 seconds