aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Besedin2012-03-22 16:20:06 (EDT)
committerOleg Besedin2012-03-22 16:20:46 (EDT)
commitfae8461069b806a9f7ff70a87cd8abe68e1c71c0 (patch)
tree6ed554ac765f9b614043bfdc52f7169241d9643d
parentcbd1913e21a75a05a3f160a61be9ed2f1dc3cf86 (diff)
downloadeclipse.platform.ui-fae8461069b806a9f7ff70a87cd8abe68e1c71c0.zip
eclipse.platform.ui-fae8461069b806a9f7ff70a87cd8abe68e1c71c0.tar.gz
eclipse.platform.ui-fae8461069b806a9f7ff70a87cd8abe68e1c71c0.tar.bz2
Bug 374942 - Copy keybinding always brings up key binding selectionv20120322-2020
popup
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/util/BindingProcessingAddon.java12
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java5
2 files changed, 12 insertions, 5 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/util/BindingProcessingAddon.java b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/util/BindingProcessingAddon.java
index ee95645..00fcfa4 100644
--- a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/util/BindingProcessingAddon.java
+++ b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/util/BindingProcessingAddon.java
@@ -328,14 +328,16 @@ public class BindingProcessingAddon {
MKeyBinding oldBinding = (MKeyBinding) EcoreUtil
.copy((EObject) binding);
oldBinding.setCommand((MCommand) oldObj);
- updateBinding(oldBinding, false, null);
+ updateBinding(oldBinding, false,
+ ((EObject) binding).eContainer());
updateBinding(binding, true, null);
} else if (UIEvents.KeySequence.KEYSEQUENCE
.equals(attrName)) {
MKeyBinding oldBinding = (MKeyBinding) EcoreUtil
.copy((EObject) binding);
oldBinding.setKeySequence((String) oldObj);
- updateBinding(oldBinding, false, null);
+ updateBinding(oldBinding, false,
+ ((EObject) binding).eContainer());
updateBinding(binding, true, null);
}
} else if (UIEvents.KeyBinding.PARAMETERS.equals(attrName)) {
@@ -346,7 +348,8 @@ public class BindingProcessingAddon {
MKeyBinding oldBinding = (MKeyBinding) EcoreUtil
.copy((EObject) binding);
oldBinding.getParameters().remove(newObj);
- updateBinding(oldBinding, false, null);
+ updateBinding(oldBinding, false,
+ ((EObject) binding).eContainer());
updateBinding(binding, true, null);
} else if (UIEvents.EventTypes.REMOVE.equals(event
.getProperty(UIEvents.EventTags.TYPE))) {
@@ -355,7 +358,8 @@ public class BindingProcessingAddon {
MKeyBinding oldBinding = (MKeyBinding) EcoreUtil
.copy((EObject) binding);
oldBinding.getParameters().add((MParameter) oldObj);
- updateBinding(oldBinding, false, null);
+ updateBinding(oldBinding, false,
+ ((EObject) binding).eContainer());
updateBinding(binding, true, null);
}
}
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
index 74fca24..b8f2203 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java
@@ -682,7 +682,10 @@ public final class BindingService implements IBindingService {
MKeyBinding keyBinding = null;
for (MKeyBinding existingBinding : table.getBindings()) {
- if (cmd.equals(existingBinding.getCommand())) {
+ if (cmd.equals(existingBinding.getCommand())
+ && existingBinding.getKeySequence() != null
+ && existingBinding.getKeySequence().equals(
+ binding.getTriggerSequence().format())) {
keyBinding = existingBinding;
break;
}