using ECommandService and Preferences in LifecycleManager [message #1384905] |
Mon, 02 June 2014 20:21  |
Eclipse User |
|
|
|
Hi all,
I've an RCP application which should check some points at startup.
Therefore, I created a LifecycleManager and added a method public void
checkOnStartup() (annotated with @PostContextCreate). Now I have to
check if some preferences are set. But somehow I can't get the
IEclipsePreferences object from context. The checkOnStartup() method
gets an IEclipseContext injected, but this didn't help me.
Additionally, I want to start a command with ECommandService. But this
service isn't available, too. If I try to inject these services into my
LifecycleManager the methods were not called, anyway (this looked very
strange to me... no error message appeared!).
How can I access these services in LifecycleManager?
Thanks in advance,
Ralf.
|
|
|
|
Re: using ECommandService and Preferences in LifecycleManager [message #1386196 is a reply to message #1385892] |
Sat, 14 June 2014 14:06  |
Eclipse User |
|
|
|
Am 12.06.2014 08:43, schrieb Dirk Fauth:
> I think you can't because the command service is created through an
> addon. And that is called after @PostContextCreate is executed. At least
> that is my understanding.
>
> And getting IEclipsePreferences from the context sound wrong to me.
> Preference values are not stored directly in the IEclipseContext but
> contributed by an ExtendedObjectSupplier. Therefore you need to use the
> @Preference annotation as explained here:
> http://www.vogella.com/tutorials/EclipsePreferences/article.html
>
> Would be the usage of a Model Addon better suit your needs?
Hi Dirk,
Thanks for your answer. I think I will omit the using of these services.
The only reason why I wanted to use them was that I thought it would be
easier to launch a dialog via a Command. I have to check some things
before the application is launched. Now, I will implement it as a simple
dialog, which is easier at this point.
For the Preferences I'll use the OSGi Preferences Service, which is
available at this point. Im a little confused about the different
preferences (one from Eclipse and one from OSGi context).
Regards,
Ralf.
|
|
|
Powered by
FUDForum. Page generated in 0.27227 seconds