diff options
author | Daniel Rolka | 2013-11-27 16:28:24 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2013-11-27 21:02:47 +0000 |
commit | 8253d4e71b639bfa437022d9e26249decb691982 (patch) | |
tree | cb97ef2d194ecd01732ef2f44261c6bbc76cad32 | |
parent | 2d66e04c48991203af1c624a69877928796b40e8 (diff) | |
download | eclipse.platform.ui-8253d4e71b639bfa437022d9e26249decb691982.tar.gz eclipse.platform.ui-8253d4e71b639bfa437022d9e26249decb691982.tar.xz eclipse.platform.ui-8253d4e71b639bfa437022d9e26249decb691982.zip |
Bug 391957 - [Contributions] ClassCastException with action sets:
OpaqueToolItemImpl cannot be cast to MTrimElement
Change-Id: Ib483f09242ad10783c6cbcaaab3ca69ffb93e8a7
Signed-off-by: Daniel Rolka <daniel.rolka@pl.ibm.com>
-rw-r--r-- | bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java index dc61cf27b2b..fc8ce60885d 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CoolBarToTrimManager.java @@ -264,11 +264,12 @@ public class CoolBarToTrimManager extends ContributionManager implements ICoolBa * @see org.eclipse.jface.action.IContributionManager#find(java.lang.String) */ public IContributionItem find(String id) { - MUIElement el = modelService.find(id, window); - if (!(el instanceof MToolBar)) + List<MToolBar> toolbars = modelService.findElements(window, id, MToolBar.class, null); + if (toolbars.isEmpty()) { return null; + } - final MToolBar model = (MToolBar) el; + final MToolBar model = toolbars.get(0); if (model.getTransientData().get(OBJECT) != null) { return (IContributionItem) model.getTransientData().get(OBJECT); } |