RCP Application deployment problem - PreferenceStore [message #436439] |
Thu, 08 September 2005 09:11  |
Eclipse User |
|
|
|
I'm developing an RCP based application. Saving and restoring to the preference store work fine when the product is started from within Eclipse 3.1.
After deployment (and standalone execution) I can set the same preferences, they are saved to the .prefs file with the correct value, but on the next startup these values are not used. Everthing is blank (or probably back to the default value).
Why isn't the preference store read from disk?
Any ideas on how to debug these deployment problems? Are there any traces that might e helpful?
Help appreciated.
|
|
|
|
|
|
|
|
|
|
|
|
Re: RCP Application deployment problem - PreferenceStore [message #439136 is a reply to message #436439] |
Wed, 02 November 2005 16:30   |
Eclipse User |
|
|
|
FWIW, I am developing an RCP app, and do not have a Plugin class, but do have a preference-page
(i.e., my RCP app extends org.eclipse.ui.preferencePages).
When I went to set up my pref-page, I had carefully read this thread (and several others), plus the
bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=86750, but just had to guess that the
following might work (in my subclass of FieldEditorPreferencePage):
public void init(final IWorkbench workbench) {
setPreferenceStore(PlatformUI.getPreferenceStore());
}
It works fine, ONLY in the workbench; after using the "Eclipse product export wizard" link on the
"Overview" page of the "MY_APP.product" file-editor, the app runs, I can set the preference on my
pref-page, the IPropertyChangeListener works, etc. -- but, as you experienced, the preferences are
not saved, in the sense that upon restart they have reverted to their initial default values.
I do find a "workspace" directory under the installed app-directory, and there is an
"org.eclipse.ui.prefs" file there, in the directory
workspace\.metadata\.plugins\org.eclipse.core.runtime\.setti ngs ... and it contains the value I set,
and the value gets changed.
So the problem boils down to "what is the code to call to cause the stored prefs, as above, to be
read in at app startup, given that there is no Plugin class in my RCP app?"
This is not so well documented ...
HTH,
Paul
Oliver Wahl wrote:
> I'm developing an RCP based application. Saving and restoring to the preference store work fine when the product is started from within Eclipse 3.1.
>
> After deployment (and standalone execution) I can set the same preferences, they are saved to the .prefs file with the correct value, but on the next startup these values are not used. Everthing is blank (or probably back to the default value).
>
> Why isn't the preference store read from disk?
>
> Any ideas on how to debug these deployment problems? Are there any traces that might e helpful?
>
> Help appreciated.
|
|
|
Re: RCP Application deployment problem - PreferenceStore, PS [message #439275 is a reply to message #439136] |
Thu, 03 November 2005 12:56   |
Eclipse User |
|
|
|
Just confirmed that upgarding to Eclipse 3.1.1 does not fix the issue.
The workaround that seems to work for me is to define a static method of my pref-page,
setDefaults(), that sets the defaults as defined by that page, using the
PlatformUI.getPreferenceStore(); and the instance-method of my pref-page, init(IWorkbench), calls
that static method, setDefaults(). THEN, to make sure that my prefs are initialised before calling
upon them, each View or Editor that accesses my prefs now makes a call to that same new static
method, setDefaults() ... since there is no way to guarantee that the user has opened my pref-page
before they open any view or editor ...
I'm sure I'm misunderstanding something, but this really does seem an awkward misfeature ... I
wonder what the intended behavior is?
Paul
|
|
|
Re: RCP Application deployment problem - PreferenceStore, PS [message #439412 is a reply to message #439275] |
Mon, 07 November 2005 14:38   |
Eclipse User |
|
|
|
Paul,
I have tried the "RCP app with an intro" example, and I don't have any
problems with the preferences, with or without having an Activator class
(the replacement concept for Plugin class).
Please file a bug against Platform/UI if you still have problems with this.
Reproducible steps (e.g. using one of the wizard-generated RCP example apps)
would be very much appreciated.
Boris
"Paul Keyser" <rolarenfan@earthlink.net> wrote in message
news:dkdj0k$u4d$1@news.eclipse.org...
> Just confirmed that upgarding to Eclipse 3.1.1 does not fix the issue.
>
> The workaround that seems to work for me is to define a static method of
my pref-page,
> setDefaults(), that sets the defaults as defined by that page, using the
> PlatformUI.getPreferenceStore(); and the instance-method of my pref-page,
init(IWorkbench), calls
> that static method, setDefaults(). THEN, to make sure that my prefs are
initialised before calling
> upon them, each View or Editor that accesses my prefs now makes a call to
that same new static
> method, setDefaults() ... since there is no way to guarantee that the user
has opened my pref-page
> before they open any view or editor ...
>
> I'm sure I'm misunderstanding something, but this really does seem an
awkward misfeature ... I
> wonder what the intended behavior is?
>
> Paul
|
|
|
Re: RCP Application deployment problem - PreferenceStore, PS [message #439420 is a reply to message #439412] |
Mon, 07 November 2005 17:09   |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
What is an activator class and where can I read about this new concept?
CL
Boris Bokowski wrote:
> Paul,
>
> I have tried the "RCP app with an intro" example, and I don't have any
> problems with the preferences, with or without having an Activator class
> (the replacement concept for Plugin class).
>
> Please file a bug against Platform/UI if you still have problems with this.
> Reproducible steps (e.g. using one of the wizard-generated RCP example apps)
> would be very much appreciated.
>
> Boris
>
> "Paul Keyser" <rolarenfan@earthlink.net> wrote in message
> news:dkdj0k$u4d$1@news.eclipse.org...
>
>>Just confirmed that upgarding to Eclipse 3.1.1 does not fix the issue.
>>
>>The workaround that seems to work for me is to define a static method of
>
> my pref-page,
>
>>setDefaults(), that sets the defaults as defined by that page, using the
>>PlatformUI.getPreferenceStore(); and the instance-method of my pref-page,
>
> init(IWorkbench), calls
>
>>that static method, setDefaults(). THEN, to make sure that my prefs are
>
> initialised before calling
>
>>upon them, each View or Editor that accesses my prefs now makes a call to
>
> that same new static
>
>>method, setDefaults() ... since there is no way to guarantee that the user
>
> has opened my pref-page
>
>>before they open any view or editor ...
>>
>>I'm sure I'm misunderstanding something, but this really does seem an
>
> awkward misfeature ... I
>
>>wonder what the intended behavior is?
>>
>>Paul
>
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.37824 seconds