diff options
author | Lars Vogel | 2013-11-18 14:06:10 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2013-11-25 21:18:43 +0000 |
commit | 995063c17c006aa3a837bf55692db5a22761c9e7 (patch) | |
tree | de3aca97d04086d646c969c7725a0b3ba80fee67 | |
parent | f36eec5fa37e88d743e80b2eaffd106f175ef980 (diff) | |
download | eclipse.platform.ui-995063c17c006aa3a837bf55692db5a22761c9e7.tar.gz eclipse.platform.ui-995063c17c006aa3a837bf55692db5a22761c9e7.tar.xz eclipse.platform.ui-995063c17c006aa3a837bf55692db5a22761c9e7.zip |
Bug 395161 - Binding Context without name -> Error Message is misleading
Change-Id: I621f536554b6407abcb5e1d0a5f4ef3d0ff4cd50
Signed-off-by: Lars Vogel <Lars.Vogel@gmail.com>
-rw-r--r-- | bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/ContextProcessingAddon.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/ContextProcessingAddon.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/ContextProcessingAddon.java index 37032df19fe..c3fc14d503d 100644 --- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/ContextProcessingAddon.java +++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/ContextProcessingAddon.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2012 IBM Corporation and others. + * Copyright (c) 2010, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Lars Vogel <lars.vogel@gmail.com> - Bug 395161 ******************************************************************************/ package org.eclipse.e4.ui.internal.workbench.addons; @@ -17,6 +18,7 @@ import javax.inject.Inject; import org.eclipse.core.commands.contexts.Context; import org.eclipse.core.commands.contexts.ContextManager; import org.eclipse.e4.core.services.events.IEventBroker; +import org.eclipse.e4.core.services.log.Logger; import org.eclipse.e4.ui.internal.workbench.Activator; import org.eclipse.e4.ui.internal.workbench.Policy; import org.eclipse.e4.ui.model.LocalizationHelper; @@ -40,6 +42,9 @@ public class ContextProcessingAddon { @Inject private ContextManager contextManager; + @Inject + Logger logger; + private EventHandler additionHandler; @PostConstruct @@ -56,6 +61,10 @@ public class ContextProcessingAddon { } private void defineContexts(MBindingContext parent, MBindingContext current) { + if (current.getName() == null || current.getElementId() == null) { + logger.error("Binding context name or id is null for: " + current); //$NON-NLS-1$ + return; + } Context context = contextManager.getContext(current.getElementId()); if (!context.isDefined()) { String localizedName = LocalizationHelper.getLocalized(current.getName(), current, |