Showing posts with label eclipse preferences. Show all posts
Showing posts with label eclipse preferences. Show all posts

Thursday, August 20, 2009

Preferences Nightmare

Business Eclipse adopters quite common request for headless preferences import/export. Eclipse preferences has one big disadvantage - they are exported if and only if they have been changed. So if you and your friend have some compiler settings, and you would like to import his preferences, it is impossible, because both preferences set will be merged. There is also a request to reset all existing preferences prior to import.

We, as Eclipse support, have tried to deliver solutions to those problems. But we failed because of something rather unexpected:


There is too much freedom in preferences allowed.

Developer tends to:
  • Cache preference node. This results in beautiful java.lang.IllegalStateException: Preference node "org.eclipse.core.XYZ" has been removed.
  • assume that nobody else will modify those preferences and there is no need to listen for changes.
  • assume that preferences can be changed only by preferences dialog and put some business logic into IPreferencePage#performOK().
And what about you? Can your preferences be exported and imported and changed via 3rd party? Or is it necessary to dig through your code innards to find what you call in performOK?

Is it so difficult to choose the right way?

Best regards,
Chris