summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDaniel Rolka2013-04-11 10:04:44 (EDT)
committer Paul Webster2013-05-02 12:17:30 (EDT)
commit1c6a8a02c140172a93a5e31fe2fd6a8878c4047c (patch)
treeeec1ec1dfa91965ccf8685adbabb47bffdf8f079
parent6e3fb24f8c6174b2c01d430555e0ccad410a892c (diff)
downloadeclipse.platform.ui-1c6a8a02c140172a93a5e31fe2fd6a8878c4047c.zip
eclipse.platform.ui-1c6a8a02c140172a93a5e31fe2fd6a8878c4047c.tar.gz
eclipse.platform.ui-1c6a8a02c140172a93a5e31fe2fd6a8878c4047c.tar.bz2
Bug 395839 - AbstractEList$BasicIndexOutOfBoundsException when opening a
context menu
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java12
1 files changed, 10 insertions, 2 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 f4d21bf..317ce8a 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
@@ -869,7 +869,11 @@ public class MenuManagerRenderer extends SWTPartRenderer {
legacySep.setVisible(item.isVisible());
legacySep.setOpaqueItem(item);
linkModelToContribution(legacySep, item);
- modelChildren.add(dest, legacySep);
+ if (modelChildren.size() > dest) {
+ modelChildren.add(dest, legacySep);
+ } else {
+ modelChildren.add(legacySep);
+ }
} else if (menuElement instanceof MOpaqueMenuSeparator) {
MOpaqueMenuSeparator legacySep = (MOpaqueMenuSeparator) menuElement;
oldSeps.remove(legacySep);
@@ -891,7 +895,11 @@ public class MenuManagerRenderer extends SWTPartRenderer {
legacyItem.setVisible(item.isVisible());
legacyItem.setOpaqueItem(item);
linkModelToContribution(legacyItem, item);
- modelChildren.add(dest, legacyItem);
+ if (modelChildren.size() > dest) {
+ modelChildren.add(dest, legacyItem);
+ } else {
+ modelChildren.add(legacyItem);
+ }
} else if (menuElement instanceof MOpaqueMenuItem) {
MOpaqueMenuItem legacyItem = (MOpaqueMenuItem) menuElement;
oldModelItems.remove(legacyItem);