Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2017-04-13 15:32:14 +0000
committerLaurent Fasani2017-08-02 14:39:19 +0000
commita8295012e10299b30dbbe3f9be6f696504bf1dbc (patch)
treef16e8f0304a219e15b1fb21268a584dfa9a99c07
parentc33f68b72bfc02fb155704f2e419759436f38c58 (diff)
downloadorg.eclipse.sirius-a8295012e10299b30dbbe3f9be6f696504bf1dbc.tar.gz
org.eclipse.sirius-a8295012e10299b30dbbe3f9be6f696504bf1dbc.tar.xz
org.eclipse.sirius-a8295012e10299b30dbbe3f9be6f696504bf1dbc.zip
[520110] Disable reveal on node and edge selection
* The code of sirius tracker super classes in handleButtonUp(int) is copied in sirius tracker classes and changed to disable reveal at selection. * Add a test * Update release notes Bug: 520110 Change-Id: I6172120ab89c00fbf9b9d261eff776cdfcfea8b7 Signed-off-by: Laurent Redor <laurent.redor@obeo.fr> Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/tools/SequenceMessageSelectConnectionEditPartTracker.java10
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/NoCopyDragEditPartsTrackerEx.java45
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/SelectConnectionEditPartTracker.java70
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/SiriusSelectConnectionEditPartTracker.java9
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release_Notes.html5
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile5
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/data/unit/selection/TestSelection.aird162
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/data/unit/selection/TestSelection.ecore12
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EditPartSelectionTest.java102
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/compartment/CompartmentsCreationTest.java292
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllTestSuite.java1
11 files changed, 512 insertions, 201 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/tools/SequenceMessageSelectConnectionEditPartTracker.java b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/tools/SequenceMessageSelectConnectionEditPartTracker.java
index 5638676f8a..fb86f359e7 100644
--- a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/tools/SequenceMessageSelectConnectionEditPartTracker.java
+++ b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/tools/SequenceMessageSelectConnectionEditPartTracker.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2017 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,15 +18,14 @@ import org.eclipse.gef.ConnectionEditPart;
import org.eclipse.gef.DragTracker;
import org.eclipse.gef.Request;
import org.eclipse.gef.requests.BendpointRequest;
-import org.eclipse.gmf.runtime.gef.ui.internal.tools.SelectConnectionEditPartTracker;
import org.eclipse.sirius.diagram.sequence.business.internal.query.ISequenceEventQuery;
import org.eclipse.sirius.diagram.sequence.ui.tool.internal.edit.part.SequenceMessageEditPart;
import org.eclipse.sirius.diagram.sequence.util.Range;
+import org.eclipse.sirius.diagram.ui.tools.internal.ui.SelectConnectionEditPartTracker;
import org.eclipse.sirius.ext.gmf.runtime.editparts.GraphicalHelper;
/**
- * Specific connection selection tracker to handle move of messageToSelf
- * messages.
+ * Specific connection selection tracker to handle move of messageToSelf messages.
*
* @author mporhel
*
@@ -44,8 +43,7 @@ public class SequenceMessageSelectConnectionEditPartTracker extends SelectConnec
* Method SequenceMessageSelectConnectionEditPartTracker.
*
* @param owner
- * ConnectionNodeEditPart that creates and owns the tracker
- * object
+ * ConnectionNodeEditPart that creates and owns the tracker object
*/
public SequenceMessageSelectConnectionEditPartTracker(ConnectionEditPart owner) {
super(owner);
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/NoCopyDragEditPartsTrackerEx.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/NoCopyDragEditPartsTrackerEx.java
index 40a3805db5..6ab0140258 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/NoCopyDragEditPartsTrackerEx.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/NoCopyDragEditPartsTrackerEx.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2016 THALES GLOBAL SERVICES.
+ * Copyright (c) 2011, 2017 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,9 +20,8 @@ import org.eclipse.sirius.diagram.ui.tools.internal.util.EditPartQuery;
import org.eclipse.sirius.viewpoint.DSemanticDecorator;
/**
- * A specific dragEditPartTracket that disable the clone feature. Indeed, in
- * Sirius it's not natural to clone a graphical element that will be removed on
- * the next refresh.
+ * A specific dragEditPartTracket that disable the clone feature. Indeed, in Sirius it's not natural to clone a
+ * graphical element that will be removed on the next refresh.
*
* @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
*
@@ -40,8 +39,8 @@ public class NoCopyDragEditPartsTrackerEx extends SnapToAllDragEditPartsTracker
}
/**
- * Always disable the clone with Ctrl key in Sirius because it only clone
- * the graphical element and not the semantic element.
+ * Always disable the clone with Ctrl key in Sirius because it only clone the graphical element and not the semantic
+ * element.
*
* @param cloneActive
* true if cloning should be active (never considered here)
@@ -64,8 +63,8 @@ public class NoCopyDragEditPartsTrackerEx extends SnapToAllDragEditPartsTracker
}
/**
- * Overridden to return a command only if we are not in case of a
- * drag'n'drop of a node/container outside of its current container.
+ * Overridden to return a command only if we are not in case of a drag'n'drop of a node/container outside of its
+ * current container.
*
* @return A command only if authorized
*/
@@ -89,8 +88,7 @@ public class NoCopyDragEditPartsTrackerEx extends SnapToAllDragEditPartsTracker
}
/**
- * @return true if the drag'n'drop is authorized (according to layouting
- * mode specificity), false otherwise.
+ * @return true if the drag'n'drop is authorized (according to layouting mode specificity), false otherwise.
*/
private boolean isAuthorized() {
boolean isAuthorized = true;
@@ -108,4 +106,31 @@ public class NoCopyDragEditPartsTrackerEx extends SnapToAllDragEditPartsTracker
}
return isAuthorized;
}
+
+ @Override
+ protected boolean handleButtonUp(int button) {
+ // The above code is copied from the super classes (SnapToAllDragEditPartsTracker, DragEditPartsTracker and
+ // SelectEditPartTracker) to disable the reveal.
+ boolean result = false;
+ if (stateTransition(STATE_DRAG_IN_PROGRESS, STATE_TERMINAL)) {
+ eraseSourceFeedback();
+ eraseTargetFeedback();
+ performDrag();
+ result = true;
+ } else if (isInState(STATE_DRAG)) {
+ performSelection();
+ if (getFlag(org.eclipse.gef.tools.SelectEditPartTracker.MAX_FLAG))
+ // SelectEditPartTracker.MAX_FLAG is a protected constant equals to
+ // SelectEditPartTracker.FLAG_ENABLE_DIRECT_EDIT (that must be originally used here).
+ performDirectEdit();
+ // The SelectEditPartTracker behavior is overridden here to never reveal the selected element.
+ // if (button == 1 && getSourceEditPart().getSelected() != EditPart.SELECTED_NONE)
+ // getCurrentViewer().reveal(getSourceEditPart());
+ setState(STATE_TERMINAL);
+ result = true;
+ }
+ // Clean up the mode to original state.
+ snapToAllShape = SnapToAllDragEditPartsTracker.DEFAULT_SNAP_TO_SHAPE_MODE;
+ return result;
+ }
}
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/SelectConnectionEditPartTracker.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/SelectConnectionEditPartTracker.java
new file mode 100644
index 0000000000..06daf3a849
--- /dev/null
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/SelectConnectionEditPartTracker.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2015 THALES GLOBAL SERVICES.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.sirius.diagram.ui.tools.internal.ui;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.eclipse.gef.ConnectionEditPart;
+
+/**
+ * A specific Sirius tracker to override the reveal behavior at selection.
+ *
+ * @author lfasani
+ *
+ */
+@SuppressWarnings("restriction")
+public class SelectConnectionEditPartTracker extends org.eclipse.gmf.runtime.gef.ui.internal.tools.SelectConnectionEditPartTracker {
+
+ /**
+ * Default constructor.
+ *
+ * @param owner
+ * ConnectionNodeEditPart that creates and owns the tracker object
+ */
+ public SelectConnectionEditPartTracker(ConnectionEditPart owner) {
+ super(owner);
+ }
+
+ @Override
+ protected boolean handleButtonUp(int button) {
+ // The above code is copied from the super classes (SelectConnectionEditPartTracker and
+ // SelectEditPartTracker) to disable the reveal.
+
+ boolean bExecuteDrag = isInState(STATE_DRAG_IN_PROGRESS) && shouldAllowDrag();
+
+ boolean bRet = false;
+ if (isInState(STATE_DRAG)) {
+ performSelection();
+ if (getFlag(MAX_FLAG))
+ performDirectEdit();
+ // The SelectEditPartTracker behavior is overridden here to never reveal the selected element.
+ // if (button == 1 && getSourceEditPart().getSelected() != EditPart.SELECTED_NONE)
+ // getCurrentViewer().reveal(getSourceEditPart());
+ setState(STATE_TERMINAL);
+ }
+
+ if (bExecuteDrag) {
+ Method eraseSourceFeedbackMethod;
+ try {
+ eraseSourceFeedbackMethod = SelectConnectionEditPartTracker.class.getDeclaredMethod("eraseSourceFeedback"); //$NON-NLS-1$
+ eraseSourceFeedbackMethod.setAccessible(true);
+ eraseSourceFeedbackMethod.invoke(this);
+ } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ setCurrentCommand(getCommand());
+ executeCurrentCommand();
+ }
+
+ return bRet;
+ }
+
+}
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/SiriusSelectConnectionEditPartTracker.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/SiriusSelectConnectionEditPartTracker.java
index 5a8ebc4c04..7670f8b238 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/SiriusSelectConnectionEditPartTracker.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/SiriusSelectConnectionEditPartTracker.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 THALES GLOBAL SERVICES.
+ * Copyright (c) 2015, 2017 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,7 +19,6 @@ import org.eclipse.gef.Request;
import org.eclipse.gef.SharedCursors;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.requests.BendpointRequest;
-import org.eclipse.gmf.runtime.gef.ui.internal.tools.SelectConnectionEditPartTracker;
import org.eclipse.sirius.diagram.ui.graphical.edit.policies.MoveEdgeGroupManager;
import org.eclipse.sirius.ext.gmf.runtime.diagram.ui.tools.MoveInDiagramDragTracker;
import org.eclipse.swt.SWT;
@@ -39,8 +38,7 @@ public class SiriusSelectConnectionEditPartTracker extends SelectConnectionEditP
private boolean moveGroupActivated;
/**
- * The getSourceRequest method is private so we need to keep the reference
- * in the createSourceRequest method.
+ * The getSourceRequest method is private so we need to keep the reference in the createSourceRequest method.
*/
private BendpointRequest bendpointRequest;
@@ -50,8 +48,7 @@ public class SiriusSelectConnectionEditPartTracker extends SelectConnectionEditP
* Method SelectConnectionEditPartTracker.
*
* @param owner
- * ConnectionNodeEditPart that creates and owns the tracker
- * object
+ * ConnectionNodeEditPart that creates and owns the tracker object
*/
public SiriusSelectConnectionEditPartTracker(ConnectionEditPart owner) {
super(owner);
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
index 5ef608ab82..36797a09d5 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
@@ -116,10 +116,11 @@
<h2 id="sirius5.1.0">Changes in Sirius 5.1.0</h2>
<h3 id="UserVisibleChanges">User-Visible Changes</h3>
<ul>
- <li><span class="label label-info">Added</span> The end user can now
+ <li><span class="label label-success">Added</span> The end user can now
<a href="user/diagrams/Diagrams.html#RemoveBendpoints">remove all bend-points</a> on rectilinear edges. It was only possible on oblique edges before. This action is available on edge context menu &#8220;Remove Bend-points&#8221; or by using the shortcut &#8220;Ctrl&#8221; + &#8220;Shift&#8221; + &#8220;-&#8221;. If number of bend-points can not be reduced, remove action will be inefficient.
</li>
- <li><span class="label label-info">Added</span> The status Synchronized/Unsynchronized of the diagram is now displayed in the status bar when the diagram editor has the focus.</li>
+ <li><span class="label label-success">Added</span> The status Synchronized/Unsynchronized of the diagram is now displayed in the status bar when the diagram editor has the focus.</li>
+ <li><span class="label label-info">Modified</span> In a diagram, when selecting an edge or a node that are not fully displayed in the editor, now, the reveal is not done anymore, that is, the displayed content of the editor is not moved anymore. If the user want to fully see the selected element, he may drag the editor content using center mouse button. </li>
</ul>
<h3 id="SpecifierVisibleChanges">Specifier-Visible Changes</h3>
<ul>
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
index 339d67b4c2..b51945f78b 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
@@ -8,8 +8,9 @@ h2(#sirius5.1.0). Changes in Sirius 5.1.0
h3. User-Visible Changes
-* <span class="label label-info">Added</span> The end user can now "remove all bend-points":user/diagrams/Diagrams.html#RemoveBendpoints on rectilinear edges. It was only possible on oblique edges before. This action is available on edge context menu "Remove Bend-points" or by using the shortcut "Ctrl" + "Shift" + "-". If number of bend-points can not be reduced, remove action will be inefficient.
-* <span class="label label-info">Added</span> The status Synchronized/Unsynchronized of the diagram is now displayed in the status bar when the diagram editor has the focus.
+* <span class="label label-success">Added</span> The end user can now "remove all bend-points":user/diagrams/Diagrams.html#RemoveBendpoints on rectilinear edges. It was only possible on oblique edges before. This action is available on edge context menu "Remove Bend-points" or by using the shortcut "Ctrl" + "Shift" + "-". If number of bend-points can not be reduced, remove action will be inefficient.
+* <span class="label label-success">Added</span> The status Synchronized/Unsynchronized of the diagram is now displayed in the status bar when the diagram editor has the focus.
+* <span class="label label-info">Modified</span> In a diagram, when selecting an edge or a node that are not fully displayed in the editor, now, the reveal is not done anymore, that is, the displayed content of the editor is not moved anymore. If the user want to fully see the selected element, he may drag the editor content using center mouse button.
h3. Specifier-Visible Changes
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/selection/TestSelection.aird b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/selection/TestSelection.aird
new file mode 100644
index 0000000000..a44dcfcea3
--- /dev/null
+++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/selection/TestSelection.aird
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style">
+ <viewpoint:DAnalysis xmi:id="_RmyMUMHCEeCenq6NHvggaA" selectedViews="_8e1WcHETEee5ZpCMxpRpSA" version="12.1.0.201706291600">
+ <semanticResources>TestSelection.ecore</semanticResources>
+ <ownedViews xmi:type="viewpoint:DView" xmi:id="_8e1WcHETEee5ZpCMxpRpSA">
+ <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/>
+ <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" xmi:id="_8u39kHETEee5ZpCMxpRpSA" name="diagram" repPath="#_8uzFEHETEee5ZpCMxpRpSA">
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/>
+ <target xmi:type="ecore:EPackage" href="TestSelection.ecore#/"/>
+ </ownedRepresentationDescriptors>
+ </ownedViews>
+ </viewpoint:DAnalysis>
+ <diagram:DSemanticDiagram xmi:id="_8uzFEHETEee5ZpCMxpRpSA" name="diagram">
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" xmi:id="_8uzFEXETEee5ZpCMxpRpSA" source="DANNOTATION_CUSTOMIZATION_KEY">
+ <data xmi:type="diagram:ComputedStyleDescriptionRegistry" xmi:id="_8uzFEnETEee5ZpCMxpRpSA"/>
+ </ownedAnnotationEntries>
+ <ownedAnnotationEntries xmi:type="description:AnnotationEntry" xmi:id="_8vCVoHETEee5ZpCMxpRpSA" source="GMF_DIAGRAMS">
+ <data xmi:type="notation:Diagram" xmi:id="_8vCVoXETEee5ZpCMxpRpSA" type="Sirius" element="_8uzFEHETEee5ZpCMxpRpSA" measurementUnit="Pixel">
+ <children xmi:type="notation:Node" xmi:id="_8vgPsHETEee5ZpCMxpRpSA" type="2003" element="_8uzFFnETEee5ZpCMxpRpSA">
+ <children xmi:type="notation:Node" xmi:id="_8vg2wHETEee5ZpCMxpRpSA" type="5007"/>
+ <children xmi:type="notation:Node" xmi:id="_8viE4HETEee5ZpCMxpRpSA" type="7004">
+ <styles xmi:type="notation:SortingStyle" xmi:id="_8viE4XETEee5ZpCMxpRpSA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_8viE4nETEee5ZpCMxpRpSA"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_8vgPsXETEee5ZpCMxpRpSA" fontName="Segoe UI" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_8vgPsnETEee5ZpCMxpRpSA" x="-78" y="186" width="75" height="63"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_8vir8HETEee5ZpCMxpRpSA" type="2003" element="_8uzFGHETEee5ZpCMxpRpSA">
+ <children xmi:type="notation:Node" xmi:id="_8vjTAHETEee5ZpCMxpRpSA" type="5007"/>
+ <children xmi:type="notation:Node" xmi:id="_8vjTAXETEee5ZpCMxpRpSA" type="7004">
+ <children xmi:type="notation:Node" xmi:id="_8vmWUHETEee5ZpCMxpRpSA" type="3010" element="_8uzFGnETEee5ZpCMxpRpSA">
+ <styles xmi:type="notation:FontStyle" xmi:id="_8vmWUXETEee5ZpCMxpRpSA" fontName="Segoe UI" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_8vmWUnETEee5ZpCMxpRpSA"/>
+ </children>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_8vjTAnETEee5ZpCMxpRpSA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_8vjTA3ETEee5ZpCMxpRpSA"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_8vir8XETEee5ZpCMxpRpSA" fontName="Segoe UI" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_8vir8nETEee5ZpCMxpRpSA" x="-69" y="-6"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_8vj6EHETEee5ZpCMxpRpSA" type="2003" element="_8uzFHHETEee5ZpCMxpRpSA">
+ <children xmi:type="notation:Node" xmi:id="_8vkhIHETEee5ZpCMxpRpSA" type="5007"/>
+ <children xmi:type="notation:Node" xmi:id="_8vkhIXETEee5ZpCMxpRpSA" type="7004">
+ <children xmi:type="notation:Node" xmi:id="_8vnkcHETEee5ZpCMxpRpSA" type="3010" element="_8uzFHnETEee5ZpCMxpRpSA">
+ <styles xmi:type="notation:FontStyle" xmi:id="_8vnkcXETEee5ZpCMxpRpSA" fontName="Segoe UI" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_8vnkcnETEee5ZpCMxpRpSA"/>
+ </children>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_8vkhInETEee5ZpCMxpRpSA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_8vkhI3ETEee5ZpCMxpRpSA"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_8vj6EXETEee5ZpCMxpRpSA" fontName="Segoe UI" fontHeight="8"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_8vj6EnETEee5ZpCMxpRpSA" x="432" y="222" width="849" height="381"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_8vCVonETEee5ZpCMxpRpSA"/>
+ <edges xmi:type="notation:Edge" xmi:id="_8vrO0HETEee5ZpCMxpRpSA" type="4001" element="_8uzFIHETEee5ZpCMxpRpSA" source="_8vj6EHETEee5ZpCMxpRpSA" target="_8vir8HETEee5ZpCMxpRpSA">
+ <children xmi:type="notation:Node" xmi:id="_8vtrEHETEee5ZpCMxpRpSA" type="6001">
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_8vtrEXETEee5ZpCMxpRpSA" x="33" y="-1"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_8vu5MHETEee5ZpCMxpRpSA" type="6002">
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_8vu5MXETEee5ZpCMxpRpSA" x="10" y="3"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_8vwuYHETEee5ZpCMxpRpSA" type="6003">
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_8vwuYXETEee5ZpCMxpRpSA" x="12" y="1"/>
+ </children>
+ <styles xmi:type="notation:ConnectorStyle" xmi:id="_8vrO0XETEee5ZpCMxpRpSA"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_8vrO0nETEee5ZpCMxpRpSA" fontName="Segoe UI" fontHeight="8"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_8vrO03ETEee5ZpCMxpRpSA" points="[-22, -3, 1281, 181]$[-1303, -184, 0, 0]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_8v7GcHETEee5ZpCMxpRpSA" id="(0.9811097992916175,0.0079155672823219)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_8v7tgHETEee5ZpCMxpRpSA" id="(0.5178571428571429,1.0)"/>
+ </edges>
+ <edges xmi:type="notation:Edge" xmi:id="_8v7tgXETEee5ZpCMxpRpSA" type="4001" element="_8uzFI3ETEee5ZpCMxpRpSA" source="_8vir8HETEee5ZpCMxpRpSA" target="_8vgPsHETEee5ZpCMxpRpSA">
+ <children xmi:type="notation:Node" xmi:id="_8v8UknETEee5ZpCMxpRpSA" type="6001">
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_8v8Uk3ETEee5ZpCMxpRpSA" x="7" y="2"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_8v87oHETEee5ZpCMxpRpSA" type="6002">
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_8v87oXETEee5ZpCMxpRpSA" x="-14" y="3"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_8v87onETEee5ZpCMxpRpSA" type="6003">
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_8v87o3ETEee5ZpCMxpRpSA" x="-13" y="4"/>
+ </children>
+ <styles xmi:type="notation:ConnectorStyle" xmi:id="_8v7tgnETEee5ZpCMxpRpSA"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_8v8UkHETEee5ZpCMxpRpSA" fontName="Segoe UI" fontHeight="8"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_8v8UkXETEee5ZpCMxpRpSA" points="[27, 3, -186, -27]$[1, 192, -212, 162]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_8v-JwHETEee5ZpCMxpRpSA" id="(0.5178571428571429,0.0)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_8v-JwXETEee5ZpCMxpRpSA" id="(3.4383561643835616,-2.6557377049180326)"/>
+ </edges>
+ </data>
+ </ownedAnnotationEntries>
+ <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_8uzFFnETEee5ZpCMxpRpSA" name="SC1" tooltipText="new EPackage0.SC1" incomingEdges="_8uzFI3ETEee5ZpCMxpRpSA">
+ <target xmi:type="ecore:EClass" href="TestSelection.ecore#//SC1"/>
+ <semanticElements xmi:type="ecore:EClass" href="TestSelection.ecore#//SC1"/>
+ <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
+ <arrangeConstraints>KEEP_SIZE</arrangeConstraints>
+ <arrangeConstraints>KEEP_RATIO</arrangeConstraints>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_8uzFF3ETEee5ZpCMxpRpSA" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="GradientTopToBottom">
+ <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/>
+ </ownedDiagramElements>
+ <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_8uzFGHETEee5ZpCMxpRpSA" name="C1" tooltipText="new EPackage0.C1" outgoingEdges="_8uzFI3ETEee5ZpCMxpRpSA" incomingEdges="_8uzFIHETEee5ZpCMxpRpSA">
+ <target xmi:type="ecore:EClass" href="TestSelection.ecore#//C1"/>
+ <semanticElements xmi:type="ecore:EClass" href="TestSelection.ecore#//C1"/>
+ <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
+ <arrangeConstraints>KEEP_SIZE</arrangeConstraints>
+ <arrangeConstraints>KEEP_RATIO</arrangeConstraints>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_8uzFGXETEee5ZpCMxpRpSA" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="GradientTopToBottom">
+ <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/>
+ <ownedElements xmi:type="diagram:DNodeListElement" xmi:id="_8uzFGnETEee5ZpCMxpRpSA" name="c1a1">
+ <target xmi:type="ecore:EAttribute" href="TestSelection.ecore#//C1/c1a1"/>
+ <semanticElements xmi:type="ecore:EAttribute" href="TestSelection.ecore#//C1/c1a1"/>
+ <ownedStyle xmi:type="diagram:BundledImage" xmi:id="_8uzFG3ETEee5ZpCMxpRpSA" labelAlignment="LEFT">
+ <description xmi:type="style:BundledImageDescription" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
+ </ownedElements>
+ </ownedDiagramElements>
+ <ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_8uzFHHETEee5ZpCMxpRpSA" name="C2" tooltipText="new EPackage0.C2" outgoingEdges="_8uzFIHETEee5ZpCMxpRpSA">
+ <target xmi:type="ecore:EClass" href="TestSelection.ecore#//C2"/>
+ <semanticElements xmi:type="ecore:EClass" href="TestSelection.ecore#//C2"/>
+ <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
+ <arrangeConstraints>KEEP_SIZE</arrangeConstraints>
+ <arrangeConstraints>KEEP_RATIO</arrangeConstraints>
+ <ownedStyle xmi:type="diagram:FlatContainerStyle" xmi:id="_8uzFHXETEee5ZpCMxpRpSA" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="GradientTopToBottom">
+ <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/>
+ <ownedElements xmi:type="diagram:DNodeListElement" xmi:id="_8uzFHnETEee5ZpCMxpRpSA" name="c2a2">
+ <target xmi:type="ecore:EAttribute" href="TestSelection.ecore#//C2/c2a2"/>
+ <semanticElements xmi:type="ecore:EAttribute" href="TestSelection.ecore#//C2/c2a2"/>
+ <ownedStyle xmi:type="diagram:BundledImage" xmi:id="_8uzFH3ETEee5ZpCMxpRpSA" labelAlignment="LEFT">
+ <description xmi:type="style:BundledImageDescription" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']/@style"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
+ </ownedElements>
+ </ownedDiagramElements>
+ <ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_8uzFIHETEee5ZpCMxpRpSA" name="[0..1] ref" sourceNode="_8uzFHHETEee5ZpCMxpRpSA" targetNode="_8uzFGHETEee5ZpCMxpRpSA">
+ <target xmi:type="ecore:EReference" href="TestSelection.ecore#//C2/ref"/>
+ <semanticElements xmi:type="ecore:EReference" href="TestSelection.ecore#//C2/ref"/>
+ <ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_8uzFIXETEee5ZpCMxpRpSA">
+ <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']/@style"/>
+ <centerLabelStyle xmi:type="diagram:CenterLabelStyle" xmi:id="_8uzFInETEee5ZpCMxpRpSA" showIcon="false"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
+ </ownedDiagramElements>
+ <ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_8uzFI3ETEee5ZpCMxpRpSA" sourceNode="_8uzFGHETEee5ZpCMxpRpSA" targetNode="_8uzFFnETEee5ZpCMxpRpSA">
+ <target xmi:type="ecore:EClass" href="TestSelection.ecore#//C1"/>
+ <ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_8uzFJHETEee5ZpCMxpRpSA" targetArrow="InputClosedArrow">
+ <customFeatures>routingStyle</customFeatures>
+ <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']/@style"/>
+ <centerLabelStyle xmi:type="diagram:CenterLabelStyle" xmi:id="_8uzFJXETEee5ZpCMxpRpSA" showIcon="false"/>
+ </ownedStyle>
+ <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']"/>
+ </ownedDiagramElements>
+ <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/>
+ <filterVariableHistory xmi:type="diagram:FilterVariableHistory" xmi:id="_8uzFJnETEee5ZpCMxpRpSA"/>
+ <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer"/>
+ <activatedLayers xmi:type="description_1:AdditionalLayer" href="platform:/plugin/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@additionalLayers[name='Package']"/>
+ <target xmi:type="ecore:EPackage" href="TestSelection.ecore#/"/>
+ </diagram:DSemanticDiagram>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/selection/TestSelection.ecore b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/selection/TestSelection.ecore
new file mode 100644
index 0000000000..0aa74dee76
--- /dev/null
+++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/selection/TestSelection.ecore
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="new EPackage0">
+ <eClassifiers xsi:type="ecore:EClass" name="SC1"/>
+ <eClassifiers xsi:type="ecore:EClass" name="C1" eSuperTypes="#//SC1">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="c1a1"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="C2">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="ref" eType="#//C1"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="c2a2"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EditPartSelectionTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EditPartSelectionTest.java
new file mode 100644
index 0000000000..ceac6886b7
--- /dev/null
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EditPartSelectionTest.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2017 THALES GLOBAL SERVICES.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.sirius.tests.swtbot;
+
+import org.eclipse.draw2d.geometry.PrecisionPoint;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.sirius.business.api.session.Session;
+import org.eclipse.sirius.diagram.DDiagram;
+import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase;
+import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource;
+import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor;
+import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
+import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
+
+/**
+ * Tests to check the behavior of the editor when selecting a node or edge edit part.
+ *
+ * @author lfasani
+ */
+public class EditPartSelectionTest extends AbstractSiriusSwtBotGefTestCase {
+
+ private static final String DATA_UNIT_DIR = "/data/unit/selection/";
+
+ private static final String MODEL = "TestSelection.ecore";
+
+ private static final String SESSION_FILE = "TestSelection.aird";
+
+ private static final String REPRESENTATION_DECRIPTION_NAME = "Entities";
+
+ private static final String REPRESENTATION_NAME = "diagram";
+
+ private static final PrecisionPoint INITIAL_NODE_CENTER_POSITION = new PrecisionPoint(856.0, 412.0);
+
+ private Session session;
+
+ @Override
+ protected void onSetUpBeforeClosingWelcomePage() throws Exception {
+ copyFileToTestProject(Activator.PLUGIN_ID, DATA_UNIT_DIR, MODEL, SESSION_FILE);
+ }
+
+ @Override
+ protected void onSetUpAfterOpeningDesignerPerspective() throws Exception {
+ sessionAirdResource = new UIResource(designerProject, "/", SESSION_FILE);
+ localSession = designerPerspective.openSessionFromFile(sessionAirdResource);
+ bot.viewById("org.eclipse.ui.views.ContentOutline").close();
+ SWTBotUtils.waitAllUiEvents();
+ session = localSession.getOpenedSession();
+ editor = (SWTBotSiriusDiagramEditor) openRepresentation(session, REPRESENTATION_DECRIPTION_NAME, REPRESENTATION_NAME, DDiagram.class, true);
+ }
+
+ /**
+ * Check that the selection of an edge that is not fully displayed in the editor will not move the content of the
+ * editor that is not move the scroll bars.
+ */
+ public void testEditorContentPositionAfterEdgeSelection() {
+ // check the initial position
+ checkBottomRightCornerNodeAbsolutePosition("Bad diagram test data");
+
+ // Select the edge
+ SWTBotGefEditPart edgeEditPart = editor.getEditPart("[0..1] ref", ConnectionEditPart.class);
+ edgeEditPart.click();
+ SWTBotUtils.waitAllUiEvents();
+
+ // Check that the node has not moved
+ checkBottomRightCornerNodeAbsolutePosition("The selection of an edge moved the editor content. Bad node position");
+ }
+
+ /**
+ * Check that the selection of an node that is not fully displayed in the editor will not move the content of the
+ * editor that is not move the scroll bars.
+ */
+ public void testEditorContentPositionAfterNodeSelection() {
+ // check the initial position
+ SWTBotGefEditPart swtNodeEditPart = editor.getEditPart("C2", AbstractBorderedShapeEditPart.class);
+ checkBottomRightCornerNodeAbsolutePosition("Bad diagram test data");
+
+ swtNodeEditPart.click();
+ SWTBotUtils.waitAllUiEvents();
+
+ // Check that the node has not moved
+ checkBottomRightCornerNodeAbsolutePosition("The selection of an Node moved the editor content. Bad node position");
+ }
+
+ void checkBottomRightCornerNodeAbsolutePosition(String message) {
+ IGraphicalEditPart nodeEditPart = (IGraphicalEditPart) editor.getEditPart("C2", AbstractBorderedShapeEditPart.class).part();
+ Rectangle bounds = nodeEditPart.getFigure().getBounds().getCopy();
+ nodeEditPart.getFigure().translateToAbsolute(bounds);
+ assertEquals("The selection of an edge moved the editor content. Bad node position", INITIAL_NODE_CENTER_POSITION, bounds.getCenter());
+ }
+
+}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/compartment/CompartmentsCreationTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/compartment/CompartmentsCreationTest.java
index cd01ae174a..1843378491 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/compartment/CompartmentsCreationTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/compartment/CompartmentsCreationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015, 2016 Obeo.
+ * Copyright (c) 2015, 2017 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -48,14 +48,14 @@ import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNodeListElementEditPar
import org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutUtils;
import org.eclipse.sirius.ecore.extender.tool.api.ModelUtils;
import org.eclipse.sirius.tests.swtbot.support.api.condition.CheckEditPartResized;
+import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
import org.eclipse.swtbot.swt.finder.waits.ICondition;
import org.eclipse.ui.PlatformUI;
/**
- * Tests defined to ensure that elements are created in compartments and regions
- * at expected locations.
+ * Tests defined to ensure that elements are created in compartments and regions at expected locations.
*
* @author <a href="mailto:belqassim.djafer@obeo.fr">Belqassim Djafer</a>
*
@@ -66,8 +66,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
private static final Point CONTAINER_CREATION_LOCATION = new Point(400, 300);
/**
- * Location used with the first one, {{@link #CONTAINER_CREATION_LOCATION},
- * to draw a rectangle for the creation of the container.
+ * Location used with the first one, {{@link #CONTAINER_CREATION_LOCATION}, to draw a rectangle for the creation of
+ * the container.
*/
private static final Point CONTAINER_SECOND_CREATION_LOCATION = new Point(600, 500);
@@ -83,73 +83,62 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
private static final Rectangle CONTAINER_BOUNDS_AUTO_SIZED = new Rectangle(CONTAINER_CREATION_LOCATION, DIM_AUTO_SIZED);
/**
- * Bounds of a HStack container with computation expression equal to -1, but
- * created directly with one region: the size is increased to allow the
- * auto-sized region.
+ * Bounds of a HStack container with computation expression equal to -1, but created directly with one region: the
+ * size is increased to allow the auto-sized region.
*/
private static final Rectangle CONTAINER_BOUNDS_AUTO_SIZED_WITH_ONE_REGION_VSTACK = new Rectangle(CONTAINER_CREATION_LOCATION, new Dimension(74, 78));
/**
- * Bounds of a container with computation expression equal to -1, but
- * created directly with two regions. Same size as one region but plus the
- * NEW_DEFAULT_CONTAINER_DIMENSION in height.
+ * Bounds of a container with computation expression equal to -1, but created directly with two regions. Same size
+ * as one region but plus the NEW_DEFAULT_CONTAINER_DIMENSION in height.
*/
private static final Rectangle CONTAINER_BOUNDS_AUTO_SIZED_WITH_TWO_REGIONS_VSTACK = CONTAINER_BOUNDS_AUTO_SIZED_WITH_ONE_REGION_VSTACK.getCopy()
.setHeight(CONTAINER_BOUNDS_AUTO_SIZED_WITH_ONE_REGION_VSTACK.height + LayoutUtils.NEW_DEFAULT_CONTAINER_DIMENSION.height);
/**
- * Bounds of a VStack container with computation expression equal to -1, but
- * created directly with one region: the size is increased to allow the
- * auto-sized region.
+ * Bounds of a VStack container with computation expression equal to -1, but created directly with one region: the
+ * size is increased to allow the auto-sized region.
*/
private static final Rectangle CONTAINER_BOUNDS_AUTO_SIZED_WITH_ONE_REGION_HSTACK = new Rectangle(CONTAINER_CREATION_LOCATION, new Dimension(72, 76));
/**
- * Bounds of a container with computation expression equal to -1 and without
- * label.
+ * Bounds of a container with computation expression equal to -1 and without label.
*/
private static final Rectangle CONTAINER_BOUNDS_DEFAULT_SIZE = new Rectangle(CONTAINER_CREATION_LOCATION, LayoutUtils.NEW_DEFAULT_CONTAINER_DIMENSION);
/**
- * GMF bounds of the first region in a VStack container with computation
- * expression equal to -1.
+ * GMF bounds of the first region in a VStack container with computation expression equal to -1.
*/
private static final Rectangle REGION_BOUNDS_FIRST_DRAW2D_AUTO_SIZED = new Rectangle(ORIGIN_LOCATION, DIM_AUTO_SIZED);
/**
- * GMF bounds of the second region in a VStack container with computation
- * expression equal to -1.
+ * GMF bounds of the second region in a VStack container with computation expression equal to -1.
*/
private static final Rectangle REGION_BOUNDS_SECOND_AUTO_SIZED_VSTACK = REGION_BOUNDS_FIRST_DRAW2D_AUTO_SIZED.getTranslated(0, LayoutUtils.NEW_DEFAULT_CONTAINER_DIMENSION.height);
/**
- * GMF bounds of the second region in a VStack container with computation
- * expression equal to -1.
+ * GMF bounds of the second region in a VStack container with computation expression equal to -1.
*/
private static final Rectangle REGION_BOUNDS_SECOND_AUTO_SIZED_HSTACK = REGION_BOUNDS_FIRST_DRAW2D_AUTO_SIZED.getTranslated(LayoutUtils.NEW_DEFAULT_CONTAINER_DIMENSION.width, 0);
/**
- * Draw2D bounds of the first region in a VStack container with computation
- * expression equal to -1.
+ * Draw2D bounds of the first region in a VStack container with computation expression equal to -1.
*/
private static final Rectangle REGION_BOUNDS_FIRST_DRAW2D = new Rectangle(ORIGIN_LOCATION, new Dimension(62, LayoutUtils.NEW_DEFAULT_CONTAINER_DIMENSION.height));
/**
- * Draw2D bounds of the second region in a VStack container with computation
- * expression equal to -1.
+ * Draw2D bounds of the second region in a VStack container with computation expression equal to -1.
*/
private static final Rectangle REGION_BOUNDS_SECOND_DRAW2D_VSTACK = REGION_BOUNDS_FIRST_DRAW2D.getTranslated(0, LayoutUtils.NEW_DEFAULT_CONTAINER_DIMENSION.height);
/**
- * Draw2D bounds of the second region in a HStack container with computation
- * expression equal to -1.
+ * Draw2D bounds of the second region in a HStack container with computation expression equal to -1.
*/
private static final Rectangle REGION_BOUNDS_SECOND_DRAW2D_HSTACK = REGION_BOUNDS_FIRST_DRAW2D.getTranslated(REGION_BOUNDS_FIRST_DRAW2D.width, 0);
/**
- * Bounds of a container with computation expression equal to -1, but
- * created directly with two regions. Same size as one region but plus the
- * size of the second region in width.
+ * Bounds of a container with computation expression equal to -1, but created directly with two regions. Same size
+ * as one region but plus the size of the second region in width.
*/
private static final Rectangle CONTAINER_BOUNDS_AUTO_SIZED_WITH_TWO_REGIONS_HSTACK = CONTAINER_BOUNDS_AUTO_SIZED_WITH_ONE_REGION_HSTACK.getCopy()
.setWidth(CONTAINER_BOUNDS_AUTO_SIZED_WITH_ONE_REGION_HSTACK.width + REGION_BOUNDS_SECOND_DRAW2D_HSTACK.width);
@@ -157,14 +146,13 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
// CONTAINER DRAWN AT CREATION (with a size of 200x200}
/**
- * Dimension corresponding to the rectangle drawn during creation. The
- * dimension is expanded by {1x1} because of a bug that be fixed later.
+ * Dimension corresponding to the rectangle drawn during creation. The dimension is expanded by {1x1} because of a
+ * bug that be fixed later.
*/
private static final Dimension DIM_DRAWN_SIZE = CONTAINER_SECOND_CREATION_LOCATION.getDifference(CONTAINER_CREATION_LOCATION).expand(1, 1);
/**
- * Bounds of a container initialized by the end-user at the creation with a
- * rectangle of {200x200}.
+ * Bounds of a container initialized by the end-user at the creation with a rectangle of {200x200}.
*/
private static final Rectangle CONTAINER_BOUNDS_DRAWN = new Rectangle(CONTAINER_CREATION_LOCATION, DIM_DRAWN_SIZE);
@@ -178,9 +166,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
private static final Rectangle REGION_BOUNDS_FIRST_IN_DRAWN_HSTACK_CONTAINER = REGION_BOUNDS_IN_DRAWN_HSTACK_CONTAINER.getCopy().setWidth(REGION_BOUNDS_IN_DRAWN_HSTACK_CONTAINER.width / 2);
/**
- * Bounds of the second region in a drawn VStack container. The same as the
- * first but shift of the width of the first and plus one pixel for the
- * separator.
+ * Bounds of the second region in a drawn VStack container. The same as the first but shift of the width of the
+ * first and plus one pixel for the separator.
*/
private static final Rectangle REGION_BOUNDS_SECOND_IN_DRAWN_HSTACK_CONTAINER = REGION_BOUNDS_FIRST_IN_DRAWN_HSTACK_CONTAINER.getTranslated(REGION_BOUNDS_FIRST_IN_DRAWN_HSTACK_CONTAINER.width, 0)
.expand(new Insets(0, 0, 0, 1));
@@ -191,9 +178,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
private static final Dimension DIM_80_DEFINED_SIZE = new Dimension(8 * LayoutUtils.SCALE, 8 * LayoutUtils.SCALE);
/**
- * Dimension corresponding to computation expressions equal to 8 and 2
- * regions. The container is increased in height because the 2 regions are
- * higher than the free container space.
+ * Dimension corresponding to computation expressions equal to 8 and 2 regions. The container is increased in height
+ * because the 2 regions are higher than the free container space.
*/
private static final Dimension DIM_80_DEFINED_SIZE_WITH_2_REGIONS = new Dimension(8 * LayoutUtils.SCALE, 93);
@@ -201,20 +187,17 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
private static final Rectangle CONTAINER_BOUNDS_80_FIXED_SIZE = new Rectangle(CONTAINER_CREATION_LOCATION, DIM_80_DEFINED_SIZE);
/**
- * Bounds of a container with computation expressions equal to 8 and 2
- * regions.
+ * Bounds of a container with computation expressions equal to 8 and 2 regions.
*/
private static final Rectangle CONTAINER_BOUNDS_80_FIXED_SIZE_WITH_2_REGIONS = new Rectangle(CONTAINER_CREATION_LOCATION, DIM_80_DEFINED_SIZE_WITH_2_REGIONS);
/**
- * Bounds of the first region in a VStack container computation expressions
- * equal to 8.
+ * Bounds of the first region in a VStack container computation expressions equal to 8.
*/
private static final Rectangle REGION_BOUNDS_IN_VSTACK_CONTAINER_80_FIXED_SIZE = new Rectangle(ORIGIN_LOCATION, new Dimension(68, 42));
/**
- * Bounds of the first region in a VStack container computation expressions
- * equal to 8.
+ * Bounds of the first region in a VStack container computation expressions equal to 8.
*/
private static final Rectangle REGION_BOUNDS_IN_HSTACK_CONTAINER_80_FIXED_SIZE = new Rectangle(ORIGIN_LOCATION, new Dimension(70, 44));
@@ -241,16 +224,14 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Ensures that containers displays correctly its children in a horizontal
- * stack.
+ * Ensures that containers displays correctly its children in a horizontal stack.
*/
public void testChildrenPresentationsInHorizontalStack() {
childrenPresentationTest(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME, ContainerLayout.HORIZONTAL_STACK);
}
/**
- * Ensures that containers displays correctly its children in a vertical
- * stack.
+ * Ensures that containers displays correctly its children in a vertical stack.
*/
public void testChildrenPresentationsInVerticalStack() {
childrenPresentationTest(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME, ContainerLayout.VERTICAL_STACK);
@@ -302,16 +283,16 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Ensures that a NodeList element is correctly created in a horizontal
- * stack compartment and has the expected location.
+ * Ensures that a NodeList element is correctly created in a horizontal stack compartment and has the expected
+ * location.
*/
public void testContainerListCreationInHorizontalStack() {
doTestContainerListCreation(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME);
}
/**
- * Ensures that a NodeList element is correctly created in a vertical stack
- * compartment and has the expected location.
+ * Ensures that a NodeList element is correctly created in a vertical stack compartment and has the expected
+ * location.
*/
public void testContainerListCreationInVerticalStack() {
doTestContainerListCreation(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -325,16 +306,14 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Ensures that horizontal stack Compartment and its children are correctly
- * created.
+ * Ensures that horizontal stack Compartment and its children are correctly created.
*/
public void testCompartmentCreationInHorizontalStack() {
compartmentCreationTest(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME, new Point(400, 350));
}
/**
- * Ensures that vertical stack Compartment and its children are correctly
- * created.
+ * Ensures that vertical stack Compartment and its children are correctly created.
*/
public void testCompartmentCreationInVerticalStack() {
compartmentCreationTest(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME, CONTAINER_CREATION_LOCATION);
@@ -358,18 +337,16 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Ensures that a Node element is correctly created in container layouted
- * with "FreeForm" style in a horizontal stack compartment and has the
- * expected location.
+ * Ensures that a Node element is correctly created in container layouted with "FreeForm" style in a horizontal
+ * stack compartment and has the expected location.
*/
public void testNodeCreationInFreeFormContainerInHorizontalStack() {
doTestNodeCreationInFreeFormContainer(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME);
}
/**
- * Ensures that a Node element is correctly created in container layouted
- * with "FreeForm" style in a vertical stack compartment and has the
- * expected location.
+ * Ensures that a Node element is correctly created in container layouted with "FreeForm" style in a vertical stack
+ * compartment and has the expected location.
*/
public void testNodeCreationInFreeFormContainerInVerticalStack() {
doTestNodeCreationInFreeFormContainer(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -383,18 +360,16 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Ensures that a list item element is correctly created in container
- * layouted with "list" style in a horizontal stack compartment and has the
- * expected location.
+ * Ensures that a list item element is correctly created in container layouted with "list" style in a horizontal
+ * stack compartment and has the expected location.
*/
public void testItemCreationInListContainerInHorizontalStack() {
doTestItemCreationInListContainer(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME);
}
/**
- * Ensures that a list item element is correctly created in container
- * layouted with "list" style created in a vertical stack compartment and
- * has the expected location.
+ * Ensures that a list item element is correctly created in container layouted with "list" style created in a
+ * vertical stack compartment and has the expected location.
*/
public void testItemCreationInListContainerInVerticalStack() {
doTestItemCreationInListContainer(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -408,14 +383,12 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Create a new node using the defined Node Creation tool, at the given
- * position.
+ * Create a new node using the defined Node Creation tool, at the given position.
*
* @param creationToolName
* Name of the tool to use to create the new element
* @param targetEditPartName
- * The name of the target edit part (container of the new
- * element)
+ * The name of the target edit part (container of the new element)
*/
private void createElement(String creationToolName, String targetEditPartName) {
// Select the tool
@@ -453,8 +426,7 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Create a new node using the given tool directly in the diagram
- * representation.
+ * Create a new node using the given tool directly in the diagram representation.
*
* @param CREATION_TOOL_NAME
* Tool name to select
@@ -466,8 +438,7 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Check if the new element has been created in the diagram with the correct
- * style.
+ * Check if the new element has been created in the diagram with the correct style.
*
* @param createdCompartmentName
* the new created element
@@ -535,13 +506,11 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test that the refresh of a diagram caused by an external change (and that
- * creates a new regions container) does not impact existing regions
- * container (no layout of them).
+ * Test that the refresh of a diagram caused by an external change (and that creates a new regions container) does
+ * not impact existing regions container (no layout of them).
*
* @throws Exception
- * In case of problem during semantic modification outside the
- * editor.
+ * In case of problem during semantic modification outside the editor.
*/
public void testCreationOfNewHorizontalRegionContainerOutsideEditor() throws Exception {
openRepresentation(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -563,13 +532,11 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test that the refresh of a diagram caused by an external change (and that
- * creates a new regions container) does not impact existing regions
- * container (no layout of them).
+ * Test that the refresh of a diagram caused by an external change (and that creates a new regions container) does
+ * not impact existing regions container (no layout of them).
*
* @throws Exception
- * In case of problem during semantic modification outside the
- * editor.
+ * In case of problem during semantic modification outside the editor.
*/
public void testCreationOfNewVerticalRegionContainerOutsideEditor() throws Exception {
openRepresentation(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -591,9 +558,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Add a new package p3 in the root package. The modification is not made in
- * the same resourceSet, as if this modification is made in another editor
- * not in Sirius.
+ * Add a new package p3 in the root package. The modification is not made in the same resourceSet, as if this
+ * modification is made in another editor not in Sirius.
*/
private void modifySemanticModelOutsideDiagram() throws Exception {
// Load the semantic resource in another resource set, delete the
@@ -634,9 +600,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with vertical stack and with no
- * region. Check auto-size gmf size for container (because of computation
- * expressions equal to -1).
+ * Test creation of regions container with vertical stack and with no region. Check auto-size gmf size for container
+ * (because of computation expressions equal to -1).
*/
public void testCreationOfNewVerticalRegionContainerWithoutRegion() {
openRepresentation(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -651,9 +616,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with vertical stack and which contains
- * one region. Check auto-size gmf size for container and region (because of
- * computation expressions equal to -1).
+ * Test creation of regions container with vertical stack and which contains one region. Check auto-size gmf size
+ * for container and region (because of computation expressions equal to -1).
*/
public void testCreationOfNewVerticalRegionContainerWithOneRegion() {
openRepresentation(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -669,9 +633,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with vertical stack which contains two
- * regions. Check auto-size gmf size for container and regions (because of
- * computation expressions equal to -1).
+ * Test creation of regions container with vertical stack which contains two regions. Check auto-size gmf size for
+ * container and regions (because of computation expressions equal to -1).
*/
public void testCreationOfNewVerticalRegionContainerWithTwoRegions() {
openRepresentation(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -688,9 +651,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with vertical stack and defined size
- * for the container. Check specific size (gmf and Draw2D) for container
- * because of specific computation expressions.
+ * Test creation of regions container with vertical stack and defined size for the container. Check specific size
+ * (gmf and Draw2D) for container because of specific computation expressions.
*/
public void testCreationOfNewVerticalRegionContainerWithDefinedSize() {
openRepresentation(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -705,9 +667,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with vertical stack. The container has
- * a defined size and contains one region. Check specific size for region,
- * auto-size gmf size and specific draw2D size for container.
+ * Test creation of regions container with vertical stack. The container has a defined size and contains one region.
+ * Check specific size for region, auto-size gmf size and specific draw2D size for container.
*/
public void testCreationOfNewVerticalRegionContainerWithDefinedSizeAndOneRegion() {
openRepresentation(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -723,11 +684,9 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with vertical stack. The container has
- * a defined size and contains two regions. Check specific size for regions,
- * auto-size gmf size for container. Draw2D height size for container is
- * changed because the two regions need a higher container (the size
- * increase in direction of the stack).
+ * Test creation of regions container with vertical stack. The container has a defined size and contains two
+ * regions. Check specific size for regions, auto-size gmf size for container. Draw2D height size for container is
+ * changed because the two regions need a higher container (the size increase in direction of the stack).
*/
public void testCreationOfNewVerticalRegionContainerWithDefinedSizeAndTwoRegions() {
openRepresentation(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -758,9 +717,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with vertical stack and end-user
- * defined size. Check specific size (gmf and Draw2D) of the container
- * (match with rectangle draw).
+ * Test creation of regions container with vertical stack and end-user defined size. Check specific size (gmf and
+ * Draw2D) of the container (match with rectangle draw).
*/
public void testCreationOfNewVerticalRegionContainerWithoutRegionAndRectangleDraw() {
openRepresentation(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -775,9 +733,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with vertical stack which contains one
- * region and end-user defined size. Check specific size for region,
- * auto-size gmf size and specific Draw2D size for container.
+ * Test creation of regions container with vertical stack which contains one region and end-user defined size. Check
+ * specific size for region, auto-size gmf size and specific Draw2D size for container.
*/
public void testCreationOfNewVerticalRegionContainerWithOneRegionAndRectangleDraw() {
openRepresentation(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -793,9 +750,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with vertical stack which contains two
- * regions and end-user defined size. Check specific size for regions,
- * auto-size gmf size for container.
+ * Test creation of regions container with vertical stack which contains two regions and end-user defined size.
+ * Check specific size for regions, auto-size gmf size for container.
*/
public void testCreationOfNewVerticalRegionContainerWithTwoRegionsAndRectangleDraw() {
openRepresentation(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -816,9 +772,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test use of regions collapsed in container with vertical stack which
- * contains two regions. Check auto-size gmf size for container and regions
- * when collapsing. Height container must change because of collapsing.
+ * Test use of regions collapsed in container with vertical stack which contains two regions. Check auto-size gmf
+ * size for container and regions when collapsing. Height container must change because of collapsing.
*/
public void testCollapseOfNewVerticalRegionContainerWithTwoRegions() {
testCreationOfNewVerticalRegionContainerWithTwoRegions();
@@ -828,6 +783,7 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
// selection of the second region
editor.click(new Point(420, 400));
+ SWTBotUtils.waitAllUiEvents(); // needed to have the collapse widget displayed
// collapse of the second region
editor.click(new Point(460, 380));
@@ -844,9 +800,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with vertical stack and hide Label.
- * Check auto-size gmf size for container (because of computation
- * expressions equal to -1).
+ * Test creation of regions container with vertical stack and hide Label. Check auto-size gmf size for container
+ * (because of computation expressions equal to -1).
*/
public void testCreationOfNewVerticalRegionContainerWithoutRegionAndHideLabel() {
openRepresentation(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -861,9 +816,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test resizing of new regions container with vertical stack which contains
- * one region. Check specific size for region, auto-size gmf size and
- * specific Draw2D size for container.
+ * Test resizing of new regions container with vertical stack which contains one region. Check specific size for
+ * region, auto-size gmf size and specific Draw2D size for container.
*/
public void testResizeOfNewVerticalRegionContainerWithOneRegionAndRectangleDraw() {
openRepresentation(VERTICAL_STACK_REPRESENTATION_NAME, VERTICAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -890,8 +844,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with horizontal stack. Check auto-size
- * gmf size for container (because of computation expressions equal to -1).
+ * Test creation of regions container with horizontal stack. Check auto-size gmf size for container (because of
+ * computation expressions equal to -1).
*/
public void testCreationOfNewHorizontalRegionContainerWithoutRegion() {
openRepresentation(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -907,9 +861,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with horizontal stack which contains
- * one region. Check auto-size gmf size for container and region (because of
- * computation expressions equal to -1).
+ * Test creation of regions container with horizontal stack which contains one region. Check auto-size gmf size for
+ * container and region (because of computation expressions equal to -1).
*/
public void testCreationOfNewHorizontalRegionContainerWithOneRegion() {
openRepresentation(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -928,9 +881,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with horizontal stack which contains
- * two regions. Check auto-size gmf size for container and regions (because
- * of computation expressions equal to -1).
+ * Test creation of regions container with horizontal stack which contains two regions. Check auto-size gmf size for
+ * container and regions (because of computation expressions equal to -1).
*/
public void testCreationOfNewHorizontalRegionContainerWithTwoRegions() {
openRepresentation(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -947,9 +899,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with horizontal stack and defined size
- * for the container. Check specific size (gmf and Draw2D) for container
- * because of specific computation expressions.
+ * Test creation of regions container with horizontal stack and defined size for the container. Check specific size
+ * (gmf and Draw2D) for container because of specific computation expressions.
*/
public void testCreationOfNewHorizontalRegionContainerWithDefinedSize() {
openRepresentation(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -964,9 +915,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with horizontal stack. The container
- * has a defined size and contains one region. Check specific size for
- * region, auto-size gmf size and specific draw2D size for container.
+ * Test creation of regions container with horizontal stack. The container has a defined size and contains one
+ * region. Check specific size for region, auto-size gmf size and specific draw2D size for container.
*/
public void testCreationOfNewHorizontalRegionContainerWithDefinedSizeAndOneRegion() {
openRepresentation(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -984,9 +934,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with horizontal stackThe container has
- * a defined size and contains two regions. Check specific size for regions,
- * auto-size gmf size for container. Draw2D height size for container must
+ * Test creation of regions container with horizontal stackThe container has a defined size and contains two
+ * regions. Check specific size for regions, auto-size gmf size for container. Draw2D height size for container must
* change because of addition of two regions size.
*/
public void testCreationOfNewHorizontalRegionContainerWithDefinedSizeAndTwoRegions() {
@@ -1006,8 +955,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with horizontal stack. Check defined
- * size of the container (match with rectangle draw).
+ * Test creation of regions container with horizontal stack. Check defined size of the container (match with
+ * rectangle draw).
*/
public void testCreationOfNewHorizontalRegionContainerWithoutRegionAndRectangleDraw() {
openRepresentation(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -1022,9 +971,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with horizontal stack which contains
- * one region. Check specific size for region and auto-size gmf size and
- * specific Draw2D size for container match with rectangle draw).
+ * Test creation of regions container with horizontal stack which contains one region. Check specific size for
+ * region and auto-size gmf size and specific Draw2D size for container match with rectangle draw).
*/
public void testCreationOfNewHorizontalRegionContainerWithOneRegionAndRectangleDraw() {
openRepresentation(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -1040,9 +988,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with horizontal stack which contains
- * two regions. Check specific size for regions, auto-size gmf size for
- * container.
+ * Test creation of regions container with horizontal stack which contains two regions. Check specific size for
+ * regions, auto-size gmf size for container.
*/
public void testCreationOfNewHorizontalRegionContainerWithTwoRegionsAndRectangleDraw() {
openRepresentation(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -1060,17 +1007,16 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test use of regions collapsed in container with horizontal stack which
- * contains two regions. Check specific size for regions, auto-size gmf size
- * for container when collapsing. Container size (gmf or Draw2D) must not
- * change because nothing has been collapse (regions are already
- * auto-sized).
+ * Test use of regions collapsed in container with horizontal stack which contains two regions. Check specific size
+ * for regions, auto-size gmf size for container when collapsing. Container size (gmf or Draw2D) must not change
+ * because nothing has been collapse (regions are already auto-sized).
*/
public void testCollapseOfNewHorizontalRegionContainerWithTowRegions() {
testCreationOfNewHorizontalRegionContainerWithTwoRegions();
// selection of the second region
editor.click(new Point(470, 360));
+ SWTBotUtils.waitAllUiEvents(); // needed to have the collapse widget displayed
// collapse of the second region
editor.click(new Point(520, 338));
@@ -1082,10 +1028,9 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test use of regions collapsed in container with horizontal stack which
- * contains two regions. Check specific size for regions, auto-size gmf size
- * for container when collapsing. Container size (gmf or Draw2D) must not
- * change. Second region is collapsed so container width change.
+ * Test use of regions collapsed in container with horizontal stack which contains two regions. Check specific size
+ * for regions, auto-size gmf size for container when collapsing. Container size (gmf or Draw2D) must not change.
+ * Second region is collapsed so container width change.
*/
public void testCollapseOfNewHorizontalRegionContainerWithTowRegionsAndRectangleDraw() {
testCreationOfNewHorizontalRegionContainerWithTwoRegionsAndRectangleDraw();
@@ -1095,6 +1040,7 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
// selection of the second region
editor.click(new Point(540, 420));
+ SWTBotUtils.waitAllUiEvents(); // needed to have the collapse widget displayed
// collapse of the second region
// Retrieve the toggle figure location (to click on it)
@@ -1129,9 +1075,8 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with horizontal stack and Hide label.
- * Check auto-size gmf size for container (because of computation
- * expressions equal to -1).
+ * Test creation of regions container with horizontal stack and Hide label. Check auto-size gmf size for container
+ * (because of computation expressions equal to -1).
*/
public void testCreationOfNewHorizontalRegionContainerWithoutRegionAndHideLabel() {
openRepresentation(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -1146,14 +1091,12 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Test creation of regions container with horizontal stack which contains
- * one region and then resizing the container. Check specific size for
- * region and auto-size gmf size and specific Draw2D size for container
- * match with rectangle draw).
+ * Test creation of regions container with horizontal stack which contains one region and then resizing the
+ * container. Check specific size for region and auto-size gmf size and specific Draw2D size for container match
+ * with rectangle draw).
*
* @throws Exception
- * In case of problem during semantic modification outside the
- * editor.
+ * In case of problem during semantic modification outside the editor.
*/
public void testResizeOfNewHorizontalRegionContainerWithOneRegionAndRectangleDraw() throws Exception {
openRepresentation(HORIZONTAL_STACK_REPRESENTATION_NAME, HORIZONTAL_STACK_REPRESENTATION_INSTANCE_NAME);
@@ -1179,8 +1122,7 @@ public class CompartmentsCreationTest extends AbstractCompartmentTest {
}
/**
- * Create a new node using the given tool directly in the diagram
- * representation.
+ * Create a new node using the given tool directly in the diagram representation.
*
* @param CREATION_TOOL_NAME
* Tool name to select
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllTestSuite.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllTestSuite.java
index 1d9fda4b45..5f5fe24656 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllTestSuite.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllTestSuite.java
@@ -294,6 +294,7 @@ public class AllTestSuite extends TestCase {
suite.addTestSuite(ExtensionActivationOrderTest.class);
suite.addTestSuite(ContainerDropPropertySectionsTests.class);
suite.addTestSuite(BorderNodeSidePropertySectionTest.class);
+ suite.addTestSuite(EditPartSelectionTest.class);
}
/**

Back to the top