aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSopot Cela2013-11-08 16:50:09 (EST)
committerGerrit Code Review @ Eclipse.org2013-11-15 14:02:55 (EST)
commit4765bf418d00ccbe40662c4d57015305985e95c9 (patch)
treeaf6a89f8e03367f9718055e1893c3fbe07c09ec8
parent5db9936fcbc271f94ecb22aababc118153503e72 (diff)
downloadeclipse.platform.ui-4765bf418d00ccbe40662c4d57015305985e95c9.zip
eclipse.platform.ui-4765bf418d00ccbe40662c4d57015305985e95c9.tar.gz
eclipse.platform.ui-4765bf418d00ccbe40662c4d57015305985e95c9.tar.bz2
Bug 375393 - Popup / Context Menu disapears after reopening a part (e4)refs/changes/42/11742/8
Unlink method moved to the cleanUp method. Change-Id: I9d9b07f0a05246cf79a6049f37f3d6b345abf9ad Signed-off-by: Sopot Cela <sopotcela@gmail.com>
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java
index 1ab0e2a..1e2e580 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java
@@ -360,6 +360,9 @@ public class MenuManagerRenderer extends SWTPartRenderer {
}
}
+ if (menuModel instanceof MPopupMenu)
+ unlinkMenu(menuModel);
+
// The cleanup() is called recursively via cleanUpCopy(), hence
// the need to do a separate pass to remove disposed records:
Iterator<Entry<MMenuElement, ContributionRecord>> iterator = modelContributionToRecord
@@ -1016,4 +1019,19 @@ public class MenuManagerRenderer extends SWTPartRenderer {
menuManager.remove(ici);
}
}
+
+ private void unlinkMenu(MMenu menu) {
+
+ List<MMenuElement> children = menu.getChildren();
+ for (MMenuElement child : children) {
+ if (child instanceof MMenu)
+ unlinkMenu((MMenu) child);
+ else {
+ IContributionItem contribution = getContribution(child);
+ clearModelToContribution(child, contribution);
+ }
+ }
+ MenuManager mm = getManager(menu);
+ clearModelToManager(menu, mm);
+ }
}