Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Porhel2016-04-25 12:49:31 +0000
committerMaxime Porhel2016-04-26 15:33:44 +0000
commit06f8c8fee98961461201ca775212d6135923e3be (patch)
tree46076b493541e93bb3b6e04340307d096cee00f6
parentc6c91e00ce7a10530c11300475d5aa60ce284008 (diff)
downloadorg.eclipse.sirius-06f8c8fee98961461201ca775212d6135923e3be.tar.gz
org.eclipse.sirius-06f8c8fee98961461201ca775212d6135923e3be.tar.xz
org.eclipse.sirius-06f8c8fee98961461201ca775212d6135923e3be.zip
[491216] Get diagram to fix from the current session.
The diagram parameter is only used in the fix command computation . to retrieve the session when it is not found from the fixTarget . as CommandContext key. The current way to get the diagram is not safe if the editor is the dummy error editor opened by the gotoMarker. Bug: 491216 Change-Id: I9f7009b7a941d346fef9924d4f1ab54e45e274f6 Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/quickfix/ValidationFixResolution.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/quickfix/ValidationFixResolution.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/quickfix/ValidationFixResolution.java
index 50744f856f..d931f8556f 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/quickfix/ValidationFixResolution.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/quickfix/ValidationFixResolution.java
@@ -128,8 +128,9 @@ public class ValidationFixResolution implements IMarkerResolution {
if (markedView != null) {
EObject fixTarget = getFixTarget(markedView);
if (fixTarget != null) {
- executeFix(editor, fixTarget, currentSession.getTransactionalEditingDomain(), offscreenValidation);
- revalidate(editor, markedView.getDiagram(), offscreenValidation);
+ Diagram diagram = markedView.getDiagram();
+ executeFix(editor, (DDiagram) diagram.getElement(), fixTarget, currentSession.getTransactionalEditingDomain(), offscreenValidation);
+ revalidate(editor, diagram, offscreenValidation);
}
}
}
@@ -182,11 +183,11 @@ public class ValidationFixResolution implements IMarkerResolution {
return (fix.eContainer() instanceof ViewValidationRule);
}
- private void executeFix(IEditorPart editor, EObject fixTarget, TransactionalEditingDomain domain, boolean offscreenValidation) {
+ private void executeFix(IEditorPart editor, DDiagram diagram, EObject fixTarget, TransactionalEditingDomain domain, boolean offscreenValidation) {
IDiagramCommandFactory commandFactory = getDiagramCommandFactory(editor, domain, offscreenValidation);
if (commandFactory != null && fixTarget != null) {
- Command fixCommand = commandFactory.buildQuickFixOperation(fix, fixTarget, getDiagram(editor));
+ Command fixCommand = commandFactory.buildQuickFixOperation(fix, fixTarget, diagram);
// Set the RefreshEditorsListener in forceRefresh mode
EObject semanticTarget = getSemanticTarget(fixTarget);

Back to the top