Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Migrate key preferences to new version of plugin when command ID has changed
Migrate key preferences to new version of plugin when command ID has changed [message #1248177] Mon, 17 February 2014 02:23 Go to next message
Simon Schäfer is currently offline Simon SchäferFriend
Messages: 14
Registered: June 2011
Junior Member
Hello everyone,

I help to develop an Eclipse plugin, whose internal package structure has changed due to refactorings. Now, I also want to change the name of command IDs in the plugin.xml whose current name scheme is similar to the old package structure. Changing the command IDs is not the problem, but our plugin takes preferences+key bindings, which should not be lost after the migration is done.

What I did so far is that I build a migration manager that can copy the value of the old command ID when a user has changed it and stores it as the value of the new command ID. This works fine so far.

For the key bindings I did this by accessing the 'IBindingService', which has a method 'savePreference' that takes all bindings to save (this method is a bit awkward to use because it overwrites all bindings. I didn't find a better way so far to just add a new binding).

But I noticed that the old command IDs + bindings still exist. I could unbind the old binding by simply not passing it to the method 'savePreference', but that does not remove the command, which is annoying because the key store of Eclipse now shows double entries, where one entry is unbound (an unused).

I assume when I remove the old command from the workbench that the old key binding is removed as well. My question now is how can I remove old commands from the workbench? I looked into 'ICommandService', but it doesn't provide a way to do this. Is it possible?

[Updated on: Mon, 17 February 2014 02:24]

Report message to a moderator

Re: Migrate key preferences to new version of plugin when command ID has changed [message #1263616 is a reply to message #1248177] Tue, 04 March 2014 16:39 Go to previous message
Simon Schäfer is currently offline Simon SchäferFriend
Messages: 14
Registered: June 2011
Junior Member
I asked the same question on the mailing lists and got an answer there: http://dev.eclipse.org/mhonarc/lists/platform-ui-dev/msg05597.html
Previous Topic:Problem on eclipse upgrade to x64
Next Topic:Eclipse product does not recognize fragment (uncompressed)
Goto Forum:
  


Current Time: Fri Apr 26 07:35:08 GMT 2024

Powered by FUDForum. Page generated in 0.04661 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top