summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDaniel Rolka2013-04-11 10:04:44 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-04-12 09:03:52 (EDT)
commit3d996ff0b4a10627420bca71805ad2b5c9195e78 (patch)
tree75f5d0ee8c5cfd32b154ba61ca8bb92f45ad633f
parentbc9eda6cbcd650e67c86f50063b3d0a272555200 (diff)
downloadeclipse.platform.ui-3d996ff0b4a10627420bca71805ad2b5c9195e78.zip
eclipse.platform.ui-3d996ff0b4a10627420bca71805ad2b5c9195e78.tar.gz
eclipse.platform.ui-3d996ff0b4a10627420bca71805ad2b5c9195e78.tar.bz2
Bug 395839 - AbstractEList$BasicIndexOutOfBoundsException when opening arefs/changes/12/11812/2
context menu
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/MenuManagerRenderer.java16
1 files changed, 12 insertions, 4 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 0cf54a3..12e4960 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
@@ -629,8 +629,8 @@ public class MenuManagerRenderer extends SWTPartRenderer {
Object obj = itemModel.getContributionItem();
if (obj instanceof IContextFunction) {
final IEclipseContext lclContext = getContext(itemModel);
- ici = (IContributionItem) ((IContextFunction) obj)
- .compute(lclContext, null);
+ ici = (IContributionItem) ((IContextFunction) obj).compute(
+ lclContext, null);
itemModel.setContributionItem(ici);
} else if (obj instanceof IContributionItem) {
ici = (IContributionItem) obj;
@@ -890,7 +890,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);
@@ -912,7 +916,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);