brunano21 / workspacemechanic

Automatically exported from code.google.com/p/workspacemechanic
0 stars 0 forks source link

Fixing keyboard bindings with .kbd file, resets the scheme to Default #113

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Create a plug-in that creates new scheme with default as a parent:

a. Create new plug-in
b. Open plugin.xml
c. In the extensions tab add: org.eclipse.ui.bindings
d. Add a scheme, id: myScheme, name: My Scheme, parentId: 
org.eclipse.ui.defaultAcceleratorConfiguration

2. Start Eclipse, set the new scheme as current and make a change in the 
bindings.

a. Open the keys preference dialog: Window > Preferences > General > Keys. 
b. Set the created 'My Scheme' as the current scheme.
c. Make a change, e.g. remove the binding for 'Build All'

3. Save the keybindings with the Workspace Mechanic.

a. RMB on the workspace mechanic icon and choose Dump keybindings...
b. Save the keybindings in ~/.eclipse/mechanic

4. Restore the keybinding for 'Build All'.

a. Open the keys preference dialog: Window > Preferences > General > Keys. 
b. Click Restore Defaults.

5. Execute the workspace mechanic fix.

a. RMB on the workspace mechanic icon and choose Check all
b. Double click on the workspace mechanic icon and note the to be executed 
change. Choose Fix Now and press OK.

What is the expected output? What do you see instead?

Expected: the keybinding for 'Build All' has been removed, while the scheme 
stays the same.

Actual result: the keybinding for 'Build All' has been removed, but the scheme 
has been set to 'Default'.

a. Open the keys preference dialog: Window > Preferences > General > Keys.
b. Note that the scheme has been set to Default.

What version of the product are you using? On what operating system?

Wind River Workbench
Version: 3.3.4 20130228-1031
Powered by Eclipse Juno
Version: 3.8.1 M20120914-1540

Workspace Mechanic Plug-in 0.3.4

Please provide any additional information below.

I noticed that the kbd file shows that the scheme of the change is 
'org.eclipse.ui.defaultAcceleratorConfiguration' instead of 'myScheme'. When I 
change the scheme name in the kbd file to 'myScheme' and perform a Check All in 
the Workspace Mechanic, no fix is proposed.

The keybinding.kbd file:

{
  "metadata" : {
    "description" : "My keyboard bindings"
  },
  "changeSets" : [
    {
    "scheme" : "org.eclipse.ui.defaultAcceleratorConfiguration",
    "context" : "org.eclipse.ui.contexts.window",
    "action" : "remove",
    "bindings" : [
      {"keys" : "Ctrl+B", "cmd" : "org.eclipse.ui.project.buildAll"},
      ]
    },
  ]
}

--------------------------------
Addition:

It seems the scheme is changed depending on where the change is performed. 
Build All is specified in the parent (default) scheme and thus the scheme 
probably is set to the Default scheme. 

When I add a change for a key specifically added in 'My Scheme' and add it 
below the current remove in the kbd file, the scheme "stays" at 'My Scheme'.

Original issue reported on code.google.com by Ruu...@gmail.com on 30 Oct 2013 at 2:10

GoogleCodeExporter commented 9 years ago

Original comment by konigsb...@gmail.com on 30 Oct 2013 at 5:59