[neon] How to replace org.osgi.service.prefs.Preferences [message #1752482] |
Tue, 24 January 2017 06:12  |
Eclipse User |
|
|
|
One of the applications I am migrating from Mars to Neon makes use of org.osgi.service.prefs.Preferences to store user settings.
Obviously, this class is no longer available in Neon. I did not find anything in the Migration Guide and the Technical Guide. Is there a new Scout equivalent to be used instead or are we on our own in covering this functionality?
|
|
|
|
Re: [neon] How to replace org.osgi.service.prefs.Preferences [message #1752497 is a reply to message #1752490] |
Tue, 24 January 2017 08:55   |
Eclipse User |
|
|
|
Hm, it seems my elation was premature.
In Mars we had the following structure:
MyPreferences extends org.eclipse.scout.commons.prefs.AbstractPreferences implements org.osgi.service.prefs.Preferences
I'm trying to map things to Neon but am struggling. For starters, there seem to be two different classes called Preferences and I am not sure which one to use
There is:
java.util.prefs.AbstractPreferences extends java.util.prefs.Preferences
But then, there also is:
org.eclipse.scout.rt.shared.services.common.prefs.Preferences
Which of the two should I use instead of org.osgi.service.prefs.Preferences?
java.util.prefs.AbstractPreferences extends java.util.prefs.Preferences, so that led me to think that this is the choice.
However, then, there is org.eclipse.scout.rt.shared.services.common.prefs.IUserPreferencesStorageService which in Mars used org.osgi.service.prefs.Preferences loadPreferences().
In Neon this seems to have been replaced with org.eclipse.scout.rt.shared.services.common.prefs.IUserPreferencesStorageService which instead has org.eclipse.scout.rt.shared.services.common.prefs.IPreferences getPreferences(). This interface however is implemented by org.eclipse.scout.rt.shared.services.common.prefs.Preferences which seems to suggest to the exact opposite.
Besides this confusion, I am not sure how I need to transfer the former loadPreferences() to the new getPreferences() which has parameters the old method lacked. Also, the Preferences now seem to require some kind of tree form instead of just key/value pairs.
Is there any documentation how we can implement our own preference store using the new Neon mechanisms?
[Updated on: Tue, 24 January 2017 09:05] by Moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.11322 seconds