diff options
| author | Laurent Redor | 2020-10-20 13:18:14 +0000 |
|---|---|---|
| committer | Laurent Redor | 2020-11-05 16:55:52 +0000 |
| commit | 602af26b4783f254f86f9d4d9ae08fbba0c97330 (patch) | |
| tree | f1e2b9d662b010ffc81b7ffcab95c1c9bcecf9c0 | |
| parent | 3e2e640c4569fe1214079941922ae7d11030d2b6 (diff) | |
| download | org.eclipse.sirius-602af26b4783f254f86f9d4d9ae08fbba0c97330.tar.gz org.eclipse.sirius-602af26b4783f254f86f9d4d9ae08fbba0c97330.tar.xz org.eclipse.sirius-602af26b4783f254f86f9d4d9ae08fbba0c97330.zip | |
[568037] Consider compartment as parent of selected elements to arrange
This commit considers AbstractDNode*CompartmentEditPart in
EditPartQuery.getDDiagram().
AbstractDNodeContainerCompartmentEditPart and
AbstractDNodeListCompartmentEditPart are not correctly managed by
EditPartQuery.getDDiagram() as they do not implement
IDiagramElementEditPart. As consequence, the ELK layout was not
retrieved for this element and a standard layout is called instead.
This commit correponds to the comment c3 of the bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=568037#c3
This commit also changes bounds of a container and its node from data
needed for EditModeTest. This test uses ELK, I don't know why, but after
this commit, the layout of the container is not done and in the rest of
test, we try to double-click on a node without success. Previously, a
"standard" layout, ie not an ELK one, is done on the contents of the
container.
Bug: 568037
Change-Id: I3be82fc1807873e4b9de451c474ef41a035ba736
Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
2 files changed, 5 insertions, 3 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/query/EditPartQuery.java b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/query/EditPartQuery.java index a77008b2a1..feb0286dab 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/query/EditPartQuery.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/query/EditPartQuery.java @@ -27,6 +27,8 @@ import org.eclipse.sirius.diagram.tools.api.layout.PinHelper; import org.eclipse.sirius.diagram.tools.api.preferences.SiriusDiagramPreferencesKeys; import org.eclipse.sirius.diagram.ui.edit.api.part.IDDiagramEditPart; import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramElementEditPart; +import org.eclipse.sirius.diagram.ui.internal.edit.parts.AbstractDNodeContainerCompartmentEditPart; +import org.eclipse.sirius.diagram.ui.internal.edit.parts.AbstractDNodeListCompartmentEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.parts.NoteEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.parts.SiriusNoteEditPart; import org.eclipse.sirius.ext.base.Option; @@ -74,7 +76,7 @@ public final class EditPartQuery { */ public Optional<DDiagram> getDDiagram() { IDDiagramEditPart effectiveDiagramEditPart = null; - if (editPart instanceof IDiagramElementEditPart) { + if (editPart instanceof IDiagramElementEditPart || editPart instanceof AbstractDNodeContainerCompartmentEditPart || editPart instanceof AbstractDNodeListCompartmentEditPart) { effectiveDiagramEditPart = getDiagramEditPart(editPart); } else if (editPart instanceof IDDiagramEditPart) { effectiveDiagramEditPart = (IDDiagramEditPart) editPart; diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editModes/vp2120.aird b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editModes/vp2120.aird index 2dbc836dc5..c731afd5db 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editModes/vp2120.aird +++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/editModes/vp2120.aird @@ -211,13 +211,13 @@ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_at-CV9apEeiyWO58F3yA9g" x="5" y="6" width="40" height="41"/> </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_at-CUdapEeiyWO58F3yA9g" fontName="Segoe UI" fontHeight="8"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_at-CUtapEeiyWO58F3yA9g" x="12" y="12" width="50" height="52"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_at-CUtapEeiyWO58F3yA9g" x="40" y="20" width="50" height="52"/> </children> <styles xmi:type="notation:SortingStyle" xmi:id="_at7mEdapEeiyWO58F3yA9g"/> <styles xmi:type="notation:FilteringStyle" xmi:id="_at7mEtapEeiyWO58F3yA9g"/> </children> <styles xmi:type="notation:ShapeStyle" xmi:id="_at6_AdapEeiyWO58F3yA9g" fontName="Segoe UI" fontHeight="8"/> - <layoutConstraint xmi:type="notation:Bounds" xmi:id="_at6_AtapEeiyWO58F3yA9g" x="4" y="90" width="74" height="76"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_at6_AtapEeiyWO58F3yA9g" x="4" y="90" width="200" height="100"/> </children> <children xmi:type="notation:Node" xmi:id="_at7mE9apEeiyWO58F3yA9g" visible="false" type="2002" element="_atkZs9apEeiyWO58F3yA9g"> <children xmi:type="notation:Node" xmi:id="_at7mFtapEeiyWO58F3yA9g" type="5006"/> |
