Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Elder2013-03-08 10:49:52 +0000
committerPaul Elder2013-03-08 17:24:09 +0000
commit50a96b5f0d537e690969462396940b4483d3f64c (patch)
treeda16128f112e3e91cb0532f10bf381f96522c352
parent0a30e5fae41ba9f0997aab29e696e6bf77b0ae0f (diff)
downloadeclipse.platform.ui-50a96b5f0d537e690969462396940b4483d3f64c.tar.gz
eclipse.platform.ui-50a96b5f0d537e690969462396940b4483d3f64c.tar.xz
eclipse.platform.ui-50a96b5f0d537e690969462396940b4483d3f64c.zip
bug 266604: [KeyBindings] Import keyBindings does not work
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java5
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java24
2 files changed, 16 insertions, 13 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
index c84207681fc..0286422da3c 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingPersistence.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 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
@@ -1226,6 +1226,9 @@ public class BindingPersistence extends PreferencePersistence {
final CommandManager commandManager) {
this.bindingManager = bindingManager;
this.commandManager = commandManager;
+ // HACK. Calling super.read() installs a required preferences change listener.
+ // See bug 266604.
+ super.read();
}
protected final boolean isChangeImportant(final IRegistryChangeEvent event) {
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 9f18be06dcb..2cc593ad136 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 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
@@ -106,6 +106,17 @@ public final class BindingService implements IBindingService {
activeSchemeIds = getSchemeIds(activeScheme.getId());
tableManager.setActiveSchemes(activeSchemeIds);
}
+ // Initialize BindingPersistence, its needed to install
+ // a preferences change listener. See bug 266604.
+ bp = new BindingPersistence(manager, commandManager) {
+ @Override
+ public void reRead() {
+ super.reRead();
+ // after having read the registry and preferences, persist
+ // and update the model
+ persistToModel(manager.getActiveScheme());
+ }
+ };
}
/*
@@ -379,17 +390,6 @@ public final class BindingService implements IBindingService {
* .ui.commands.ICommandService)
*/
public void readRegistryAndPreferences(ICommandService commandService) {
- if (bp == null) {
- bp = new BindingPersistence(manager, commandManager) {
- @Override
- public void reRead() {
- super.reRead();
- // after having read the registry and preferences, persist
- // and update the model
- persistToModel(manager.getActiveScheme());
- }
- };
- }
bp.read();
}

Back to the top