Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Porhel2016-04-05 15:23:31 +0000
committerMaxime Porhel2016-04-12 14:01:27 +0000
commit336d26fc98f93dce935d0e7314da60b5809010f2 (patch)
tree330b98f769e7dcfe70e5ec23ac48c331f9d4960a
parent7a5a60924eaa6d5ca4ba009d4e728e69f01a3e72 (diff)
downloadorg.eclipse.sirius-336d26fc98f93dce935d0e7314da60b5809010f2.tar.gz
org.eclipse.sirius-336d26fc98f93dce935d0e7314da60b5809010f2.tar.xz
org.eclipse.sirius-336d26fc98f93dce935d0e7314da60b5809010f2.zip
[461740] Correct navigation from a marker referencing external diagram
When a validation marker has been created from a DDiagram which does not belong to the main aird, the marker references . the main aird file (entry point of the session) . the marked diagram uri (belongs to an other file) . the marked element uri (used later for the selection) This commit corrects the opening of such diagram belonging to a referenced resource (which might not be a file) and ensure that when we call DialectUIManager.INSTANCE.openEditor(session, dDiagram, pm), the diagram instance we want to open is the one of the ResourceSet of the current session. Previously, the passed dDiagram potentially came from the ResourceSet of a temporary editor opened by Eclipse with a non-open dummy session. This used to trigger the opening of the DiagramDialectUIService.informOfActivateNeededViewpoints popup due to a wrong analysis of activated Viewpoints the activateNeededViewpoint method: the analyzed diagram coming from a phantom session. Bug: 461740 Change-Id: I77b300c26bf8d1d96d19676f7551cc80e3e2cb73 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/tools/internal/marker/SiriusMarkerNavigationProviderSpec.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/marker/SiriusMarkerNavigationProviderSpec.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/marker/SiriusMarkerNavigationProviderSpec.java
index 60869377ab..8c45748a93 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/marker/SiriusMarkerNavigationProviderSpec.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/marker/SiriusMarkerNavigationProviderSpec.java
@@ -114,7 +114,14 @@ public class SiriusMarkerNavigationProviderSpec extends SiriusMarkerNavigationPr
// Open the corresponding editor
SiriusDiagramEditor openedEditor = null;
if (session != null) {
- openedEditor = (SiriusDiagramEditor) DialectUIManager.INSTANCE.openEditor(session, (DDiagram) markerDiagram.getElement(), new NullProgressMonitor());
+ Diagram diagramToOpen = markerDiagram;
+ if (session.getTransactionalEditingDomain() != null && session.getTransactionalEditingDomain().getResourceSet() != defaultEditor.getEditingDomain().getResourceSet()) {
+ diagramToOpen = (Diagram) session.getTransactionalEditingDomain().getResourceSet().getEObject(markerDiagramURI, true);
+ }
+
+ if (diagramToOpen != null) {
+ openedEditor = (SiriusDiagramEditor) DialectUIManager.INSTANCE.openEditor(session, (DDiagram) diagramToOpen.getElement(), new NullProgressMonitor());
+ }
}
if (openedEditor != null) {

Back to the top