summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDaniel Rolka2013-11-27 11:28:24 (EST)
committer Gerrit Code Review @ Eclipse.org2013-11-27 16:02:47 (EST)
commit8253d4e71b639bfa437022d9e26249decb691982 (patch)
treecb97ef2d194ecd01732ef2f44261c6bbc76cad32
parent2d66e04c48991203af1c624a69877928796b40e8 (diff)
downloadeclipse.platform.ui-8253d4e71b639bfa437022d9e26249decb691982.zip
eclipse.platform.ui-8253d4e71b639bfa437022d9e26249decb691982.tar.gz
eclipse.platform.ui-8253d4e71b639bfa437022d9e26249decb691982.tar.bz2
Bug 391957 - [Contributions] ClassCastException with action sets:refs/changes/78/18978/4
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.java7
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 dc61cf2..fc8ce60 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);
}