Bug 406003 - Persisting bindings forever results in bad/conflicting bindings that cannot be removed
Summary: Persisting bindings forever results in bad/conflicting bindings that cannot b...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 4.4 M2   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 406941 409369 (view as bug list)
Depends on:
Blocks: 405296 408079 415473
  Show dependency tree
 
Reported: 2013-04-18 12:05 EDT by Curtis Windatt CLA
Modified: 2013-09-17 10:11 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2013-04-18 12:05:20 EDT
Every key binding that is loaded from the bindings extension is persisted in the workbench xmi.  If the plug-in providing that extension is later removed, the keybinding stays.  Worse is that the keys pref page doesn't recognize the conflict.  The only workaround is to delete the xmi file or start a new workspace.

1) Create a new plug-in project > Create an RCP > Use the Mail RCP Template
2) Launch a normal Eclipse application launch (runtime workbench)
3) Note that CTRL+X will close Eclipse instead of copy
4) Note that CTRL+3 has a conflict (Quick Access and Open Message)
5) Shut down the runtime workbench
6) Close or delete the Mail RCP project
7) Launch the runtime workbench again
Result:
CTRL+X still shuts down Eclipse!
CTRL+3 still has a conflict
The preference page doesn't list any conflicts for those keybindings
Comment 1 Curtis Windatt CLA 2013-04-18 12:10:35 EDT
This is really annoying if you have some test projects with odd keybindings.  I can improve my situation by changing the keybindings in the Mail template, but the workbench xmi for my target workspace is always a massive file with many obsolete entries.

If we cannot automatically clear out obsolete entries, we should still look for an easier process than going into the file system and deleting the file.  A launcher argument to avoid persisting things to the xmi or an option to delete the file on startup would help.
Comment 2 Thomas Schindl CLA 2013-04-18 12:12:21 EDT
we have a switch for not persisting state already -clearPersistedState!
Comment 3 Paul Webster CLA 2013-04-18 12:16:14 EDT
(In reply to comment #1)
> 
> If we cannot automatically clear out obsolete entries, we should still look
> for an easier process than going into the file system and deleting the file.
> A launcher argument to avoid persisting things to the xmi or an option to
> delete the file on startup would help.

3 things that come to mind:

1) install and bring up the Live Model editor and remove them (not ideal)

2) -persistState false # don't persist state

3) -clearPersistedState # remove it/ignore it on startup.

I suspect the correct fix would be in the org.eclipse.ui.internal.BindingToModelProcessor, removing "system" model keybindings that don't exist in the extension point.

PW
Comment 4 Curtis Windatt CLA 2013-04-18 13:38:10 EDT
(In reply to comment #3)
> 2) -persistState false # don't persist state

To me it sounds like these settings should be on by default for Eclipse launch configurations.  Perhaps only when launching the workbench though, as the same launch configuration is used by e4 RCP developers.  It is late in 4.3 to change something like that.  Maybe providing a UI option is doable.
Comment 5 Curtis Windatt CLA 2013-04-18 13:49:21 EDT
The keybindings for the Mail RCP template have been changed (Bug 406014) so the steps in comment #0 will not work anymore.
Comment 6 Lars Vogel CLA 2013-04-30 14:35:06 EDT
*** Bug 406941 has been marked as a duplicate of this bug. ***
Comment 7 Lars Vogel CLA 2013-04-30 14:36:14 EDT
In Bug 406941 I observed a similar error for the Eclipse IDE. I used the preference to remove the Ctrl+P keybinding and it stayed active even though the preference did not show it anymore.
Comment 8 Alexandra Schladebeck CLA 2013-05-30 02:52:27 EDT
*** Bug 409369 has been marked as a duplicate of this bug. ***
Comment 9 Curtis Windatt CLA 2013-05-30 11:21:27 EDT
(In reply to comment #8)
> *** Bug 409369 has been marked as a duplicate of this bug. ***

In Bug 409369 it was pointed out that uninstalling a feature doesn't remove the keybindings.  Paul marked that bug for consideration in 4.3.1.  Even if we don't have a complete fix, we should look at what cases we can solve.  Perhaps we can recognize a p2 uninstall operation and clear the persisted state.
Comment 10 Paul Webster CLA 2013-08-19 15:30:34 EDT
Curtis, could you have a look at https://git.eclipse.org/r/#/c/15620/

I remove bindings that are no longer backed by an extension.

PW
Comment 11 Curtis Windatt CLA 2013-08-19 17:20:05 EDT
(In reply to comment #10)
> Curtis, could you have a look at https://git.eclipse.org/r/#/c/15620/
> 
> I remove bindings that are no longer backed by an extension.
> 
> PW

This works great for my use case (steps from comment #0 noting the keybinding change to CtrlShiftQ).  Code looks reasonable, much simpler code change than I would have expected.
Comment 13 Paul Elder CLA 2013-08-26 15:03:26 EDT
Verified in build 4.3.0.M20130821-0800
Comment 14 Paul Elder CLA 2013-08-26 15:05:39 EDT
(In reply to comment #13)
> Verified in build 4.3.0.M20130821-0800

Ignore that, should have been a comment on bug 415473.
Comment 15 Paul Elder CLA 2013-09-17 10:11:18 EDT
Verified in 4.4 M2 (4.4.0.I20130916-2330)