aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSopot Cela2013-11-20 10:04:04 (EST)
committerSopot Cela2013-11-20 10:05:20 (EST)
commitc302e42d5a2f3a406622515de3fb2b33ddfa838e (patch)
treefdf81aa841046e1083712b3796e08bc2ca6a7052
parent1348cdaa673e042ea615e7b4c7014d3d05f9aa8b (diff)
downloadeclipse.platform.ui-c302e42d5a2f3a406622515de3fb2b33ddfa838e.zip
eclipse.platform.ui-c302e42d5a2f3a406622515de3fb2b33ddfa838e.tar.gz
eclipse.platform.ui-c302e42d5a2f3a406622515de3fb2b33ddfa838e.tar.bz2
Bug 375393 - Popup / Context Menu disapears after reopening a part (e4)refs/changes/17/18617/1
Change-Id: I767ee2c86cc03b230f056eee4a7fe2a92a45bec7 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.java21
1 files changed, 16 insertions, 5 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 166e57d..80c69cd 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
@@ -174,6 +174,22 @@ public class MenuManagerRenderer extends SWTPartRenderer {
}
}
}
+
+ if (element instanceof MPart) {
+ MPart part = (MPart) element;
+ if (UIEvents.UIElement.TOBERENDERED.equals(attName)) {
+ boolean tbr = (Boolean) event
+ .getProperty(UIEvents.EventTags.NEW_VALUE);
+ if (!tbr) {
+ List<MMenu> menus = part.getMenus();
+ for (MMenu menu : menus) {
+ if (menu instanceof MPopupMenu)
+ unlinkMenu(menu);
+ }
+ }
+ }
+ }
+
if (UIEvents.UIElement.VISIBLE.equals(attName)) {
if (element instanceof MMenu) {
MMenu menuModel = (MMenu) element;
@@ -384,11 +400,6 @@ 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
.entrySet().iterator();
for (; iterator.hasNext();) {