Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraradermache2012-08-22 03:56:48 -0400
committeraradermache2012-08-22 03:56:48 -0400
commitcc76fd04466da91f6e120f122112cd4f7f1794f6 (patch)
treeaceaa16ce0f1435881fea6d60bff792609a43697 /plugins
parentddbadc78be7507a47bcfe50a2cb7599e1db9a778 (diff)
downloadorg.eclipse.papyrus-cc76fd04466da91f6e120f122112cd4f7f1794f6.tar.gz
org.eclipse.papyrus-cc76fd04466da91f6e120f122112cd4f7f1794f6.tar.xz
org.eclipse.papyrus-cc76fd04466da91f6e120f122112cd4f7f1794f6.zip
Fix for bug 387578, i.e. the check for the interface IGotoMarker is no longer restricted to the model explorer. Only the first referenced view implementing the interface gets activated.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/editor/CoreMultiDiagramEditor.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/editor/CoreMultiDiagramEditor.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/editor/CoreMultiDiagramEditor.java
index d27ac7b7839..8bc825c0d91 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/editor/CoreMultiDiagramEditor.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/editor/CoreMultiDiagramEditor.java
@@ -555,8 +555,8 @@ public class CoreMultiDiagramEditor extends AbstractMultiPageSashEditor implemen
protected void warnUser(ModelMultiException e) {
MessageDialog.openError(getSite().getShell(), "Error", String.format("Your model is corrupted, invalid links have been found :\n"
- + "%s"
- + "It is recommended to fix it before editing it", e.getMessage()));
+ + "%s"
+ + "It is recommended to fix it before editing it", e.getMessage()));
}
/**
@@ -625,9 +625,9 @@ public class CoreMultiDiagramEditor extends AbstractMultiPageSashEditor implemen
// Avoid memory leak
// This call is done from the ServicesRegistry when it is disposed.
// Don't need to do it there.
-// if(resourceSet != null) {
-// resourceSet.unload();
-// }
+ // if(resourceSet != null) {
+ // resourceSet.unload();
+ // }
// dispose available service
if(servicesRegistry != null) {
@@ -799,13 +799,17 @@ public class CoreMultiDiagramEditor extends AbstractMultiPageSashEditor implemen
public void gotoMarker(IMarker marker) {
IWorkbench wb = PlatformUI.getWorkbench();
IWorkbenchPage page = wb.getActiveWorkbenchWindow().getActivePage();
+ boolean first = true;
for(IViewReference view : page.getViewReferences()) {
- if(view.getId().equals("org.eclipse.papyrus.views.modelexplorer.modelexplorer")) {
- page.activate(view.getPart(false));
- IWorkbenchPart part = view.getPart(false);
- if(part instanceof IGotoMarker) {
- ((IGotoMarker)part).gotoMarker(marker);
+ // no longer restrict to model explorer (see bug 387578)
+ IWorkbenchPart part = view.getPart(false);
+ if(part instanceof IGotoMarker) {
+ // activate first view implementing the IGotoMarker interface
+ if(first) {
+ page.activate(view.getPart(false));
+ first = false;
}
+ ((IGotoMarker)part).gotoMarker(marker);
}
}
}

Back to the top