summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorThorsten Hake2013-11-28 03:33:24 (EST)
committer Paul Webster2013-11-29 15:39:28 (EST)
commita3c710b567f2280cccd2a8532173e1552f79e9bf (patch)
tree6920adaea1150d9deb096880f72fab8876196bd0
parent937b734d57ce9d85b68624e2e8a05b09f2eb61d2 (diff)
downloadeclipse.platform.ui-a3c710b567f2280cccd2a8532173e1552f79e9bf.zip
eclipse.platform.ui-a3c710b567f2280cccd2a8532173e1552f79e9bf.tar.gz
eclipse.platform.ui-a3c710b567f2280cccd2a8532173e1552f79e9bf.tar.bz2
[422034] Fixed unchecked cast from MHandlerContainer to MContext.refs/changes/51/19151/1
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=422034 Change-Id: I4e01f9824bd8ccbf4d3eebca8f3d53dec1afb7af Signed-off-by: Thorsten Hake <eclipse@thorsten-hake.com>
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/HandlerProcessingAddon.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/HandlerProcessingAddon.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/HandlerProcessingAddon.java
index c2859c4..9b8cc56 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/HandlerProcessingAddon.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/HandlerProcessingAddon.java
@@ -52,11 +52,13 @@ public class HandlerProcessingAddon {
List<MHandlerContainer> findElements = modelService.findElements(application, null,
MHandlerContainer.class, null);
for (MHandlerContainer mHandlerContainer : findElements) {
- for (MHandler mHandler : mHandlerContainer.getHandlers()) {
+ if (mHandlerContainer instanceof MContext) {
MContext mContext = (MContext) mHandlerContainer;
IEclipseContext context = mContext.getContext();
if (context != null) {
- processActiveHandler(mHandler, context);
+ for (MHandler mHandler : mHandlerContainer.getHandlers()) {
+ processActiveHandler(mHandler, context);
+ }
}
}
}
@@ -67,7 +69,8 @@ public class HandlerProcessingAddon {
private void registerModelListeners() {
eventHandler = new EventHandler() {
public void handleEvent(Event event) {
- if ((event.getProperty(UIEvents.EventTags.ELEMENT) instanceof MHandlerContainer)) {
+ if ((event.getProperty(UIEvents.EventTags.ELEMENT) instanceof MHandlerContainer)
+ && (event.getProperty(UIEvents.EventTags.ELEMENT) instanceof MContext)) {
MHandlerContainer handlerContainer = (MHandlerContainer) event
.getProperty(UIEvents.EventTags.ELEMENT);
if (UIEvents.EventTypes.ADD.equals(event.getProperty(UIEvents.EventTags.TYPE))) {