diff options
| author | Maxime Porhel | 2016-04-05 15:23:31 +0000 |
|---|---|---|
| committer | Maxime Porhel | 2016-04-22 16:21:56 +0000 |
| commit | 3e98cae364873867c8a5380ddc78fb7dcab1e119 (patch) | |
| tree | 454054a33ceab759c907098465201316ef829059 | |
| parent | 10f8085f4ed9b5ed09262e44a2e7b292767d5069 (diff) | |
| download | org.eclipse.sirius-3e98cae364873867c8a5380ddc78fb7dcab1e119.tar.gz org.eclipse.sirius-3e98cae364873867c8a5380ddc78fb7dcab1e119.tar.xz org.eclipse.sirius-3e98cae364873867c8a5380ddc78fb7dcab1e119.zip | |
[490907] 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: 490907
Cherry-picked-from: 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.java | 9 |
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 8148ab1ab3..ff20058139 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 @@ -110,7 +110,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) { |
