[474878] Improve the integration of AQL in the interpreter

1) Added an new interface, IInterpreterWithDiagnostic, to let
interpreters provide a diagnostic along with their result.
2) Improved the support of collection types in order to use Sequence and
Set instead of the name of the Java classes involved
3) Improved the support of EObject by displaying their type using
ePackageName::eClassName instead of the name of their Java class
4) Added support for AQL's warning
5) Added support for AQL's diagnostic with children.
6) Update the release notes with a picture and description of the
changes.

Bug: 474878
Change-Id: I09ec0a8e0dfe65ab026dc2707f33bb548dd4c210
Signed-off-by: Stéphane Bégaudeau <stephane.begaudeau@obeo.fr>
diff --git a/plugins/org.eclipse.sirius.common.acceleo.aql/src/org/eclipse/sirius/common/acceleo/aql/business/internal/AQLSiriusInterpreter.java b/plugins/org.eclipse.sirius.common.acceleo.aql/src/org/eclipse/sirius/common/acceleo/aql/business/internal/AQLSiriusInterpreter.java
index df3b656..9092d6d 100644
--- a/plugins/org.eclipse.sirius.common.acceleo.aql/src/org/eclipse/sirius/common/acceleo/aql/business/internal/AQLSiriusInterpreter.java
+++ b/plugins/org.eclipse.sirius.common.acceleo.aql/src/org/eclipse/sirius/common/acceleo/aql/business/internal/AQLSiriusInterpreter.java
@@ -186,19 +186,38 @@
 
     @Override
     public Object evaluate(EObject target, String fullExpression) throws EvaluationException {
+        IEvaluationResult evaluationResult = this.evaluateExpression(target, fullExpression);
+        // We fire the exception to keep the old behavior
+        if (evaluationResult.getDiagnostic().getSeverity() == Diagnostic.ERROR) {
+            throw new EvaluationException(evaluationResult.getDiagnostic().getMessage(), evaluationResult.getDiagnostic().getException());
+        }
+        return evaluationResult.getValue();
+    }
+
+    @Override
+    public IEvaluationResult evaluateExpression(final EObject target, final String fullExpression) throws EvaluationException {
         this.javaExtensions.reloadIfNeeded();
         String expression = new ExpressionTrimmer(fullExpression).getExpression();
         Map<String, Object> variables = getVariables();
         variables.put("self", target); //$NON-NLS-1$
-        AstResult build;
+
         try {
-            build = parsedExpressions.get(expression);
+            AstResult build = parsedExpressions.get(expression);
             IQueryEvaluationEngine evaluationEngine = QueryEvaluation.newEngine(queryEnvironment);
-            EvaluationResult evalResult = evaluationEngine.eval(build, variables);
-            if (evalResult.getDiagnostic().getSeverity() == Diagnostic.ERROR) {
-                throw new EvaluationException(evalResult.getDiagnostic().getMessage(), evalResult.getDiagnostic().getException());
-            }
-            return evalResult.getResult();
+            final EvaluationResult evalResult = evaluationEngine.eval(build, variables);
+
+            return new IEvaluationResult() {
+
+                @Override
+                public Object getValue() {
+                    return evalResult.getResult();
+                }
+
+                @Override
+                public Diagnostic getDiagnostic() {
+                    return evalResult.getDiagnostic();
+                }
+            };
         } catch (ExecutionException e) {
             throw new EvaluationException(e.getCause());
         }
diff --git a/plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/api/interpreter/CompoundInterpreter.java b/plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/api/interpreter/CompoundInterpreter.java
index d1c6f63..f12a011 100644
--- a/plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/api/interpreter/CompoundInterpreter.java
+++ b/plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/api/interpreter/CompoundInterpreter.java
@@ -26,6 +26,7 @@
 import org.eclipse.core.runtime.IExtension;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.Diagnostic;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.util.ECrossReferenceAdapter;
 import org.eclipse.sirius.common.tools.DslCommonPlugin;
@@ -48,7 +49,7 @@
  * 
  * @author ymortier
  */
-public final class CompoundInterpreter implements IInterpreter, IProposalProvider, TypedValidation {
+public final class CompoundInterpreter implements IInterpreter, IProposalProvider, TypedValidation, IInterpreterWithDiagnostic {
 
     /** The shared instance of the registry. */
     public static final CompoundInterpreter INSTANCE = new CompoundInterpreter();
@@ -134,6 +135,36 @@
     }
 
     /**
+     * {@inheritDoc}
+     * 
+     * @see org.eclipse.sirius.common.tools.api.interpreter.IInterpreterWithDiagnostic#evaluateExpression(EObject,
+     *      String)
+     */
+    public IEvaluationResult evaluateExpression(final EObject target, final String expression) throws EvaluationException {
+        final IInterpreter interpreter = getInterpreterForExpression(expression);
+        if (interpreter instanceof IInterpreterWithDiagnostic) {
+            return ((IInterpreterWithDiagnostic) interpreter).evaluateExpression(target, expression);
+        }
+
+        // Fall back on the default behavior otherwise with an OK diagnostic
+        final Object result = interpreter.evaluate(target, expression);
+
+        IEvaluationResult evaluationResult = new IEvaluationResult() {
+            @Override
+            public Object getValue() {
+                return result;
+            }
+
+            @Override
+            public Diagnostic getDiagnostic() {
+                return Diagnostic.OK_INSTANCE;
+            }
+        };
+
+        return evaluationResult;
+    }
+
+    /**
      * Evaluates the given expression as a boolean value.
      * 
      * @param context
diff --git a/plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/api/interpreter/IInterpreterWithDiagnostic.java b/plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/api/interpreter/IInterpreterWithDiagnostic.java
new file mode 100644
index 0000000..7a9c955
--- /dev/null
+++ b/plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/api/interpreter/IInterpreterWithDiagnostic.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2015 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.common.tools.api.interpreter;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * An interface for implementations of {@link IInterpreter} used to provide
+ * additional information after the evaluation of an expression.
+ * 
+ * @author <a href="mailto:stephane.begaudeau@obeo.fr">Stephane Begaudeau</a>
+ */
+public interface IInterpreterWithDiagnostic {
+
+    /**
+     * This interface represents the result of the evaluation of an expression
+     * with its value and a diagnostic.
+     * 
+     * @author <a href="mailto:stephane.begaudeau@obeo.fr">Stephane Begaudeau</a>
+     */
+    public interface IEvaluationResult {
+        /**
+         * Returns the value computed from the evaluation of the expression.
+         * 
+         * @return The value
+         */
+        Object getValue();
+
+        /**
+         * The diagnostic computed during the evaluation of the expression.
+         * 
+         * @return The diagnostic
+         */
+        Diagnostic getDiagnostic();
+    }
+
+    /**
+     * Wrapper method to evaluate an expression and return the result and its
+     * diagnostic. This method should have the same behavior as the method
+     * {@link IInterpreter#evaluate(EObject, String)} but with a result
+     * containing a diagnostic too.
+     * 
+     * @param target
+     *            the EObject instance to evaluate on.
+     * @param expression
+     *            the expression to evaluate.
+     * @return an object with the evaluation result.
+     * @throws EvaluationException
+     *             if the evaluation was not successful.
+     */
+    IEvaluationResult evaluateExpression(final EObject target, final String expression) throws EvaluationException;
+}
diff --git a/plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/internal/interpreter/AbstractInterpreter.java b/plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/internal/interpreter/AbstractInterpreter.java
index e42012a..14f6385 100644
--- a/plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/internal/interpreter/AbstractInterpreter.java
+++ b/plugins/org.eclipse.sirius.common/src/org/eclipse/sirius/common/tools/internal/interpreter/AbstractInterpreter.java
@@ -14,10 +14,12 @@
 import java.util.Collections;
 import java.util.Map;
 
+import org.eclipse.emf.common.util.Diagnostic;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.util.ECrossReferenceAdapter;
 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.interpreter.IInterpreterWithDiagnostic;
 import org.eclipse.sirius.common.tools.api.interpreter.IInterpreterContext;
 import org.eclipse.sirius.common.tools.api.interpreter.IInterpreterStatus;
 import org.eclipse.sirius.common.tools.api.interpreter.IVariableStatusListener;
@@ -33,7 +35,7 @@
  * 
  * @author pcdavid
  */
-public abstract class AbstractInterpreter implements IInterpreter, TypedValidation {
+public abstract class AbstractInterpreter implements IInterpreter, TypedValidation, IInterpreterWithDiagnostic {
 
     /** The separator between EPackage name and EClass name for domain class. */
     protected static final String SEPARATOR = "."; //$NON-NLS-1$
@@ -260,4 +262,24 @@
     public void activateMetamodels(Collection<MetamodelDescriptor> metamodels) {
         // Nothing to do.
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IEvaluationResult evaluateExpression(EObject target, String expression) throws EvaluationException {
+        final Object result = this.evaluate(target, expression);
+        return new IEvaluationResult() {
+
+            @Override
+            public Object getValue() {
+                return result;
+            }
+
+            @Override
+            public Diagnostic getDiagnostic() {
+                return Diagnostic.OK_INSTANCE;
+            }
+        };
+    }
 }
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
index 844dc88..2acffdc 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
@@ -114,7 +114,15 @@
 				<em>Horizontal Stack</em>. It allows to define complex stacks of 
 				<em>compartments</em> mixing both stack directions. While working reliably, this support is marked experimental in Sirius 3.1.0 as there are still some behaviors which do not behave as expected. If you make use of this feature, be aware that some details may still change in future releases, including 3.1.x maintenance releases.
 			</li>
+			<li><span class="label label-info">Modified</span> The 
+				<em>Acceleo Query Language</em> (AQL) interpreter  has been improved. It will now be able to display warnings and errors in the Interpreter view. The message displayed in the Interpreter view after an evaluation has also been improved to display the qualified name of the type of the value computed (ePackageName::eClassName). The improvements realized can be viewed by clicking on the image below.
+			</li>
 		</ul>
+		<p>
+			<a href="images/improvedsiriusinterpreter.png">
+				<img border="0" src="images/improvedsiriusinterpreter_thumbnail.png"/>
+			</a>
+		</p>
 		<h3 id="DeveloperVisibleChanges">Developer-Visible Changes</h3>
 		<h4 id="Partialsupportforinternationalization">Partial support for internationalization</h4>
 		<p>Sirius 3.1 introduces partial support for internationalization: all literal strings from the runtime part of Sirius are now externalized and can be localized by third parties by providing the appropriate &#171;language packs&#187; as OSGi fragments. Note that this does not concern the VSM editor&#8217;s UI, the VSMs themselves, or the parts of the UI inherited from Eclipse/EMF/GEF/GMF and other libraries and frameworks used by Sirius.</p>
@@ -284,6 +292,14 @@
 				</ul>
 			</li>
 		</ul>
+		<h4 id="Changesinorg.eclipse.sirius.common">Changes in 
+			<code>org.eclipse.sirius.common</code>
+		</h4>
+		<ul>
+			<li><span class="label label-success">Added</span> The new interface 
+				<code>org.eclipse.sirius.common.tools.api.interpreter.IInterpreterWithDiagnostic</code> has been added. It allows an interpreter to evaluate an expression and return not only the result of the evaluation but also a diagnostic.
+			</li>
+		</ul>
 		<h4 id="Changesinorg.eclipse.sirius.ext.gef">Changes in 
 			<code>org.eclipse.sirius.ext.gef</code>
 		</h4>
@@ -326,7 +342,7 @@
 				<code>org.eclipse.sirius.tools.api.command.IUndoableCommand</code> interface removed because it is useless since undo/redo is managed by EMF Transaction.
 			</li>
 		</ul>
-		<h4 id="Changesinorg.eclipse.sirius.common">Changes in 
+		<h4 id="Changesinorg.eclipse.sirius.common2">Changes in 
 			<code>org.eclipse.sirius.common</code>
 		</h4>
 		<ul>
@@ -646,7 +662,7 @@
 				<a href="https://git.eclipse.org/r/#/admin/projects/sirius/org.eclipse.sirius">Sirius Gerrit</a> now automatically trigger a sub-set of the Sirius automated test suites, which give a good feedback on the absence of regressions introduced by the proposed patch.
 			</li>
 		</ul>
-		<h4 id="Changesinorg.eclipse.sirius.common2">Changes in 
+		<h4 id="Changesinorg.eclipse.sirius.common3">Changes in 
 			<code>org.eclipse.sirius.common</code>
 		</h4>
 		<ul>
@@ -1558,7 +1574,7 @@
 				<code>findViewpointByName()</code> to correct a wrong rebranding.
 			</li>
 		</ul>
-		<h4 id="Changesinorg.eclipse.sirius.common3">Changes in 
+		<h4 id="Changesinorg.eclipse.sirius.common4">Changes in 
 			<code>org.eclipse.sirius.common</code>
 		</h4>
 		<ul>
@@ -1832,4 +1848,4 @@
 			</li>
 		</ul>
 	</body>
-</html>
+</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
index 0f6a6cd..5c9cf2d 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
@@ -24,6 +24,8 @@
 * <span class="label label-info">Modified</span> You have now really the capability to set the @BorderSizeComputationExpression@ as 0 for style of @ContainerMapping@. Before Sirius 3.1.0, a size of 0 is interpreted as 1 at runtime. For compatibility reason, all existing @BorderSizeComputationExpression@ equals to 0 for style of @ContainerMapping@ are automatically set to 1 (ditto for results of this expression in representations file for container elements). For @ContainerMapping@, the default value of @BorderSizeComputationExpression@ for new style is now 1, except for _Worskpace Image_ where the value is 0.
 * <span class="label label-info">Modified</span> The support for containers with vertical or horizontal _compartments_ on diagrams was introduced in Sirius 3.0.0 as an experimental feature. Several improvements and corrections have been done around the behaviors of this feature which is now ready to have its experimental state removed. Validation rules and tooltips in the VSM editor are here to help the specifier create a consistent mapping structure.
 * <span class="label label-info">Modified</span> <span class="label label-info">Experimental</span> New, experimental support for recursive _compartments_ on diagrams: the _children presentation_ property of a _Container Mapping_, which is defined as a _compartment_ (its parent _ContainerMapping_ has a _VerticalStack_ or _HorizontalStack_ _children presentation_), can now also be set to _Vertical Stack_ and _Horizontal Stack_. It allows to define complex stacks of _compartments_ mixing both stack directions. While working reliably, this support is marked experimental in Sirius 3.1.0 as there are still some behaviors which do not behave as expected. If you make use of this feature, be aware that some details may still change in future releases, including 3.1.x maintenance releases.
+* <span class="label label-info">Modified</span> The _Acceleo Query Language_ (AQL) interpreter  has been improved. It will now be able to display warnings and errors in the Interpreter view. The message displayed in the Interpreter view after an evaluation has also been improved to display the qualified name of the type of the value computed (ePackageName::eClassName). The improvements realized can be viewed by clicking on the image below.
+!images/improvedsiriusinterpreter_thumbnail.png!:images/improvedsiriusinterpreter.png
 
 h3. Developer-Visible Changes
 
@@ -67,6 +69,10 @@
 ** @org.eclipse.sirius.common.acceleo.mtl.ide@
 ** @org.eclipse.sirius.eef.adapters@
 
+h4. Changes in @org.eclipse.sirius.common@
+
+* <span class="label label-success">Added</span> The new interface @org.eclipse.sirius.common.tools.api.interpreter.IInterpreterWithDiagnostic@ has been added. It allows an interpreter to evaluate an expression and return not only the result of the evaluation but also a diagnostic.
+
 h4. Changes in @org.eclipse.sirius.ext.gef@
 
 * <span class="label label-success">Added</span> The new class @org.eclipse.sirius.ext.gef.query.EditPartQuery@ has been added. It allows to retrieve all children of the current part.
diff --git a/plugins/org.eclipse.sirius.doc/doc/images/improvedsiriusinterpreter.png b/plugins/org.eclipse.sirius.doc/doc/images/improvedsiriusinterpreter.png
new file mode 100644
index 0000000..359b679
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/doc/images/improvedsiriusinterpreter.png
Binary files differ
diff --git a/plugins/org.eclipse.sirius.doc/doc/images/improvedsiriusinterpreter_thumbnail.png b/plugins/org.eclipse.sirius.doc/doc/images/improvedsiriusinterpreter_thumbnail.png
new file mode 100644
index 0000000..2b48bea
--- /dev/null
+++ b/plugins/org.eclipse.sirius.doc/doc/images/improvedsiriusinterpreter_thumbnail.png
Binary files differ
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 51c9648..ac288ad 100644
--- a/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.html
+++ b/plugins/org.eclipse.sirius.doc/doc/user/diagrams/Diagrams.html
@@ -238,7 +238,7 @@
 		<ul>
 			<li>SHIFT: Constrained move (only vertical or horizontal move is authorized at once).</li>
 			<li>ALT (or CTRL for Mac users): Ignore snap while dragging (temporarily disables the snap during the move if it is activated).</li>
-			<li>F3: Move the edge source and target if pressed during the edge move. See the &#8220;Move edge group&#8221; subsection below for more details. </li>
+			<li>F3: Move the edge source and target if pressed during the edge move. See the &#171;Move edge group&#187; subsection below for more details. </li>
 			<li>F4: Move with snap to all shapes (if the 
 				<a href="#snap_to_shapes">Snap to shapes</a> is already activated for the current diagram)
 			</li>
@@ -250,7 +250,7 @@
 			<em>Snap to grid</em>, and unlike to snap for node, there is no guide drawn during the move.
 		</p>
 		<h4 id="RemoveBendpoints">Remove Bend-points</h4>
-		<p>You can define some bend-points (or inflection points) on an edge. It is possible to remove all these bend-points to retrieve the original Straight edge. This action is available within the edge context menu or by using the shortcut &#8220;Ctrl&#8221; + &#8220;Shift&#8221; + &#8220;-&#8221;. This action is only available on edges with a &#8220;Straight&#8221; routing style.</p>
+		<p>You can define some bend-points (or inflection points) on an edge. It is possible to remove all these bend-points to retrieve the original Straight edge. This action is available within the edge context menu or by using the shortcut &#171;Ctrl&#187; + &#171;Shift&#187; + &#171;-&#187;. This action is only available on edges with a &#171;Straight&#187; routing style.</p>
 		<p>The edge state just after its creation:
 			<br/>
 			<img border="0" src="images/beforeBendpoints.png"/>
@@ -259,7 +259,7 @@
 			<br/>
 			<img border="0" src="images/withBendpoints.png"/>
 		</p>
-		<p>The user executes the &#8220;Remove Bend-points&#8221; action:
+		<p>The user executes the &#171;Remove Bend-points&#187; action:
 			<br/>
 			<img border="0" src="images/afterRemoveBendpoints.png"/>
 		</p>
@@ -281,7 +281,7 @@
 			<li>A border node as target.</li>
 			<li>Source node has only one connection: the moved edge.</li>
 			<li>Target node has only one connection: the moved edge.</li>
-			<li>Source and target are on the same &#8220;axis&#8221;:
+			<li>Source and target are on the same &#171;axis&#187;:
 				<ul>
 					<li>located on west or east sides of their respective parent (could be the same).</li>
 					<li>located on north or south sides of their respective parent (could be the same).</li>
@@ -345,7 +345,7 @@
 			<li>the last shape is the lowest one (with the bottom side with the maximum y coordinate). If several shapes are aligned by middle, the rightmost one is the last.</li>
 		</ul>
 		<h3 id="ResetDiagramorContainerOrigin">Reset Diagram or Container Origin</h3>
-		<p>This action is available within the diagram or containers contextual menu (&#8220;Reset Origin&#8221;) or via &#8220;M1&#8221; + &#8220;&amp;&#8221; shortcut.
+		<p>This action is available within the diagram or containers contextual menu (&#171;Reset Origin&#187;) or via &#171;M1&#187; + &#171;&amp;&#187; shortcut.
 			<br/>The diagram (or container) bounds (the rectangle formed by the highest, the leftmost, the lowest and the rightmost elements) can have a negative origin or can be shifted toward the bottom-right with a blank zone at the top-left.
 			<br/>This action aims to move all diagram (or container) elements so that the diagram (or container) retrieves its origin while keeping the element layout.
 		</p>
@@ -360,7 +360,7 @@
 		</p>
 		<h4 id="Specificcases">Specific cases</h4>
 		<ul>
-			<li>Elements hidden by the user are not considered to compute the shift size but are shifted as the other shapes. That means if an hidden element is located at the top-left corner, the diagram coordinates will turn negative if the user reveals it after having executed the &#8220;Reset Origin&#8221; action.</li>
+			<li>Elements hidden by the user are not considered to compute the shift size but are shifted as the other shapes. That means if an hidden element is located at the top-left corner, the diagram coordinates will turn negative if the user reveals it after having executed the &#171;Reset Origin&#187; action.</li>
 			<li>Edges hidden because of a masked source or target are taken in account to compute the diagram bounds:</li>
 		</ul>
 		<p>
@@ -374,7 +374,7 @@
 			<i>Show/Hide</i> / 
 			<i>Hide Element</i>. The graphical element is now hidden from view.
 		</p>
-		<p>The icon in the tool-bar changes showing a &#8220;check box&#8221; on it as soon as at least one element has been hidden, to remind you that what you see is not a complete view of the model being represented:</p>
+		<p>The icon in the tool-bar changes showing a &#171;check box&#187; on it as soon as at least one element has been hidden, to remind you that what you see is not a complete view of the model being represented:</p>
 		<p>	
 			<img border="0" src="images/diagram_editor11.png"/>
 		</p>
@@ -418,7 +418,7 @@
 		</p>
 		<h4 id="Hidinglabels">Hiding labels</h4>
 		<p>It is also possible to hide the label of graphical elements (see the node labels section for nodes supported case).</p>
-		<p>The approach is the same as for other elements, except that there are a specific menus named &#8220;Hide/Show Label&#8221;. It is possible to call this menu directly on the label or on its element.</p>
+		<p>The approach is the same as for other elements, except that there are a specific menus named &#171;Hide/Show Label&#187;. It is possible to call this menu directly on the label or on its element.</p>
 		<p>	
 			<img border="0" src="images/diagram_editor_hide_label_1.png"/>
 		</p>
@@ -454,7 +454,7 @@
 		</p>
 		<h5 id="Edgeslabels">Edges labels</h5>
 		<p>It is also possible to hide the edge labels. </p>
-		<p>The approach is the same than the nodes labels with the specific menus &#8220;Hide/Show Label&#8221; called from the edge or its label.</p>
+		<p>The approach is the same than the nodes labels with the specific menus &#171;Hide/Show Label&#187; called from the edge or its label.</p>
 		<p>	
 			<img border="0" src="images/diagram_editor_hide_edge_label_1.png"/>
 		</p>
@@ -463,7 +463,7 @@
 		<p>When working on 
 			<em>big</em> diagrams, you may want to hide the icons of the labels on all shapes or connectors, in order to improve the readability of your representations. To do so, open the Eclipse Preferences (
 			<em>Window</em>/ 
-			<em>Preferences</em>), and select the &#8220;Appearance&#8221; category (
+			<em>Preferences</em>), and select the &#171;Appearance&#187; category (
 			<em>Sirius</em>/ 
 			<em>Sirius Diagram</em>/ 
 			<em>Appearance</em>).
@@ -583,11 +583,11 @@
 		<p>The port is dropped in the container above the mouse location and linked to its closest edge.</p>
 		<h3 id="Copypasteoflayout">Copy/paste of layout</h3>
 		<p>It is possible to duplicate layout of diagram elements, that is to say to replicate mutual organization of diagram elements from one diagram to another. This replication only applies to the same semantic elements between diagrams.</p>
-		<p>The next picture shows a partial view of a diagram. The tool to replicate the layout is called &#8220;Copy layout&#8221; and can be activated from the tab-bar or the contextual menu (see &#8220;edit&#8221; section). In this picture, layout of John Doe and Earvin Johnson persons will be replicated to another diagram.</p>
+		<p>The next picture shows a partial view of a diagram. The tool to replicate the layout is called &#171;Copy layout&#187; and can be activated from the tab-bar or the contextual menu (see &#171;edit&#187; section). In this picture, layout of John Doe and Earvin Johnson persons will be replicated to another diagram.</p>
 		<p>	
 			<img border="0" src="images/diagram_editor_copy_layout1.png"/>
 		</p>
-		<p>The next picture shows the diagram where the layout will be replicated. The tool to paste layout is called &#8220;Paste layout&#8221; and can be activated from the toolbar or the contextual menu (see &#8220;edit&#8221; section).</p>
+		<p>The next picture shows the diagram where the layout will be replicated. The tool to paste layout is called &#171;Paste layout&#187; and can be activated from the toolbar or the contextual menu (see &#171;edit&#187; section).</p>
 		<p>	
 			<img border="0" src="images/diagram_editor_copy_layout2.png"/>
 		</p>
@@ -612,7 +612,7 @@
 			<img border="0" src="images/diagram_editor_pin01.png"/>
 		</p>
 		<p>
-			<i>Arrange All</i> action lays out all diagram elements in order to produce the &#8220;best&#8221; layout. As we can see on the next picture, all diagram elements are moved.
+			<i>Arrange All</i> action lays out all diagram elements in order to produce the &#171;best&#187; layout. As we can see on the next picture, all diagram elements are moved.
 		</p>
 		<p>	
 			<img border="0" src="images/diagram_editor_pin02.png"/>
@@ -646,14 +646,14 @@
 			<li>it is not possible to pin/unpin edges or compartiments.</li>
 		</ul>
 		<h4 id="Configuration">Configuration</h4>
-		<p>Every diagram elements that you move will be pinned by default and will need an unpin operation to be &#8220;moveable&#8221; again.</p>
+		<p>Every diagram elements that you move will be pinned by default and will need an unpin operation to be &#171;moveable&#187; again.</p>
 		<p>This default behavior can be changed in Eclipse preferences, as can be seen in the next picture.</p>
 		<p>	
 			<img border="0" src="images/diagram_editor_pin_configuration01.png"/>
 		</p>
 		<h4 id="PinUnpinonNotes">Pin/Unpin on Notes</h4>
 		<p>The notes can be pinned if they are attached to a pinned diagram element. If a note is attached to several elements of which at least one is pinned then the note is pinned.</p>
-		<p>Otherwise for notes linked to any elements, it&#8217;s possible to use the preferences &#8220;Move unlinked notes during layout&#8221;. By default, this preference is disabled, in this case the unlinked notes are pinned.</p>
+		<p>Otherwise for notes linked to any elements, it&#8217;s possible to use the preferences &#171;Move unlinked notes during layout&#187;. By default, this preference is disabled, in this case the unlinked notes are pinned.</p>
 		<p>This default behavior can be changed in Eclipse preferences, as can be seen in the next picture.</p>
 		<p>	
 			<img border="0" src="images/diagram_editor_note_pin_configuration01.png"/>
@@ -673,7 +673,7 @@
 		<p>You can also use 
 			<a href="#UsingRegularExpressionstoFindDiagramElements">RegularExpressions</a> to easily retrieve the elements you want to pin/unpin.
 		</p>
-		<p>To see more easily if one or more graphical elements are pinned, the icon in the toolbar change, showing a &#8220;checked&#8221; if an element is pinned.</p>
+		<p>To see more easily if one or more graphical elements are pinned, the icon in the toolbar change, showing a &#171;checked&#187; if an element is pinned.</p>
 		<p>	
 			<img border="0" src="images/diagram_editor_pin_toolbar_activated.png"/>
 		</p>
@@ -686,7 +686,7 @@
 			<li>moving the extremity of an edge to adjust its connection point (to the source or target element) is possible, but will never trigger a reconnection operation.</li>
 		</ul>
 		<p>Note that other operations which can change the semantic model are still possible. Only the operations listed above, which are easy to misuse, are disabled/modified. 
-			<strong>Layout Mode is not a &#8220;read-only&#8221; mode and does not guarantee that the semantic model is not modified when it is enabled.</strong>
+			<strong>Layout Mode is not a &#171;read-only&#187; mode and does not guarantee that the semantic model is not modified when it is enabled.</strong>
 		</p>
 		<p>
 			<strong>Layouting mode</strong> can be activated/disabled on a diagram through the tab bar (when there is no selected element) : 
@@ -782,8 +782,8 @@
 				<em>'a'</em> and 
 				<em>'A'</em> are strictly equivalent);
 			</li>
-			<li>A &#8216;?&#8217; wild-card can be used to replace exactly 1 character in the search ;</li>
-			<li>A &#8216;*&#8217; wild-card can be used to replace exactly 0 or more characters in the search.</li>
+			<li>A &#8249;?&#8250; wild-card can be used to replace exactly 1 character in the search ;</li>
+			<li>A &#8249;*&#8250; wild-card can be used to replace exactly 0 or more characters in the search.</li>
 		</ol>
 		<h4 id="Examples">Examples</h4>
 		<p>Consider that you have a Diagram containing the following Diagram elements :</p>
@@ -817,7 +817,7 @@
 		<ul>
 			<li>isaBot</li>
 		</ul>
-		<p>As &#8216;?&#8217; stands for 
+		<p>As &#8249;?&#8250; stands for 
 			<strong>exactly</strong> one character, 
 			<em>isaBoot</em> and 
 			<em>isaBt</em> aren&#8217;t matching this regular expression.
@@ -852,15 +852,15 @@
 			<code>Enter</code>.
 		</p>
 		<h3 id="styleCustomizations">Style customizations </h3>
-		<p>Although the style of the diagram elements is defined in the VSM, it can be customized for each diagram elements. This customization can be applied from the tool bar, from the &#8220;Style&#8221; and &#8220;Appearance&#8221; tab of the property view, from the &#8220;Diagram&#8221; menu or from the contextual menu Format.</p>
+		<p>Although the style of the diagram elements is defined in the VSM, it can be customized for each diagram elements. This customization can be applied from the tool bar, from the &#171;Style&#187; and &#171;Appearance&#187; tab of the property view, from the &#171;Diagram&#187; menu or from the contextual menu Format.</p>
 		<p>You have the possibility to customize :</p>
 		<ul>
 			<li>in container style : the background color, the background style, the border size, the foreground color, the label alignment, the label size and the label format.</li>
 			<li>in node style: the border size, the color, the label alignment, format, position and size.</li>
 			<li>in edge style: the folding style, the color,  the label alignment, format, position and size, the line and routing style, the size and the target and source arrow.</li>
 		</ul>
-		<p>Theses customizations can be reset by the &#8220;Reset style customization&#8221; button available in the &#8220;Appearance&#8221; tab of the property view and in the diagram editor tool bar.</p>
-		<p>NOTE: in case a user customized a Node with a WorkspaceImage style (through the &#8220;Set style to workspace image&#8221; action), it is considered in its whole customized then it can&#8217;t be updated by the refresh action, only the &#8220;Reset style properties to default values&#8221; action can update it by reset it.</p>
+		<p>Theses customizations can be reset by the &#171;Reset style customization&#187; button available in the &#171;Appearance&#187; tab of the property view and in the diagram editor tool bar.</p>
+		<p>NOTE: in case a user customized a Node with a WorkspaceImage style (through the &#171;Set style to workspace image&#187; action), it is considered in its whole customized then it can&#8217;t be updated by the refresh action, only the &#171;Reset style properties to default values&#187; action can update it by reset it.</p>
 		<h4 id="routingStylePref">Customize edge routing style from preferences</h4>
 		<p>You have the possibility to customize the routing style of all new edges from the preferences. In the preference page 
 			<em>Sirius/Sirius Diagram/Connections</em>, you can enable 
@@ -942,7 +942,7 @@
 		</p>
 		<p>
 			<em>Notes</em> and 
-			<em>Text</em> elements are created in a similar way: either a single click somewhere on the diagram (which creates an element with a default size), or a click-drag to create the element with a custom initial size. Once created, one can edit the text inside the note or text zone usual the standard &#8220;direct edit&#8221; behavior (
+			<em>Text</em> elements are created in a similar way: either a single click somewhere on the diagram (which creates an element with a default size), or a click-drag to create the element with a custom initial size. Once created, one can edit the text inside the note or text zone usual the standard &#171;direct edit&#187; behavior (
 			<em>F2</em>, a slow double click, or by directly starting to enter alpha-numeric text). The only difference between notes and text zones is the visual presentation; notes have a yellow background (by default) and a border which represents a sticky not with a folded top-right corner. 
 		</p>
 		<p>
@@ -960,13 +960,13 @@
 		</p>
 		<p>
 			<em>Tool Drawers</em>. Tools in the palette may be organized in expandable 
-			<em>drawers</em> to group them by category. To expand a drawer and show its content, simply click once in the drawer&#8217;s header. Click again to fold it back and hide its tools. When you expand a drawer, some others may be folded automatically if there is not enough space to show all of them. To prevent this, you can &#8220;pin&#8221; a drawer opened by clicking on the &#8220;pin&#8221; icon in the drawer&#8217;s title area when it is expanded. This will force it to be kept opened, and its tools available, at all times.
+			<em>drawers</em> to group them by category. To expand a drawer and show its content, simply click once in the drawer&#8217;s header. Click again to fold it back and hide its tools. When you expand a drawer, some others may be folded automatically if there is not enough space to show all of them. To prevent this, you can &#171;pin&#187; a drawer opened by clicking on the &#171;pin&#187; icon in the drawer&#8217;s title area when it is expanded. This will force it to be kept opened, and its tools available, at all times.
 		</p>
 		<p>	
 			<img border="0" src="images/palette_tool_drawer.png"/>
 		</p>
 		<p>
-			<em>Tool Groups</em>. Most entries in the palette correspond to a single tool, but some of them represent tool groups. Tool groups are identified by a small right-facing arrow on the left of the tool&#8217;s icon. They behave like combo-boxes: click on the arrow to expand the group and reveal all the tools available in this group. Click on the tool you want to activate to make it the default and close the group. You can then use the selected tool as any other, but you have to re-open the popup menu if you want to enable a different one. When the group is expanded, you can click on the &#8220;pin&#8221; icon to the right to of the top-most tool to force the group to stay expanded, so that you can easily have access to all the tools. 
+			<em>Tool Groups</em>. Most entries in the palette correspond to a single tool, but some of them represent tool groups. Tool groups are identified by a small right-facing arrow on the left of the tool&#8217;s icon. They behave like combo-boxes: click on the arrow to expand the group and reveal all the tools available in this group. Click on the tool you want to activate to make it the default and close the group. You can then use the selected tool as any other, but you have to re-open the popup menu if you want to enable a different one. When the group is expanded, you can click on the &#171;pin&#187; icon to the right to of the top-most tool to force the group to stay expanded, so that you can easily have access to all the tools. 
 		</p>
 		<p>	
 			<img border="0" src="images/palette_tool_group.png"/>
@@ -974,7 +974,7 @@
 		<h4 id="UsingTheToolsFromThePalette">Using The Tools From The Palette</h4>
 		<p>There are different interaction modes possible for the tools available in the palette. The basic pattern is to select the tool in the palette with a simple left-click on in it the palette, and then apply it once on the diagram.</p>
 		<p>Normally, when you have used a tool once, it does not stay selected; if you want to reuse it a second time, you have to re-select it in the palette. If you want to apply the same tool several times in a row, simply hold the 
-			<em>Ctrl</em> key pressed while using it; it will stay &#8220;armed&#8221; until you release the 
+			<em>Ctrl</em> key pressed while using it; it will stay &#171;armed&#187; until you release the 
 			<em>Ctrl</em> key or select another tool.
 		</p>
 		<p>To deselect a tool without executing it, simply press the 
@@ -1018,7 +1018,7 @@
 				<strong>not</strong> be moved by the algorithm.
 			</li>
 			<li>
-				<em>Arrange Linked Border Nodes</em> This special action will only concerns nodes which are on the border of another element and which are either the source or the target of at least one edge. When invoked, the action will try to move these bordered nodes on the border of their parent on the most &#8220;natural&#8221; side of their parent element depending on the direction of the edge. For example if a border node is on the top side of an element but has an edge which goes down to a target element below its parent, this action will move the border node to the bottom side so that the edge does not cross the parent element.
+				<em>Arrange Linked Border Nodes</em> This special action will only concerns nodes which are on the border of another element and which are either the source or the target of at least one edge. When invoked, the action will try to move these bordered nodes on the border of their parent on the most &#171;natural&#187; side of their parent element depending on the direction of the edge. For example if a border node is on the top side of an element but has an edge which goes down to a target element below its parent, this action will move the border node to the bottom side so that the edge does not cross the parent element.
 			</li>
 		</ul>
 		<p>
@@ -1088,13 +1088,13 @@
 			<img border="0" src="images/tabbar_paste_layout.png"/> 
 			<em>Paste Layout</em>. This button is only enabled if you have previously copied the layout of some elements in the clipboard, using the 
 			<em>Copy layout</em> action (only visible in the tab-bar when elements are select). 
-			<em>Paste layout</em> will apply the same size and positions which were copied in the clipboard to the corresponding elements in the current diagram. For the purpose of this command, the &#8220;corresponding elements&#8221; are the graphical elements which represent the same semantic objects.
+			<em>Paste layout</em> will apply the same size and positions which were copied in the clipboard to the corresponding elements in the current diagram. For the purpose of this command, the &#171;corresponding elements&#187; are the graphical elements which represent the same semantic objects.
 		</p>
 		<p>
 			<img border="0" src="images/tabbar_zoom.png"/> 
 			<em>Zoom Controls</em>. Next in the tab-bar is a set of buttons to control the zoom level. The 
 			<em>Zoom in</em> and 
-			<em>Zoom out</em> buttons behave similarly to their equivalents in the palette. The combo-box shows the current zoom level and allows you to choose among some pre-defined levels. You can also manually enter a specific zoom level (e.g. &#8220;42&#8221;) and hit 
+			<em>Zoom out</em> buttons behave similarly to their equivalents in the palette. The combo-box shows the current zoom level and allows you to choose among some pre-defined levels. You can also manually enter a specific zoom level (e.g. &#171;42&#187;) and hit 
 			<em>Return</em> to apply it.
 		</p>
 		<p>
@@ -1106,7 +1106,7 @@
 		</p>
 		<p>
 			<img border="0" src="images/tabbar_layouting_mode.png"/> 
-			<em>Layout Mode</em>. This button enables a special &#8220;layout mode&#8221;, in which some operations are prevented from having an effect on the semantic model. It can be used when you want to tweak the layout of a diagram and want to be sure to only make graphical changes, and not semantic ones by mistake. Click on the button to enable the &#8220;layout mode&#8221;, and click again when finished to return to the normal model. When this mode is enabled, the following operations are changed:
+			<em>Layout Mode</em>. This button enables a special &#171;layout mode&#187;, in which some operations are prevented from having an effect on the semantic model. It can be used when you want to tweak the layout of a diagram and want to be sure to only make graphical changes, and not semantic ones by mistake. Click on the button to enable the &#171;layout mode&#187;, and click again when finished to return to the normal model. When this mode is enabled, the following operations are changed:
 		</p>
 		<ul>
 			<li>direct edit is disabled on all elements;</li>
@@ -1114,7 +1114,7 @@
 			<li>moving the extremity of an edge to adjust its connection point (to the source or target element) is possible, but will never trigger a reconnection operation.</li>
 		</ul>
 		<p>Note that other operations which can change the semantic model are still possible. Only the operations listed above, which are easy to misuse, are disabled/modified. 
-			<strong>Layout Mode is not a &#8220;read-only&#8221; mode and does not guarantee that the semantic model is not modified when it is enabled.</strong>
+			<strong>Layout Mode is not a &#171;read-only&#187; mode and does not guarantee that the semantic model is not modified when it is enabled.</strong>
 		</p>
 		<p>The diagram&#8217;s status line indicates when 
 			<em>Layouting mode</em> is enabled: 
@@ -1252,7 +1252,7 @@
 			<i>Hide element</i>, 
 			<i>Hide label</i>, 
 			<i>Show element</i>, 
-			<i>Show label</i> menus. The availability of the menus depends on the state of each element and its support of the &#8220;Show/Hide&#8221; feature.
+			<i>Show label</i> menus. The availability of the menus depends on the state of each element and its support of the &#171;Show/Hide&#187; feature.
 		</p>
 		<p>The hidden elements have their label displayed in italic style and their icon is decorated with a yellow dot in the top left corner.
 			<br/>The elements whose label is hidden have their label displayed in italic style and their icon is decorated with a 
@@ -1303,7 +1303,7 @@
 		<ul>
 			<li>
 				<em>Auto-size containers during arrange-all action:</em> Container elements which have an explicit size are normally not resized during an 
-				<em>Arrange All</em>. This can be problematic if the elements they contain are re-arranged so that the container&#8217;s size is not appropriate anymore. When this preference is enabled, the arrange all action will treat all containers as if they are &#8220;auto-sized&#8221;, and adjust their size to the computed arrangement for their content. After the arrange all action is finished, the containers which had an explicit size before will still have an explicit size (although potentially different); they are only switched to auto-size mode during the arrange all action. 
+				<em>Arrange All</em>. This can be problematic if the elements they contain are re-arranged so that the container&#8217;s size is not appropriate anymore. When this preference is enabled, the arrange all action will treat all containers as if they are &#171;auto-sized&#187;, and adjust their size to the computed arrangement for their content. After the arrange all action is finished, the containers which had an explicit size before will still have an explicit size (although potentially different); they are only switched to auto-size mode during the arrange all action. 
 			</li>
 			<li>
 				<em>Move unlinked notes during layout:</em> If checked, then the 
diff --git a/plugins/org.eclipse.sirius.interpreter/src/org/eclipse/sirius/common/acceleo/interpreter/SiriusEvaluationTask.java b/plugins/org.eclipse.sirius.interpreter/src/org/eclipse/sirius/common/acceleo/interpreter/SiriusEvaluationTask.java
index 32ba552..916c962 100644
--- a/plugins/org.eclipse.sirius.interpreter/src/org/eclipse/sirius/common/acceleo/interpreter/SiriusEvaluationTask.java
+++ b/plugins/org.eclipse.sirius.interpreter/src/org/eclipse/sirius/common/acceleo/interpreter/SiriusEvaluationTask.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011 THALES GLOBAL SERVICES.
+ * Copyright (c) 2011, 2015 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
@@ -10,14 +10,9 @@
  *******************************************************************************/
 package org.eclipse.sirius.common.acceleo.interpreter;
 
-import org.eclipse.sirius.common.tools.api.interpreter.CompoundInterpreter;
-import org.eclipse.sirius.common.tools.api.interpreter.EvaluationException;
-import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter;
-import org.eclipse.sirius.viewpoint.DSemanticDecorator;
-import org.eclipse.sirius.business.api.session.Session;
-import org.eclipse.sirius.business.api.session.SessionManager;
-
 import java.util.Collection;
+import java.util.List;
+import java.util.Set;
 import java.util.concurrent.Callable;
 import java.util.concurrent.CancellationException;
 
@@ -25,8 +20,20 @@
 import org.eclipse.acceleo.ui.interpreter.language.EvaluationResult;
 import org.eclipse.acceleo.ui.interpreter.view.Variable;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.ecore.EClass;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.sirius.business.api.session.Session;
+import org.eclipse.sirius.business.api.session.SessionManager;
+import org.eclipse.sirius.common.tools.api.interpreter.CompoundInterpreter;
+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.interpreter.IInterpreterWithDiagnostic;
+import org.eclipse.sirius.common.tools.api.interpreter.IInterpreterWithDiagnostic.IEvaluationResult;
+import org.eclipse.sirius.viewpoint.DSemanticDecorator;
 
 /**
  * This task delegates to the viewpoint's CompoundInterpreter for expression
@@ -53,6 +60,7 @@
      * 
      * @see java.util.concurrent.Callable#call()
      */
+    @Override
     public EvaluationResult call() throws Exception {
         checkCancelled();
 
@@ -86,9 +94,15 @@
 
         EvaluationResult evaluationResult = null;
         try {
-            final Object result = vpInterpreter.evaluate(target, expression);
-            final IStatus status = createResultStatus(result);
-            evaluationResult = new EvaluationResult(result, status);
+            if (vpInterpreter instanceof IInterpreterWithDiagnostic) {
+                IEvaluationResult result = ((IInterpreterWithDiagnostic) vpInterpreter).evaluateExpression(target, expression);
+                final IStatus status = createResultStatus(result);
+                evaluationResult = new EvaluationResult(result.getValue(), status);
+            } else {
+                Object result = vpInterpreter.evaluate(target, expression);
+                final IStatus status = createResultStatus(result);
+                evaluationResult = new EvaluationResult(result, status);
+            }
         } catch (EvaluationException e) {
             final IStatus status = new Status(IStatus.ERROR, InterpreterViewPlugin.PLUGIN_ID, e.getMessage(), e);
             evaluationResult = new EvaluationResult(status);
@@ -109,25 +123,123 @@
      *         evaluation.
      */
     private IStatus createResultStatus(Object result) {
-        if (result == null) {
-            return new Status(IStatus.OK, InterpreterViewPlugin.PLUGIN_ID, ""); //$NON-NLS-1$
+        IStatus status = new Status(IStatus.OK, InterpreterViewPlugin.PLUGIN_ID, ""); //$NON-NLS-1$
+        if (result instanceof IEvaluationResult) {
+            IEvaluationResult evaluationResult = (IEvaluationResult) result;
+            status = this.getStatus(evaluationResult);
+        } else if (result != null) {
+            // Fallback to the original behavior if we are not using an
+            // IEvaluationResult but a regular object
+            String message = this.getDefaultMessage(result);
+            status = new Status(IStatus.OK, InterpreterViewPlugin.PLUGIN_ID, message);
+        }
+        return status;
+    }
+
+    /**
+     * Computes the status representing the given evaluation result.
+     * 
+     * @param evaluationResult
+     *            The evaluation result
+     * @return The status to be displayed to the end user
+     */
+    private IStatus getStatus(IEvaluationResult evaluationResult) {
+        Object result = evaluationResult.getValue();
+
+        String message = this.getDefaultMessage(result);
+
+        Diagnostic diagnostic = evaluationResult.getDiagnostic();
+        int statusCode = this.getStatusCodeFromDiagnostic(diagnostic);
+
+        IStatus status = new Status(statusCode, InterpreterViewPlugin.PLUGIN_ID, message);
+        if (Diagnostic.OK != diagnostic.getSeverity() && diagnostic.getChildren().size() > 0) {
+            MultiStatus multiStatus = new MultiStatus(InterpreterViewPlugin.PLUGIN_ID, statusCode, message, null);
+
+            List<Diagnostic> children = diagnostic.getChildren();
+            for (Diagnostic childDiagnostic : children) {
+                int childStatusCode = this.getStatusCodeFromDiagnostic(childDiagnostic);
+                String childMessage = childDiagnostic.getMessage();
+                IStatus childStatus = new Status(childStatusCode, InterpreterViewPlugin.PLUGIN_ID, childMessage);
+                multiStatus.add(childStatus);
+            }
+
+            status = multiStatus;
         }
 
-        final String type = result.getClass().getSimpleName();
+        return status;
+    }
+
+    /**
+     * Computes the status code matching the given {@link Diagnostic}.
+     * 
+     * @param diagnostic
+     *            The diagnostic of the evaluation result
+     * @return A {@link IStatus} code.
+     */
+    private int getStatusCodeFromDiagnostic(Diagnostic diagnostic) {
+        int statusCode = IStatus.OK;
+        switch (diagnostic.getSeverity()) {
+        case Diagnostic.ERROR:
+            statusCode = IStatus.ERROR;
+            break;
+        case Diagnostic.WARNING:
+            statusCode = IStatus.WARNING;
+            break;
+        case Diagnostic.INFO:
+            statusCode = IStatus.INFO;
+            break;
+        case Diagnostic.CANCEL:
+            statusCode = IStatus.CANCEL;
+            break;
+        case Diagnostic.OK:
+            statusCode = IStatus.OK;
+            break;
+        default:
+            statusCode = IStatus.ERROR;
+        }
+        return statusCode;
+    }
+
+    /**
+     * Computes the default message to display in the interpreter view.
+     * 
+     * @param result
+     *            The result of the evaluation
+     * @return A message to be displayed in the interpreter
+     */
+    private String getDefaultMessage(Object result) {
+        String type = "null"; //$NON-NLS-1$
+
+        if (result != null) {
+            type = result.getClass().getSimpleName();
+        }
 
         String size = null;
         if (result instanceof String) {
             size = String.valueOf(((String) result).length());
         } else if (result instanceof Collection<?>) {
             size = String.valueOf(((Collection<?>) result).size());
+
+            // Convert the type of collection displayed (List -> Sequence, Set
+            // -> Set)
+            if (result instanceof List<?>) {
+                type = "Sequence"; //$NON-NLS-1$
+            } else if (result instanceof Set<?>) {
+                type = "Set"; //$NON-NLS-1$
+            }
+        } else if (result instanceof EObject) {
+            // Improve the type displayed if we have an EObject
+            EObject eObject = (EObject) result;
+            EClass eClass = eObject.eClass();
+            EPackage ePackage = eClass.getEPackage();
+            type = ePackage.getName() + "::" + eClass.getName(); //$NON-NLS-1$
         }
 
         String message = "Result of type " + type;
         if (size != null) {
             message += " and size " + size;
         }
-
-        return new Status(IStatus.OK, InterpreterViewPlugin.PLUGIN_ID, message);
+        return message;
     }
 
     /**