Merge branch 'master' into gsoc2014
diff --git a/plugins/org.eclipse.sirius.common.acceleo.mtl/src/org/eclipse/sirius/common/acceleo/mtl/business/internal/interpreter/DynamicAcceleoModule.java b/plugins/org.eclipse.sirius.common.acceleo.mtl/src/org/eclipse/sirius/common/acceleo/mtl/business/internal/interpreter/DynamicAcceleoModule.java
index b361316..be49089 100644
--- a/plugins/org.eclipse.sirius.common.acceleo.mtl/src/org/eclipse/sirius/common/acceleo/mtl/business/internal/interpreter/DynamicAcceleoModule.java
+++ b/plugins/org.eclipse.sirius.common.acceleo.mtl/src/org/eclipse/sirius/common/acceleo/mtl/business/internal/interpreter/DynamicAcceleoModule.java
@@ -753,7 +753,7 @@
                 compiledModules.put(actualModule, result);
             }
 
-            boolean resultOK = result != null && result.getCompiledExpression() instanceof EObject && result.getStatus().getSeverity() != IStatus.ERROR;
+            boolean resultOK = result != null && result.getCompiledExpression() instanceof EObject && (result.getStatus() == null || result.getStatus().getSeverity() < IStatus.ERROR);
             if (resultOK) {
                 // The module is created with an "http acceleo" URI ...
                 // which won't allow us to retrieve the corresponding java
diff --git a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/AbstractFrameResizableEditPolicy.java b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/AbstractFrameResizableEditPolicy.java
index 61ef730..07152a5 100644
--- a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/AbstractFrameResizableEditPolicy.java
+++ b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/AbstractFrameResizableEditPolicy.java
@@ -26,7 +26,6 @@
 import org.eclipse.gef.commands.UnexecutableCommand;
 import org.eclipse.gef.requests.AlignmentRequest;
 import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
 import org.eclipse.sirius.diagram.sequence.business.internal.RangeHelper;
 import org.eclipse.sirius.diagram.sequence.business.internal.elements.AbstractFrame;
 import org.eclipse.sirius.diagram.sequence.business.internal.elements.ISequenceEvent;
@@ -140,7 +139,7 @@
         Range expansionZone = validator.getExpansionZone();
         if (!expansionZone.isEmpty()) {
             Rectangle screenRange = new Rectangle(0, expansionZone.getLowerBound(), 0, expansionZone.width());
-            screenRange.performScale(GraphicalHelper.getZoom((IGraphicalEditPart) getHost()));
+            screenRange.performScale(GraphicalHelper.getZoom(getHost()));
             Range expand = RangeHelper.verticalRange(screenRange);
 
             RangeGuide expansion = new RangeGuide(validator.isValid() ? ColorConstants.blue : ColorConstants.red, expand, true);
@@ -155,7 +154,7 @@
     private void feedBackConflicts(AbstractInteractionFrameValidator validator) {
         for (Integer conflict : validator.getInvalidPositions()) {
             Point conflictingPosition = new Point(0, conflict);
-            conflictingPosition.performScale(GraphicalHelper.getZoom((IGraphicalEditPart) getHost()));
+            conflictingPosition.performScale(GraphicalHelper.getZoom(getHost()));
 
             Rectangle bounds = getFeedbackLayer().getBounds().getCopy();
             bounds.y = conflictingPosition.y;
diff --git a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/ExecutionSelectionEditPolicy.java b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/ExecutionSelectionEditPolicy.java
index 08c4037..9e7b9c1 100644
--- a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/ExecutionSelectionEditPolicy.java
+++ b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/ExecutionSelectionEditPolicy.java
@@ -522,7 +522,7 @@
         IFigure feedbackLayer = getFeedbackLayer();
         for (Integer conflict : validator.getInvalidPositions()) {
             Point conflictingPosition = new Point(0, conflict);
-            conflictingPosition.performScale(GraphicalHelper.getZoom((IGraphicalEditPart) getHost()));
+            conflictingPosition.performScale(GraphicalHelper.getZoom(getHost()));
 
             Rectangle bounds = feedbackLayer.getBounds().getCopy();
             bounds.y = conflictingPosition.y;
@@ -537,7 +537,7 @@
         Range expansionZone = validator.getExpansionZone();
         if (expansionZone != null && !expansionZone.isEmpty() && expansionZone.width() != 0) {
             Rectangle screenRange = new Rectangle(0, expansionZone.getLowerBound(), 0, expansionZone.width());
-            screenRange.performScale(GraphicalHelper.getZoom((IGraphicalEditPart) getHost()));
+            screenRange.performScale(GraphicalHelper.getZoom(getHost()));
             Range expand = RangeHelper.verticalRange(screenRange);
 
             Rectangle bounds = feedbackLayer.getBounds().getCopy();
diff --git a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/ExecutionSemanticEditPolicy.java b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/ExecutionSemanticEditPolicy.java
index e2b9100..294c159 100644
--- a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/ExecutionSemanticEditPolicy.java
+++ b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/ExecutionSemanticEditPolicy.java
@@ -180,7 +180,7 @@
                 if (layer != null && ise instanceof CombinedFragment) {
                     Range verticalRange = ise.getVerticalRange();
                     Rectangle screenRange = new Rectangle(0, verticalRange.getLowerBound(), 0, LayoutConstants.COMBINED_FRAGMENT_TITLE_HEIGHT);
-                    screenRange.performScale(GraphicalHelper.getZoom((IGraphicalEditPart) getHost()));
+                    screenRange.performScale(GraphicalHelper.getZoom(getHost()));
                     Range forbiddenRange = RangeHelper.verticalRange(screenRange);
 
                     forbiddenRangeArea = new RangeGuide(ColorConstants.red, forbiddenRange, true);
diff --git a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/InstanceRoleSiriusGraphicalNodeEditPolicy.java b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/InstanceRoleSiriusGraphicalNodeEditPolicy.java
index c92ffbd..c6c592f 100644
--- a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/InstanceRoleSiriusGraphicalNodeEditPolicy.java
+++ b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/InstanceRoleSiriusGraphicalNodeEditPolicy.java
@@ -23,6 +23,7 @@
 import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
 import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
 import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.INodeEditPart;
 import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
 import org.eclipse.gmf.runtime.notation.View;
 import org.eclipse.sirius.diagram.EdgeTarget;
@@ -303,4 +304,16 @@
         SequenceEditPartsOperations.appendFullRefresh((IGraphicalEditPart) getHost(), result);
         return result;
     }
+
+    /**
+     * The snap to grid should be disabled in sequence diagram, but to avoid
+     * confusion the specific method for edge behavior with snap to grid is
+     * disabled.
+     * 
+     * {@inheritDoc}
+     */
+    @Override
+    protected EdgeLayoutData getEdgeLayoutDataWithSnapToGrid(CreateConnectionRequest request, INodeEditPart sourceEditPart, INodeEditPart targetEditPart, Point sourceLocation, Point targetLocation) {
+        return super.getEdgeLayoutData(request, sourceEditPart, targetEditPart, sourceLocation, targetLocation);
+    }
 }
diff --git a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/SequenceMessageEditPolicy.java b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/SequenceMessageEditPolicy.java
index 4d37d59..9173983 100644
--- a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/SequenceMessageEditPolicy.java
+++ b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/SequenceMessageEditPolicy.java
@@ -164,7 +164,7 @@
                 showCompoundEndFeedback(br, thisEvent, ends, moveType.isFromTop());
             } else {
                 Point location = new Point(1, thisEvent.getConnectionFigure().getPoints().getFirstPoint().y);
-                location.performScale(GraphicalHelper.getZoom((IGraphicalEditPart) getHost()));
+                location.performScale(GraphicalHelper.getZoom(getHost()));
 
                 Figure guide = new HorizontalGuide(MESSAGE_FEEDBACK_COLOR, location.y);
                 Rectangle bounds = getFeedbackLayer().getBounds().getCopy();
@@ -176,7 +176,7 @@
 
                 if (new ISequenceEventQuery(getMessage().getISequenceEvent()).isReflectiveMessage()) {
                     Point endLocation = new Point(1, thisEvent.getConnectionFigure().getPoints().getLastPoint().y);
-                    endLocation.performScale(GraphicalHelper.getZoom((IGraphicalEditPart) getHost()));
+                    endLocation.performScale(GraphicalHelper.getZoom(getHost()));
                     Figure messageToSelfBottomGuide = new HorizontalGuide(MESSAGE_FEEDBACK_COLOR, endLocation.y);
                     bounds = getFeedbackLayer().getBounds().getCopy();
                     bounds.height = 1;
@@ -201,7 +201,7 @@
                         bounds = getFeedbackLayer().getBounds().getCopy();
 
                         Point conflictingPosition = new Point(0, conflict);
-                        conflictingPosition.performScale(GraphicalHelper.getZoom((IGraphicalEditPart) getHost()));
+                        conflictingPosition.performScale(GraphicalHelper.getZoom(getHost()));
 
                         HorizontalGuide conflictGuide = new HorizontalGuide(ColorConstants.red, conflictingPosition.y);
                         bounds.y = conflictingPosition.y;
diff --git a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/SequenceSiriusGraphicalNodeEditPolicy.java b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/SequenceSiriusGraphicalNodeEditPolicy.java
index 2f4a469..e7d5feb 100644
--- a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/SequenceSiriusGraphicalNodeEditPolicy.java
+++ b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/SequenceSiriusGraphicalNodeEditPolicy.java
@@ -25,6 +25,7 @@
 import org.eclipse.gef.requests.CreateConnectionRequest;
 import org.eclipse.gef.requests.ReconnectRequest;
 import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.INodeEditPart;
 import org.eclipse.gmf.runtime.diagram.ui.editparts.NoteEditPart;
 import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
 import org.eclipse.gmf.runtime.notation.View;
@@ -255,4 +256,15 @@
         return result;
     }
 
+    /**
+     * The snap to grid should be disabled in sequence diagram, but to avoid
+     * confusion the specific method for edge behavior with snap to grid is
+     * disabled.
+     * 
+     * {@inheritDoc}
+     */
+    @Override
+    protected EdgeLayoutData getEdgeLayoutDataWithSnapToGrid(CreateConnectionRequest request, INodeEditPart sourceEditPart, INodeEditPart targetEditPart, Point sourceLocation, Point targetLocation) {
+        return super.getEdgeLayoutData(request, sourceEditPart, targetEditPart, sourceLocation, targetLocation);
+    }
 }
diff --git a/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF
index 54646be..7431d81 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF
@@ -29,12 +29,13 @@
  org.eclipse.sirius.common;bundle-version="2.0.0",
  org.eclipse.sirius.common.ui;bundle-version="2.0.0",
  org.eclipse.core.runtime;bundle-version="3.8.0",
- org.eclipse.sirius.diagram;visibility:=reexport;bundle-version="2.0.0",
- org.eclipse.emf.edit;visibility:=reexport;bundle-version="2.8.0",
- org.eclipse.emf.ecore;visibility:=reexport;bundle-version="2.8.0",
- org.eclipse.emf.ecore.edit;visibility:=reexport;bundle-version="2.8.0",
- org.eclipse.sirius;visibility:=reexport;bundle-version="2.0.0",
- org.eclipse.sirius.ui;visibility:=reexport;bundle-version="2.0.0",
+ org.eclipse.sirius.diagram;bundle-version="2.0.0";visibility:=reexport,
+ org.eclipse.emf.edit;bundle-version="2.8.0";visibility:=reexport,
+ org.eclipse.emf.ecore;bundle-version="2.8.0";visibility:=reexport,
+ org.eclipse.emf.ecore.edit;bundle-version="2.8.0";visibility:=reexport,
+ org.eclipse.sirius;bundle-version="2.0.0";visibility:=reexport,
+ org.eclipse.sirius.ext.gmf.runtime;bundle-version="2.0.0";visibility:=reexport,
+ org.eclipse.sirius.ui;bundle-version="2.0.0";visibility:=reexport,
  org.eclipse.sirius.diagram.layoutdata;bundle-version="2.0.0",
  org.eclipse.sirius.ecore.extender;bundle-version="2.0.0",
  org.eclipse.ui.navigator;bundle-version="3.5.200",
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/query/DNodeContainerQuery.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/query/DNodeContainerQuery.java
new file mode 100644
index 0000000..b10968a
--- /dev/null
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/query/DNodeContainerQuery.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.business.internal.query;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.sirius.diagram.DNodeContainer;
+import org.eclipse.sirius.diagram.FlatContainerStyle;
+import org.eclipse.sirius.diagram.business.internal.query.DDiagramElementContainerExperimentalQuery;
+import org.eclipse.sirius.diagram.business.internal.query.DNodeContainerExperimentalQuery;
+import org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutUtils;
+
+import com.google.common.base.Preconditions;
+
+/**
+ * Queries relative to a DNodeContainer.
+ * 
+ * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
+ */
+public class DNodeContainerQuery {
+
+    private final DNodeContainer container;
+
+    /**
+     * Constructor.
+     * 
+     * @param container
+     *            the container to query.
+     */
+    public DNodeContainerQuery(DNodeContainer container) {
+        this.container = Preconditions.checkNotNull(container);
+    }
+
+    /**
+     * Return the default draw2D dimension according to the specified
+     * DNodeContainer.
+     * 
+     * @return the default draw2D dimension according to the specified
+     *         DNodeContainer.
+     */
+    public Dimension getDefaultDimension() {
+        Dimension defaultSize = new Dimension(LayoutUtils.NEW_DEFAULT_CONTAINER_DIMENSION);
+
+        /*
+         * here we need to set a default size to 150, 70 because this was the
+         * image size before the 4.0
+         */
+        if (container.getOwnedStyle() instanceof FlatContainerStyle && !new DDiagramElementContainerExperimentalQuery(container).isRegion()
+                && !new DNodeContainerExperimentalQuery(container).isRegionContainer()) {
+            defaultSize.setSize(LayoutUtils.DEFAULT_CONTAINER_DIMENSION);
+        }
+
+        return defaultSize;
+    }
+
+}
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDDiagramEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDDiagramEditPart.java
index 4ef4eb8..9b396b4 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDDiagramEditPart.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDDiagramEditPart.java
@@ -71,11 +71,11 @@
 import org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl;
 import org.eclipse.sirius.diagram.ui.tools.internal.layout.ordering.ViewOrderingProviderRegistry;
 import org.eclipse.sirius.diagram.ui.tools.internal.providers.decorators.SubDiagramDecoratorProvider;
-import org.eclipse.sirius.diagram.ui.tools.internal.ui.RubberbandDragTracker;
 import org.eclipse.sirius.ecore.extender.business.api.permission.IPermissionAuthority;
 import org.eclipse.sirius.ecore.extender.business.api.permission.PermissionAuthorityRegistry;
 import org.eclipse.sirius.ext.base.Option;
 import org.eclipse.sirius.ext.base.Options;
+import org.eclipse.sirius.ext.gmf.runtime.diagram.ui.tools.RubberbandDragTracker;
 
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramContainerEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramContainerEditPart.java
index d37b746..ae1c453 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramContainerEditPart.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramContainerEditPart.java
@@ -16,6 +16,7 @@
 
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Rectangle;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.gef.DragTracker;
@@ -46,10 +47,10 @@
 import org.eclipse.sirius.diagram.FlatContainerStyle;
 import org.eclipse.sirius.diagram.ShapeContainerStyle;
 import org.eclipse.sirius.diagram.WorkspaceImage;
-import org.eclipse.sirius.diagram.business.internal.query.DDiagramElementContainerExperimentalQuery;
 import org.eclipse.sirius.diagram.business.internal.query.DNodeContainerExperimentalQuery;
 import org.eclipse.sirius.diagram.description.style.FlatContainerStyleDescription;
 import org.eclipse.sirius.diagram.ui.business.api.view.SiriusLayoutDataManager;
+import org.eclipse.sirius.diagram.ui.business.internal.query.DNodeContainerQuery;
 import org.eclipse.sirius.diagram.ui.edit.internal.part.CommonEditPartOperation;
 import org.eclipse.sirius.diagram.ui.edit.internal.part.DiagramContainerEditPartOperation;
 import org.eclipse.sirius.diagram.ui.edit.internal.part.PortLayoutHelper;
@@ -350,30 +351,22 @@
      * {@inheritDoc}
      */
     protected NodeFigure createNodePlate() {
-        NodeFigure result;
+        Dimension defaultSize = LayoutUtils.NEW_DEFAULT_CONTAINER_DIMENSION;
         final EObject eObj = resolveSemanticElement();
+        if (eObj instanceof DNodeContainer) {
+            defaultSize = new DNodeContainerQuery((DNodeContainer) eObj).getDefaultDimension();
+        }
+        NodeFigure result;
         if (eObj instanceof DStylizable && eObj instanceof DDiagramElement) {
             final DStylizable viewNode = (DStylizable) eObj;
             Option<LabelBorderStyleDescription> hasLabelBorderStyle = hasLabelBorderStyle(viewNode);
             if (hasLabelBorderStyle.some()) {
-                result = new ContainerWithTitleBlockFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40), viewNode, hasLabelBorderStyle.get());
+                result = new ContainerWithTitleBlockFigure(getMapMode().DPtoLP(defaultSize.width), getMapMode().DPtoLP(defaultSize.height), viewNode, hasLabelBorderStyle.get());
             } else {
-                result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40));
+                result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(defaultSize.width), getMapMode().DPtoLP(defaultSize.height));
             }
         } else {
-            result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40));
-        }
-
-        /*
-         * here we need to set a default size to 150, 70 because this was the
-         * image size before the 4.0
-         */
-        if (result instanceof DefaultSizeNodeFigure && eObj instanceof DNodeContainer) {
-            final DNodeContainer container = (DNodeContainer) eObj;
-            if (container.getOwnedStyle() instanceof FlatContainerStyle && !new DDiagramElementContainerExperimentalQuery(container).isRegion()
-                    && !new DNodeContainerExperimentalQuery(container).isRegionContainer()) {
-                ((DefaultSizeNodeFigure) result).setDefaultSize(LayoutUtils.DEFAULT_CONTAINER_DIMENSION);
-            }
+            result = new DefaultSizeNodeFigure(getMapMode().DPtoLP(defaultSize.width), getMapMode().DPtoLP(defaultSize.height));
         }
 
         return result;
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramEdgeEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramEdgeEditPart.java
index 9c08b94..d71c0c8 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramEdgeEditPart.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramEdgeEditPart.java
@@ -690,13 +690,11 @@
             }
         }
 
-        /**
-         * {@inheritDoc}
-         * 
-         * @see org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx#paintFigure(org.eclipse.draw2d.Graphics)
-         */
         @Override
         public void paintFigure(final Graphics graphics) {
+            if (!isActive()) {
+                return;
+            }
             final EObject element = resolveSemanticElement();
             if (element != null && DEdge.class.isInstance(element)) {
                 final DEdge viewEdge = (DEdge) element;
@@ -706,13 +704,11 @@
             }
         }
 
-        /**
-         * {@inheritDoc}
-         * 
-         * @see org.eclipse.draw2d.Figure#paintChildren(org.eclipse.draw2d.Graphics)
-         */
         @Override
         protected void paintChildren(Graphics graphics) {
+            if (!isActive()) {
+                return;
+            }
             final EObject element = resolveSemanticElement();
             if (element != null && DEdge.class.isInstance(element)) {
                 final DEdge viewEdge = (DEdge) element;
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramListEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramListEditPart.java
index 78f9b70..47bb260 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramListEditPart.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramListEditPart.java
@@ -38,6 +38,7 @@
 import org.eclipse.sirius.diagram.ui.tools.api.figure.GradientRoundedRectangle;
 import org.eclipse.sirius.diagram.ui.tools.api.figure.SiriusWrapLabel;
 import org.eclipse.sirius.diagram.ui.tools.api.figure.ViewNodeContainerFigureDesc;
+import org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutUtils;
 import org.eclipse.sirius.diagram.ui.tools.internal.ui.NoCopyDragEditPartsTrackerEx;
 
 import com.google.common.collect.Iterables;
@@ -260,6 +261,6 @@
      * @was-generated
      */
     protected NodeFigure createNodePlate() {
-        return new DefaultSizeNodeFigure(getMapMode().DPtoLP(40), getMapMode().DPtoLP(40));
+        return new DefaultSizeNodeFigure(getMapMode().DPtoLP(LayoutUtils.NEW_DEFAULT_CONTAINER_DIMENSION.width), getMapMode().DPtoLP(LayoutUtils.NEW_DEFAULT_CONTAINER_DIMENSION.height));
     }
 }
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/NodeCreationEditPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/NodeCreationEditPolicy.java
index c1d7122..3b625f5 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/NodeCreationEditPolicy.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/NodeCreationEditPolicy.java
@@ -149,8 +149,16 @@
             final Point containerLocation = fig.getBounds().getLocation();
             location = new Point(location.x - containerLocation.x, location.y - containerLocation.y);
             if (fig instanceof ResizableCompartmentFigure) {
-                final Point scrollOffset = ((ResizableCompartmentFigure) fig).getScrollPane().getViewport().getViewLocation();
-                final Point shiftFromMarginOffset = FigureUtilities.getShiftFromMarginOffset((ResizableCompartmentFigure) fig, new RequestQuery(request).isDropOrCreationOfBorderedNode(), getHost());
+                boolean isBorderNodeCreationRequest = new RequestQuery(request).isDropOrCreationOfBorderedNode();
+                Point scrollOffset;
+                if (isBorderNodeCreationRequest) {
+                    // Ignore scroll for border node, the border of the parent
+                    // is always visible...
+                    scrollOffset = new Point(0, 0);
+                } else {
+                    scrollOffset = ((ResizableCompartmentFigure) fig).getScrollPane().getViewport().getViewLocation();
+                }
+                final Point shiftFromMarginOffset = FigureUtilities.getShiftFromMarginOffset((ResizableCompartmentFigure) fig, isBorderNodeCreationRequest, getHost());
                 realLocation = new Point(location.x + scrollOffset.x - shiftFromMarginOffset.x, location.y + scrollOffset.y - shiftFromMarginOffset.y);
 
             } else {
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusContainerDropPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusContainerDropPolicy.java
index 3a31b3c..ffa1cce 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusContainerDropPolicy.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusContainerDropPolicy.java
@@ -374,7 +374,7 @@
                     final Point absoluteLayoutConstraint = shapeEditPart.getFigure().getBounds().getTopLeft().getCopy();
                     shapeEditPart.getFigure().translateToAbsolute(absoluteLayoutConstraint);
                     GraphicalHelper.screen2logical(absoluteLayoutConstraint, (IGraphicalEditPart) getHost());
-                    absoluteLayoutConstraint.translate(moveDelta.getScaled(1.0d / GraphicalHelper.getZoom((IGraphicalEditPart) getHost())));
+                    absoluteLayoutConstraint.translate(moveDelta.getScaled(1.0d / GraphicalHelper.getZoom(getHost())));
 
                     boolean isBorderedTarget = editPart instanceof AbstractDiagramBorderNodeEditPart;
                     final Point computedLayoutConstraint = computeLocationHint(absoluteLayoutConstraint, isBorderedTarget, isConcernedBorderedNode);
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusGraphicalNodeEditPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusGraphicalNodeEditPolicy.java
index 4bf0e1f..93aeec7 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusGraphicalNodeEditPolicy.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusGraphicalNodeEditPolicy.java
@@ -23,6 +23,7 @@
 import org.eclipse.draw2d.RectangleFigure;
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.PrecisionPoint;
 import org.eclipse.draw2d.geometry.Rectangle;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.transaction.TransactionalEditingDomain;
@@ -57,6 +58,7 @@
 import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
 import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
 import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.gef.ui.figures.SlidableAnchor;
 import org.eclipse.gmf.runtime.notation.ConnectorStyle;
 import org.eclipse.gmf.runtime.notation.Diagram;
 import org.eclipse.gmf.runtime.notation.Edge;
@@ -101,6 +103,7 @@
 import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor;
 import org.eclipse.sirius.diagram.ui.tools.api.util.GMFNotationHelper;
 import org.eclipse.sirius.ext.base.Option;
+import org.eclipse.sirius.ext.gmf.runtime.editparts.GraphicalHelper;
 import org.eclipse.sirius.viewpoint.DMappingBased;
 import org.eclipse.sirius.viewpoint.DSemanticDecorator;
 import org.eclipse.sirius.viewpoint.SiriusPlugin;
@@ -485,42 +488,20 @@
 
             INodeEditPart sourceEditPart = (INodeEditPart) request.getSourceEditPart();
 
+            // Location relative to the source: Position where the user
+            // clicked, but snap to grid if this feature is enabled
             Point sourceLocation = getEdgeLocationSource(request);
+            // Location relative to the target: Position where the user
+            // clicked, but snap to grid if this feature is enabled
             Point targetLocation = getConvertedLocation(request);
 
-            String newSourceTerminal = getEdgeTerminalSource(request);
-            ConnectionAnchor sourceAnchor = sourceEditPart.mapTerminalToConnectionAnchor(newSourceTerminal);
-
-            ConnectionAnchor targetAnchor = targetEP.getTargetConnectionAnchor(request);
-            String newTargetTerminal = targetEP.mapConnectionAnchorToTerminal(targetAnchor);
-
-            PointList pointList = new PointList();
-            if (request.getLocation() == null) {
-                pointList.addPoint(sourceAnchor.getLocation(targetAnchor.getReferencePoint()));
-                pointList.addPoint(targetAnchor.getLocation(sourceAnchor.getReferencePoint()));
+            EdgeLayoutData edgeLayoutData;
+            if (GraphicalHelper.isSnapToGridEnabled(sourceEditPart)) {
+                edgeLayoutData = getEdgeLayoutDataWithSnapToGrid(request, sourceEditPart, targetEP, sourceLocation, targetLocation);
             } else {
-                pointList.addPoint(sourceAnchor.getLocation(request.getLocation()));
-                pointList.addPoint(targetAnchor.getLocation(request.getLocation()));
+                edgeLayoutData = getEdgeLayoutData(request, sourceEditPart, targetEP, sourceLocation, targetLocation);
             }
 
-            Point sourceRefPoint = sourceAnchor.getReferencePoint();
-
-            Point targetRefPoint = targetAnchor.getReferencePoint();
-
-            final LayoutData sourceLayoutData = new RootLayoutData(sourceEditPart, sourceLocation.getCopy(), null);
-            final LayoutData targetLayoutData = new RootLayoutData(targetEP, targetLocation.getCopy(), null);
-            final EdgeLayoutData edgeLayoutData = new EdgeLayoutData(sourceLayoutData, targetLayoutData);
-
-            edgeLayoutData.setSourceTerminal("" + newSourceTerminal);
-            edgeLayoutData.setTargetTerminal("" + newTargetTerminal);
-
-            edgeLayoutData.setPointList(pointList.getCopy());
-            edgeLayoutData.setSourceRefPoint(sourceRefPoint.getCopy());
-            edgeLayoutData.setTargetRefPoint(targetRefPoint.getCopy());
-
-            // Routing routing = getRouting(edge);
-            // egdeLayoutData.setRouting(routing);
-
             DSemanticDecorator decorateSemanticElement = null;
             if (this.getHost().getModel() instanceof View) {
                 View view = (View) this.getHost().getModel();
@@ -545,6 +526,197 @@
         return viewpointConnectionCreationCmd;
     }
 
+    /**
+     * Create the edge layout data that will be used later after the refresh.
+     * 
+     * @param request
+     *            The original creation request
+     * @param sourceEditPart
+     *            the {@link EditPart} that the source end of the connection
+     *            should be connected to.
+     * @param targetEditPart
+     *            the {@link EditPart} that the target end of the connection
+     *            should be connected to.
+     * @param sourceLocation
+     *            the location of the first click (relative to the source edit
+     *            part)
+     * @param targetLocation
+     *            the location of the second click (relative to the target edit
+     *            part)
+     * @return The edge layout data corresponding to the creation request.
+     */
+    protected EdgeLayoutData getEdgeLayoutData(CreateConnectionRequest request, INodeEditPart sourceEditPart, INodeEditPart targetEditPart, Point sourceLocation, Point targetLocation) {
+        String newSourceTerminal = getEdgeTerminalSource(request);
+        ConnectionAnchor sourceAnchor = sourceEditPart.mapTerminalToConnectionAnchor(newSourceTerminal);
+
+        ConnectionAnchor targetAnchor = targetEditPart.getTargetConnectionAnchor(request);
+        String newTargetTerminal = targetEditPart.mapConnectionAnchorToTerminal(targetAnchor);
+
+        Point sourceRefPoint = sourceAnchor.getReferencePoint();
+        Point targetRefPoint = targetAnchor.getReferencePoint();
+
+        PointList pointList = new PointList();
+        if (request.getLocation() == null) {
+            pointList.addPoint(sourceAnchor.getLocation(targetAnchor.getReferencePoint()));
+            pointList.addPoint(targetAnchor.getLocation(sourceAnchor.getReferencePoint()));
+        } else {
+            pointList.addPoint(sourceAnchor.getLocation(request.getLocation()));
+            pointList.addPoint(targetAnchor.getLocation(request.getLocation()));
+        }
+
+        final LayoutData sourceLayoutData = new RootLayoutData(sourceEditPart, sourceLocation.getCopy(), null);
+        final LayoutData targetLayoutData = new RootLayoutData(targetEditPart, targetLocation.getCopy(), null);
+        EdgeLayoutData edgeLayoutData = new EdgeLayoutData(sourceLayoutData, targetLayoutData);
+
+        edgeLayoutData.setSourceTerminal("" + newSourceTerminal);
+        edgeLayoutData.setTargetTerminal("" + newTargetTerminal);
+
+        edgeLayoutData.setPointList(pointList.getCopy());
+        edgeLayoutData.setSourceRefPoint(sourceRefPoint.getCopy());
+        edgeLayoutData.setTargetRefPoint(targetRefPoint.getCopy());
+        return edgeLayoutData;
+    }
+
+    /**
+     * Create the edge layout data that will be used later after the refresh.
+     * According to
+     * {@link #getEdgeLayoutData(CreateConnectionRequest, INodeEditPart, INodeEditPart, Point, Point)}
+     * this method ensures that the first point and the last point of the edge
+     * will be snap to the grid (at least one of there coordinates. The other is
+     * constrained by the side of the source (or the target).<BR>
+     * This is not possible to do it earlier (in feedback for example) because
+     * we should know source and target data to compute the new source and
+     * target location.
+     * 
+     * @param request
+     *            The original creation request
+     * @param sourceEditPart
+     *            the {@link EditPart} that the source end of the connection
+     *            should be connected to.
+     * @param targetEditPart
+     *            the {@link EditPart} that the target end of the connection
+     *            should be connected to.
+     * @param sourceLocation
+     *            the location of the first click (relative to the source edit
+     *            part)
+     * @param targetLocation
+     *            the location of the second click (relative to the target edit
+     *            part)
+     * @return The edge layout data corresponding to the creation request and to
+     *         the snapToGrid state.
+     */
+    protected EdgeLayoutData getEdgeLayoutDataWithSnapToGrid(CreateConnectionRequest request, INodeEditPart sourceEditPart, INodeEditPart targetEditPart, Point sourceLocation, Point targetLocation) {
+        // Get the absolute source and target location but in 100% to facilitate
+        // the computing
+        Rectangle absoluteSourceBoundsIn100Percent = GraphicalHelper.getAbsoluteBoundsIn100Percent(sourceEditPart);
+        Point absoluteSourceLocationIn100Percent = sourceLocation.getTranslated(absoluteSourceBoundsIn100Percent.getTopLeft());
+        Rectangle absoluteTargetBoundsIn100Percent = GraphicalHelper.getAbsoluteBoundsIn100Percent(targetEditPart);
+        Point absoluteTargetLocationIn100Percent = targetLocation.getTranslated(absoluteTargetBoundsIn100Percent.getTopLeft());
+
+        // Compute intersection between the line (source location<-->target
+        // location) and the source node
+        Option<Point> intersectionSourcePoint = GraphicalHelper.getIntersection(absoluteSourceLocationIn100Percent, absoluteTargetLocationIn100Percent, (IGraphicalEditPart) sourceEditPart, false);
+        // Compute intersection between the line (source location<-->target
+        // location) and the target node
+        Option<Point> intersectionTargetPoint = GraphicalHelper.getIntersection(absoluteSourceLocationIn100Percent, absoluteTargetLocationIn100Percent, (IGraphicalEditPart) targetEditPart, true);
+        // Compute the snap source location and the snap target location
+        Point absoluteSourceLocationSnapIn100Percent;
+        Point absoluteTargetLocationSnapIn100Percent;
+        if (intersectionSourcePoint.some() && intersectionTargetPoint.some()) {
+            absoluteSourceLocationSnapIn100Percent = snapLocationToGridAndToParentBorder(absoluteSourceLocationIn100Percent, absoluteSourceBoundsIn100Percent, intersectionSourcePoint.get());
+            absoluteTargetLocationSnapIn100Percent = snapLocationToGridAndToParentBorder(absoluteTargetLocationIn100Percent, absoluteTargetBoundsIn100Percent, intersectionTargetPoint.get());
+        } else {
+            // There is probably a case not handle, use the default layout data
+            return getEdgeLayoutData(request, sourceEditPart, targetEditPart, sourceLocation, targetLocation);
+        }
+
+        // Make snap source point relative to the source edit part
+        Point sourceLocationSnapIn100Percent = getTranslatedToRelative(absoluteSourceLocationSnapIn100Percent, absoluteSourceBoundsIn100Percent);
+        final LayoutData sourceLayoutData = new RootLayoutData(sourceEditPart, sourceLocationSnapIn100Percent, null);
+        // Make snap target point relative to the source edit part
+        Point targetLocationSnapIn100Percent = getTranslatedToRelative(absoluteTargetLocationSnapIn100Percent, absoluteTargetBoundsIn100Percent);
+        final LayoutData targetLayoutData = new RootLayoutData(targetEditPart, targetLocationSnapIn100Percent, null);
+        EdgeLayoutData edgeLayoutData = new EdgeLayoutData(sourceLayoutData, targetLayoutData);
+        // Compute the new source terminal anchor
+        PrecisionPoint sourceTerminalPosition = new PrecisionPoint((double) sourceLocationSnapIn100Percent.x / absoluteSourceBoundsIn100Percent.width, (double) sourceLocationSnapIn100Percent.y
+                / absoluteSourceBoundsIn100Percent.height);
+        String sourceTerminal = new SlidableAnchor(null, sourceTerminalPosition).getTerminal();
+        edgeLayoutData.setSourceTerminal("" + sourceTerminal);
+        // Compute the new target terminal anchor
+        PrecisionPoint targetTerminalPosition = new PrecisionPoint((double) targetLocationSnapIn100Percent.x / absoluteTargetBoundsIn100Percent.width, (double) targetLocationSnapIn100Percent.y
+                / absoluteTargetBoundsIn100Percent.height);
+        String targetTerminal = new SlidableAnchor(null, targetTerminalPosition).getTerminal();
+        edgeLayoutData.setTargetTerminal("" + targetTerminal);
+        // Applied the zoom of the current diagram to set the pointList, the
+        // source reference point and the target reference point.
+        Point absoluteSourceLocationSnap = absoluteSourceLocationSnapIn100Percent.getCopy();
+        GraphicalHelper.applyZoomOnPoint((IGraphicalEditPart) sourceEditPart, absoluteSourceLocationSnap);
+        Point absoluteTargteLoactionSnap = absoluteTargetLocationSnapIn100Percent.getCopy();
+        GraphicalHelper.applyZoomOnPoint((IGraphicalEditPart) targetEditPart, absoluteTargteLoactionSnap);
+
+        edgeLayoutData.setSourceRefPoint(absoluteSourceLocationSnap);
+        edgeLayoutData.setTargetRefPoint(absoluteTargteLoactionSnap);
+
+        PointList pointList = new PointList();
+        pointList.addPoint(absoluteSourceLocationSnap.getCopy());
+        pointList.addPoint(absoluteTargteLoactionSnap.getCopy());
+        edgeLayoutData.setPointList(pointList.getCopy());
+
+        return edgeLayoutData;
+    }
+
+    /**
+     * * @param absoluteLocation The location in absolute coordinates (and in
+     * 100%)
+     * 
+     * @param absoluteParentBounds
+     *            The parent bounds in absolute coordinates (and in 100%)
+     * @param intersectionPoint
+     *            The intersection location in absolute coordinates (and in
+     *            100%)
+     * @return
+     */
+    private Point snapLocationToGridAndToParentBorder(Point absoluteLocation, Rectangle absoluteParentBounds, Point intersectionPoint) {
+        Point absoluteSourceLocationSnapIn100Percent;
+        if (intersectionPoint.x == absoluteParentBounds.x || intersectionPoint.x == (absoluteParentBounds.x + absoluteParentBounds.width)) {
+            int yCoordinate = absoluteLocation.y;
+            // If y coordinate of absoluteLocation is outside the parent
+            // (possible if the snapToGrid "has attached" the location outside),
+            // we use the nearer parent side has coordinate.
+            if (absoluteParentBounds.y > yCoordinate) {
+                yCoordinate = absoluteParentBounds.y;
+            } else if (yCoordinate > (absoluteParentBounds.y + absoluteParentBounds.height)) {
+                yCoordinate = absoluteParentBounds.y + absoluteParentBounds.height;
+            }
+            absoluteSourceLocationSnapIn100Percent = new Point(intersectionPoint.x, yCoordinate);
+        } else {
+            int xCoordinate = absoluteLocation.x;
+            // If x coordinate of absoluteLocation is outside the parent
+            // (possible if the snapToGrid "has attached" the location outside),
+            // we use the nearer parent side has coordinate.
+            if (absoluteParentBounds.x > xCoordinate) {
+                xCoordinate = absoluteParentBounds.x;
+            } else if (xCoordinate > (absoluteParentBounds.x + absoluteParentBounds.width)) {
+                xCoordinate = absoluteParentBounds.x + absoluteParentBounds.width;
+            }
+            absoluteSourceLocationSnapIn100Percent = new Point(xCoordinate, intersectionPoint.y);
+        }
+        return absoluteSourceLocationSnapIn100Percent;
+    }
+
+    /**
+     * Get a new location point relative to the parent.
+     * 
+     * @param absoluteLocation
+     *            The location in absolute coordinates (and in 100%)
+     * @param absoluteParentBounds
+     *            The parent bounds in absolute coordinates (and in 100%)
+     * @return The location relative to the parent
+     */
+    private Point getTranslatedToRelative(Point absoluteLocation, Rectangle absoluteParentBounds) {
+        return new Point(absoluteLocation.x - absoluteParentBounds.x, absoluteLocation.y - absoluteParentBounds.y);
+    }
+
     private Point getConvertedLocation(final CreateRequest request) {
         //
         // Retrieves the location.
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DDiagramEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DDiagramEditPart.java
index 154b3a0..7fafe6f 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DDiagramEditPart.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DDiagramEditPart.java
@@ -99,15 +99,17 @@
     private void deactivateLayoutingMode() {
         if (getModel() instanceof Diagram) {
             Diagram diagramGMF = (Diagram) getModel();
-            if (diagramGMF.getElement() instanceof DDiagram) {
-                try {
+            try {
+                if (diagramGMF.getElement() instanceof DDiagram) {
+
                     DDiagram dDiagram = (DDiagram) diagramGMF.getElement();
                     if (dDiagram.isIsInLayoutingMode()) {
                         getEditingDomain().getCommandStack().execute(new SetLayoutingModeCommand(getEditingDomain(), dDiagram, false));
                     }
-                } catch (IllegalStateException e) {
-                    // In case of collab session closing with opened editor
                 }
+            } catch (IllegalStateException e) {
+                // If the DDiagram associated to this GMF Diagram is not
+                // accessible any more, we do not modify layouting mode
             }
         }
     }
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/GMFHelper.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/GMFHelper.java
index 45f2023..0531645 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/GMFHelper.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/GMFHelper.java
@@ -35,6 +35,7 @@
 import org.eclipse.sirius.diagram.DNodeList;
 import org.eclipse.sirius.diagram.ui.business.api.query.NodeQuery;
 import org.eclipse.sirius.diagram.ui.business.api.query.ViewQuery;
+import org.eclipse.sirius.diagram.ui.business.internal.query.DNodeContainerQuery;
 import org.eclipse.sirius.diagram.ui.business.internal.query.DNodeQuery;
 import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramElementContainerEditPart;
 import org.eclipse.sirius.diagram.ui.internal.refresh.borderednode.CanonicalDBorderItemLocator;
@@ -370,8 +371,10 @@
         Dimension defaultSize = new Dimension(-1, -1);
         if (abstractDNode instanceof DNode) {
             defaultSize = new DNodeQuery((DNode) abstractDNode).getDefaultDimension();
-        } else if (abstractDNode instanceof DNodeContainer || abstractDNode instanceof DNodeList) {
-            defaultSize = LayoutUtils.DEFAULT_CONTAINER_DIMENSION;
+        } else if (abstractDNode instanceof DNodeContainer) {
+            defaultSize = new DNodeContainerQuery((DNodeContainer) abstractDNode).getDefaultDimension();
+        } else if (abstractDNode instanceof DNodeList) {
+            defaultSize = LayoutUtils.NEW_DEFAULT_CONTAINER_DIMENSION;
         }
         return defaultSize;
     }
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/borderednode/CanonicalDBorderItemLocator.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/borderednode/CanonicalDBorderItemLocator.java
index da219c1..a79d4aa 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/borderednode/CanonicalDBorderItemLocator.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/borderednode/CanonicalDBorderItemLocator.java
@@ -336,19 +336,19 @@
             if (suggestedLocation.x != westX) {
                 newX = westX;
             }
-            if (suggestedLocation.y < bounds.getTopLeft().y) {
-                newY = northY + borderItemSize.height;
+            if (suggestedLocation.y < parentFigureY) {
+                newY = parentFigureY;
             } else if (suggestedLocation.y > bounds.getBottomLeft().y - borderItemSize.height) {
-                newY = southY - borderItemSize.height;
+                newY = bounds.getBottomLeft().y - borderItemSize.height;
             }
         } else if (suggestedSide == PositionConstants.EAST) {
             if (suggestedLocation.x != eastX) {
                 newX = eastX;
             }
-            if (suggestedLocation.y < bounds.getTopLeft().y) {
-                newY = northY + borderItemSize.height;
+            if (suggestedLocation.y < parentFigureY) {
+                newY = parentFigureY;
             } else if (suggestedLocation.y > bounds.getBottomLeft().y - borderItemSize.height) {
-                newY = southY - borderItemSize.height;
+                newY = bounds.getBottomLeft().y - borderItemSize.height;
             }
         } else if (suggestedSide == PositionConstants.SOUTH) {
             if (suggestedLocation.y != southY) {
@@ -359,10 +359,10 @@
                 // case, we will center the border item on the south side of the
                 // parent.
                 newX = parentFigureX - (borderItemSize.width - bounds.width) / 2;
-            } else if (suggestedLocation.x < bounds.getBottomLeft().x) {
-                newX = westX + borderItemSize.width;
+            } else if (suggestedLocation.x < parentFigureX) {
+                newX = parentFigureX;
             } else if (suggestedLocation.x > bounds.getBottomRight().x - borderItemSize.width) {
-                newX = eastX - borderItemSize.width;
+                newX = bounds.getBottomRight().x - borderItemSize.width;
             }
         } else { // NORTH
             if (suggestedLocation.y != northY) {
@@ -373,10 +373,10 @@
                 // case, we will center the border item on the north side of the
                 // parent.
                 newX = parentFigureX - (borderItemSize.width - bounds.width) / 2;
-            } else if (suggestedLocation.x < bounds.getBottomLeft().x) {
-                newX = westX + borderItemSize.width;
+            } else if (suggestedLocation.x < parentFigureX) {
+                newX = parentFigureX;
             } else if (suggestedLocation.x > bounds.getBottomRight().x - borderItemSize.width) {
-                newX = eastX - borderItemSize.width;
+                newX = bounds.getBottomRight().x - borderItemSize.width;
             }
         }
         return new Point(newX, newY);
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/draw2d/ui/figures/FigureUtilities.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/draw2d/ui/figures/FigureUtilities.java
index 4f3aa43..73d2cda 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/draw2d/ui/figures/FigureUtilities.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/draw2d/ui/figures/FigureUtilities.java
@@ -55,36 +55,39 @@
      *         and its children
      */
     public static Point getShiftFromMarginOffset(ResizableCompartmentFigure fig, boolean isConcernedBorderedNode, EditPart editPart) {
-        // ignore shift for creation of bordered node.
+        // Ignore shift for creation of bordered node.
         if (isConcernedBorderedNode) {
             return new Point(0, 0);
         }
-        int leftShift = 0;
-        int topShif = 0;
-        // DnD and Node Creation in a container add extra x
-        // and y values of 5 pixels
-        // If the target EditPart is an
+        Point shift = new Point();
+        // DnD and Node Creation in a container add extra x and y values of 5
+        // pixels. If the target EditPart is an
         // AbstractDNodeContainerCompartmentEditPart, we consider the shift
         // Margins associated to the figure linked with this editPart
         if (editPart instanceof AbstractDNodeContainerCompartmentEditPart) {
-
+            // Current figure border
+            shiftBorderInsets(shift, fig);
+            // Children figures
             Iterator<?> childrenFiguresIterator = fig.getChildren().iterator();
             while (childrenFiguresIterator.hasNext()) {
                 Object next = childrenFiguresIterator.next();
 
                 if (next instanceof IFigure) {
                     IFigure childrenFigure = (IFigure) next;
-                    Border border = childrenFigure.getBorder();
-                    if (border != null) {
-                        Insets insets = border.getInsets(childrenFigure);
-                        if (insets != null) {
-                            leftShift += insets.left;
-                            topShif += insets.top;
-                        }
-                    }
+                    shiftBorderInsets(shift, childrenFigure);
                 }
             }
         }
-        return new Point(leftShift, topShif);
+        return shift;
+    }
+
+    private static void shiftBorderInsets(Point shift, IFigure figure) {
+        Border border = figure.getBorder();
+        if (border != null) {
+            Insets insets = border.getInsets(figure);
+            if (insets != null) {
+                shift.translate(insets.left, insets.top);
+            }
+        }
     }
 }
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/locator/DBorderItemLocator.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/locator/DBorderItemLocator.java
index f63377c..2b09964 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/locator/DBorderItemLocator.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/locator/DBorderItemLocator.java
@@ -565,19 +565,19 @@
             if (suggestedLocation.x != westX) {
                 newX = westX;
             }
-            if (suggestedLocation.y < bounds.getTopLeft().y) {
-                newY = northY + borderItemSize.height;
+            if (suggestedLocation.y < parentFigureY) {
+                newY = parentFigureY;
             } else if (suggestedLocation.y > bounds.getBottomLeft().y - borderItemSize.height) {
-                newY = southY - borderItemSize.height;
+                newY = bounds.getBottomLeft().y - borderItemSize.height;
             }
         } else if (suggestedSide == PositionConstants.EAST) {
             if (suggestedLocation.x != eastX) {
                 newX = eastX;
             }
-            if (suggestedLocation.y < bounds.getTopLeft().y) {
-                newY = northY + borderItemSize.height;
+            if (suggestedLocation.y < parentFigureY) {
+                newY = parentFigureY;
             } else if (suggestedLocation.y > bounds.getBottomLeft().y - borderItemSize.height) {
-                newY = southY - borderItemSize.height;
+                newY = bounds.getBottomLeft().y - borderItemSize.height;
             }
         } else if (suggestedSide == PositionConstants.SOUTH) {
             if (suggestedLocation.y != southY) {
@@ -588,10 +588,10 @@
                 // case, we will center the border item on the south side of the
                 // parent.
                 newX = parentFigureX - (borderItemSize.width - bounds.width) / 2;
-            } else if (suggestedLocation.x < bounds.getBottomLeft().x) {
-                newX = westX + borderItemSize.width;
+            } else if (suggestedLocation.x < parentFigureX) {
+                newX = parentFigureX;
             } else if (suggestedLocation.x > bounds.getBottomRight().x - borderItemSize.width) {
-                newX = eastX - borderItemSize.width;
+                newX = bounds.getBottomRight().x - borderItemSize.width;
             }
         } else { // NORTH
             if (suggestedLocation.y != northY) {
@@ -602,10 +602,10 @@
                 // case, we will center the border item on the north side of the
                 // parent.
                 newX = parentFigureX - (borderItemSize.width - bounds.width) / 2;
-            } else if (suggestedLocation.x < bounds.getBottomLeft().x) {
-                newX = westX + borderItemSize.width;
+            } else if (suggestedLocation.x < parentFigureX) {
+                newX = parentFigureX;
             } else if (suggestedLocation.x > bounds.getBottomRight().x - borderItemSize.width) {
-                newX = eastX - borderItemSize.width;
+                newX = bounds.getBottomRight().x - borderItemSize.width;
             }
         }
         return new Point(newX, newY);
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/LayoutUtils.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/LayoutUtils.java
index fdbad83..497bc15 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/LayoutUtils.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/LayoutUtils.java
@@ -86,6 +86,11 @@
     public static final Dimension DEFAULT_CONTAINER_DIMENSION = new Dimension(150, 70);
 
     /**
+     * The default container dimension (since 4.0).
+     */
+    public static final Dimension NEW_DEFAULT_CONTAINER_DIMENSION = new Dimension(40, 40);
+
+    /**
      * Default width.
      */
     public static final int DEFAULT_WIDTH = 10;
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/WorkspaceImagePathSelector.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/WorkspaceImagePathSelector.java
index 78af197..2ce63bb 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/WorkspaceImagePathSelector.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/WorkspaceImagePathSelector.java
@@ -93,7 +93,8 @@
                 // In the case of a file, we'll check if its extension is one of
                 // the expected
                 IFile file = (IFile) element;
-                isValid = extensions.contains(file.getFileExtension().toLowerCase());
+                String fileExtension = file.getFileExtension();
+                isValid = fileExtension != null && extensions.contains(fileExtension.toLowerCase());
             } else if (element instanceof IContainer) {
                 // In the case of a container, we'll probe its content to see if
                 // it contains a valid file
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java
index 23d4846..322b83d 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java
@@ -1248,20 +1248,6 @@
     /**
      * {@inheritDoc}
      * 
-     * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor#disposeDocumentProvider()
-     */
-    @Override
-    protected void disposeDocumentProvider() {
-        final IEditingSession sess = getUISession();
-        if (sess != null) {
-            sess.detachEditor(this);
-        }
-        super.disposeDocumentProvider();
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
      * @see org.eclipse.sirius.diagram.part.SiriusDiagramEditor#getAdapter(java.lang.Class)
      */
     @Override
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/NavigateToMenuContribution.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/NavigateToMenuContribution.java
index e82ee39..930522a 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/NavigateToMenuContribution.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/NavigateToMenuContribution.java
@@ -124,7 +124,7 @@
                 final Collection<DRepresentation> otherRepresentations = DialectManager.INSTANCE.getRepresentations(semantic, session);
 
                 for (final DRepresentation representation : otherRepresentations) {
-                    if (!EcoreUtil.equals(designerDiag, representation) && isFromActiveSirius(session, representation)) {
+                    if (!EcoreUtil.equals(designerDiag, representation) && isFromActiveViewpoint(session, representation)) {
                         navigate.add(buildOpenRepresentationAction(session, representation, editpart, transDomain));
                     }
                 }
@@ -136,6 +136,22 @@
     }
 
     /**
+     * Tests whether a representation description belongs to a viewpoint which
+     * is currently active in the session.
+     * 
+     * @param session
+     *            the current session.
+     * @param representationDescription
+     *            the representation description to check.
+     * @return <code>true</code> if the representation description belongs to a
+     *         viewpoint which is currently active in the session.
+     */
+    private boolean isFromActiveViewpoint(final Session session, final RepresentationDescription representationDescription) {
+        final Viewpoint vp = ViewpointRegistry.getInstance().getViewpoint(representationDescription);
+        return vp != null && session.getSelectedViewpoints(false).contains(vp);
+    }
+
+    /**
      * Tests whether a representation belongs to a viewpoint which is currently
      * active in the session.
      * 
@@ -146,10 +162,9 @@
      * @return <code>true</code> if the representation belongs to a viewpoint
      *         which is currently active in the session.
      */
-    private boolean isFromActiveSirius(final Session session, final DRepresentation representation) {
+    private boolean isFromActiveViewpoint(final Session session, final DRepresentation representation) {
         final RepresentationDescription description = DialectManager.INSTANCE.getDescription(representation);
-        final Viewpoint vp = ViewpointRegistry.getInstance().getViewpoint(description);
-        return vp != null && session.getSelectedViewpoints(false).contains(vp);
+        return isFromActiveViewpoint(session, description);
     }
 
     private void buildNavigableRepresentationsMenu(final IMenuManager navigate, final EObject designerObj, final Session session, final EditPart editpart, final TransactionalEditingDomain transDomain) {
@@ -157,6 +172,11 @@
         final Separator createGroup = new Separator(NAVIGATE_REPRESENTATION_GROUP_SEPARATOR);
         navigate.add(createGroup);
         for (RepresentationNavigationDescription navDesc : element.getMapping().getNavigationDescriptions()) {
+            boolean append = true;
+            if (!isFromActiveViewpoint(session, navDesc.getRepresentationDescription())) {
+                append = false;
+            }
+
             final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(element.getTarget());
             Option<DDiagram> diagram = new EObjectQuery(element).getParentDiagram();
             if (diagram.some()) {
@@ -172,16 +192,18 @@
             final InitInterpreterVariablesTask init = new InitInterpreterVariablesTask(variables, interpreter, new EMFCommandFactoryUI());
             init.execute();
 
-            boolean precondition = true;
-            if (!StringUtil.isEmpty(navDesc.getPrecondition())) {
+            final String precondition = navDesc.getPrecondition();
+            if (append && !StringUtil.isEmpty(precondition)) {
+                append = false;
+
                 try {
-                    precondition = interpreter.evaluateBoolean(element.getTarget(), navDesc.getPrecondition());
+                    append = interpreter.evaluateBoolean(element.getTarget(), navDesc.getPrecondition());
                 } catch (final EvaluationException e) {
                     RuntimeLoggerManager.INSTANCE.error(navDesc, ToolPackage.eINSTANCE.getAbstractToolDescription_Precondition(), e);
                 }
             }
 
-            if (precondition) {
+            if (append) {
                 buildOpenRepresentationActions(navigate, interpreter, navDesc, element, session, editpart, transDomain);
             }
 
@@ -194,9 +216,6 @@
         final Collection<EObject> candidates = findCandidates(element, navDesc, interpreter);
         final Collection<DRepresentation> representations = DialectManager.INSTANCE.getRepresentations(navDesc.getRepresentationDescription(), session);
         for (DRepresentation representation : representations) {
-            if (!isFromActiveSirius(session, representation)) {
-                continue;
-            }
             if (representation instanceof DSemanticDecorator && candidates.contains(((DSemanticDecorator) representation).getTarget())) {
                 interpreter.setVariable(navDesc.getRepresentationNameVariable().getName(), representation.getName());
                 String label = new StringBuffer("Open ").append(navDesc.getName()).append(" : ").append(representation.getName()).toString();
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/SubDiagramMenu.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/SubDiagramMenu.java
index dba8d5a..3a4015e 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/SubDiagramMenu.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/SubDiagramMenu.java
@@ -10,8 +10,6 @@
  *******************************************************************************/
 package org.eclipse.sirius.diagram.ui.tools.internal.menu;
 
-import java.util.Iterator;
-
 import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.transaction.TransactionalEditingDomain;
@@ -30,17 +28,10 @@
 import org.eclipse.sirius.common.tools.api.interpreter.EvaluationException;
 import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter;
 import org.eclipse.sirius.common.tools.api.util.StringUtil;
-import org.eclipse.sirius.diagram.DDiagramElementContainer;
-import org.eclipse.sirius.diagram.DEdge;
-import org.eclipse.sirius.diagram.DNode;
-import org.eclipse.sirius.diagram.DNodeListElement;
-import org.eclipse.sirius.diagram.business.api.query.IEdgeMappingQuery;
-import org.eclipse.sirius.diagram.description.EdgeMapping;
-import org.eclipse.sirius.diagram.description.tool.DiagramCreationDescription;
+import org.eclipse.sirius.diagram.DDiagramElement;
 import org.eclipse.sirius.diagram.ui.edit.api.part.ISiriusEditPart;
 import org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditor;
 import org.eclipse.sirius.diagram.ui.tools.internal.actions.CreateRepresentationFromRepresentationCreationDescription;
-import org.eclipse.sirius.ext.base.Option;
 import org.eclipse.sirius.viewpoint.DRepresentationElement;
 import org.eclipse.sirius.viewpoint.SiriusPlugin;
 import org.eclipse.sirius.viewpoint.description.RepresentationDescription;
@@ -94,14 +85,8 @@
                     final IMenuManager navigate = (IMenuManager) menu.find("navigateMenu");
                     final Separator createGroup = new Separator(CREATE_REPRESENTATION_GROUP_SEPARATOR);
                     navigate.add(createGroup);
-                    if (eObj instanceof DNode) {
-                        createDetailsActions((DNode) eObj, navigate, diagrampart.getEditingDomain(), curPart);
-                    } else if (eObj instanceof DNodeListElement) {
-                        createDetailsActions((DNodeListElement) eObj, navigate, diagrampart.getEditingDomain(), curPart);
-                    } else if (eObj instanceof DEdge) {
-                        createDetailsActions((DEdge) eObj, navigate, diagrampart.getEditingDomain(), curPart);
-                    } else if (eObj instanceof DDiagramElementContainer) {
-                        createDetailsActions((DDiagramElementContainer) eObj, navigate, diagrampart.getEditingDomain(), curPart);
+                    if (eObj instanceof DDiagramElement) {
+                        createDetailsActions((DDiagramElement) eObj, navigate, diagrampart.getEditingDomain(), curPart);
                     }
                 } else {
                     // no focused edit part
@@ -111,138 +96,39 @@
 
     }
 
-    private void createDetailsActions(final DDiagramElementContainer container, final IMenuManager navigate, final TransactionalEditingDomain editingDomain, final IGraphicalEditPart curPart) {
-        if (container.getActualMapping() != null) {
-            final Iterator<RepresentationCreationDescription> it = container.getActualMapping().getDetailDescriptions().iterator();
-            while (it.hasNext()) {
-                final RepresentationCreationDescription desc = it.next();
-                final String precondition = desc.getPrecondition();
-                boolean append = true;
-                final EList<EObject> semanticElements = container.getSemanticElements();
-                if (semanticElements != null && !semanticElements.isEmpty()) {
-                    final Session session = SessionManager.INSTANCE.getSession(semanticElements.get(0));
-                    if (!isFromActiveSirius(session, desc.getRepresentationDescription())) {
-                        append = false;
-                    }
-                }
-                if (precondition != null && !StringUtil.isEmpty(precondition.trim())) {
-                    append = false;
-                    final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(container);
-                    try {
-                        append = interpreter.evaluateBoolean(container.getTarget(), precondition);
-                    } catch (final EvaluationException e) {
-                        // do nothing
-                    }
-                }
-                if (append) {
-                    navigate.appendToGroup(CREATE_REPRESENTATION_GROUP_SEPARATOR, new CreateRepresentationFromRepresentationCreationDescription(desc, container, editingDomain, curPart));
-                }
-            }
-        }
-
-    }
-
-    private void createDetailsActions(final DNode viewNode, final IMenuManager navigate, final TransactionalEditingDomain editingDomain, final IGraphicalEditPart curPart) {
-        if (viewNode.getActualMapping() != null) {
-            final Iterator<RepresentationCreationDescription> it = viewNode.getActualMapping().getDetailDescriptions().iterator();
-            while (it.hasNext()) {
-                final RepresentationCreationDescription repCreation = it.next();
-                final RepresentationCreationDescription desc = repCreation;
-                final String precondition = desc.getPrecondition();
-                boolean append = true;
-                final EList<EObject> semanticElements = viewNode.getSemanticElements();
-                if (semanticElements != null && !semanticElements.isEmpty()) {
-                    final Session session = SessionManager.INSTANCE.getSession(semanticElements.get(0));
-                    if (!isFromActiveSirius(session, desc.getRepresentationDescription())) {
-                        append = false;
-                    }
-                }
-                if (precondition != null && !StringUtil.isEmpty(precondition.trim())) {
-                    append = false;
-                    final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(viewNode);
-                    try {
-                        append = interpreter.evaluateBoolean(viewNode.getTarget(), precondition);
-                    } catch (final EvaluationException e) {
-                        // do nothing
-                    }
-                }
-                if (append) {
-                    navigate.appendToGroup(CREATE_REPRESENTATION_GROUP_SEPARATOR, new CreateRepresentationFromRepresentationCreationDescription(desc, viewNode, editingDomain, curPart));
-                }
-            }
-
-        }
-    }
-
-    private void createDetailsActions(final DNodeListElement viewNodeListElement, final IMenuManager navigate, final TransactionalEditingDomain editingDomain, final IGraphicalEditPart curPart) {
-        if (viewNodeListElement.getActualMapping() != null) {
-            final Iterator<RepresentationCreationDescription> it = viewNodeListElement.getActualMapping().getDetailDescriptions().iterator();
-            while (it.hasNext()) {
-                final RepresentationCreationDescription desc = it.next();
-                final String precondition = desc.getPrecondition();
-                boolean append = true;
-                final EList<EObject> semanticElements = viewNodeListElement.getSemanticElements();
-                if (semanticElements != null && !semanticElements.isEmpty()) {
-                    final Session session = SessionManager.INSTANCE.getSession(semanticElements.get(0));
-                    if (!isFromActiveSirius(session, desc.getRepresentationDescription())) {
-                        append = false;
-                    }
-                }
-                if (precondition != null && !StringUtil.isEmpty(precondition.trim())) {
-                    append = false;
-                    final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(viewNodeListElement);
-                    try {
-                        append = interpreter.evaluateBoolean(viewNodeListElement.getTarget(), precondition);
-                    } catch (final EvaluationException e) {
-                        // do nothing
-                    }
-                }
-                if (append) {
-                    navigate.appendToGroup(CREATE_REPRESENTATION_GROUP_SEPARATOR, new CreateRepresentationFromRepresentationCreationDescription(desc, viewNodeListElement, editingDomain, curPart));
-                }
-            }
-
-        }
-    }
-
-    private boolean isFromActiveSirius(final Session session, final RepresentationDescription description) {
+    private boolean isFromActiveViewpoint(final Session session, final RepresentationDescription description) {
         final Viewpoint vp = ViewpointRegistry.getInstance().getViewpoint(description);
         return vp != null && session.getSelectedViewpoints(false).contains(vp);
     }
 
-    private void createDetailsActions(final DEdge viewedge, final IMenuManager navigate, final TransactionalEditingDomain editingDomain, final IGraphicalEditPart curPart) {
-        Option<EdgeMapping> edgeMapping = new IEdgeMappingQuery(viewedge.getActualMapping()).getEdgeMapping();
-        if (edgeMapping.some()) {
-            final Iterator<RepresentationCreationDescription> it = edgeMapping.get().getDetailDescriptions().iterator();
-            while (it.hasNext()) {
-                final RepresentationCreationDescription repCreation = it.next();
-                if (repCreation instanceof DiagramCreationDescription) {
-                    final DiagramCreationDescription desc = (DiagramCreationDescription) repCreation;
-                    final String precondition = desc.getPrecondition();
+    private void createDetailsActions(final DDiagramElement dde, final IMenuManager navigate, final TransactionalEditingDomain editingDomain, final IGraphicalEditPart curPart) {
+        if (dde.getMapping() != null) {
+            EObject sessionFinder = null;
+            final EList<EObject> semanticElements = dde.getSemanticElements();
+            if (semanticElements != null && !semanticElements.isEmpty()) {
+                sessionFinder = semanticElements.get(0);
+            } else if (dde.getTarget() != null) {
+                sessionFinder = dde.getTarget();
+            }
+            final Session session = sessionFinder != null ? SessionManager.INSTANCE.getSession(sessionFinder) : null;
+            if (session != null) {
+                for (RepresentationCreationDescription desc : dde.getMapping().getDetailDescriptions()) {
                     boolean append = true;
-                    final EList<EObject> semanticElements = viewedge.getSemanticElements();
-                    if (semanticElements != null && !semanticElements.isEmpty()) {
-                        final Session session = SessionManager.INSTANCE.getSession(semanticElements.get(0));
-                        if (!isFromActiveSirius(session, desc.getRepresentationDescription())) {
-                            append = false;
-                        }
-                    } else if (viewedge.getTarget() != null) {
-                        final Session session = SessionManager.INSTANCE.getSession(viewedge.getTarget());
-                        if (!isFromActiveSirius(session, desc.getRepresentationDescription())) {
-                            append = false;
-                        }
-                    }
-                    if (precondition != null && !StringUtil.isEmpty(precondition.trim())) {
+                    if (!isFromActiveViewpoint(session, desc.getRepresentationDescription())) {
                         append = false;
-                        final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(viewedge);
+                    }
+                    final String precondition = desc.getPrecondition();
+                    if (append && !StringUtil.isEmpty(precondition)) {
+                        append = false;
+                        final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(dde);
                         try {
-                            append = interpreter.evaluateBoolean(viewedge.getTarget(), precondition);
+                            append = interpreter.evaluateBoolean(dde.getTarget(), precondition);
                         } catch (final EvaluationException e) {
                             // do nothing
                         }
                     }
                     if (append) {
-                        navigate.appendToGroup(CREATE_REPRESENTATION_GROUP_SEPARATOR, new CreateRepresentationFromRepresentationCreationDescription(desc, viewedge, editingDomain, curPart));
+                        navigate.appendToGroup(CREATE_REPRESENTATION_GROUP_SEPARATOR, new CreateRepresentationFromRepresentationCreationDescription(desc, dde, editingDomain, curPart));
                     }
                 }
             }
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/ConnectionCreationTool.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/ConnectionCreationTool.java
index b1a5219..1d84b46 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/ConnectionCreationTool.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/ConnectionCreationTool.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009, 2009 THALES GLOBAL SERVICES.
+ * Copyright (c) 2009, 2014 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
@@ -10,7 +10,11 @@
  *******************************************************************************/
 package org.eclipse.sirius.diagram.ui.tools.internal.palette;
 
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.PrecisionPoint;
+import org.eclipse.gef.SnapToHelper;
 import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.CreateConnectionRequest;
 import org.eclipse.gef.requests.CreationFactory;
 import org.eclipse.swt.graphics.Cursor;
 
@@ -85,4 +89,24 @@
         return super.calculateCursor();
     }
 
+    /**
+     * Overridden so that the snap to grid or snap to geometry is considered for
+     * the creation.
+     */
+    @Override
+    protected void updateTargetRequest() {
+        super.updateTargetRequest();
+        if (!getCurrentInput().isAltKeyDown()) {
+            if (getTargetEditPart() != null) {
+                SnapToHelper helper = (SnapToHelper) getTargetEditPart().getAdapter(SnapToHelper.class);
+                if (helper != null) {
+                    CreateConnectionRequest req = (CreateConnectionRequest) getTargetRequest();
+                    PrecisionPoint preciseLocation = new PrecisionPoint(getLocation());
+                    PrecisionPoint result = new PrecisionPoint(getLocation());
+                    helper.snapPoint(req, PositionConstants.HORIZONTAL | PositionConstants.VERTICAL, preciseLocation, result);
+                    req.setLocation(result.getCopy());
+                }
+            }
+        }
+    }
 }
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/CreationTool.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/CreationTool.java
index 51a964f..fd815b9 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/CreationTool.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/CreationTool.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009, 2009 THALES GLOBAL SERVICES.
+ * Copyright (c) 2009, 2014 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
@@ -10,7 +10,11 @@
  *******************************************************************************/
 package org.eclipse.sirius.diagram.ui.tools.internal.palette;
 
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.PrecisionPoint;
 import org.eclipse.gef.Request;
+import org.eclipse.gef.SnapToHelper;
+import org.eclipse.gef.requests.CreateRequest;
 import org.eclipse.gef.requests.CreationFactory;
 
 /**
@@ -60,4 +64,27 @@
             reactivate();
         }
     }
+
+    /**
+     * Overridden so that the snap to grid or snap to geometry is considered for
+     * the creation.
+     */
+    @Override
+    protected void updateTargetRequest() {
+        super.updateTargetRequest();
+        if (!isInState(STATE_DRAG_IN_PROGRESS)) {
+            if (!getCurrentInput().isAltKeyDown()) {
+                if (getTargetEditPart() != null) {
+                    SnapToHelper helper = (SnapToHelper) getTargetEditPart().getAdapter(SnapToHelper.class);
+                    if (helper != null) {
+                        PrecisionPoint preciseLocation = new PrecisionPoint(getLocation());
+                        PrecisionPoint result = new PrecisionPoint(getLocation());
+                        CreateRequest req = getCreateRequest();
+                        helper.snapPoint(req, PositionConstants.HORIZONTAL | PositionConstants.VERTICAL, preciseLocation, result);
+                        req.setLocation(result.getCopy());
+                    }
+                }
+            }
+        }
+    }
 }
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/providers/decorators/SubDiagramDecorator.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/providers/decorators/SubDiagramDecorator.java
index 4767235..c7b6990 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/providers/decorators/SubDiagramDecorator.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/providers/decorators/SubDiagramDecorator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2012, 2014 THALES GLOBAL SERVICES and others.
  * 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
@@ -22,6 +22,7 @@
 import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
 import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
 import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.sirius.business.api.componentization.ViewpointRegistry;
 import org.eclipse.sirius.business.api.dialect.DialectManager;
 import org.eclipse.sirius.business.api.logger.RuntimeLoggerManager;
 import org.eclipse.sirius.business.api.query.DRepresentationElementQuery;
@@ -39,6 +40,8 @@
 import org.eclipse.sirius.viewpoint.DRepresentationElement;
 import org.eclipse.sirius.viewpoint.DSemanticDecorator;
 import org.eclipse.sirius.viewpoint.SiriusPlugin;
+import org.eclipse.sirius.viewpoint.description.RepresentationDescription;
+import org.eclipse.sirius.viewpoint.description.Viewpoint;
 import org.eclipse.sirius.viewpoint.description.tool.RepresentationNavigationDescription;
 import org.eclipse.sirius.viewpoint.description.tool.ToolPackage;
 import org.eclipse.swt.graphics.Image;
@@ -159,32 +162,38 @@
             IInterpreter interpreter = session.getInterpreter();
 
             for (RepresentationNavigationDescription navDesc : element.getMapping().getNavigationDescriptions()) {
+                if (isFromActiveViewpoint(navDesc.getRepresentationDescription())) {
+                    interpreter.setVariable(navDesc.getContainerVariable().getName(), target);
+                    interpreter.setVariable(navDesc.getContainerViewVariable().getName(), element);
 
-                interpreter.setVariable(navDesc.getContainerVariable().getName(), target);
-                interpreter.setVariable(navDesc.getContainerViewVariable().getName(), element);
-
-                boolean precondition = true;
-                if (!StringUtil.isEmpty(navDesc.getPrecondition())) {
-                    try {
-                        precondition = interpreter.evaluateBoolean(target, navDesc.getPrecondition());
-                    } catch (EvaluationException e) {
-                        RuntimeLoggerManager.INSTANCE.error(navDesc, ToolPackage.eINSTANCE.getAbstractToolDescription_Precondition(), e);
+                    boolean precondition = true;
+                    if (!StringUtil.isEmpty(navDesc.getPrecondition())) {
+                        try {
+                            precondition = interpreter.evaluateBoolean(target, navDesc.getPrecondition());
+                        } catch (EvaluationException e) {
+                            RuntimeLoggerManager.INSTANCE.error(navDesc, ToolPackage.eINSTANCE.getAbstractToolDescription_Precondition(), e);
+                        }
                     }
-                }
 
-                if (precondition) {
-                    if (checkRepresentationNavigationDescription(interpreter, navDesc, element)) {
-                        return true;
+                    if (precondition) {
+                        if (checkRepresentationNavigationDescription(interpreter, navDesc, element)) {
+                            return true;
+                        }
                     }
-                }
 
-                interpreter.unSetVariable(navDesc.getContainerVariable().getName());
-                interpreter.unSetVariable(navDesc.getContainerViewVariable().getName());
+                    interpreter.unSetVariable(navDesc.getContainerVariable().getName());
+                    interpreter.unSetVariable(navDesc.getContainerViewVariable().getName());
+                }
             }
         }
         return false;
     }
 
+    private boolean isFromActiveViewpoint(final RepresentationDescription description) {
+        final Viewpoint vp = ViewpointRegistry.getInstance().getViewpoint(description);
+        return vp != null && session.getSelectedViewpoints(false).contains(vp);
+    }
+
     private boolean checkRepresentationNavigationDescription(IInterpreter interpreter, RepresentationNavigationDescription navDesc, DRepresentationElement element) {
         Collection<EObject> candidates = null;
         if (!StringUtil.isEmpty(navDesc.getBrowseExpression())) {
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/ViewportUtilities.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/ViewportUtilities.java
deleted file mode 100644
index efad18b..0000000
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/ViewportUtilities.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
- * 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:
- *     Research Group Software Construction,
- *     RWTH Aachen University, Germany - initial API and implementation
- */
-package org.eclipse.sirius.diagram.ui.tools.internal.ui;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Viewport;
-
-//CHECKSTYLE:OFF Class cloned because it is not available for 3.5.
-/**
- * Utility class to support working with {@link Viewport}s.
- * 
- * @author Philip Ritzkopf
- * @author Alexander Nyssen
- * 
- * @since 0.9.0
- */
-public final class ViewportUtilities {
-
-    private ViewportUtilities() {
-        // provides only static utility functions and should not be accessed in
-        // any other way than static.
-    }
-
-    /**
-     * Returns all enclosing {@link Viewport}s for a given {@link IFigure},
-     * beginning with its direct enclosing {@link Viewport} up the root
-     * {@link Viewport} in the figure's parent hierarchy.
-     * 
-     * @param figure
-     * @return A list of {@link Viewport}s representing the figure's enclosing
-     *         {@link Viewport} path, where the nearest enclosing
-     *         {@link Viewport} as the first element and the root
-     *         {@link Viewport} as the last element. In case there is no
-     *         enclosing {@link Viewport}, an empty list is returned.
-     */
-    public static List getEnclosingViewportsPath(IFigure figure) {
-        Viewport nearestEnclosingViewport = getNearestEnclosingViewport(figure);
-        if (nearestEnclosingViewport == null) {
-            return new ArrayList();
-        }
-        Viewport rootViewport = getRootViewport(figure);
-        return getViewportsPath(nearestEnclosingViewport, rootViewport, true);
-    }
-
-    /**
-     * Returns a list containing the provided leaf {@link Viewport} as the first
-     * element, and all its enclosing {@link Viewport}s up to the root
-     * {@link Viewport}, where the root {@link Viewport} forms the last element
-     * of the list.
-     * 
-     * @param leafViewport
-     *            The {@link Viewport}, whose parent hierarchy is processed.
-     * @param rootViewport
-     *            an ancestor of the given leafViewport, which marks the end
-     *            point of the hierarchy to be processed.
-     * @return A list of {@link Viewport}s containing the leaf {@link Viewport}
-     *         as the first element, the root {@link Viewport} as the last and
-     *         in between all enclosing {@link Viewport}s of the leaf
-     *         {@link Viewport} up to the root. Returns an empty list in case
-     *         leaf or root {@link Viewport} are null or in case the root
-     *         viewport is not an ancestor of the leaf {@link Viewport}.
-     */
-    public static List getViewportsPath(final Viewport leafViewport, final Viewport rootViewport) {
-        return getViewportsPath(leafViewport, rootViewport, true);
-    }
-
-    /**
-     * Returns a list containing the provided leaf {@link Viewport} as the first
-     * element, and all its enclosing {@link Viewport}s up to the root
-     * {@link Viewport}. The root {@link Viewport} forms the last element of the
-     * list, in case includeRootViewport is set to true, otherwise the viewport
-     * directly nested below the root viewport will be the last in the list.
-     * 
-     * @param leafViewport
-     *            The {@link Viewport}, whose parent hierarchy is processed.
-     * @param rootViewport
-     *            an ancestor of the given leafViewport, which marks the end
-     *            point of the hierarchy to be processed.
-     * @param includeRootViewport
-     *            whether the provided rootViewport should be included in the
-     *            list of returned viewports (as the last one) or not.
-     * @return A list of {@link Viewport}s containing the leaf {@link Viewport}
-     *         as the first element, the root {@link Viewport} as the last and
-     *         in between all enclosing {@link Viewport}s of the leaf
-     *         {@link Viewport} up to the root. Returns an empty list in case
-     *         leaf or root {@link Viewport} are null or in case the root
-     *         viewport is not an ancestor of the leaf {@link Viewport}.
-     */
-    public static List getViewportsPath(final Viewport leafViewport, final Viewport rootViewport, boolean includeRootViewport) {
-        if (leafViewport == null || rootViewport == null) {
-            return Collections.EMPTY_LIST;
-        }
-
-        // search all enclosing viewports of leaf viewport up to root viewport
-        // (or until no enclosing viewport can be found)
-        List nestedViewports = new ArrayList();
-        Viewport currentViewport = leafViewport;
-        do {
-            nestedViewports.add(currentViewport);
-            currentViewport = ViewportUtilities.getNearestEnclosingViewport(currentViewport);
-        } while (currentViewport != null && currentViewport != rootViewport);
-
-        // check if root viewport is an ancestor of the given leaf viewport
-        if (currentViewport != null) {
-            if (includeRootViewport) {
-                nestedViewports.add(currentViewport);
-            }
-            return nestedViewports;
-        }
-        return Collections.EMPTY_LIST;
-    }
-
-    /**
-     * Returns the nearest common enclosing {@link Viewport} for two given
-     * {@link org.eclipse.draw2d.Figure}s.
-     * 
-     * @param firstFigure
-     * @param secondFigure
-     * @return The nearest common {@link Viewport} of the two given figures, or
-     *         null if no common enclosing {@link Viewport} could be found.
-     */
-    public static Viewport getNearestCommonViewport(IFigure firstFigure, IFigure secondFigure) {
-        return getNearestViewport(FigureUtilities.findCommonAncestor(firstFigure, secondFigure));
-    }
-
-    /**
-     * Returns the upper most enclosing {@link Viewport} for the given
-     * {@link IFigure}.
-     * 
-     * @param figure
-     * @return The upper most enclosing {@link Viewport} or null if there is no
-     *         enclosing {@link Viewport} for the given {@link IFigure},
-     */
-    public static Viewport getRootViewport(final IFigure figure) {
-        Viewport currentViewport = getNearestViewport(figure);
-        while (getNearestEnclosingViewport(currentViewport) != null) {
-            currentViewport = getNearestEnclosingViewport(currentViewport);
-        }
-        return currentViewport;
-    }
-
-    /**
-     * Returns the given figure in case it is a {@link Viewport} itself,
-     * otherwise its nearest enclosing {@link Viewport}.
-     * 
-     * @param figure
-     * @return The given figure in case it is a {@link Viewport} itself,
-     *         otherwise the nearest enclosing {@link Viewport} or null if there
-     *         is no nearest enclosing {@link Viewport}.
-     */
-    public static Viewport getNearestViewport(final IFigure figure) {
-        if (figure == null) {
-            return null;
-        }
-        if (figure instanceof Viewport) {
-            return (Viewport) figure;
-        } else {
-            return getNearestEnclosingViewport(figure);
-        }
-    }
-
-    /**
-     * Returns the nearest enclosing {@link Viewport} of a given {@link IFigure}
-     * by walking up the figure's hierarchy.
-     * 
-     * @param figure
-     * @return The nearest enclosing {@link Viewport} of the given figure, or
-     *         null if none could be found.
-     */
-    public static Viewport getNearestEnclosingViewport(final IFigure figure) {
-        if (figure == null) {
-            return null;
-        }
-        Viewport viewport = null;
-        IFigure currentFigure = figure;
-        while (currentFigure.getParent() != null) {
-            if (currentFigure.getParent() instanceof Viewport) {
-                viewport = (Viewport) currentFigure.getParent();
-                break;
-            }
-            currentFigure = currentFigure.getParent();
-        }
-        return viewport;
-    }
-}
-// CHECKSTYLE:ON
diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/display/VisibilityPropagatorAdapter.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/display/VisibilityPropagatorAdapter.java
index 8962f75..29e77ab 100644
--- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/display/VisibilityPropagatorAdapter.java
+++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/display/VisibilityPropagatorAdapter.java
@@ -202,7 +202,7 @@
      * Dispose the current content adapter: remove it from the diagram.
      */
     public void dispose() {
-        if (diagram != null) {
+        if (diagram != null && diagram.eResource() != null) {
             diagram.eAdapters().remove(this);
         }
         diagram = null;
diff --git a/plugins/org.eclipse.sirius.doc/build-doc.xml b/plugins/org.eclipse.sirius.doc/build-doc.xml
index 5ffd575..81ebb04 100644
--- a/plugins/org.eclipse.sirius.doc/build-doc.xml
+++ b/plugins/org.eclipse.sirius.doc/build-doc.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  Copyright (c) 2007, 2013 THALES GLOBAL SERVICES
+  Copyright (c) 2007, 2014 THALES GLOBAL SERVICES and others
   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
@@ -21,22 +21,28 @@
 	<taskdef classpathref="wikitext.classpath" resource="org/eclipse/mylyn/wikitext/core/util/anttask/tasks.properties" />
 
 	<target name="generate-html" description="Generate Eclipse help from textile source">
-		<wikitext-to-html markupLanguage="Textile" formatOutput="true">
+		<wikitext-to-html markupLanguage="Textile" formatOutput="true" failonvalidationerror="true" failonvalidationwarning="true" validate="true">
 			<fileset dir="${basedir}">
-				<include name="doc/**/*.textile" />
+				<include name="doc/*.textile" />
 			</fileset>
-			<stylesheet url="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css" />
-			<stylesheet url="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css" />
+			<stylesheet url="resources/bootstrap.css" />
+			<stylesheet url="resources/custom.css" />
 		</wikitext-to-html>
-	</target>
-	
-	<target name="generate-site-html" description="Generate Eclipse help from textile source">
-		<wikitext-to-html markupLanguage="Textile" formatOutput="true">
+
+		<wikitext-to-html markupLanguage="Textile" formatOutput="true" failonvalidationerror="true" failonvalidationwarning="true" validate="true">
 			<fileset dir="${basedir}">
-				<include name="doc/**/*.textile" />
+				<include name="doc/*/*.textile" />
 			</fileset>
-			<stylesheet url="/sirius/doc/resources/bootstrap.css" />
-			<stylesheet url="/sirius/doc/resources/custom.css" />
+			<stylesheet url="../resources/bootstrap.css" />
+			<stylesheet url="../resources/custom.css" />
+		</wikitext-to-html>
+
+		<wikitext-to-html markupLanguage="Textile" formatOutput="true" failonvalidationerror="true" failonvalidationwarning="true" validate="true">
+			<fileset dir="${basedir}">
+				<include name="doc/*/*/*.textile" />
+			</fileset>
+			<stylesheet url="../../resources/bootstrap.css" />
+			<stylesheet url="../../resources/custom.css" />
 		</wikitext-to-html>
 	</target>
 </project>
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html
index 722ffe7..2d6fb48 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html
+++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Release Notes</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="ReleaseNotesforSirius">Release Notes for Sirius</h1>
@@ -13,6 +13,9 @@
 				<a href="#ReleaseNotesforSirius">Release Notes for Sirius</a>
 				<ol style="list-style: disc;">
 					<li>
+						<a href="#sirius2.0.0">Changes in Sirius 2.0.0 (from Sirius 1.0.0)</a>
+					</li>
+					<li>
 						<a href="#sirius1.0.0">Changes in Sirius 1.0.0 (from Sirius 1.0.0M7)</a>
 					</li>
 					<li>
@@ -34,9 +37,84 @@
 			</li>
 		</ol>
 		<p>This document contains the release notes for all major releases of Sirius.</p>
-		<h2 id="sirius1.0.0">Changes in Sirius 1.0.0 (from Sirius 1.0.0M7)</h2>
+		<h2 id="sirius2.0.0">Changes in Sirius 2.0.0 (from Sirius 1.0.0)</h2>
 		<h3 id="UserVisibleChanges">User-Visible Changes</h3>
 		<ul>
+			<li>It is now possible to select element that intersects the selection rectangle and not that is completely contained by the selection rectangle. This new behavior is enabled when user selects elements from right to left. The normal mode (previous mode) remains when the user selects elements from left to right. </li>
+		</ul>
+		<h3 id="APIChanges">API Changes</h3>
+		<h4 id="Changesinorg.eclipse.sirius.diagram.ui">Changes in 
+			<code>org.eclipse.sirius.diagram.ui</code>
+		</h4>
+		<ul>
+			<li>The method 
+				<code>org.eclipse.sirius.diagram.ui.business.internal.query.DNodeContainerQuery.getDefaultDimension()</code> has been added to compute the default size of a DNodeContainer.
+			</li>
+		</ul>
+		<h4 id="Changesinorg.eclipse.sirius.ext.gmf.runtime">Changes in 
+			<code>org.eclipse.sirius.ext.gmf.runtime</code>
+		</h4>
+		<ul>
+			<li>Several utilities have been added in 
+				<code>org.eclipse.sirius.ext.gmf.runtime.editparts.GraphicalHelper</code>:
+				<ul>
+					<li>
+						<code>applyZoomOnPoint(IGraphicalEditPart, Point)</code>: Apply the current zoom, of the diagram of the 
+						<code>IGraphicalEditPart</code>, to the 
+						<code>Point</code>.
+					</li>
+					<li>
+						<code>getAnchorPoint(IGraphicalEditPart parent, Anchor anchor)</code>: Get the 
+						<code>Point</code> (absolute draw2d coordinates) corresponding to this 
+						<code>Anchor</code>.
+					</li>
+					<li>
+						<code>getAnchorPoint(IGraphicalEditPart parent, IdentityAnchor anchor)</code>: Get the 
+						<code>Point</code> (absolute draw2d coordinates) corresponding to this 
+						<code>IdentityAnchor</code>.
+					</li>
+					<li>
+						<code>getIntersection(Point, Point, IGraphicalEditPart, boolean)</code>: Get intersection between a line between lineOrigin and lineTerminus, and the rectangle bounds of the 
+						<code>IGraphicalEditPart</code>. If there are several intersections, the shortest is returned.
+					</li>
+					<li>
+						<code>getAbsoluteBounds(IGraphicalEditPart)</code>: Get the absolute bounds of this 
+						<code>IGraphicalEditPart</code>.
+					</li>
+					<li>
+						<code>getAbsoluteBoundsIn100Percent(IGraphicalEditPart)</code>: Get the absolute bounds of this 
+						<code>IGraphicalEditPart</code> but adapted according to the current zoom level.
+					</li>
+					<li>
+						<code>isSnapToGridEnabled(EditPart)</code>: Return true if the snapToGrid is enabled for the diagram containing this edit part, false otherwise.
+					</li>
+				</ul>
+			</li>
+		</ul>
+		<h4 id="Changesinorg.eclipse.sirius.tests.swtbot.support">Changes in 
+			<code>org.eclipse.sirius.tests.swtbot.support</code>
+		</h4>
+		<ul>
+			<li>The method 
+				<code>SWTBotSiriusDiagramEditor.setSnapToGrid(boolean)</code> has been added. It allows to disable or enable the snapToGrid option for this editor.
+			</li>
+			<li>The method 
+				<code>SWTBotSiriusDiagramEditor.setSnapToGrid(boolean, double, int)</code> has been added. It allows to disable or enable the snapToGrid option for this editor. In case of activation, you can also set the grid spacing and the ruler units. 
+			</li>
+			<li>The method 
+				<code>SWTBotSiriusDiagramEditor.disableSnapToGrid()</code> has been deprecated, use 
+				<code>SWTBotSiriusDiagramEditor.setSnapToGrid(false)</code> instead.
+			</li>
+			<li>The method 
+				<code>SWTBotSiriusDiagramEditor.adaptLocationToSnap(Point)</code> has been added. It allows to adapt location according to SnapToHelper of the current editor.
+			</li>
+			<li>The method 
+				<code>SWTBotSiriusDiagramEditor.getDiagramEditPart()</code> has been added. It allows to retrieve the diagram edit part of the current editor.
+			</li>
+		</ul>
+		<h2 id="sirius1.0.0">Changes in Sirius 1.0.0 (from Sirius 1.0.0M7)</h2>
+		<h3 id="UserVisibleChanges2">User-Visible Changes</h3>
+		<ul>
 			<li>The ability to print table representations has been disabled for the 1.0.0 release due to an external dependency issue (see 
 				<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=435204">bug #435204</a> for the details).
 			</li>
@@ -55,7 +133,7 @@
 				<em>Layer</em>. The corresponding property sections will be shown only for old VSM with reused elements.
 			</li>
 		</ul>
-		<h3 id="APIChanges">API Changes</h3>
+		<h3 id="APIChanges2">API Changes</h3>
 		<h4 id="Changesinorg.eclipse.sirius">Changes in 
 			<code>org.eclipse.sirius</code>
 		</h4>
@@ -75,7 +153,7 @@
 				<code>computeResourcesToSave()</code> method.
 			</li>
 		</ul>
-		<h4 id="Changesinorg.eclipse.sirius.diagram.ui">Changes in 
+		<h4 id="Changesinorg.eclipse.sirius.diagram.ui2">Changes in 
 			<code>org.eclipse.sirius.diagram.ui</code>
 		</h4>
 		<ul>
@@ -87,7 +165,7 @@
 				<code>org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramListEditPart.createLayoutEditPolicy</code> implementation has been removed.
 			</li>
 		</ul>
-		<h4 id="Changesinorg.eclipse.sirius.diagram.ui2">Changes in 
+		<h4 id="Changesinorg.eclipse.sirius.diagram.ui3">Changes in 
 			<code>org.eclipse.sirius.diagram.ui</code>
 		</h4>
 		<ul>
@@ -113,7 +191,7 @@
 				<em>Time (ms)</em> column, harder to read/sort, and showed wrongly formatted results. 
 			</li>
 		</ul>
-		<h3 id="APIChanges2">API Changes</h3>
+		<h3 id="APIChanges3">API Changes</h3>
 		<h4 id="separationOfDiagramSpecificConcept-step3">Move diagram.ecore in its own plugin</h4>
 		<p>This milestone (Sirius 1.0M7) includes the third, and final, step towards a full separation of the diagram-specific stuff out of the core of Sirius (see 
 			<a href="#separationOfDiagramSpecificConcept-step1">Step1</a> and 
@@ -670,7 +748,7 @@
 			</li>
 		</ul>
 		<h2 id="sirius1.0M6">Changes in Sirius 1.0.0M6 (from Sirius 1.0M5)</h2>
-		<h3 id="APIChanges3">API Changes</h3>
+		<h3 id="APIChanges4">API Changes</h3>
 		<h4 id="tests">High-level API for Automated Tests Using JUnit and SWTBot</h4>
 		<p>Starting from version 1.0.0M6, Sirius includes high-level APIs to help creating automated tests using JUnit and/or SWTBot. These can be used either to test Sirius itself or to test Sirius-based modelers. These APIs are provided by two plug-ins:</p>
 		<ul>
@@ -807,11 +885,11 @@
 			</li>
 		</ul>
 		<h2 id="sirius1.0M5">Changes in Sirius 1.0.0M5 (from Sirius 1.0M4)</h2>
-		<h3 id="UserVisibleChanges2">User-Visible Changes</h3>
+		<h3 id="UserVisibleChanges3">User-Visible Changes</h3>
 		<ul>
 			<li>The table csv export has been improved to handle cropped label. In some specific cases, the cell label is automatically cropped and &#8249;...&#8250; is concatenated to the resulting value. This cropped displayed label was previously exported, now the complete semantic value is exported.</li>
 		</ul>
-		<h3 id="APIChanges4">API Changes</h3>
+		<h3 id="APIChanges5">API Changes</h3>
 		<h4 id="LibraryExtensions">Library Extensions</h4>
 		<p>This milestone (Sirius 1.0M5) introduces several new plug-ins, collectively called &#171;library extensions&#187;. They are all named 
 			<code>org.eclipse.sirius.ext.LIB</code>, where 
@@ -935,11 +1013,11 @@
 			</li>
 		</ul>
 		<h2 id="sirius1.0M4">Changes in Sirius 1.0.0M4 (from Sirius 0.9)</h2>
-		<h3 id="UserVisibleChanges3">User-Visible Changes</h3>
+		<h3 id="UserVisibleChanges4">User-Visible Changes</h3>
 		<ul>
 			<li>The ability to print table representations, which had been disabled for the 0.9 release, has been re-enabled.</li>
 		</ul>
-		<h3 id="APIChanges5">API Changes</h3>
+		<h3 id="APIChanges6">API Changes</h3>
 		<p>Sirius 1.0.0M4 includes a lots of API-breaking changes, as part of a global effort to improve the quality of the Sirius internals. In this milestone in particular, most of the APIs which were marked as deprecated in previous versions of Sirius (and before that of Viewpoint) have been either removed (if a replacement exists) or marked as non-deprecated (if no replacement exists yet).</p>
 		<h4 id="Changesinorg.eclipse.sirius.common2">Changes in 
 			<code>org.eclipse.sirius.common</code>
@@ -1533,7 +1611,7 @@
 				<em>targetView</em>: the target view of the current edge.
 			</li>
 		</ul>
-		<h3 id="UserVisibleChanges4">User-Visible Changes</h3>
+		<h3 id="UserVisibleChanges5">User-Visible Changes</h3>
 		<ul>
 			<li>The ability to print table representations has been disabled for the 0.9 release due to an external dependency issue (see 
 				<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=422223">bug #422223</a> for the details). It should be re-introduced in 1.0.
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
index d5f0292..7410bd3 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
@@ -4,6 +4,37 @@
 
 This document contains the release notes for all major releases of Sirius.
 
+h2(#sirius2.0.0). Changes in Sirius 2.0.0 (from Sirius 1.0.0)
+
+h3. User-Visible Changes
+
+* It is now possible to select element that intersects the selection rectangle and not that is completely contained by the selection rectangle. This new behavior is enabled when user selects elements from right to left. The normal mode (previous mode) remains when the user selects elements from left to right. 
+
+h3. API Changes
+
+h4. Changes in @org.eclipse.sirius.diagram.ui@
+
+* The method @org.eclipse.sirius.diagram.ui.business.internal.query.DNodeContainerQuery.getDefaultDimension()@ has been added to compute the default size of a DNodeContainer.
+
+h4. Changes in @org.eclipse.sirius.ext.gmf.runtime@
+
+* Several utilities have been added in @org.eclipse.sirius.ext.gmf.runtime.editparts.GraphicalHelper@:
+** @applyZoomOnPoint(IGraphicalEditPart, Point)@: Apply the current zoom, of the diagram of the @IGraphicalEditPart@, to the @Point@.
+** @getAnchorPoint(IGraphicalEditPart parent, Anchor anchor)@: Get the @Point@ (absolute draw2d coordinates) corresponding to this @Anchor@.
+** @getAnchorPoint(IGraphicalEditPart parent, IdentityAnchor anchor)@: Get the @Point@ (absolute draw2d coordinates) corresponding to this @IdentityAnchor@.
+** @getIntersection(Point, Point, IGraphicalEditPart, boolean)@: Get intersection between a line between lineOrigin and lineTerminus, and the rectangle bounds of the @IGraphicalEditPart@. If there are several intersections, the shortest is returned.
+** @getAbsoluteBounds(IGraphicalEditPart)@: Get the absolute bounds of this @IGraphicalEditPart@.
+** @getAbsoluteBoundsIn100Percent(IGraphicalEditPart)@: Get the absolute bounds of this @IGraphicalEditPart@ but adapted according to the current zoom level.
+** @isSnapToGridEnabled(EditPart)@: Return true if the snapToGrid is enabled for the diagram containing this edit part, false otherwise.
+
+h4. Changes in @org.eclipse.sirius.tests.swtbot.support@
+
+* The method @SWTBotSiriusDiagramEditor.setSnapToGrid(boolean)@ has been added. It allows to disable or enable the snapToGrid option for this editor.
+* The method @SWTBotSiriusDiagramEditor.setSnapToGrid(boolean, double, int)@ has been added. It allows to disable or enable the snapToGrid option for this editor. In case of activation, you can also set the grid spacing and the ruler units. 
+* The method @SWTBotSiriusDiagramEditor.disableSnapToGrid()@ has been deprecated, use @SWTBotSiriusDiagramEditor.setSnapToGrid(false)@ instead.
+* The method @SWTBotSiriusDiagramEditor.adaptLocationToSnap(Point)@ has been added. It allows to adapt location according to SnapToHelper of the current editor.
+* The method @SWTBotSiriusDiagramEditor.getDiagramEditPart()@ has been added. It allows to retrieve the diagram edit part of the current editor.
+
 h2(#sirius1.0.0). Changes in Sirius 1.0.0 (from Sirius 1.0.0M7)
 
 h3. User-Visible Changes
diff --git a/plugins/org.eclipse.sirius.doc/doc/index.html b/plugins/org.eclipse.sirius.doc/doc/index.html
index d5e6890..8abb86f 100644
--- a/plugins/org.eclipse.sirius.doc/doc/index.html
+++ b/plugins/org.eclipse.sirius.doc/doc/index.html
@@ -4,8 +4,8 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     <title>Eclipse Sirius Documentation</title>
-    <link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-    <link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+    <link type="text/css" rel="stylesheet" href="resources/bootstrap.css"/>
+    <link type="text/css" rel="stylesheet" href="resources/custom.css"/>
   </head>
   <body>
 
@@ -87,7 +87,7 @@
     </div>
 
     <div class="col2 right">
-      <img src="/help/topic/org.eclipse.sirius.doc/doc/resources/images/screenshot.png" alt="The easiest way to get your own modeling tool" />  
+      <img src="resources/images/screenshot.png" alt="The easiest way to get your own modeling tool" />  
     </div>
 
     <div class="clear"></div>
diff --git a/plugins/org.eclipse.sirius.doc/doc/release_notes_vp.html b/plugins/org.eclipse.sirius.doc/doc/release_notes_vp.html
index 1f45658..3c2fba8 100644
--- a/plugins/org.eclipse.sirius.doc/doc/release_notes_vp.html
+++ b/plugins/org.eclipse.sirius.doc/doc/release_notes_vp.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>release_notes_vp</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="ReleaseNotesforViewpoint">Release Notes for Viewpoint</h1>
diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/Sirius Specifier Manual.html b/plugins/org.eclipse.sirius.doc/doc/specifier/Sirius Specifier Manual.html
index 463fe27..5feda41 100644
--- a/plugins/org.eclipse.sirius.doc/doc/specifier/Sirius Specifier Manual.html
+++ b/plugins/org.eclipse.sirius.doc/doc/specifier/Sirius Specifier Manual.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Sirius Specifier Manual</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="../resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="../resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="SiriusSpecifierManual">Sirius Specifier Manual</h1>
diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/diagrams/Diagrams.html b/plugins/org.eclipse.sirius.doc/doc/specifier/diagrams/Diagrams.html
index f7533b6..bba2f3f 100644
--- a/plugins/org.eclipse.sirius.doc/doc/specifier/diagrams/Diagrams.html
+++ b/plugins/org.eclipse.sirius.doc/doc/specifier/diagrams/Diagrams.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Diagrams</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="SpecifyingDiagramEditors">Specifying Diagram Editors</h1>
diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Colors.html b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Colors.html
index 3d76c1b..5cf62b6 100644
--- a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Colors.html
+++ b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Colors.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Colors</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="DefiningColorPalettes">Defining Color Palettes</h1>
diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Model_Operations.html b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Model_Operations.html
index 483c366..b1d0998 100644
--- a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Model_Operations.html
+++ b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Model_Operations.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Model_Operations</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="SpecifyingModelOperations">Specifying Model Operations</h1>
diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Specifying_Viewpoints.html b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Specifying_Viewpoints.html
index 5ee96a6..53cc7a1 100644
--- a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Specifying_Viewpoints.html
+++ b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Specifying_Viewpoints.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Specifying_Viewpoints</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="SpecifyingViewpoints">Specifying Viewpoints</h1>
diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Writing_Queries.html b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Writing_Queries.html
index 2fd44b9..bcb3d78 100644
--- a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Writing_Queries.html
+++ b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Writing_Queries.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Writing_Queries</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="WritingQueriesandInterpretedExpressions">Writing Queries and Interpreted Expressions</h1>
diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/sequences/Sequence Diagrams.html b/plugins/org.eclipse.sirius.doc/doc/specifier/sequences/Sequence Diagrams.html
index 2ff1f51..747e0a8 100644
--- a/plugins/org.eclipse.sirius.doc/doc/specifier/sequences/Sequence Diagrams.html
+++ b/plugins/org.eclipse.sirius.doc/doc/specifier/sequences/Sequence Diagrams.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Sequence Diagrams</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="SpecifyingSequenceDiagramEditors">Specifying Sequence Diagram Editors</h1>
diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/tables/Tables.html b/plugins/org.eclipse.sirius.doc/doc/specifier/tables/Tables.html
index f44c970..793054e 100644
--- a/plugins/org.eclipse.sirius.doc/doc/specifier/tables/Tables.html
+++ b/plugins/org.eclipse.sirius.doc/doc/specifier/tables/Tables.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Tables</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="SpecifyingTableEditors">Specifying Table Editors</h1>
diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/trees/Trees.html b/plugins/org.eclipse.sirius.doc/doc/specifier/trees/Trees.html
index ebf2ba6..9ffdad9 100644
--- a/plugins/org.eclipse.sirius.doc/doc/specifier/trees/Trees.html
+++ b/plugins/org.eclipse.sirius.doc/doc/specifier/trees/Trees.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Trees</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="SpecifyingTreeEditors">Specifying Tree Editors</h1>
diff --git a/plugins/org.eclipse.sirius.doc/doc/user/Sirius User Manual.html b/plugins/org.eclipse.sirius.doc/doc/user/Sirius User Manual.html
index 98684c7..ac9ab40 100644
--- a/plugins/org.eclipse.sirius.doc/doc/user/Sirius User Manual.html
+++ b/plugins/org.eclipse.sirius.doc/doc/user/Sirius User Manual.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Sirius User Manual</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="../resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="../resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="SiriusUserManual">Sirius User Manual</h1>
diff --git a/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.html b/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.html
index 07ca10b..24e256b 100644
--- a/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.html
+++ b/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Diagrams</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="DiagramEditors">Diagram Editors</h1>
@@ -669,10 +669,15 @@
 		</p>
 		<p>
 			<i>Selection</i>. The 
-			<em>selection</em> tool is the default one initially selected when you open a diagram. To select an element on a diagram while this tool is active, simply click on it. To select several elements at the same time, you can either draw a rectangle on the diagram (all the elements completely contained in the rectangle will get selected), or click on each element individually while keeping the 
-			<em>Ctrl</em> key pressed.When selecting elements which are already selected using this method, by clicking on them or drawing a rectangle around them, they are removed from the selection. You can combine both methods (de/selection by single click or by zone) to build complex selection incrementally by always keeping the 
+			<em>selection</em> tool is the default one initially selected when you open a diagram. To select an element on a diagram while this tool is active, simply click on it. To select several elements at the same time, you can either draw a rectangle on the diagram, or click on each element individually while keeping the 
+			<em>Ctrl</em> key pressed. When selecting elements which are already selected using this method, by clicking on them or drawing a rectangle around them, they are removed from the selection. You can combine both methods (de/selection by single click or by zone) to build complex selection incrementally by always keeping the 
 			<em>Ctrl</em> key pressed.
+			<br/>The selection of several elements by drawing a rectangle on the diagram has 2 modes:
 		</p>
+		<ul>
+			<li>Selection from left to right: all the elements completely contained in the rectangle will get selected</li>
+			<li>Selection from right to left: all the elements that intersect the rectangle will get selected</li>
+		</ul>
 		<p>Selected elements have an outline and anchors drawn on their border. Note that when a selection contains multiple elements, exactly one of them has black selection anchors; the rest have white anchors. The element with the black anchors is called the primary selection, and some tools treat it differently than the others (for example alignment tools).</p>
 		<p>
 			<i>Zoom</i>. Next in the palette come two buttons to control the zoom level of the main diagram area. When the 
diff --git a/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.textile b/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.textile
index 71d8853..ff06611 100644
--- a/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.textile
@@ -429,7 +429,10 @@
 
 	!images/palette_tools.png!
 
-__Selection__. The _selection_ tool is the default one initially selected when you open a diagram. To select an element on a diagram while this tool is active, simply click on it. To select several elements at the same time, you can either draw a rectangle on the diagram (all the elements completely contained in the rectangle will get selected), or click on each element individually while keeping the _Ctrl_ key pressed.When selecting elements which are already selected using this method, by clicking on them or drawing a rectangle around them, they are removed from the selection. You can combine both methods (de/selection by single click or by zone) to build complex selection incrementally by always keeping the _Ctrl_ key pressed.
+__Selection__. The _selection_ tool is the default one initially selected when you open a diagram. To select an element on a diagram while this tool is active, simply click on it. To select several elements at the same time, you can either draw a rectangle on the diagram, or click on each element individually while keeping the _Ctrl_ key pressed. When selecting elements which are already selected using this method, by clicking on them or drawing a rectangle around them, they are removed from the selection. You can combine both methods (de/selection by single click or by zone) to build complex selection incrementally by always keeping the _Ctrl_ key pressed.
+The selection of several elements by drawing a rectangle on the diagram has 2 modes:
+* Selection from left to right: all the elements completely contained in the rectangle will get selected
+* Selection from right to left: all the elements that intersect the rectangle will get selected
 
 Selected elements have an outline and anchors drawn on their border. Note that when a selection contains multiple elements, exactly one of them has black selection anchors; the rest have white anchors. The element with the black anchors is called the primary selection, and some tools treat it differently than the others (for example alignment tools).
 
diff --git a/plugins/org.eclipse.sirius.doc/doc/user/general/Modeling Project.html b/plugins/org.eclipse.sirius.doc/doc/user/general/Modeling Project.html
index 5f79ecd..73a97a7 100644
--- a/plugins/org.eclipse.sirius.doc/doc/user/general/Modeling Project.html
+++ b/plugins/org.eclipse.sirius.doc/doc/user/general/Modeling Project.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Modeling Project</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="ModelingProjectsandRepresentations">Modeling Projects and Representations</h1>
diff --git a/plugins/org.eclipse.sirius.doc/doc/user/sequences/Sequence Diagrams.html b/plugins/org.eclipse.sirius.doc/doc/user/sequences/Sequence Diagrams.html
index 02a47b0..dc1be77 100644
--- a/plugins/org.eclipse.sirius.doc/doc/user/sequences/Sequence Diagrams.html
+++ b/plugins/org.eclipse.sirius.doc/doc/user/sequences/Sequence Diagrams.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Sequence Diagrams</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="SequenceDiagramsEditors">Sequence Diagrams Editors</h1>
diff --git a/plugins/org.eclipse.sirius.doc/doc/user/tables/Tables.html b/plugins/org.eclipse.sirius.doc/doc/user/tables/Tables.html
index c674055..05695a7 100644
--- a/plugins/org.eclipse.sirius.doc/doc/user/tables/Tables.html
+++ b/plugins/org.eclipse.sirius.doc/doc/user/tables/Tables.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Tables</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="TableEditors">Table Editors</h1>
diff --git a/plugins/org.eclipse.sirius.doc/doc/user/trees/Trees.html b/plugins/org.eclipse.sirius.doc/doc/user/trees/Trees.html
index a6703a4..8731ac8 100644
--- a/plugins/org.eclipse.sirius.doc/doc/user/trees/Trees.html
+++ b/plugins/org.eclipse.sirius.doc/doc/user/trees/Trees.html
@@ -3,8 +3,8 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 		<title>Trees</title>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/bootstrap.css"/>
-		<link type="text/css" rel="stylesheet" href="/help/topic/org.eclipse.sirius.doc/doc/resources/custom.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/bootstrap.css"/>
+		<link type="text/css" rel="stylesheet" href="../../resources/custom.css"/>
 	</head>
 	<body>
 		<h1 id="TreeEditors">Tree Editors</h1>
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/435507.html b/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/435507.html
index fe887fd..505ffb7 100644
--- a/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/435507.html
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/435507.html
@@ -1 +1 @@
-<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body><h1 id="ElementcreationshouldsupportSnapToGrid">Element creation should support Snap To Grid</h1><h2 id="Preamble">Preamble</h2><p><em>Summary</em>: If &#171;Snap To Grid&#187; property is enabled (in the &#171;Rulers &amp; Grid&#187; tab of diagrams properties view), elements (node or edge) should be created on the grid.</p><table><tr><th>Version </th><th>Status </th><th>Date        </th><th>Authors </th><th>Changes </th></tr><tr><td>v0.1        </td><td>DRAFT    </td><td>2014-05-22 </td><td>lredor    </td><td>Initial version. </td></tr><tr><td>v0.2        </td><td>DRAFT    </td><td>2014-05-28 </td><td>lredor    </td><td>Updates after team review. </td></tr><tr><td>v0.3        </td><td>PROPOSAL    </td><td>2014-06-11 </td><td>lredor    </td><td>Add screenshots. </td></tr></table><p><em>Relevant tickets</em>:</p><ul><li>&#171;Bugzilla #435507&#187;, Element creation should support Snap To Grid":https://bugs.eclipse.org/bugs/show_bug.cgi?id=435507</li></ul><h2 id="Introduction">Introduction</h2><p>If &#171;Snap To Grid&#187; property is enabled (in the &#171;Rulers &amp; Grid&#187; tab of diagrams properties view), elements (node or edge) should be created on the grid.</p><p>Currently, with the &#171;Snap To Grid&#187; property enabled, with &#171;Ruler Units&#187;=Pixels and &#171;Grid Spacing&#187;=100, if you create a node by clicking on coordinates (125,125), the node is created to (125,125). It should be created to (100, 100), ie the nearest step grid.</p><p>This enhancement will not be available for sequence diagrams because &#171;Snap To Grid&#187; is not supported for this kind of diagram (see documentation for more explanations).</p><h2 id="DetailedSpecification">Detailed Specification</h2><p>When &#171;Snap To Grid&#187; property is enabled, the moved elements are aligned on the grid but this is not the case during the creation. The goal of this enhancement is to have the same location if an element is moved on a point or created on this same point.<br/>This enhancement is available for all kind of created elements: node, container and edge. You can refer to the section &#171;Tests and Non-regression strategy/Test cases&#187; for details of each cases to support.</p><p>The two classes <code>org.eclipse.sirius.diagram.ui.tools.internal.palette.CreationTool</code> and <code>org.eclipse.sirius.diagram.ui.tools.internal.palette.ConnectionCreationTool</code> should adapt the request location in <code>updateTargetRequest()</code> according to the &#171;Snap To Grid&#187; property state.</p><p>Limits:</p><ul><li>This enhancement will not be available for sequence diagrams because &#171;Snap To Grid&#187; is not supported for this kind of diagram (see documentation for more explanations). But an enhancement should be created to properly disable the SnapToGrid on Sequence diagrams.</li><li>This enhancement will not be available for default GMF elements: Note, Text and Note Attachment. It seems possible to change the behavior for this kind of elements (in method <code>org.eclipse.sirius.diagram.ui.tools.internal.palette.PaletteManagerImpl.updatePalette(Diagram)</code>) but this is not the goal of this enhancement.</li><li>This enhancement does not affect the case where the element is created to the center of the visible part of the diagram and not where the user has clicked. For information, this case is possible if a tool creates an element outside of the selected element. It would be possible to adapt this behavior but it does not seem user friendly.</li></ul><h3 id="Existingbugs">Existing bugs</h3><p>During the analysis of this issue, bugs have been discovered. They should be ideally be fixed but it is not in the scope of this evolution.</p><ul><li>Create a border node on the left side of a container with vertical scroll: The creation location is wrongly shifted according to the container scroll and can be, in some case, created to the bottom side.</li></ul><p><img border="0" src="images/bug-borderNodeCreationWithContainerScroll.png"/></p><ul><li>Moving a collapsed border node with the snap to grid enabled, aligns the collapsed border node with the grid crossing. It should align the expanded state to the grid crossing (and not the collapsed state).</li></ul><p><img border="0" src="images/bug-borderNodeMovedWithSnapToGridEnabled.png"/></p><h2 id="BackwardCompatibilityandMigrationPaths">Backward Compatibility and Migration Paths</h2><h3 id="MetamodelChanges">Metamodel Changes</h3><p>There is no change in metamodel for this evolution.</p><h3 id="APIChanges">API Changes</h3><p>This evolution does not change any API.</p><h3 id="UserInterfaceChanges">User Interface Changes</h3><p>No user interface change.</p><h3 id="DocumentationChanges">Documentation Changes</h3><p>This new behavior should be added in the New and Noteworthy documentation. There is no need to document this elsewhere because it became the default behavior.</p><h2 id="TestsandNonregressionstrategy">Tests and Non-regression strategy</h2><h3 id="Existingtests">Existing tests</h3><p>Existing tests should be adapted to this new feature.</p><h3 id="Testcases">Test cases</h3><p>This chapter lists all different cases that should be tested for this enhancement.</p><p>Each above cases should be tested:</p><ul><li>with different zoom factor: 75%, 100%, 200%</li><li>with and without scroll (in diagram and in container). Note that the scroll on diagram has no impact on the grid: the scroll shift the diagram and its grid (the scroll pane contains the diagram figure and its grid layer).</li></ul><h4 id="Createacontainer">Create a container</h4><p>The container should be created on the nearest grid crossing.</p><h4 id="Createanode">Create a node</h4><p>Cases: Create a node on the diagram or in container.</p><p>The node should be created on the nearest grid crossing.</p><h4 id="Createabordernode">Create a border node</h4><p>Cases:</p><ul><li>Create a border node on a container, on a node or on a node in container.</li><li>Collapsed or not<ul><li>If the border node is created collapsed, it is not aligned to the grid. The expanded state of this border node is aligned to the grid, so the collapsed state is not.</li></ul></li></ul><p>The border node should be created on the nearest grid crossing, as close as possible. Indeed, one of the coordinates (x or y) is constrained by the parent border. The location is also constrained by other border nodes on the selected container.<br/>For north and south border node, only the x axis grid crossing is considered (the y axis is fixed by the parent north, or south, border).<br/>For east and west border node, only the y axis grid crossing is considered (the x axis is fixed by the parent east, or west, border).</p><h5 id="Specificcases">Specific cases</h5><ul><li>2 border nodes with same creation location<ul><li>The first border node is aligned on the grid. But the second can not. It is shift to have a location near the grid crossing but just at the side of the first border node.</li></ul></li><li>no corresponding grid crossing on the selected container</li></ul><p><img border="0" src="images/gridWithBigGridSpacing.png"/></p><h4 id="Createanedge">Create an edge</h4><p>The starting point and the ending point of the edge should be aligned on the grid crossing, as close as possible. Indeed, one of the coordinates (x or y) is constrained by the connected side of the source/target.</p><p><img border="0" src="images/createEdge.png"/></p><h5 id="Specificcase">Specific case</h5><ul><li>no corresponding grid crossing on the selected source node or target node</li></ul><h4 id="Createanedgeandsimultaneously2bordernodesateachextremity">Create an edge and simultaneously 2 border nodes at each extremity</h4><p>This is a particular case where border nodes and edge are created together with the same tool. The border nodes should be created as if they are created apart.</p><p><img border="0" src="images/createEdgeAndBorderNodes.png"/></p><h4 id="Specificcaseforcreationinacontainer">Specific case for creation in a container</h4><h5 id="Withscrollhorizontalorverticalincontainer">With scroll (horizontal or vertical) in container</h5><p>For all creation in a container with scroll, the node (border or not) is created according to global grid and not to a potential internal grid to the container. The scroll is not really considered in this case.<br/>We should make attention to avoid any disturbing effect: after the node creation, the scroll bars should not be reset. Even if the scroll is not really considered, the node should be created on the closest grid crossing, but the real location is a scrolled one (current behavior), we have just to align the location to the global grid.</p><h5 id="Thegriddoesnotcrossthecontainer">The grid does not cross the container</h5><p>In case of a large grid spacing, it is possible that the grid does not cross the container. In this case, the coordinates are constrained by the bounds of the container and are set according to the nearest grid crossing.</p><h2 id="Implementationchoicesandtradeoffs">Implementation choices and tradeoffs</h2><p>If the centered in visible part creation (marked as known limitation) is finally needed, the impacted code will be in the method <code>org.eclipse.sirius.diagram.ui.business.internal.view.SiriusLayoutDataManagerImpl.calculateCenterLocation(IGraphicalEditPart, CompoundCommand, IAdaptable, Point)</code>.</p></body></html>
\ No newline at end of file
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body><h1 id="ElementcreationshouldsupportSnapToGrid">Element creation should support Snap To Grid</h1><h2 id="Preamble">Preamble</h2><p><em>Summary</em>: If &#171;Snap To Grid&#187; property is enabled (in the &#171;Rulers &amp; Grid&#187; tab of diagrams properties view), elements (node or edge) should be created on the grid.</p><table><tr><th>Version </th><th>Status </th><th>Date        </th><th>Authors </th><th>Changes </th></tr><tr><td>v0.1        </td><td>DRAFT    </td><td>2014-05-22 </td><td>lredor    </td><td>Initial version. </td></tr><tr><td>v0.2        </td><td>DRAFT    </td><td>2014-05-28 </td><td>lredor    </td><td>Updates after team review. </td></tr><tr><td>v0.3        </td><td>PROPOSAL </td><td>2014-06-11 </td><td>lredor    </td><td>Add screenshots. </td></tr><tr><td>v0.4        </td><td>PROPOSAL </td><td>2014-06-19 </td><td>lredor    </td><td>Add ref to bugzilla 437544. </td></tr><tr><td>v0.5        </td><td>PROPOSAL </td><td>2014-06-26 </td><td>lredor    </td><td>Edge creation updates </td></tr></table><p><em>Relevant tickets</em>:</p><ul><li>&#171;Bugzilla #435507&#187;, Element creation should support Snap To Grid":https://bugs.eclipse.org/bugs/show_bug.cgi?id=435507</li></ul><h2 id="Introduction">Introduction</h2><p>If &#171;Snap To Grid&#187; property is enabled (in the &#171;Rulers &amp; Grid&#187; tab of diagrams properties view), elements (node or edge) should be created on the grid.</p><p>Currently, with the &#171;Snap To Grid&#187; property enabled, with &#171;Ruler Units&#187;=Pixels and &#171;Grid Spacing&#187;=100, if you create a node by clicking on coordinates (125,125), the node is created to (125,125). It should be created to (100, 100), ie the nearest step grid.</p><p>This enhancement will not be available for sequence diagrams because &#171;Snap To Grid&#187; is not supported for this kind of diagram (see documentation for more explanations).</p><h2 id="DetailedSpecification">Detailed Specification</h2><p>When &#171;Snap To Grid&#187; property is enabled, the moved elements are aligned on the grid but this is not the case during the creation. The goal of this enhancement is to have the same location if an element is moved on a point or created on this same point.<br/>This enhancement is available for all kind of created elements: node, container and edge. You can refer to the section &#171;Tests and Non-regression strategy/Test cases&#187; for details of each cases to support.</p><p>The two classes <code>org.eclipse.sirius.diagram.ui.tools.internal.palette.CreationTool</code> and <code>org.eclipse.sirius.diagram.ui.tools.internal.palette.ConnectionCreationTool</code> should adapt the request location in <code>updateTargetRequest()</code> according to the &#171;Snap To Grid&#187; property state.</p><p>Limits:</p><ul><li>This enhancement will not be available for sequence diagrams because &#171;Snap To Grid&#187; is not supported for this kind of diagram (see documentation for more explanations). But an enhancement should be created to properly disable the SnapToGrid on Sequence diagrams.</li><li>This enhancement will not be available for default GMF elements: Note, Text and Note Attachment. It seems possible to change the behavior for this kind of elements (in method <code>org.eclipse.sirius.diagram.ui.tools.internal.palette.PaletteManagerImpl.updatePalette(Diagram)</code>) but this is not the goal of this enhancement.</li><li>This enhancement does not affect the case where the element is created to the center of the visible part of the diagram and not where the user has clicked. For information, this case is possible if a tool creates an element outside of the selected element. It would be possible to adapt this behavior but it does not seem user friendly.</li></ul><h3 id="Edgecase">Edge case</h3><p>The edge case is specific. Indeed, when the user clicks the first time (for source location), the best location depends on the second click (target location). So the real locations (source and target) are only computed after these 2 clicks (in org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusGraphicalNodeEditPolicy.getConnectionCompleteCommand(CreateConnectionRequest)).</p><p><img border="0" src="images/edgeCreation_defaultBehaviorWithSnap.png"/><br/><i>Default behavior: the anchors are aligned to the grid</i></p><p>But the end user is not aware of the anchors existence. So it is more user friendly to align the edge ends to the grid.</p><p><img border="0" src="images/edgeCreation_expectedBehaviorWithSnap.png"/><br/><i>Expected behavior: the edge ends are aligned to the grid</i></p><h3 id="Existingbugs">Existing bugs</h3><p>During the analysis of this issue, bugs have been discovered. They should be ideally be fixed but it is not in the scope of this evolution.</p><ul><li>Create a border node on the left side of a container with vertical scroll: The creation location is wrongly shifted according to the container scroll and can be, in some case, created to the bottom side. The corresponding bug is <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=437544">Bugzilla #437544</a> .</li></ul><p><img border="0" src="images/bug-borderNodeCreationWithContainerScroll.png"/></p><ul><li>Moving a collapsed border node with the snap to grid enabled, aligns the collapsed border node with the grid crossing. It should align the expanded state to the grid crossing (and not the collapsed state).</li></ul><p><img border="0" src="images/bug-borderNodeMovedWithSnapToGridEnabled.png"/></p><h2 id="BackwardCompatibilityandMigrationPaths">Backward Compatibility and Migration Paths</h2><h3 id="MetamodelChanges">Metamodel Changes</h3><p>There is no change in metamodel for this evolution.</p><h3 id="APIChanges">API Changes</h3><p>This evolution does not change any API.</p><h3 id="UserInterfaceChanges">User Interface Changes</h3><p>No user interface change.</p><h3 id="DocumentationChanges">Documentation Changes</h3><p>This new behavior should be added in the New and Noteworthy documentation. There is no need to document this elsewhere because it became the default behavior.</p><h2 id="TestsandNonregressionstrategy">Tests and Non-regression strategy</h2><h3 id="Existingtests">Existing tests</h3><p>Existing tests should be adapted to this new feature.</p><h3 id="Testcases">Test cases</h3><p>This chapter lists all different cases that should be tested for this enhancement.</p><p>Each above cases should be tested:</p><ul><li>with different zoom factor: 75%, 100%, 200%</li><li>with and without scroll (in diagram and in container). Note that the scroll on diagram has no impact on the grid: the scroll shift the diagram and its grid (the scroll pane contains the diagram figure and its grid layer).</li></ul><h4 id="Createacontainer">Create a container</h4><p>The container should be created on the nearest grid crossing.</p><h4 id="Createanode">Create a node</h4><p>Cases: Create a node on the diagram or in container.</p><p>The node should be created on the nearest grid crossing.</p><h4 id="Createabordernode">Create a border node</h4><p>Cases:</p><ul><li>Create a border node on a container, on a node or on a node in container.</li><li>Collapsed or not<ul><li>If the border node is created collapsed, it is not aligned to the grid. The expanded state of this border node is aligned to the grid, so the collapsed state is not.</li></ul></li></ul><p>The border node should be created on the nearest grid crossing, as close as possible. Indeed, one of the coordinates (x or y) is constrained by the parent border. The location is also constrained by other border nodes on the selected container.<br/>For north and south border node, only the x axis grid crossing is considered (the y axis is fixed by the parent north, or south, border).<br/>For east and west border node, only the y axis grid crossing is considered (the x axis is fixed by the parent east, or west, border).</p><h5 id="Specificcases">Specific cases</h5><ul><li>2 border nodes with same creation location<ul><li>The first border node is aligned on the grid. But the second can not. It is shift to have a location near the grid crossing but just at the side of the first border node.</li></ul></li><li>no corresponding grid crossing on the selected container</li></ul><p><img border="0" src="images/gridWithBigGridSpacing.png"/></p><h4 id="Createanedge">Create an edge</h4><p>The starting point and the ending point of the edge should be aligned on the grid crossing, as close as possible. Indeed, one of the coordinates (x or y) is constrained by the connected side of the source/target.</p><p><img border="0" src="images/createEdge.png"/></p><h5 id="Specificcase">Specific case</h5><ul><li>no corresponding grid crossing on the selected source node or target node</li></ul><h4 id="Createanedgeandsimultaneously2bordernodesateachextremity">Create an edge and simultaneously 2 border nodes at each extremity</h4><p>This is a particular case where border nodes and edge are created together with the same tool. The border nodes should be created as if they are created apart.</p><p><img border="0" src="images/createEdgeAndBorderNodes.png"/></p><h4 id="Specificcaseforcreationinacontainer">Specific case for creation in a container</h4><h5 id="Withscrollhorizontalorverticalincontainer">With scroll (horizontal or vertical) in container</h5><p>For all creation in a container with scroll, the node (border or not) is created according to global grid and not to a potential internal grid to the container. The scroll is not really considered in this case.<br/>We should make attention to avoid any disturbing effect: after the node creation, the scroll bars should not be reset. Even if the scroll is not really considered, the node should be created on the closest grid crossing, but the real location is a scrolled one (current behavior), we have just to align the location to the global grid.</p><h5 id="Thegriddoesnotcrossthecontainer">The grid does not cross the container</h5><p>In case of a large grid spacing, it is possible that the grid does not cross the container. In this case, the coordinates are constrained by the bounds of the container and are set according to the nearest grid crossing.</p><h2 id="Implementationchoicesandtradeoffs">Implementation choices and tradeoffs</h2><p>If the centered in visible part creation (marked as known limitation) is finally needed, the impacted code will be in the method <code>org.eclipse.sirius.diagram.ui.business.internal.view.SiriusLayoutDataManagerImpl.calculateCenterLocation(IGraphicalEditPart, CompoundCommand, IAdaptable, Point)</code>.</p></body></html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/435507.textile b/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/435507.textile
index f051f05..55e4f53 100644
--- a/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/435507.textile
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/435507.textile
@@ -7,7 +7,9 @@
 |_. Version |_. Status |_. Date        |_. Authors |_. Changes |
 | v0.1        | DRAFT    | 2014-05-22 | lredor    | Initial version. |
 | v0.2        | DRAFT    | 2014-05-28 | lredor    | Updates after team review. |
-| v0.3        | PROPOSAL    | 2014-06-11 | lredor    | Add screenshots. |
+| v0.3        | PROPOSAL | 2014-06-11 | lredor    | Add screenshots. |
+| v0.4        | PROPOSAL | 2014-06-19 | lredor    | Add ref to bugzilla 437544. |
+| v0.5        | PROPOSAL | 2014-06-26 | lredor    | Edge creation updates |
 
 _Relevant tickets_:
 * "Bugzilla #435507", Element creation should support Snap To Grid":https://bugs.eclipse.org/bugs/show_bug.cgi?id=435507
@@ -32,10 +34,22 @@
 * This enhancement will not be available for default GMF elements: Note, Text and Note Attachment. It seems possible to change the behavior for this kind of elements (in method @org.eclipse.sirius.diagram.ui.tools.internal.palette.PaletteManagerImpl.updatePalette(Diagram)@) but this is not the goal of this enhancement.
 * This enhancement does not affect the case where the element is created to the center of the visible part of the diagram and not where the user has clicked. For information, this case is possible if a tool creates an element outside of the selected element. It would be possible to adapt this behavior but it does not seem user friendly.
 
+h3. Edge case
+
+The edge case is specific. Indeed, when the user clicks the first time (for source location), the best location depends on the second click (target location). So the real locations (source and target) are only computed after these 2 clicks (in org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusGraphicalNodeEditPolicy.getConnectionCompleteCommand(CreateConnectionRequest)).
+
+!images/edgeCreation_defaultBehaviorWithSnap.png!
+__Default behavior: the anchors are aligned to the grid__
+
+But the end user is not aware of the anchors existence. So it is more user friendly to align the edge ends to the grid.
+
+!images/edgeCreation_expectedBehaviorWithSnap.png!
+__Expected behavior: the edge ends are aligned to the grid__
+
 h3. Existing bugs
 
 During the analysis of this issue, bugs have been discovered. They should be ideally be fixed but it is not in the scope of this evolution.
-* Create a border node on the left side of a container with vertical scroll: The creation location is wrongly shifted according to the container scroll and can be, in some case, created to the bottom side.
+* Create a border node on the left side of a container with vertical scroll: The creation location is wrongly shifted according to the container scroll and can be, in some case, created to the bottom side. The corresponding bug is "Bugzilla #437544":https://bugs.eclipse.org/bugs/show_bug.cgi?id=437544 .
 !images/bug-borderNodeCreationWithContainerScroll.png!
 * Moving a collapsed border node with the snap to grid enabled, aligns the collapsed border node with the grid crossing. It should align the expanded state to the grid crossing (and not the collapsed state).
 !images/bug-borderNodeMovedWithSnapToGridEnabled.png!
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/images/edgeCreation_defaultBehaviorWithSnap.png b/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/images/edgeCreation_defaultBehaviorWithSnap.png
new file mode 100644
index 0000000..6370220
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/images/edgeCreation_defaultBehaviorWithSnap.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/images/edgeCreation_defaultBehaviorWithSnap.xcf b/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/images/edgeCreation_defaultBehaviorWithSnap.xcf
new file mode 100644
index 0000000..2dba86f
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/images/edgeCreation_defaultBehaviorWithSnap.xcf
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/images/edgeCreation_expectedBehaviorWithSnap.png b/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/images/edgeCreation_expectedBehaviorWithSnap.png
new file mode 100644
index 0000000..483a4d2
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/images/edgeCreation_expectedBehaviorWithSnap.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/images/edgeCreation_expectedBehaviorWithSnap.xcf b/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/images/edgeCreation_expectedBehaviorWithSnap.xcf
new file mode 100644
index 0000000..8429615
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/435507_SnapToGridForCreation/images/edgeCreation_expectedBehaviorWithSnap.xcf
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/437528.html b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/437528.html
new file mode 100644
index 0000000..de89b13
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/437528.html
@@ -0,0 +1 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body><h1 id="Forcinganedgedirectiontowardthecenterofanode.">Forcing an edge direction toward the center of a node.</h1><h2 id="Preamble">Preamble</h2><p><em>Summary</em>: This evolution allows the specifier to force edges direction toward the center of a node.</p><table><tr><th>Version </th><th>Status </th><th>Date        </th><th>Authors </th><th>Changes </th></tr><tr><td>v0.1        </td><td>DRAFT    </td><td>2014-06-06 </td><td>fbarbin    </td><td>Initial version. </td></tr><tr><td>v0.2        </td><td>DRAFT    </td><td>2014-06-16 </td><td>fbarbin    </td><td>Update after a first team discussion. </td></tr><tr><td>v0.3        </td><td>DRAFT    </td><td>2014-06-18 </td><td>fbarbin    </td><td>Update after team review. </td></tr><tr><td>v0.4        </td><td>DRAFT    </td><td>2014-06-27 </td><td>fbarbin    </td><td>Update after team review. </td></tr><tr><td>v0.5        </td><td>PROPOSAL    </td><td>2014-06-27 </td><td>fbarbin    </td><td>Update after team review. </td></tr></table><p><em>Relevant tickets</em> :</p><ul><li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=437528">Bugzilla #437528 Forcing an edge direction toward the center of a node.</a></li></ul><h2 id="Introduction">Introduction</h2><p>The edge source and edge target are not systematically oriented toward the center of the node, depending on where the edge has been created or moved by the end user. Taking the example of a &#8220;port&#8221; concept that is represented by a 10px by 10px border node, for esthetic reasons the specifier could force the edges ends to be centered on those border nodes. Although the first purpose was about to center edges toward border nodes, this enhancement will affect all kind of nodes: containers, border nodes and  simple nodes.</p><p><img border="0" src="image3.png"/><br/>The first edge, the highest one, is oriented to the node&#8217;s center</p><h3 id="examples">Examples</h3><p>This enhancement will cover several cases detailed below:</p><h4 id="Example1">Example 1</h4><p>Edges between border nodes on a same axis will now be aligned:  </p><p><img border="0" src="image4.png"/></p><p><img border="0" src="image5.png"/></p><h4 id="Example2">Example 2</h4><p>An other example with edges with a rectilinear routing style:<br/><img border="0" src="image7.png"/></p><p>When applying this enhancement, the last edge segment will be oriented toward the conainer&#8217;s center:<br/><img border="0" src="image6.png"/></p><h4 id="Example3">Example 3</h4><p>We also have to manage routing style changes. The picture below displays two oblique edges toward the container&#8217;s center.<br/><img border="0" src="image8.png"/></p><p>When modifying the routing style to Rectilinear, the edge direction is not toward the container' s center anymore.<br/><img border="0" src="image9.png"/><br/>We need to fix the last edge segment to obtain this expected result:<br/><img border="0" src="image10.png"/></p><h2 id="details">Detailed Specification</h2><p>The edge orientation follows an invisible point on the node called &#8220;anchor&#8221;. The anchor is composed of a X and Y coordinates, each one with a range value between 0 and 1. To set the anchor at the center of the node for instance, the coordinates should be (0.5, 0.5).</p><p>Edges with an &#8220;auto centered anchor&#8221; will be restricted to a specific edge mapping and source/target mapping pair. This means that the specifier will choose which kind of edge with which kind of source (and/or target) will have this behavior. The specifier will also have the possibility to systematically center the edge on its target and/or its source.</p><p><img border="0" src="propertiesView.png"/><br/>The edge style properties view that lets the specifier personalizing the enhancement behavior.</p><h3 id="Creation">Creation</h3><p>The source and target anchors are computed in <code>org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusGraphicalNodeEditPolicy.buildSiriusConnectionCreationCmd(CreateConnectionRequest)</code>. We need to modify it to force the anchor value.</p><h3 id="Reconnection">Reconnection</h3><p>The reconnect should also manage the centered anchor. Edge anchors are computed and given to the command in these two methods:<br/><code>org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusGraphicalNodeEditPolicy.getReconnectSourceCommandAfterTool(ReconnectRequest)</code><br/><code>org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusGraphicalNodeEditPolicy.getReconnectTargetCommandAfterTool(ReconnectRequest)</code></p><h3 id="Move">Move</h3><p>The end-user should not have the possibility to change the edge source or edge target anchor when this one is concerned by the rule.</p><h3 id="Refresh">Refresh</h3><p>The refresh mechanism should be responsible to keep edges behavior synchronized with VSM parameters. We need to modify the <code>DDiagramSynchronizer</code> component to update the Sirius model when the VSM is modified. In addition, the <code>DDiagramCanonicalSynchronizer</code> should also be modified to change the edge anchor in the GMF annotation model. Edge bendpoints should also be recomputed to consider new anchor coordinates. </p><p>See the &#8220;Metamodel Changes&#8221; section for more details about the metamodel changes.</p><h3 id="Mappingimports">Mapping imports</h3><p>We also have to consider the mapping imports. This means that if an edge is centered on a node mapping A, it should also be centered on a node mapping A' which imports the mapping A. In addition, an edge mapping E' that imports an edge mapping E, will inherit this behavior since it also inherits its style.</p><h3 id="Stylecustomization">Style customization</h3><p>As the mapping imports, these features could be customized with Style Customization.</p><h3 id="Routingstyle">Routing style</h3><p>In addition to recompute the bendpoints coordinates after having changed edge anchors, we should also consider the routing style changes. The last example in the <a href="#examples">Examples</a> section illustrates the fact that the last edge segment has to be recomputed to have a direction toward the centered anchor.</p><h3 id="Limitation">Limitation</h3><p>There is a limitation about this approach. Draw2D tries to privilege straight edge. This means that in some cases, even with an anchor set at (0.5,0.5), the edge can be shifted to keep it straight. This is called the &#8220;Straight Line Tolerance&#8221; and the constant is defined in <code>org.eclipse.gmf.runtime.draw2d.ui.figures.BaseSlidableAnchor.STRAIGHT_LINE_TOLERANCE</code></p><p><img border="0" src="image2.png"/><br/>An example with a source and target anchors fixed at (0.5, 0.5).</p><h2 id="BackwardCompatibilityandMigrationPaths">Backward Compatibility and Migration Paths</h2><p>The metamodel changes will be incremental so there is no migration planned. The diagram will be updated by the refresh mechanism according to the VSM changes.</p><h3 id="MetamodelChanges">Metamodel Changes</h3><h4 id="Description">Description</h4><p><code>org.eclipse.sirius.diagram.description.style.EdgeStyleDescription</code> will have four additional attributes. Two attributes to let the specifier choose for which target mappings and which source mappings the anchor of this edge will be centered. Two boolean attributes to specify whether the source or the target should always be centered.</p><h4 id="Diagram">Diagram</h4><p><code>org.eclipse.sirius.diagram.EdgeStyle</code> will have two more boolean attributes computed from the edge style description. These attributes will provide the information about centering or not the source or target anchors.</p><h3 id="APIChanges">API Changes</h3><p>This enhancement will not change the API. Since sequence diagrams should not be impacted, we will just restrict the properties view.</p><h3 id="UserInterfaceChanges">User Interface Changes</h3><p>The Edge Style properties view should have two new fields to select the source and target mapping for which the edge anchor is centered. These fields could be inserted in the advanced tab. The properties view will also let the specifier to systematically center edges source, target or both. When these options will be selected, the corresponding mappings fields will be unavailable. <br/>see the Properties View <a href="#details">illustration</a> within the Detailed Specification section header.</p><p>Sequence diagrams should not be impacted by this enhancement. This feature will be masked in the properties view or invalidated by a validation rule if the first solution cannot be applied.</p><h3 id="DocumentationChanges">Documentation Changes</h3><p>The specifier documentation will be updated to mention the new Edge Style Description attributes.<br/>The &#8220;release notes&#8221; will be updated to mention Metamodel changes.</p><h2 id="TestsandNonregressionstrategy">Tests and Non-regression strategy</h2><ul><li>We should test the following cases (for border-node, node and container mappings):<ul><li>Test that edge anchors are well set when the edge is automatically created.</li><li>Test that edge anchors are well set when the edge is created by the end-user.</li><li>Test that edge anchors are well set when the edge has been reconnected.</li><li>Test that the end-user cannot change the edge anchor when the specifier has chosen to keep it centered. Test in rectilinear mode too.</li><li>Test that changing the routing style to rectilinear keep the edge centered toward the anchor.</li><li>Test the edge creation with a rectilinear style.</li><li>Test that after having reconnected an edge source and target to a node not among the &#8220;centered list mapping&#8221;, the user is free to move the anchor anywhere.</li><li>Taking an edge (egde mapping A) with a source and a target (node mapping B), test that edge is correctly centered when the mapping B is added to the &#8220;centered anchor list&#8221;.</li><li>The test cases above should also be tested with mapping imports:<ul><li>Test that an edge between a node A and B, assuming that the edge should be centered on A, will also be centered on node mapping A' which import the node mapping A. </li><li>Test that an edge mapping E', importing an edge mapping E also inherit the centered style properties.</li></ul></li></ul></li></ul><h2 id="Implementationchoicesandtradeoffs">Implementation choices and tradeoffs</h2><p>The first idea was to fix a border node size limit to apply the centered anchor. This option had a limited precision compared to the edge-mapping/node-mapping pair.</p></body></html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/437528.textile b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/437528.textile
new file mode 100644
index 0000000..8d5ca12
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/437528.textile
@@ -0,0 +1,170 @@
+h1. Forcing an edge direction toward the center of a node.
+
+h2. Preamble
+
+_Summary_: This evolution allows the specifier to force edges direction toward the center of a node.
+
+|_. Version |_. Status |_. Date        |_. Authors |_. Changes |
+| v0.1        | DRAFT    | 2014-06-06 | fbarbin    | Initial version. |
+| v0.2        | DRAFT    | 2014-06-16 | fbarbin    | Update after a first team discussion. |
+| v0.3        | DRAFT    | 2014-06-18 | fbarbin    | Update after team review. |
+| v0.4        | DRAFT    | 2014-06-27 | fbarbin    | Update after team review. |
+| v0.5        | PROPOSAL    | 2014-06-27 | fbarbin    | Update after team review. |
+
+_Relevant tickets_ :
+* "Bugzilla #437528 Forcing an edge direction toward the center of a node.":https://bugs.eclipse.org/bugs/show_bug.cgi?id=437528
+
+
+h2. Introduction
+
+The edge source and edge target are not systematically oriented toward the center of the node, depending on where the edge has been created or moved by the end user. Taking the example of a "port" concept that is represented by a 10px by 10px border node, for esthetic reasons the specifier could force the edges ends to be centered on those border nodes. Although the first purpose was about to center edges toward border nodes, this enhancement will affect all kind of nodes: containers, border nodes and  simple nodes.
+
+!image3.png!
+The first edge, the highest one, is oriented to the node's center
+
+h3(#examples). Examples
+
+This enhancement will cover several cases detailed below:
+
+h4. Example 1
+
+Edges between border nodes on a same axis will now be aligned:  
+
+!image4.png!
+
+
+!image5.png!
+
+
+h4. Example 2
+
+An other example with edges with a rectilinear routing style:
+!image7.png!
+
+
+When applying this enhancement, the last edge segment will be oriented toward the conainer's center:
+!image6.png!
+
+
+h4. Example 3
+
+We also have to manage routing style changes. The picture below displays two oblique edges toward the container's center.
+!image8.png!
+
+When modifying the routing style to Rectilinear, the edge direction is not toward the container' s center anymore.
+!image9.png!
+We need to fix the last edge segment to obtain this expected result:
+!image10.png!
+
+h2(#details). Detailed Specification
+
+The edge orientation follows an invisible point on the node called "anchor". The anchor is composed of a X and Y coordinates, each one with a range value between 0 and 1. To set the anchor at the center of the node for instance, the coordinates should be (0.5, 0.5).
+
+Edges with an "auto centered anchor" will be restricted to a specific edge mapping and source/target mapping pair. This means that the specifier will choose which kind of edge with which kind of source (and/or target) will have this behavior. The specifier will also have the possibility to systematically center the edge on its target and/or its source.
+
+!propertiesView.png!
+The edge style properties view that lets the specifier personalizing the enhancement behavior.
+
+h3. Creation
+
+The source and target anchors are computed in @org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusGraphicalNodeEditPolicy.buildSiriusConnectionCreationCmd(CreateConnectionRequest)@. We need to modify it to force the anchor value.
+
+
+h3. Reconnection
+
+The reconnect should also manage the centered anchor. Edge anchors are computed and given to the command in these two methods:
+@org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusGraphicalNodeEditPolicy.getReconnectSourceCommandAfterTool(ReconnectRequest)@
+@org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusGraphicalNodeEditPolicy.getReconnectTargetCommandAfterTool(ReconnectRequest)@
+
+
+h3. Move
+
+The end-user should not have the possibility to change the edge source or edge target anchor when this one is concerned by the rule.
+
+
+h3. Refresh
+
+The refresh mechanism should be responsible to keep edges behavior synchronized with VSM parameters. We need to modify the @DDiagramSynchronizer@ component to update the Sirius model when the VSM is modified. In addition, the @DDiagramCanonicalSynchronizer@ should also be modified to change the edge anchor in the GMF annotation model. Edge bendpoints should also be recomputed to consider new anchor coordinates. 
+
+See the "Metamodel Changes" section for more details about the metamodel changes.
+
+
+h3. Mapping imports
+
+We also have to consider the mapping imports. This means that if an edge is centered on a node mapping A, it should also be centered on a node mapping A' which imports the mapping A. In addition, an edge mapping E' that imports an edge mapping E, will inherit this behavior since it also inherits its style.
+
+
+h3. Style customization
+
+As the mapping imports, these features could be customized with Style Customization.
+
+h3. Routing style
+
+In addition to recompute the bendpoints coordinates after having changed edge anchors, we should also consider the routing style changes. The last example in the "Examples":#examples section illustrates the fact that the last edge segment has to be recomputed to have a direction toward the centered anchor.
+
+h3. Limitation
+
+There is a limitation about this approach. Draw2D tries to privilege straight edge. This means that in some cases, even with an anchor set at (0.5,0.5), the edge can be shifted to keep it straight. This is called the "Straight Line Tolerance" and the constant is defined in @org.eclipse.gmf.runtime.draw2d.ui.figures.BaseSlidableAnchor.STRAIGHT_LINE_TOLERANCE@
+
+!image2.png!
+An example with a source and target anchors fixed at (0.5, 0.5).
+
+
+
+
+h2. Backward Compatibility and Migration Paths
+
+The metamodel changes will be incremental so there is no migration planned. The diagram will be updated by the refresh mechanism according to the VSM changes.
+
+
+h3. Metamodel Changes
+
+h4. Description
+
+@org.eclipse.sirius.diagram.description.style.EdgeStyleDescription@ will have four additional attributes. Two attributes to let the specifier choose for which target mappings and which source mappings the anchor of this edge will be centered. Two boolean attributes to specify whether the source or the target should always be centered.
+
+
+h4. Diagram
+
+@org.eclipse.sirius.diagram.EdgeStyle@ will have two more boolean attributes computed from the edge style description. These attributes will provide the information about centering or not the source or target anchors.
+  
+  
+h3. API Changes
+
+This enhancement will not change the API. Since sequence diagrams should not be impacted, we will just restrict the properties view.
+
+h3. User Interface Changes
+
+The Edge Style properties view should have two new fields to select the source and target mapping for which the edge anchor is centered. These fields could be inserted in the advanced tab. The properties view will also let the specifier to systematically center edges source, target or both. When these options will be selected, the corresponding mappings fields will be unavailable. 
+see the Properties View "illustration":#details within the Detailed Specification section header.
+
+Sequence diagrams should not be impacted by this enhancement. This feature will be masked in the properties view or invalidated by a validation rule if the first solution cannot be applied.
+
+
+h3. Documentation Changes
+
+The specifier documentation will be updated to mention the new Edge Style Description attributes.
+The "release notes" will be updated to mention Metamodel changes.
+
+
+h2. Tests and Non-regression strategy
+
+* We should test the following cases (for border-node, node and container mappings):
+** Test that edge anchors are well set when the edge is automatically created.
+** Test that edge anchors are well set when the edge is created by the end-user.
+** Test that edge anchors are well set when the edge has been reconnected.
+** Test that the end-user cannot change the edge anchor when the specifier has chosen to keep it centered. Test in rectilinear mode too.
+** Test that changing the routing style to rectilinear keep the edge centered toward the anchor.
+** Test the edge creation with a rectilinear style.
+** Test that after having reconnected an edge source and target to a node not among the "centered list mapping", the user is free to move the anchor anywhere.
+** Taking an edge (egde mapping A) with a source and a target (node mapping B), test that edge is correctly centered when the mapping B is added to the "centered anchor list".
+** The test cases above should also be tested with mapping imports:
+*** Test that an edge between a node A and B, assuming that the edge should be centered on A, will also be centered on node mapping A' which import the node mapping A. 
+*** Test that an edge mapping E', importing an edge mapping E also inherit the centered style properties.
+
+
+h2. Implementation choices and tradeoffs
+
+The first idea was to fix a border node size limit to apply the centered anchor. This option had a limited precision compared to the edge-mapping/node-mapping pair.
+
+
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image10.png b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image10.png
new file mode 100644
index 0000000..56e1774
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image10.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image2.png b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image2.png
new file mode 100644
index 0000000..2cbfcbe
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image2.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image3.png b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image3.png
new file mode 100644
index 0000000..4c183ee
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image3.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image4.png b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image4.png
new file mode 100644
index 0000000..5d0d356
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image4.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image5.png b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image5.png
new file mode 100644
index 0000000..f130b23
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image5.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image6.png b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image6.png
new file mode 100644
index 0000000..7604a59
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image6.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image7.png b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image7.png
new file mode 100644
index 0000000..479afd3
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image7.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image8.png b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image8.png
new file mode 100644
index 0000000..929badc
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image8.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image9.png b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image9.png
new file mode 100644
index 0000000..ee06420
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/image9.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/propertiesView.png b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/propertiesView.png
new file mode 100644
index 0000000..6892427
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/propertiesView.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/propertiesView.screen b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/propertiesView.screen
new file mode 100644
index 0000000..0fce0b3
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/specs/proposal/centeredAnchors/propertiesView.screen
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<model:Screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:model="http://wireframesketcher.com/1.0/model.ecore">
+  <widgets xsi:type="model:TabbedPane" id="4" x="56" y="40" width="801" height="217" text="General, Decorators, Color, Advanced" measuredWidth="801" measuredHeight="217" selection="3" position="left">
+    <items x="0" y="10" width="83" height="27" text="General"/>
+    <items x="0" y="37" width="83" height="27" text="Decorators"/>
+    <items x="0" y="64" width="83" height="27" text="Color"/>
+    <items x="0" y="91" width="83" height="27" text="Advanced"/>
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:TextField" id="5" x="328" y="50" width="519" measuredWidth="519" measuredHeight="25">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:Label" id="6" x="149" y="50" text="Size Computation Expression*:" measuredWidth="183" measuredHeight="25">
+    <font bold="true"/>
+  </widgets>
+  <widgets xsi:type="model:Label" id="7" x="149" y="88" text="Folding Style:" measuredWidth="80" measuredHeight="25">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:RadioButton" id="9" x="337" y="88" text="None" measuredWidth="48" measuredHeight="25" selected="true">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:RadioButton" id="10" x="390" y="88" text="Source" measuredWidth="57" measuredHeight="25">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:RadioButton" id="11" x="456" y="88" text="Target" measuredWidth="56" measuredHeight="25">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:Panel" id="12" x="328" y="84" width="193" height="33" measuredWidth="193" measuredHeight="33" alpha="0"/>
+  <widgets xsi:type="model:Label" id="13" x="149" y="128" text="Centered Source Mappings:" measuredWidth="152" measuredHeight="25">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:Label" id="14" x="149" y="160" text="Centered Target Mappings:" measuredWidth="151" measuredHeight="25">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:TextField" id="15" x="328" y="128" width="483" measuredWidth="483" measuredHeight="25">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:Button" id="16" x="810" y="127" width="37" text="..." measuredWidth="37" measuredHeight="27">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:TextField" id="17" x="328" y="160" width="483" measuredWidth="483" measuredHeight="25">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:Button" id="18" x="810" y="159" width="37" text="..." measuredWidth="37" measuredHeight="27">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:Label" id="20" x="149" y="192" text="Always center:" measuredWidth="86" measuredHeight="25">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:RadioButton" id="21" x="390" y="192" text="Both" measuredWidth="46" measuredHeight="25">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:RadioButton" id="22" x="446" y="192" text="Source" measuredWidth="57" measuredHeight="25">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:RadioButton" id="23" x="510" y="192" text="Target" measuredWidth="56" measuredHeight="25">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:RadioButton" id="25" x="338" y="192" text="None" measuredWidth="48" measuredHeight="25" selected="true">
+    <font/>
+  </widgets>
+  <widgets xsi:type="model:Panel" id="26" x="328" y="188" width="249" height="33" measuredWidth="249" measuredHeight="33" alpha="0"/>
+  <hRuler/>
+  <vRuler/>
+  <font size="12px"/>
+</model:Screen>
diff --git a/plugins/org.eclipse.sirius.ext.gmf.runtime/META-INF/MANIFEST.MF b/plugins/org.eclipse.sirius.ext.gmf.runtime/META-INF/MANIFEST.MF
index f6c668d..25fe94e 100644
--- a/plugins/org.eclipse.sirius.ext.gmf.runtime/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.sirius.ext.gmf.runtime/META-INF/MANIFEST.MF
@@ -7,11 +7,23 @@
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Import-Package: com.google.common.base;version="10.0.1",
+ org.eclipse.core.runtime,
  org.eclipse.draw2d,
  org.eclipse.draw2d.geometry,
+ org.eclipse.emf.ecore,
  org.eclipse.gef,
+ org.eclipse.gef.handles,
  org.eclipse.gef.editparts,
+ org.eclipse.gef.tools,
  org.eclipse.gmf.runtime.diagram.ui.editparts,
+ org.eclipse.gmf.runtime.diagram.ui.util,
+ org.eclipse.gmf.runtime.draw2d.ui.figures,
+ org.eclipse.gmf.runtime.draw2d.ui.geometry,
+ org.eclipse.gmf.runtime.notation,
+ org.eclipse.jface.viewers,
+ org.eclipse.sirius.ext.base;version="2.0.0",
  org.eclipse.sirius.ext.draw2d.figure;version="2.0.0",
+ org.eclipse.swt.events,
  org.eclipse.swt.widgets
-Export-Package: org.eclipse.sirius.ext.gmf.runtime.editparts;version="2.0.0"
+Export-Package: org.eclipse.sirius.ext.gmf.runtime.diagram.ui.tools;version="2.0.0",
+ org.eclipse.sirius.ext.gmf.runtime.editparts;version="2.0.0"
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/RubberbandDragTracker.java b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandDragTracker.java
similarity index 93%
rename from plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/RubberbandDragTracker.java
rename to plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandDragTracker.java
index 17c4dcd..c162628 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/RubberbandDragTracker.java
+++ b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandDragTracker.java
@@ -9,7 +9,7 @@
  *    IBM Corporation - initial API and implementation 
  ****************************************************************************/
 // CHECKSTYLE:OFF
-package org.eclipse.sirius.diagram.ui.tools.internal.ui;
+package org.eclipse.sirius.ext.gmf.runtime.diagram.ui.tools;
 
 import org.eclipse.gef.DragTracker;
 
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/RubberbandSelectionTool.java b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandSelectionTool.java
similarity index 87%
rename from plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/RubberbandSelectionTool.java
rename to plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandSelectionTool.java
index 789e37c..f56b4bd 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/ui/RubberbandSelectionTool.java
+++ b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/diagram/ui/tools/RubberbandSelectionTool.java
@@ -1,5 +1,5 @@
 /******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
  * 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
@@ -8,9 +8,10 @@
  * Contributors:
  *    IBM Corporation - initial API and implementation
  *    Obeo - Allow ports selection (IBorderItemEditPart)
+ *    Obeo - Add "Touched" mode
  ****************************************************************************/
 // CHECKSTYLE:OFF
-package org.eclipse.sirius.diagram.ui.tools.internal.ui;
+package org.eclipse.sirius.ext.gmf.runtime.diagram.ui.tools;
 
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
@@ -20,14 +21,16 @@
 import java.util.ListIterator;
 
 import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Cursors;
+import org.eclipse.draw2d.Connection;
 import org.eclipse.draw2d.Figure;
 import org.eclipse.draw2d.FigureCanvas;
 import org.eclipse.draw2d.Graphics;
 import org.eclipse.draw2d.IFigure;
 import org.eclipse.draw2d.Viewport;
+import org.eclipse.draw2d.ViewportUtilities;
 import org.eclipse.draw2d.geometry.Point;
 import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.ConnectionEditPart;
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.EditPartViewer;
 import org.eclipse.gef.GraphicalEditPart;
@@ -36,6 +39,7 @@
 import org.eclipse.gef.LayerConstants;
 import org.eclipse.gef.Request;
 import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.SharedCursors;
 import org.eclipse.gef.editparts.LayerManager;
 import org.eclipse.gef.tools.AbstractTool;
 import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
@@ -51,6 +55,11 @@
  * key is pressed at the beginning of the drag, the enclosed items will have
  * their selection state inverted.
  * <P>
+ * If the selection is made from left to right, the behavior is the one
+ * described previously. But if the selection is made from right to left the
+ * items that intersect the selection rectangle are concerned (and not only
+ * enclosed items).
+ * <P>
  * By default, only editparts whose figure's are on the primary layer will be
  * considered within the enclosed rectangle.
  * 
@@ -78,6 +87,18 @@
 
     static final int APPEND_MODE = 2;
 
+    /**
+     * When marquee is made from left to right, it is a standard selection:
+     * select elements wholly inside the marquee selection rectangle
+     */
+    static final int SELECTION_CONTAINED_MODE = 1;
+
+    /**
+     * When marquee is made from right to left, it is an alternative selection:
+     * select elements partially inside the marquee selection rectangle
+     */
+    static final int SELECTION_TOUCHED_MODE = 2;
+
     private int mode;
 
     private Figure marqueeRectangleFigure;
@@ -98,7 +119,7 @@
      * Creates a new MarqueeSelectionTool.
      */
     public RubberbandSelectionTool() {
-        setDefaultCursor(Cursors.CROSS);
+        setDefaultCursor(SharedCursors.CROSS);
         setUnloadWhenFinished(false);
     }
 
@@ -106,25 +127,40 @@
 
         List newSelections = new ArrayList();
         Iterator children = getAllChildren().iterator();
+        Rectangle marqueeBounds = getMarqueeBounds();
+
+        int selectionMode = SELECTION_CONTAINED_MODE;
+        if (feedBackStartLocation != null && feedBackStartLocation.x != getMarqueeBounds().getLeft().x) {
+            // Marquee from right to left (alternative selection: select
+            // elements partially inside the marquee selection rectangle
+            selectionMode = SELECTION_TOUCHED_MODE;
+        }
 
         // Calculate new selections based on which children fall
         // inside the marquee selection rectangle. Do not select
         // children who are not visible
         while (children.hasNext()) {
             EditPart child = (EditPart) children.next();
-            if (!child.isSelectable()) {
+            IFigure figure = ((GraphicalEditPart) child).getFigure();
+            if (!child.isSelectable() || child.getTargetEditPart(MARQUEE_REQUEST) != child || !((child instanceof IBorderItemEditPart && isBorderFigureVisible(figure)) || isFigureVisible(figure))) {
                 continue;
             }
-            IFigure figure = ((GraphicalEditPart) child).getFigure();
-            Rectangle r = figure.getBounds().getCopy();
+            Rectangle r;
+            if (child instanceof ConnectionEditPart) {
+                // RATLC00569348 For connection, get the bounds of connection
+                // points rather than connection figure since the
+                // figure's bounds contain the bounds of all connection children
+                // and would require selection rectangle
+                // to be larger than expected in some cases
+                r = ((Connection) figure).getPoints().getBounds().getCopy();
+            } else {
+                r = figure.getBounds().getCopy();
+            }
             figure.translateToAbsolute(r);
-
-            Rectangle marqueeBounds = getMarqueeBounds();
             getMarqueeFeedbackFigure().translateToRelative(r);
-            if (marqueeBounds.contains(r.getTopLeft()) && marqueeBounds.contains(r.getBottomRight()) && child.getTargetEditPart(MARQUEE_REQUEST) == child) {
-                if ((child instanceof IBorderItemEditPart && isBorderFigureVisible(figure)) || isFigureVisible(figure)) {
-                    newSelections.add(child);
-                }
+            if ((selectionMode == SELECTION_CONTAINED_MODE && marqueeBounds.contains(r.getTopLeft()) && marqueeBounds.contains(r.getBottomRight()))
+                    || (selectionMode == SELECTION_TOUCHED_MODE && marqueeBounds.intersects(r))) {
+                newSelections.add(child);
             }
         }
         return newSelections;
@@ -460,9 +496,9 @@
         }
         super.setViewer(viewer);
         if (viewer instanceof GraphicalViewer) {
-            setDefaultCursor(Cursors.CROSS);
+            setDefaultCursor(SharedCursors.CROSS);
         } else {
-            setDefaultCursor(Cursors.NO);
+            setDefaultCursor(SharedCursors.NO);
         }
         if (viewer != null) {
             weakReference = new WeakReference(viewer);
diff --git a/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/editparts/GraphicalHelper.java b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/editparts/GraphicalHelper.java
index e7de4d3..0dcbe0e 100644
--- a/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/editparts/GraphicalHelper.java
+++ b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/editparts/GraphicalHelper.java
@@ -14,9 +14,21 @@
 import org.eclipse.draw2d.FreeformViewport;
 import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.PrecisionPoint;
 import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.SnapToGrid;
+import org.eclipse.gef.handles.HandleBounds;
 import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart;
 import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.BaseSlidableAnchor;
+import org.eclipse.gmf.runtime.draw2d.ui.geometry.PointListUtilities;
+import org.eclipse.gmf.runtime.notation.Anchor;
+import org.eclipse.gmf.runtime.notation.IdentityAnchor;
+import org.eclipse.sirius.ext.base.Option;
+import org.eclipse.sirius.ext.base.Options;
 import org.eclipse.sirius.ext.draw2d.figure.FigureUtilities;
 
 import com.google.common.base.Preconditions;
@@ -39,7 +51,7 @@
      *            the current part
      * @return the zoom factor
      */
-    public static double getZoom(IGraphicalEditPart part) {
+    public static double getZoom(EditPart part) {
         Preconditions.checkNotNull(part);
         double scale = 1.0;
         if (part.getRoot() instanceof DiagramRootEditPart) {
@@ -50,7 +62,14 @@
     }
 
     /**
-     * Applied zoom on relative point.
+     * Applied zoom on relative point.<BR>
+     * For example:
+     * <UL>
+     * <LI>For a zoom of 200%, the result of this method for the point (100,
+     * 100) is (50, 50)</LI>
+     * <LI>For a zoom of 50%, the result of this method for the point (100, 100)
+     * is (200, 200)</LI>
+     * </UL>
      * 
      * @param part
      *            the current part
@@ -63,6 +82,26 @@
     }
 
     /**
+     * Applied zoom on a point.<BR>
+     * For example:
+     * <UL>
+     * <LI>For a zoom of 200%, the result of this method for the point (100,
+     * 100) is (200, 200)</LI>
+     * <LI>For a zoom of 50%, the result of this method for the point (100, 100)
+     * is (50, 50)</LI>
+     * </UL>
+     * 
+     * @param part
+     *            the current part
+     * @param point
+     *            a point
+     */
+    public static void applyZoomOnPoint(IGraphicalEditPart part, Point point) {
+        double zoom = getZoom(part);
+        point.setLocation((int) (point.x / zoom), (int) (point.y / zoom));
+    }
+
+    /**
      * Set the zoom factor.
      * 
      * @param part
@@ -201,4 +240,158 @@
         dim.performScale(GraphicalHelper.getZoom(part));
     }
 
+    /**
+     * Return the Point (absolute draw2d coordinates) corresponding to this
+     * Anchor. If anchor is not an IdentityAnchor, the center of
+     * <code>parent</code> is returned.
+     * 
+     * @param parent
+     *            The parent node
+     * @param anchor
+     *            The anchor
+     * @return The corresponding point to this anchor
+     */
+    public static Point getAnchorPoint(IGraphicalEditPart parent, Anchor anchor) {
+        if (anchor instanceof IdentityAnchor) {
+            return getAnchorPoint(parent, (IdentityAnchor) anchor);
+        } else {
+            return getAnchorPoint(parent, null);
+        }
+    }
+
+    /**
+     * Return the Point (absolute draw2d coordinates) corresponding to this
+     * Anchor. If anchor is null, the center of <code>parent</code> is returned.
+     * 
+     * @param parent
+     *            The parent node
+     * @param anchor
+     *            The anchor
+     * @return The corresponding point to this anchor
+     */
+    public static Point getAnchorPoint(IGraphicalEditPart parent, IdentityAnchor anchor) {
+        Rectangle bounds;
+        if (parent.getFigure() instanceof HandleBounds) {
+            bounds = ((HandleBounds) parent.getFigure()).getHandleBounds();
+        } else {
+            bounds = parent.getFigure().getBounds();
+        }
+        parent.getFigure().translateToAbsolute(bounds);
+
+        PrecisionPoint rel;
+        if (anchor != null) {
+            rel = BaseSlidableAnchor.parseTerminalString(anchor.getId());
+        } else {
+            // If anchor is null, the default value is (0.5, 0.5)
+            rel = new PrecisionPoint(0.5, 0.5);
+        }
+        Point location = new PrecisionPoint(bounds.getLocation().x + bounds.width * rel.preciseX(), bounds.getLocation().y + bounds.height * rel.preciseY());
+        return location;
+    }
+
+    /**
+     * Get intersection between a line between lineOrigin and lineTerminus, and
+     * the rectangle bounds of the part. If there are several intersections, the
+     * shortest is returned.
+     * 
+     * @param lineOrigin
+     *            Origin of the line
+     * @param lineTerminus
+     *            Terminus of the line
+     * @param part
+     *            Part to detect intersection.
+     * @param minimalDistancefromLineOrigin
+     *            true if the shortest distance is between the line origin and
+     *            the part, false otherwise.
+     * @return Intersection between a line and a rectangle.
+     */
+    public static Option<Point> getIntersection(Point lineOrigin, Point lineTerminus, IGraphicalEditPart part, boolean minimalDistancefromLineOrigin) {
+        // Create the line segment
+        PointList line = new PointList();
+        line.addPoint(lineOrigin);
+        line.addPoint(lineTerminus);
+        // Get the bounds of the part
+        Rectangle bounds = getAbsoluteBoundsIn100Percent(part);
+        // Get the intersection
+        PointList partBoundsPointList = PointListUtilities.createPointsFromRect(bounds);
+        PointList distances = new PointList();
+        PointList intersections = new PointList();
+        PointListUtilities.findIntersections(line, partBoundsPointList, intersections, distances);
+
+        if (intersections.size() > 0) {
+            Point referencePoint;
+            if (minimalDistancefromLineOrigin) {
+                referencePoint = lineOrigin;
+            } else {
+                referencePoint = lineTerminus;
+            }
+            Point shortestPoint = intersections.getFirstPoint();
+            double minimalDistance = shortestPoint.getDistance(referencePoint);
+            for (int i = 1; i < intersections.size(); i++) {
+                Point intersectionPoint = intersections.getPoint(i);
+                double currentDistance = intersectionPoint.getDistance(referencePoint);
+                if (currentDistance < minimalDistance) {
+                    minimalDistance = currentDistance;
+                    shortestPoint = intersectionPoint;
+                }
+            }
+            return Options.newSome(shortestPoint);
+        } else {
+            return Options.newNone();
+        }
+    }
+
+    /**
+     * Get the absolute bounds of this <code>part</code>.<BR>
+     * Detail: If the zoom is set to 200%, the location and the size are
+     * multiplied by two with respect to the real location and size.
+     * 
+     * @param part
+     *            The part to consider.
+     * @return The absolute bounds.
+     */
+    public static Rectangle getAbsoluteBounds(IGraphicalEditPart part) {
+        Rectangle bounds;
+        if (part.getFigure() instanceof HandleBounds) {
+            bounds = ((HandleBounds) part.getFigure()).getHandleBounds().getCopy();
+        } else {
+            bounds = part.getFigure().getBounds().getCopy();
+        }
+        part.getFigure().translateToAbsolute(bounds);
+        return bounds;
+    }
+
+    /**
+     * Get the absolute bounds of this <code>part</code>.<BR>
+     * Detail: If the zoom is set to 200%, the location and the size are
+     * multiplied by two with respect to the real location and size.
+     * 
+     * @param part
+     *            The part to consider.
+     * @return The absolute bounds.
+     */
+    public static Rectangle getAbsoluteBoundsIn100Percent(GraphicalEditPart part) {
+        Rectangle bounds;
+        if (part.getFigure() instanceof HandleBounds) {
+            bounds = ((HandleBounds) part.getFigure()).getHandleBounds().getCopy();
+        } else {
+            bounds = part.getFigure().getBounds().getCopy();
+        }
+        part.getFigure().translateToAbsolute(bounds);
+        bounds.performScale(1.0d / GraphicalHelper.getZoom(part));
+        return bounds;
+    }
+
+    /**
+     * Return true if the snapToGrid is enabled for the diagram containing this
+     * edit part, false otherwise.
+     * 
+     * @param editPart
+     *            The edit part to use.
+     * @return true if the snapToGrid is enabled for the diagram containing this
+     *         edit part, false otherwise.
+     */
+    public static boolean isSnapToGridEnabled(EditPart editPart) {
+        return (Boolean) editPart.getViewer().getProperty(SnapToGrid.PROPERTY_GRID_ENABLED);
+    }
 }
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/DTableMenuListener.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/DTableMenuListener.java
index 007d26e..6a4da06 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/DTableMenuListener.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/DTableMenuListener.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2012 THALES GLOBAL SERVICES.
+ * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES and others.
  * 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
@@ -21,6 +21,7 @@
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.emf.common.notify.AdapterFactory;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.emf.edit.provider.IItemLabelProvider;
 import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
 import org.eclipse.emf.transaction.RecordingCommand;
@@ -33,6 +34,7 @@
 import org.eclipse.jface.action.Separator;
 import org.eclipse.jface.action.SubContributionItem;
 import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.sirius.business.api.componentization.ViewpointRegistry;
 import org.eclipse.sirius.business.api.dialect.DialectManager;
 import org.eclipse.sirius.business.api.helper.task.InitInterpreterVariablesTask;
 import org.eclipse.sirius.business.api.logger.RuntimeLoggerInterpreter;
@@ -79,6 +81,8 @@
 import org.eclipse.sirius.viewpoint.DRepresentationElement;
 import org.eclipse.sirius.viewpoint.DSemanticDecorator;
 import org.eclipse.sirius.viewpoint.SiriusPlugin;
+import org.eclipse.sirius.viewpoint.description.RepresentationDescription;
+import org.eclipse.sirius.viewpoint.description.Viewpoint;
 import org.eclipse.sirius.viewpoint.description.tool.AbstractVariable;
 import org.eclipse.sirius.viewpoint.description.tool.RepresentationCreationDescription;
 import org.eclipse.sirius.viewpoint.description.tool.RepresentationNavigationDescription;
@@ -292,9 +296,9 @@
             createNavigationAction(navigateMenuItem, currentTableElement);
             // Add actions to navigate to new representation
             if (currentTableElement instanceof DCell) {
-                createDetailsActions((DCell) currentTableElement, navigateMenuItem);
+                createDetailsActions(currentTableElement, navigateMenuItem);
             } else if (currentTableElement instanceof DLine) {
-                createDetailsActions((DLine) currentTableElement, navigateMenuItem);
+                createDetailsActions(currentTableElement, navigateMenuItem);
             }
         } else {
             // Add actions to navigate to existing representation
@@ -312,8 +316,10 @@
         if (session != null) {
             final Collection<DRepresentation> otherRepresentations = DialectManager.INSTANCE.getRepresentations(semanticElement, session);
             for (final DRepresentation representation : otherRepresentations) {
-                navigate.setVisible(true);
-                ((IMenuManager) navigate.getInnerItem()).appendToGroup(EXISTING_REPRESENTATION_GROUP_SEPARATOR, buildOpenRepresentationAction(session, representation));
+                if (!EcoreUtil.equals(dTable, representation) && isFromActiveViewpoint(session, representation)) {
+                    navigate.setVisible(true);
+                    ((IMenuManager) navigate.getInnerItem()).appendToGroup(EXISTING_REPRESENTATION_GROUP_SEPARATOR, buildOpenRepresentationAction(session, representation));
+                }
             }
             if (decorator instanceof DRepresentationElement) {
                 if (buildNavigableRepresentationsMenu((IMenuManager) navigate.getInnerItem(), decorator, session)) {
@@ -331,6 +337,11 @@
         if (element.getMapping() != null) {
 
             for (final RepresentationNavigationDescription navDesc : element.getMapping().getNavigationDescriptions()) {
+                boolean append = true;
+                if (!isFromActiveViewpoint(session, navDesc.getRepresentationDescription())) {
+                    append = false;
+                }
+
                 final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(element.getTarget());
 
                 final Map<AbstractVariable, Object> variables = new HashMap<AbstractVariable, Object>();
@@ -340,16 +351,18 @@
                 final InitInterpreterVariablesTask init = new InitInterpreterVariablesTask(variables, interpreter, new EMFCommandFactoryUI());
                 init.execute();
 
-                boolean precondition = true;
-                if (!StringUtil.isEmpty(navDesc.getPrecondition())) {
+                final String precondition = navDesc.getPrecondition();
+                if (append && !StringUtil.isEmpty(precondition)) {
+                    append = false;
+
                     try {
-                        precondition = interpreter.evaluateBoolean(element.getTarget(), navDesc.getPrecondition());
+                        append = interpreter.evaluateBoolean(element.getTarget(), navDesc.getPrecondition());
                     } catch (final EvaluationException e) {
                         RuntimeLoggerManager.INSTANCE.error(navDesc, ToolPackage.eINSTANCE.getAbstractToolDescription_Precondition(), e);
                     }
                 }
 
-                if (precondition) {
+                if (append) {
                     // We return true if at least one action has been
                     // added in the menu to make it visible
                     return buildOpenRepresentationActions(navigate, interpreter, navDesc, element, session);
@@ -624,39 +637,68 @@
         }
     }
 
-    private void createDetailsActions(final DCell currentElement, final SubContributionItem navigate) {
-        if (currentElement.getIntersectionMapping() != null) {
-            createDetailsActions(currentElement, currentElement.getIntersectionMapping().getDetailDescriptions(), navigate);
-        }
-    }
+    private void createDetailsActions(final DTableElement currentElement, final SubContributionItem navigate) {
+        if (currentElement.getMapping() != null) {
+            final Session session = currentElement.getTarget() != null ? SessionManager.INSTANCE.getSession(currentElement.getTarget()) : null;
+            if (session != null) {
+                for (RepresentationCreationDescription desc : currentElement.getMapping().getDetailDescriptions()) {
+                    boolean append = true;
+                    if (!isFromActiveViewpoint(session, desc.getRepresentationDescription())) {
+                        append = false;
+                    }
 
-    private void createDetailsActions(final DLine currentElement, final SubContributionItem navigate) {
-        if (currentElement.getOriginMapping() != null) {
-            createDetailsActions(currentElement, currentElement.getOriginMapping().getDetailDescriptions(), navigate);
-        }
-    }
-
-    private void createDetailsActions(final DTableElement currentElement, final List<RepresentationCreationDescription> detailDescriptions, final SubContributionItem navigate) {
-        for (RepresentationCreationDescription desc : detailDescriptions) {
-            final String precondition = desc.getPrecondition();
-            boolean append = true;
-            if (precondition != null && !StringUtil.isEmpty(precondition.trim())) {
-                append = false;
-                final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(currentElement.getTarget());
-                try {
-                    append = interpreter.evaluateBoolean(currentElement.getTarget(), precondition);
-                } catch (final EvaluationException e) {
-                    // do nothing
+                    final String precondition = desc.getPrecondition();
+                    if (append && !StringUtil.isEmpty(precondition)) {
+                        append = false;
+                        final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(currentElement.getTarget());
+                        try {
+                            append = interpreter.evaluateBoolean(currentElement.getTarget(), precondition);
+                        } catch (final EvaluationException e) {
+                            // do nothing
+                        }
+                    }
+                    if (append) {
+                        navigate.setVisible(true);
+                        ((IMenuManager) navigate.getInnerItem()).appendToGroup(NEW_REPRESENTATION_GROUP_SEPARATOR, new CreateRepresentationFromRepresentationCreationDescription(desc, currentElement,
+                                treeViewManager.getEditingDomain(), treeViewManager.getTableCommandFactory()));
+                    }
                 }
             }
-            if (append) {
-                navigate.setVisible(true);
-                ((IMenuManager) navigate.getInnerItem()).appendToGroup(NEW_REPRESENTATION_GROUP_SEPARATOR, new CreateRepresentationFromRepresentationCreationDescription(desc, currentElement,
-                        treeViewManager.getEditingDomain(), treeViewManager.getTableCommandFactory()));
-            }
         }
     }
 
+    /**
+     * Tests whether a representation description belongs to a viewpoint which
+     * is currently active in the session.
+     * 
+     * @param session
+     *            the current session.
+     * @param representationDescription
+     *            the representation description to check.
+     * @return <code>true</code> if the representation description belongs to a
+     *         viewpoint which is currently active in the session.
+     */
+    private boolean isFromActiveViewpoint(final Session session, final RepresentationDescription representationDescription) {
+        final Viewpoint vp = ViewpointRegistry.getInstance().getViewpoint(representationDescription);
+        return vp != null && session.getSelectedViewpoints(false).contains(vp);
+    }
+
+    /**
+     * Tests whether a representation belongs to a viewpoint which is currently
+     * active in the session.
+     * 
+     * @param session
+     *            the current session.
+     * @param representation
+     *            the representation to check.
+     * @return <code>true</code> if the representation belongs to a viewpoint
+     *         which is currently active in the session.
+     */
+    private boolean isFromActiveViewpoint(final Session session, final DRepresentation representation) {
+        final RepresentationDescription description = DialectManager.INSTANCE.getDescription(representation);
+        return isFromActiveViewpoint(session, description);
+    }
+
     protected Map<TableMapping, DeleteTargetColumnAction> getMappingToDeleteActions() {
         return mappingToDeleteColumnActions;
     }
diff --git a/plugins/org.eclipse.sirius.table/src/org/eclipse/sirius/table/business/internal/metamodel/TableToolVariables.java b/plugins/org.eclipse.sirius.table/src/org/eclipse/sirius/table/business/internal/metamodel/TableToolVariables.java
index 2137346..7952f5d 100644
--- a/plugins/org.eclipse.sirius.table/src/org/eclipse/sirius/table/business/internal/metamodel/TableToolVariables.java
+++ b/plugins/org.eclipse.sirius.table/src/org/eclipse/sirius/table/business/internal/metamodel/TableToolVariables.java
@@ -112,7 +112,7 @@
         containerViewVariable.setName("containerView");
         object.setContainerViewVariable(containerViewVariable);
         final ElementSelectVariable containerVariable = ToolFactory.eINSTANCE.createElementSelectVariable();
-        containerViewVariable.setName("container");
+        containerVariable.setName("container");
         object.setContainerVariable(containerVariable);
         final NameVariable tableNameVariable = ToolFactory.eINSTANCE.createNameVariable();
         tableNameVariable.setName("tableName");
diff --git a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/AbstractSiriusSwtBotGefTestCase.java b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/AbstractSiriusSwtBotGefTestCase.java
index b58003c..f25ed09 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/AbstractSiriusSwtBotGefTestCase.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/AbstractSiriusSwtBotGefTestCase.java
@@ -1094,7 +1094,7 @@
         if (DDiagram.class.isAssignableFrom(expectedRepresentationClass)) {
             swtBotEditor = SWTBotSiriusHelper.getSiriusDiagramEditor(editorPart.getTitle());
             if (disableSnapToGridOnThisEditor) {
-                ((SWTBotSiriusDiagramEditor) swtBotEditor).disableSnapToGrid();
+                ((SWTBotSiriusDiagramEditor) swtBotEditor).setSnapToGrid(false);
             }
         } else {
             swtBotEditor = SWTBotSiriusHelper.getSiriusEditor(editorPart.getTitle());
diff --git a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/business/UINewRepresentationBuilder.java b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/business/UINewRepresentationBuilder.java
index 66b8513..0f7bf40 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/business/UINewRepresentationBuilder.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/business/UINewRepresentationBuilder.java
@@ -143,7 +143,7 @@
             swtBotEditor = SWTBotSiriusHelper.getSiriusEditor(newRepresentationName);
         }
         if (swtBotEditor != null && disableSnapToGridOnThisEditor) {
-            ((SWTBotSiriusDiagramEditor) swtBotEditor).disableSnapToGrid();
+            ((SWTBotSiriusDiagramEditor) swtBotEditor).setSnapToGrid(false);
         }
         return UIRepresentationUtils.buildRepresentation(null, getRealNewRepresentationName(), getRepresentationType());
     }
diff --git a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/editor/SWTBotSiriusDiagramEditor.java b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/editor/SWTBotSiriusDiagramEditor.java
index a1e71f1..80884a5 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/editor/SWTBotSiriusDiagramEditor.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/editor/SWTBotSiriusDiagramEditor.java
@@ -18,21 +18,27 @@
 
 import org.eclipse.draw2d.FigureCanvas;
 import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
 import org.eclipse.draw2d.geometry.Dimension;
 import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PrecisionPoint;
 import org.eclipse.draw2d.geometry.Rectangle;
 import org.eclipse.gef.ConnectionEditPart;
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.GraphicalEditPart;
 import org.eclipse.gef.GraphicalViewer;
 import org.eclipse.gef.Request;
+import org.eclipse.gef.SnapToHelper;
 import org.eclipse.gef.editparts.AbstractConnectionEditPart;
 import org.eclipse.gef.editparts.ZoomManager;
 import org.eclipse.gef.palette.ToolEntry;
+import org.eclipse.gef.requests.CreateRequest;
 import org.eclipse.gef.requests.DirectEditRequest;
 import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
 import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
 import org.eclipse.gmf.runtime.diagram.ui.internal.properties.WorkspaceViewerProperties;
+import org.eclipse.gmf.runtime.diagram.ui.internal.ruler.SnapToGridEx;
 import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
 import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer;
 import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer;
@@ -79,6 +85,8 @@
 import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PlatformUI;
+import org.hamcrest.BaseMatcher;
+import org.hamcrest.Description;
 import org.hamcrest.Matcher;
 import org.junit.Assert;
 
@@ -1393,9 +1401,44 @@
 
     /**
      * Disable the snapToGrid option for this editor.
+     * 
+     * @deprecated Use {@link #setSnapToGrid(boolean)} instead.
      */
+    @Deprecated
     public void disableSnapToGrid() {
-        ((DiagramGraphicalViewer) getDiagramGraphicalViewer()).getWorkspaceViewerPreferenceStore().setValue(WorkspaceViewerProperties.SNAPTOGRID, false);
+        setSnapToGrid(false);
+    }
+
+    /**
+     * Disable or enable the snapToGrid option for this editor.
+     * 
+     * @param snap
+     *            true to enable, false to disable snap to grid property
+     */
+    public void setSnapToGrid(boolean snap) {
+        ((DiagramGraphicalViewer) getDiagramGraphicalViewer()).getWorkspaceViewerPreferenceStore().setValue(WorkspaceViewerProperties.SNAPTOGRID, snap);
+    }
+
+    /**
+     * Disable or enable the snapToGrid option for this editor.
+     * 
+     * @param snap
+     *            true to enable, false to disable snap to grid property
+     * @param gridSpacing
+     *            The grid spacing parameter
+     * @param rulerUnits
+     *            The ruler units value (0 for Inches, 1 for Centimeters, 2 for
+     *            Pixels)
+     */
+    public void setSnapToGrid(final boolean snap, final double gridSpacing, final int rulerUnits) {
+        PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+            @Override
+            public void run() {
+                ((DiagramGraphicalViewer) getDiagramGraphicalViewer()).getWorkspaceViewerPreferenceStore().setValue(WorkspaceViewerProperties.SNAPTOGRID, snap);
+                ((DiagramGraphicalViewer) getDiagramGraphicalViewer()).getWorkspaceViewerPreferenceStore().setValue(WorkspaceViewerProperties.GRIDSPACING, gridSpacing);
+                ((DiagramGraphicalViewer) getDiagramGraphicalViewer()).getWorkspaceViewerPreferenceStore().setValue(WorkspaceViewerProperties.RULERUNIT, rulerUnits);
+            }
+        });
     }
 
     /**
@@ -1589,4 +1632,41 @@
             throw new WidgetNotFoundException(String.format("Expected to find one text control, but found %s.  Is the editor in direct-edit mode?", controls.size()));
         }
     }
+
+    /**
+     * Get the diagram edit part of this editor.
+     * 
+     * @return The diagram edit part of this editor.
+     */
+    public DiagramEditPart getDiagramEditPart() {
+        final List<SWTBotGefEditPart> parts = editParts(new BaseMatcher<EditPart>() {
+
+            public void describeTo(final Description description) {
+            }
+
+            public boolean matches(final Object item) {
+                return item instanceof DiagramEditPart;
+            }
+
+        });
+        return (DiagramEditPart) parts.iterator().next().part();
+    }
+
+    /**
+     * Adapt location according to SnapToHelper.
+     * 
+     * @param expectedAbsoluteLocation
+     *            The initial expected location
+     * @return The adapted location
+     */
+    public PrecisionPoint adaptLocationToSnap(Point expectedAbsoluteLocation) {
+        IGraphicalEditPart diagramEditPart = getDiagramEditPart();
+        SnapToHelper snapToHelper = new SnapToGridEx(diagramEditPart);
+        PrecisionPoint preciseLocation = new PrecisionPoint(expectedAbsoluteLocation);
+        diagramEditPart.getFigure().translateToAbsolute(preciseLocation);
+        PrecisionPoint result = new PrecisionPoint(preciseLocation);
+        snapToHelper.snapPoint(new CreateRequest(), PositionConstants.HORIZONTAL | PositionConstants.VERTICAL, preciseLocation, result);
+        diagramEditPart.getFigure().translateToRelative(result);
+        return result;
+    }
 }
diff --git a/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/DTreeMenuListener.java b/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/DTreeMenuListener.java
index da6bf68..86f8f8c 100644
--- a/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/DTreeMenuListener.java
+++ b/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/DTreeMenuListener.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010, 2012 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES and others.
  * 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,6 +19,7 @@
 
 import org.eclipse.emf.common.notify.AdapterFactory;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.emf.edit.provider.IItemLabelProvider;
 import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
 import org.eclipse.jface.action.IAction;
@@ -28,6 +29,7 @@
 import org.eclipse.jface.action.Separator;
 import org.eclipse.jface.action.SubContributionItem;
 import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.sirius.business.api.componentization.ViewpointRegistry;
 import org.eclipse.sirius.business.api.dialect.DialectManager;
 import org.eclipse.sirius.business.api.helper.task.InitInterpreterVariablesTask;
 import org.eclipse.sirius.business.api.logger.RuntimeLoggerInterpreter;
@@ -55,6 +57,8 @@
 import org.eclipse.sirius.viewpoint.DRepresentationElement;
 import org.eclipse.sirius.viewpoint.DSemanticDecorator;
 import org.eclipse.sirius.viewpoint.SiriusPlugin;
+import org.eclipse.sirius.viewpoint.description.RepresentationDescription;
+import org.eclipse.sirius.viewpoint.description.Viewpoint;
 import org.eclipse.sirius.viewpoint.description.tool.AbstractVariable;
 import org.eclipse.sirius.viewpoint.description.tool.RepresentationCreationDescription;
 import org.eclipse.sirius.viewpoint.description.tool.RepresentationNavigationDescription;
@@ -230,11 +234,13 @@
         if (session != null) {
             final Collection<DRepresentation> otherRepresentations = DialectManager.INSTANCE.getRepresentations(semanticElement, session);
             for (final DRepresentation representation : otherRepresentations) {
-                navigate.setVisible(true);
-                ((IMenuManager) navigate.getInnerItem()).appendToGroup(EXISTING_REPRESENTATION_GROUP_SEPARATOR, buildOpenRepresentationAction(session, representation));
+                if (!EcoreUtil.equals(dTree, representation) && isFromActiveViewpoint(session, representation)) {
+                    navigate.setVisible(true);
+                    ((IMenuManager) navigate.getInnerItem()).appendToGroup(EXISTING_REPRESENTATION_GROUP_SEPARATOR, buildOpenRepresentationAction(session, representation));
+                }
             }
             if (decorator instanceof DRepresentationElement) {
-                if (buildNavigableRepresentationsMenu((IMenuManager) navigate.getInnerItem(), decorator, session)) {
+                if (buildNavigableRepresentationsMenu((IMenuManager) navigate.getInnerItem(), (DRepresentationElement) decorator, session)) {
                     // if at least one navigable representation menu
                     // has been created, we have to make the navigate menu
                     // visible
@@ -244,11 +250,15 @@
         }
     }
 
-    private boolean buildNavigableRepresentationsMenu(final IMenuManager navigate, final EObject designerObj, final Session session) {
-        final DRepresentationElement element = (DRepresentationElement) designerObj;
+    private boolean buildNavigableRepresentationsMenu(final IMenuManager navigate, final DRepresentationElement element, final Session session) {
         if (element.getMapping() != null) {
 
             for (final RepresentationNavigationDescription navDesc : element.getMapping().getNavigationDescriptions()) {
+                boolean append = true;
+                if (!isFromActiveViewpoint(session, navDesc.getRepresentationDescription())) {
+                    append = false;
+                }
+
                 final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(element.getTarget());
 
                 final Map<AbstractVariable, Object> variables = new HashMap<AbstractVariable, Object>();
@@ -258,16 +268,18 @@
                 final InitInterpreterVariablesTask init = new InitInterpreterVariablesTask(variables, interpreter, new EMFCommandFactoryUI());
                 init.execute();
 
-                boolean precondition = true;
-                if (!StringUtil.isEmpty(navDesc.getPrecondition())) {
+                final String precondition = navDesc.getPrecondition();
+                if (append && !StringUtil.isEmpty(precondition)) {
+                    append = false;
+
                     try {
-                        precondition = interpreter.evaluateBoolean(element.getTarget(), navDesc.getPrecondition());
+                        append = interpreter.evaluateBoolean(element.getTarget(), navDesc.getPrecondition());
                     } catch (final EvaluationException e) {
                         RuntimeLoggerManager.INSTANCE.error(navDesc, ToolPackage.eINSTANCE.getAbstractToolDescription_Precondition(), e);
                     }
                 }
 
-                if (precondition) {
+                if (append) {
                     // VP-2659 : we return true if at least one action has been
                     // added in the menu to make it visible
                     return buildOpenRepresentationActions(navigate, interpreter, navDesc, element, session);
@@ -382,30 +394,67 @@
     }
 
     private void createDetailsActions(final DTreeItem currentElement, final SubContributionItem navigate) {
-        if (currentElement.getActualMapping() != null) {
-            final Iterator<RepresentationCreationDescription> it = currentElement.getActualMapping().getDetailDescriptions().iterator();
-            while (it.hasNext()) {
-                final RepresentationCreationDescription desc = it.next();
-                final String precondition = desc.getPrecondition();
-                boolean append = true;
-                if (precondition != null && !StringUtil.isEmpty(precondition.trim())) {
-                    append = false;
-                    final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(currentElement.getTarget());
-                    try {
-                        append = interpreter.evaluateBoolean(currentElement.getTarget(), precondition);
-                    } catch (final EvaluationException e) {
-                        // do nothing
+        if (currentElement.getMapping() != null) {
+            final Session session = currentElement.getTarget() != null ? SessionManager.INSTANCE.getSession(currentElement.getTarget()) : null;
+            if (session != null) {
+                for (RepresentationCreationDescription desc : currentElement.getMapping().getDetailDescriptions()) {
+                    boolean append = true;
+                    if (!isFromActiveViewpoint(session, desc.getRepresentationDescription())) {
+                        append = false;
                     }
-                }
-                if (append) {
-                    navigate.setVisible(true);
-                    ((IMenuManager) navigate.getInnerItem()).appendToGroup(NEW_REPRESENTATION_GROUP_SEPARATOR, new CreateRepresentationFromRepresentationCreationDescription(desc, currentElement,
-                            treeViewManager.getEditingDomain(), treeViewManager.getTreeCommandFactory()));
+
+                    final String precondition = desc.getPrecondition();
+                    if (append && !StringUtil.isEmpty(precondition)) {
+                        append = false;
+                        final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(currentElement.getTarget());
+                        try {
+                            append = interpreter.evaluateBoolean(currentElement.getTarget(), precondition);
+                        } catch (final EvaluationException e) {
+                            // do nothing
+                        }
+                    }
+                    if (append) {
+                        navigate.setVisible(true);
+                        ((IMenuManager) navigate.getInnerItem()).appendToGroup(NEW_REPRESENTATION_GROUP_SEPARATOR, new CreateRepresentationFromRepresentationCreationDescription(desc, currentElement,
+                                treeViewManager.getEditingDomain(), treeViewManager.getTreeCommandFactory()));
+                    }
                 }
             }
         }
     }
 
+    /**
+     * Tests whether a representation description belongs to a viewpoint which
+     * is currently active in the session.
+     * 
+     * @param session
+     *            the current session.
+     * @param representationDescription
+     *            the representation description to check.
+     * @return <code>true</code> if the representation description belongs to a
+     *         viewpoint which is currently active in the session.
+     */
+    private boolean isFromActiveViewpoint(final Session session, final RepresentationDescription representationDescription) {
+        final Viewpoint vp = ViewpointRegistry.getInstance().getViewpoint(representationDescription);
+        return vp != null && session.getSelectedViewpoints(false).contains(vp);
+    }
+
+    /**
+     * Tests whether a representation belongs to a viewpoint which is currently
+     * active in the session.
+     * 
+     * @param session
+     *            the current session.
+     * @param representation
+     *            the representation to check.
+     * @return <code>true</code> if the representation belongs to a viewpoint
+     *         which is currently active in the session.
+     */
+    private boolean isFromActiveViewpoint(final Session session, final DRepresentation representation) {
+        final RepresentationDescription description = DialectManager.INSTANCE.getDescription(representation);
+        return isFromActiveViewpoint(session, description);
+    }
+
     protected Map<TreeMapping, List<AbstractToolAction>> getMappingToCreateActions() {
         return mappingToCreateActions;
     }
diff --git a/plugins/org.eclipse.sirius.tree/src/org/eclipse/sirius/tree/business/internal/metamodel/TreeToolVariables.java b/plugins/org.eclipse.sirius.tree/src/org/eclipse/sirius/tree/business/internal/metamodel/TreeToolVariables.java
index e9529b3..ff449f6 100644
--- a/plugins/org.eclipse.sirius.tree/src/org/eclipse/sirius/tree/business/internal/metamodel/TreeToolVariables.java
+++ b/plugins/org.eclipse.sirius.tree/src/org/eclipse/sirius/tree/business/internal/metamodel/TreeToolVariables.java
@@ -160,7 +160,7 @@
         containerViewVariable.setName("containerView");
         object.setContainerViewVariable(containerViewVariable);
         final ElementSelectVariable containerVariable = ToolFactory.eINSTANCE.createElementSelectVariable();
-        containerViewVariable.setName("container");
+        containerVariable.setName("container");
         object.setContainerVariable(containerVariable);
         final NameVariable treeNameVariable = ToolFactory.eINSTANCE.createNameVariable();
         treeNameVariable.setName("treeName");
diff --git a/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/SiriusEditPlugin.java b/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/SiriusEditPlugin.java
index 05cd159..15dfca6 100644
--- a/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/SiriusEditPlugin.java
+++ b/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/SiriusEditPlugin.java
@@ -62,7 +62,6 @@
 import org.eclipse.sirius.viewpoint.description.tool.provider.ToolItemProviderAdapterFactory;
 import org.eclipse.sirius.viewpoint.description.validation.provider.ValidationItemProviderAdapterFactory;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
 
@@ -210,9 +209,6 @@
                 SiriusEditPlugin.getPlugin().getLog().log(status);
             }
 
-            /* set ecore editor as default editor. */
-            PlatformUI.getWorkbench().getEditorRegistry().setDefaultEditor("*.ecore", "org.eclipse.emf.ecore.presentation.EcoreEditorID");
-
             try {
                 // Just a call to load all plugins that provide a specific
                 // resource locator (can be usefull as for automaticall test).
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/session/IEditingSession.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/session/IEditingSession.java
index 4d5797c..27307ab 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/session/IEditingSession.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/session/IEditingSession.java
@@ -25,7 +25,7 @@
  * @author cbrun
  */
 public interface IEditingSession {
-    
+
     /**
      * Get the wrapped {@link Session}.
      * 
@@ -33,10 +33,12 @@
      * @since 0.9.0
      */
     Session getSession();
-    
+
     /**
      * Attach an editor to the current {@link IEditingSession}.
      * 
+     * This is called when a {@link DialectEditor} is opened
+     * 
      * @param editor
      *            editor to attach.
      */
@@ -55,6 +57,8 @@
     /**
      * Detach an editor from the current Session.
      * 
+     * This is called when a {@link DialectEditor} is closed
+     * 
      * @param editor
      *            editor to detach.
      */
@@ -191,11 +195,12 @@
      */
     DialectEditor getEditor(DRepresentation representation);
 
-    
     /**
      * Notify the editing session about the event given as parameter.
-     * @param event the event
+     * 
+     * @param event
+     *            the event
      */
     void notify(EditingSessionEvent event);
-    
+
 }
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/editor/DialectEditorCloser.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/editor/DialectEditorCloser.java
index 6b97be2..f985ca1 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/editor/DialectEditorCloser.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/editor/DialectEditorCloser.java
@@ -10,19 +10,17 @@
  *******************************************************************************/
 package org.eclipse.sirius.ui.business.internal.dialect.editor;
 
-import org.eclipse.emf.transaction.NotificationFilter;
 import org.eclipse.emf.transaction.ResourceSetChangeEvent;
 import org.eclipse.emf.transaction.ResourceSetListener;
 import org.eclipse.emf.transaction.ResourceSetListenerImpl;
 import org.eclipse.emf.transaction.TransactionalEditingDomain;
 import org.eclipse.sirius.ui.business.api.dialect.DialectEditor;
-import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager;
 import org.eclipse.sirius.ui.business.api.session.IEditingSession;
 import org.eclipse.swt.widgets.Display;
 
 /**
- * A {@link ResourceSetListener} to close a {@link DialectEditor} when its DRepresentation or its
- * DRepresentation's target has been deleted.
+ * A {@link ResourceSetListener} to close a {@link DialectEditor} when its
+ * DRepresentation or its DRepresentation's target has been deleted.
  * 
  * @author <a href="mailto:esteban.dugueperoux@obeo.fr">Esteban Dugueperoux</a>
  */
@@ -32,8 +30,6 @@
 
     private DialectEditor dialectEditor;
 
-    private NotificationFilter notificationFilter;
-
     /**
      * Default constructor.
      * 
@@ -45,26 +41,14 @@
      *            DRepresentation's root semantic deletion
      */
     public DialectEditorCloser(IEditingSession editingSession, DialectEditor dialectEditor) {
-        super();
+        super(new DialectEditorCloserFilter(dialectEditor.getRepresentation()));
         this.dialectEditor = dialectEditor;
         this.editingSession = editingSession;
-        notificationFilter = new DialectEditorCloserFilter(dialectEditor.getRepresentation());
         TransactionalEditingDomain domain = editingSession.getSession().getTransactionalEditingDomain();
         domain.addResourceSetListener(this);
     }
 
     /**
-     * Overridden to have this listener only notified on DRepresentation's
-     * target deletion.
-     * 
-     * {@inheritDoc}
-     */
-    @Override
-    public NotificationFilter getFilter() {
-        return notificationFilter;
-    }
-
-    /**
      * We are only interested in post-commit to close {@link DialectEditor}.
      * 
      * {@inheritDoc}
@@ -82,21 +66,7 @@
      */
     @Override
     public void resourceSetChanged(ResourceSetChangeEvent event) {
-        Display.getDefault().asyncExec(new Runnable() {
-
-            public void run() {
-                if (dialectEditor != null) {
-                    // We open a dialog informing the user that the
-                    // representation or its target has been deleted, and close the editor
-                    if (dialectEditor.getSite() != null && dialectEditor.getSite().getShell() != null) {
-                        dialectEditor.getDialogFactory().editorWillBeClosedInformationDialog(dialectEditor.getSite().getShell());
-                    }
-                    DialectUIManager.INSTANCE.closeEditor(dialectEditor, false);
-                    editingSession.detachEditor(dialectEditor);
-                }
-            }
-
-        });
+        Display.getDefault().asyncExec(new DialectEditorCloserRunnable(editingSession, dialectEditor));
     }
 
     /**
@@ -104,6 +74,8 @@
      */
     public void dispose() {
         getTarget().removeResourceSetListener(this);
+        dialectEditor = null;
+        editingSession = null;
     }
 
 }
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/editor/DialectEditorCloserRunnable.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/editor/DialectEditorCloserRunnable.java
new file mode 100644
index 0000000..1cdb2be
--- /dev/null
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/editor/DialectEditorCloserRunnable.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2014 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.sirius.ui.business.internal.dialect.editor;
+
+import org.eclipse.sirius.ui.business.api.dialect.DialectEditor;
+import org.eclipse.sirius.ui.business.api.session.IEditingSession;
+
+/**
+ * {@link Runnable} to close a {@link DialectEditor}.
+ * 
+ * @author <a href="mailto:esteban.dugueperoux@obeo.fr">Esteban Dugueperoux</a>
+ */
+public class DialectEditorCloserRunnable implements Runnable {
+
+    private IEditingSession editingSession;
+
+    private DialectEditor dialectEditor;
+
+    /**
+     * Default constructor.
+     * 
+     * @param editingSession
+     *            the {@link IEditingSession} to close the {@link DialectEditor}
+     * @param dialectEditor
+     *            the {@link DialectEditor} to close
+     */
+    public DialectEditorCloserRunnable(IEditingSession editingSession, DialectEditor dialectEditor) {
+        this.editingSession = editingSession;
+        this.dialectEditor = dialectEditor;
+    }
+
+    @Override
+    public void run() {
+        if (dialectEditor != null && editingSession.getEditors().contains(dialectEditor)) {
+            // We open a dialog informing the user that the
+            // representation or its target has been deleted, and close
+            // the editor
+            if (dialectEditor.getSite() != null && dialectEditor.getSite().getShell() != null) {
+                dialectEditor.getDialogFactory().editorWillBeClosedInformationDialog(dialectEditor.getSite().getShell());
+            }
+            editingSession.closeEditors(false, dialectEditor);
+        }
+    }
+
+}
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/ResourceQuery.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/ResourceQuery.java
index 4a5c156..779fbd4 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/ResourceQuery.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/ResourceQuery.java
@@ -16,7 +16,7 @@
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.sirius.business.api.session.resource.AirdResource;
-import org.eclipse.sirius.viewpoint.ViewpointPackage;
+import org.eclipse.sirius.viewpoint.DAnalysis;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Sets;
@@ -102,8 +102,13 @@
         }
         isRepresentationsResource = isRepresentationsResource && new FileQuery(resource.getURI().fileExtension()).isSessionResourceFile();
         isRepresentationsResource = isRepresentationsResource || resource instanceof AirdResource;
-        if (!isRepresentationsResource && resource.getContents() != null && resource.getContents().size() == 1) {
-            isRepresentationsResource = resource.getContents().get(0).eClass().equals(ViewpointPackage.eINSTANCE.getDAnalysis());
+        if (!isRepresentationsResource && !resource.getContents().isEmpty()) {
+            for (EObject contentEObject : resource.getContents()) {
+                if (contentEObject != null && contentEObject instanceof DAnalysis) {
+                    isRepresentationsResource = true;
+                    break;
+                }
+            }
         }
         return isRepresentationsResource;
     }
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/resource/parser/AirDCrossReferenceAdapterImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/resource/parser/AirDCrossReferenceAdapterImpl.java
index 879483d..dedf80f 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/resource/parser/AirDCrossReferenceAdapterImpl.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/resource/parser/AirDCrossReferenceAdapterImpl.java
@@ -10,9 +10,10 @@
  *******************************************************************************/
 package org.eclipse.sirius.business.internal.resource.parser;
 
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter;
+import org.eclipse.sirius.business.api.query.ResourceQuery;
 import org.eclipse.sirius.business.internal.resource.AirDCrossReferenceAdapter;
 
 /**
@@ -20,23 +21,31 @@
  * AirDResource.
  * 
  * @author smonnier
- * 
  */
 public class AirDCrossReferenceAdapterImpl extends CrossReferenceAdapter implements AirDCrossReferenceAdapter {
     boolean resolve = true;
 
     /**
-     * This method has been overridden to filter only the AirDResource and its
-     * elements.
+     * Overridden to have this {@link AirDCrossReferenceAdapter} installed only
+     * on aird resource.
      * 
-     * {@inheritDoc}
+     * @param notifier
+     *            a model element of the ResourceSet
      */
     @Override
-    public void selfAdapt(Notification notification) {
-        if (!notification.isTouch()
-                && (notification.getNotifier() instanceof AirDResourceImpl || (notification.getNotifier() instanceof EObject && ((EObject) notification.getNotifier()).eResource() instanceof AirDResourceImpl))) {
-            super.selfAdapt(notification);
+    protected void addAdapter(Notifier notifier) {
+        if (notifier instanceof Resource) {
+            Resource resource = (Resource) notifier;
+            if (!new ResourceQuery(resource).isRepresentationsResource()) {
+                return;
+            }
         }
+        super.addAdapter(notifier);
+    }
+
+    @Override
+    public boolean isAdapterForType(Object type) {
+        return type == AirDCrossReferenceAdapter.class;
     }
 
     /**
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/resource/parser/AirDResourceFactory.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/resource/parser/AirDResourceFactory.java
index 81afa08..8f35025 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/resource/parser/AirDResourceFactory.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/resource/parser/AirDResourceFactory.java
@@ -27,11 +27,8 @@
 import org.eclipse.sirius.business.internal.migration.RepresentationsFileMigrationService;
 import org.eclipse.sirius.business.internal.migration.RepresentationsFileResourceHandler;
 import org.eclipse.sirius.business.internal.migration.RepresentationsFileVersionSAXParser;
-import org.eclipse.sirius.business.internal.resource.AirDCrossReferenceAdapter;
 import org.osgi.framework.Version;
 
-import com.google.common.base.Predicates;
-import com.google.common.collect.Iterables;
 import com.google.common.collect.Maps;
 
 /**
@@ -117,10 +114,6 @@
             resource.setEncoding(XMI_ENCODING);
         }
 
-        if (!Iterables.any(resource.eAdapters(), Predicates.instanceOf(AirDCrossReferenceAdapter.class))) {
-            resource.eAdapters().add(new AirDCrossReferenceAdapterImpl());
-        }
-
         return resource;
     }
 
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionFactoryImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionFactoryImpl.java
index a4fa6df..fdc0308 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionFactoryImpl.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionFactoryImpl.java
@@ -31,6 +31,7 @@
 import org.eclipse.sirius.business.internal.movida.Movida;
 import org.eclipse.sirius.business.internal.movida.registry.ViewpointRegistry;
 import org.eclipse.sirius.business.internal.movida.registry.ViewpointURIConverter;
+import org.eclipse.sirius.business.internal.resource.parser.AirDCrossReferenceAdapterImpl;
 import org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl;
 import org.eclipse.sirius.common.tools.api.editing.EditingDomainFactoryService;
 import org.eclipse.sirius.common.tools.api.resource.ResourceSetFactory;
@@ -75,7 +76,8 @@
      */
     public Session createSession(final URI sessionResourceURI, IProgressMonitor monitor) throws CoreException {
         final ResourceSet set = ResourceSetFactory.createFactory().createResourceSet(sessionResourceURI);
-
+        set.eAdapters().add(new AirDCrossReferenceAdapterImpl());
+        
         final TransactionalEditingDomain transactionalEditingDomain = EditingDomainFactoryService.INSTANCE.getEditingDomainFactory().createEditingDomain(set);
         if (Movida.isEnabled()) {
             transactionalEditingDomain.getResourceSet()
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java
index 57989dd..6c42ada 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java
@@ -62,7 +62,6 @@
 import org.eclipse.sirius.business.api.extender.MetamodelDescriptorManager;
 import org.eclipse.sirius.business.api.helper.SiriusResourceHelper;
 import org.eclipse.sirius.business.api.helper.SiriusUtil;
-import org.eclipse.sirius.business.api.query.AirDResouceQuery;
 import org.eclipse.sirius.business.api.query.DAnalysisQuery;
 import org.eclipse.sirius.business.api.query.FileQuery;
 import org.eclipse.sirius.business.api.query.ResourceQuery;
@@ -84,7 +83,6 @@
 import org.eclipse.sirius.business.api.session.danalysis.DAnalysisSession;
 import org.eclipse.sirius.business.api.session.danalysis.DAnalysisSessionHelper;
 import org.eclipse.sirius.business.api.session.danalysis.DAnalysisSessionService;
-import org.eclipse.sirius.business.api.session.resource.AirdResource;
 import org.eclipse.sirius.business.internal.metamodel.helper.ComponentizationHelper;
 import org.eclipse.sirius.business.internal.migration.resource.ResourceFileExtensionPredicate;
 import org.eclipse.sirius.business.internal.movida.Movida;
@@ -108,7 +106,6 @@
 import org.eclipse.sirius.ecore.extender.business.api.permission.IPermissionAuthority;
 import org.eclipse.sirius.ecore.extender.business.api.permission.PermissionAuthorityRegistry;
 import org.eclipse.sirius.ecore.extender.business.api.permission.exception.LockedInstanceException;
-import org.eclipse.sirius.ext.base.Option;
 import org.eclipse.sirius.tools.api.command.semantic.RemoveSemanticResourceCommand;
 import org.eclipse.sirius.tools.api.command.ui.NoUICallback;
 import org.eclipse.sirius.tools.api.interpreter.InterpreterRegistry;
@@ -771,7 +768,6 @@
         registerResourceInCrossReferencer(newResource);
     }
 
-
     /**
      * Add the cross referencer (if exists and is not present) to the eAdapters
      * list of the given resource.
@@ -1360,7 +1356,6 @@
         set.getResources().remove(res);
     }
 
-
     @Override
     public void statusChanged(final Resource resource, final ResourceStatus oldStatus, final ResourceStatus newStatus) {
         // Do nothing while processing.
@@ -1695,12 +1690,8 @@
             ViewpointRegistry.getInstance().removeListener(this);
         }
         notifyListeners(SessionListener.CLOSING);
-        // Disable resolution of proxy for all airdCrossReferenceAdapter of
-        // session resources and for semanticCrossReferencer during the closing
-        List<AirDCrossReferenceAdapter> airdCrossReferenceAdapters = disableCrossReferenceAdaptersResolution(Iterables.filter(getAllSessionResources(), AirdResource.class));
-        if (getSemanticCrossReferencer() instanceof LazyCrossReferencer) {
-            ((LazyCrossReferencer) getSemanticCrossReferencer()).disableResolve();
-        }
+        disableAndRemoveECrossReferenceAdapters();
+
         if (controlledResourcesDetector != null) {
             controlledResourcesDetector.dispose();
         }
@@ -1708,18 +1699,7 @@
             dAnalysisRefresher.dispose();
             dAnalysisRefresher = null;
         }
-        // Let's clear the cross referencer if it's still there.
-        for (final Resource res : getSemanticResources()) {
-            unregisterResourceInCrossReferencer(res);
-        }
-        for (final DAnalysis analysis : Iterables.filter(allAnalyses(), Predicates.notNull())) {
-            removeAdaptersOnAnalysis(analysis);
-            Resource analysisResource = analysis.eResource();
-            if (analysisResource != null) {
-                unregisterResourceInCrossReferencer(analysisResource);
-            }
-        }
-        ResourceSet resourceSet = transactionalEditingDomain.getResourceSet();
+
         if (interpreter != null) {
             interpreter.dispose();
         }
@@ -1730,10 +1710,8 @@
          * Let's clear the cross referencer of the VSM resource if it's still
          * there (added by the updateSelectedViewpointsData).
          */
-        Iterable<Resource> resources = Lists.newArrayList(resourceSet.getResources());
-        for (Resource resource : Iterables.filter(resources, new ResourceFileExtensionPredicate(SiriusUtil.DESCRIPTION_MODEL_EXTENSION, false))) {
-            unregisterResourceInCrossReferencer(resource);
-        }
+        ResourceSet resourceSet = getTransactionalEditingDomain().getResourceSet();
+
         if (currentResourceCollector != null) {
             currentResourceCollector.dispose();
             currentResourceCollector = null;
@@ -1769,14 +1747,8 @@
         if (semanticResources != null) {
             semanticResources.clear();
         }
-        // Enable resolution for all airdCrossReferenceAdapter of session
-        // resources after the closing
-        for (AirDCrossReferenceAdapter airDCrossReferenceAdapter : airdCrossReferenceAdapters) {
-            airDCrossReferenceAdapter.enableResolve();
-        }
-        if (getSemanticCrossReferencer() instanceof LazyCrossReferencer) {
-            ((LazyCrossReferencer) getSemanticCrossReferencer()).enableResolve();
-        }
+        reenableECrossReferenceAdaptersBeforeEndOfClosing();
+
         if (disposeEditingDomainOnClose) {
             transactionalEditingDomain.dispose();
             doDisposePermissionAuthority(resourceSet);
@@ -1784,6 +1756,52 @@
         mainDAnalysis = null;
     }
 
+    private void disableAndRemoveECrossReferenceAdapters() {
+        ResourceSet resourceSet = getTransactionalEditingDomain().getResourceSet();
+        // Disable resolution of proxy for AirDCrossReferenceAdapter of
+        // session and for semanticCrossReferencer during the closing
+        Adapter existingAirDCrossReferenceAdapter = EcoreUtil.getExistingAdapter(resourceSet, AirDCrossReferenceAdapter.class);
+        AirDCrossReferenceAdapter airDCrossReferenceAdapter = null;
+        if (existingAirDCrossReferenceAdapter instanceof AirDCrossReferenceAdapter) {
+            airDCrossReferenceAdapter = (AirDCrossReferenceAdapter) existingAirDCrossReferenceAdapter;
+            airDCrossReferenceAdapter.disableResolve();
+            resourceSet.eAdapters().remove(airDCrossReferenceAdapter);
+        }
+        if (getSemanticCrossReferencer() instanceof LazyCrossReferencer) {
+            ((LazyCrossReferencer) getSemanticCrossReferencer()).disableResolve();
+        }
+        // Let's clear the cross referencer if it's still there.
+        for (final Resource res : getSemanticResources()) {
+            unregisterResourceInCrossReferencer(res);
+        }
+        for (final DAnalysis analysis : Iterables.filter(allAnalyses(), Predicates.notNull())) {
+            removeAdaptersOnAnalysis(analysis);
+            Resource analysisResource = analysis.eResource();
+            if (analysisResource != null) {
+                unregisterResourceInCrossReferencer(analysisResource);
+            }
+        }
+        Iterable<Resource> resources = Lists.newArrayList(resourceSet.getResources());
+        for (Resource resource : Iterables.filter(resources, new ResourceFileExtensionPredicate(SiriusUtil.DESCRIPTION_MODEL_EXTENSION, false))) {
+            unregisterResourceInCrossReferencer(resource);
+        }
+    }
+
+    private void reenableECrossReferenceAdaptersBeforeEndOfClosing() {
+        ResourceSet resourceSet = getTransactionalEditingDomain().getResourceSet();
+        // Enable resolution for AirdCrossReferenceAdapter of session at the end
+        // of closing
+        Adapter existingAirDCrossReferenceAdapter = EcoreUtil.getExistingAdapter(resourceSet, AirDCrossReferenceAdapter.class);
+        AirDCrossReferenceAdapter airDCrossReferenceAdapter = null;
+        if (existingAirDCrossReferenceAdapter instanceof AirDCrossReferenceAdapter) {
+            airDCrossReferenceAdapter = (AirDCrossReferenceAdapter) existingAirDCrossReferenceAdapter;
+            airDCrossReferenceAdapter.enableResolve();
+        }
+        if (getSemanticCrossReferencer() instanceof LazyCrossReferencer) {
+            ((LazyCrossReferencer) getSemanticCrossReferencer()).enableResolve();
+        }
+    }
+
     private void flushOperations() {
         CommandStack commandStack = transactionalEditingDomain.getCommandStack();
         ResourceSet resourceSet = transactionalEditingDomain.getResourceSet();
@@ -1815,25 +1833,6 @@
     }
 
     /**
-     * @param resources
-     *            List of resources that potentially having a
-     *            AirDCrossReferenceAdapter.
-     * @return The list of airDCrossReferenceAdapter for which the resolution
-     *         has been disabled.
-     */
-    private List<AirDCrossReferenceAdapter> disableCrossReferenceAdaptersResolution(Iterable<AirdResource> resources) {
-        List<AirDCrossReferenceAdapter> airdCrossReferenceAdapters = Lists.newArrayList();
-        for (AirdResource representationsFileResource : resources) {
-            Option<AirDCrossReferenceAdapter> optionalAirdCrossReferenceAdapter = new AirDResouceQuery(representationsFileResource).getAirDCrossReferenceAdapter();
-            if (optionalAirdCrossReferenceAdapter.some()) {
-                airdCrossReferenceAdapters.add(optionalAirdCrossReferenceAdapter.get());
-                optionalAirdCrossReferenceAdapter.get().disableResolve();
-            }
-        }
-        return airdCrossReferenceAdapters;
-    }
-
-    /**
      * Method called at {@link Session#close(IProgressMonitor)} to unload all
      * referenced {@link Resource}s.
      */
diff --git a/releng/org.eclipse.sirius.targets/sirius_luna.target b/releng/org.eclipse.sirius.targets/sirius_luna.target
index f95d397..c3ccf00 100644
--- a/releng/org.eclipse.sirius.targets/sirius_luna.target
+++ b/releng/org.eclipse.sirius.targets/sirius_luna.target
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <?pde?>
 <!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="sirius_luna" sequenceNumber="1401702036">
+<target name="sirius_luna" sequenceNumber="1403709565">
   <locations>
     <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
       <unit id="org.apache.log4j" version="1.2.15.v201012070815"/>
@@ -27,11 +27,11 @@
     <location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
       <unit id="com.google.guava" version="15.0.0.v201403281430"/>
       <unit id="com.ibm.icu" version="52.1.0.v201404241930"/>
-      <unit id="org.eclipse.acceleo.feature.group" version="3.5.0.201405271356"/>
-      <unit id="org.eclipse.acceleo.ide.ui" version="3.5.0.201405271356"/>
+      <unit id="org.eclipse.acceleo.feature.group" version="3.5.0.201406101309"/>
+      <unit id="org.eclipse.acceleo.ide.ui" version="3.5.0.201406101309"/>
       <unit id="org.eclipse.draw2d.sdk.feature.group" version="3.9.100.201405261516"/>
       <unit id="org.eclipse.emf.common.feature.group" version="2.10.0.v20140514-1158"/>
-      <unit id="org.eclipse.emf.compare.feature.group" version="3.0.0.201405271400"/>
+      <unit id="org.eclipse.emf.compare.feature.group" version="3.0.0.201406111328"/>
       <unit id="org.eclipse.emf.ecore.feature.group" version="2.10.0.v20140514-1158"/>
       <unit id="org.eclipse.emf.edit.feature.group" version="2.10.0.v20140519-0339"/>
       <unit id="org.eclipse.emf.eef.runtime" version="1.3.0.201311221533"/>
@@ -41,15 +41,15 @@
       <unit id="org.eclipse.emf.transaction.sdk.feature.group" version="1.8.0.201405281451"/>
       <unit id="org.eclipse.emf.validation.sdk.feature.group" version="1.8.0.201405281429"/>
       <unit id="org.eclipse.emf.workspace.feature.group" version="1.8.0.201405281451"/>
-      <unit id="org.eclipse.equinox.sdk.feature.group" version="3.10.0.v20140522-0452"/>
+      <unit id="org.eclipse.equinox.sdk.feature.group" version="3.10.0.v20140606-1602"/>
       <unit id="org.eclipse.gef.feature.group" version="3.9.100.201405261516"/>
       <unit id="org.eclipse.gef.sdk.feature.group" version="3.9.100.201405261516"/>
       <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="1.8.0.201405281433"/>
-      <unit id="org.eclipse.gmf.runtime.sdk.feature.group" version="1.8.0.201405281701"/>
-      <unit id="org.eclipse.ocl.all.feature.group" version="5.0.0.v20140524-1657"/>
-      <unit id="org.eclipse.ocl.core.sdk.feature.group" version="5.0.0.v20140524-1657"/>
-      <unit id="org.eclipse.platform.feature.group" version="4.4.0.v20140522-1614"/>
-      <unit id="org.eclipse.sdk.feature.group" version="4.4.0.v20140522-1618"/>
+      <unit id="org.eclipse.gmf.runtime.sdk.feature.group" version="1.8.0.201406111639"/>
+      <unit id="org.eclipse.ocl.all.feature.group" version="5.0.0.v20140528-1458"/>
+      <unit id="org.eclipse.ocl.core.sdk.feature.group" version="5.0.0.v20140528-1458"/>
+      <unit id="org.eclipse.platform.feature.group" version="4.4.0.v20140606-1558"/>
+      <unit id="org.eclipse.sdk.feature.group" version="4.4.0.v20140606-1558"/>
       <unit id="org.eclipse.xtext.sdk.feature.group" version="2.6.0.v201405210727"/>
       <repository id="Eclipse-Luna" location="http://download.eclipse.org/releases/luna"/>
     </location>