Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » core/ui separation : preferences jface preferencestore
core/ui separation : preferences jface preferencestore [message #306131] Fri, 21 July 2006 10:26 Go to next message
Eclipse UserFriend
Originally posted by: ecomar.NOSPAM.uk.ibm.com

I am porting some code developed in a single ui plugin project
to a workspace with multiple plugin projects, with core/ui separation.

In the old code there is a FieldEditorPreferencePage which reads/writes
from/to the plugin's preference store

In the new code the values must to be tied up to the core plugin
preferences (as they are used by core code), but the preference page has
to stay in the ui plugin

The problem is I cannot get a IPreferenceStore from the core plugin as
it's a jface concept. but I need the ui-plugin preference page to
read/write to the core plugin preference.

Edo

PS - The problem (but not a solution) was also posted here
news://news.eclipse.org:119/op.s1e60gg8audqvk@localhost.loca ldomain
"preference mechanisms" on 07/12/2005 15:37

<QUOTE>
Hello,

I am slightly confused about the right use of preferences. In a Plugin
the getPluginPreferences() method returns a Preference object. The
AbstractUIPlugin additionally has the method getPreferenceStore() which
returns an IPreferenceStore object. And the Platform has the method
getPreferencesService() which returns an IPreferencesService object.
Maybe also the OSGi Preferences service is present.

What should I use? My objective is to store preferences in a core plugin
(Plugin subclass) and have a ui plugin (AbstractUIPlugin subclass) which
contributes PreferencePages to read and write the core preferences. The
funny thing is that the PreferencePages use IPreferenceStore but the
Plugin only provides Preferences. And it is even more funny that the
problem solving PreferenceAdapter is internal.

One workaround would be to use AbstractUIPlugin for the core plugin to
get at an IPreferenceStore intance. But this is ugly. And using internal
API is not indented by the creator. So what should I do? Have I missed
an important aspect? Whats the rational about the duplicated
functionality of these preference mechanisms?
</QUOTE>
Re: core/ui separation : preferences jface preferencestore [message #306133 is a reply to message #306131] Fri, 21 July 2006 11:10 Go to previous message
Eclipse UserFriend
Originally posted by: ecomar.NOSPAM.uk.ibm.com

my solution is to create in the preference page contructor
a preference store using the same line of code used by
AbstractUiPlugin.getPreferenceStore()

seems to work although it wasn't obvious initially that the
preferencestore instantiated by the ui plugin using the same underlying
storage / event mechanism as the core preferences.

Edo


Edoardo Comar wrote:
> I am porting some code developed in a single ui plugin project
> to a workspace with multiple plugin projects, with core/ui separation.
>
> In the old code there is a FieldEditorPreferencePage which reads/writes
> from/to the plugin's preference store
>
> In the new code the values must to be tied up to the core plugin
> preferences (as they are used by core code), but the preference page has
> to stay in the ui plugin
>
> The problem is I cannot get a IPreferenceStore from the core plugin as
> it's a jface concept. but I need the ui-plugin preference page to
> read/write to the core plugin preference.
>
> Edo
>
> PS - The problem (but not a solution) was also posted here
> news://news.eclipse.org:119/op.s1e60gg8audqvk@localhost.loca ldomain
> "preference mechanisms" on 07/12/2005 15:37
>
> <QUOTE>
> Hello,
>
> I am slightly confused about the right use of preferences. In a Plugin
> the getPluginPreferences() method returns a Preference object. The
> AbstractUIPlugin additionally has the method getPreferenceStore() which
> returns an IPreferenceStore object. And the Platform has the method
> getPreferencesService() which returns an IPreferencesService object.
> Maybe also the OSGi Preferences service is present.
>
> What should I use? My objective is to store preferences in a core plugin
> (Plugin subclass) and have a ui plugin (AbstractUIPlugin subclass) which
> contributes PreferencePages to read and write the core preferences. The
> funny thing is that the PreferencePages use IPreferenceStore but the
> Plugin only provides Preferences. And it is even more funny that the
> problem solving PreferenceAdapter is internal.
>
> One workaround would be to use AbstractUIPlugin for the core plugin to
> get at an IPreferenceStore intance. But this is ugly. And using internal
> API is not indented by the creator. So what should I do? Have I missed
> an important aspect? Whats the rational about the duplicated
> functionality of these preference mechanisms?
> </QUOTE>
Previous Topic:Need to checkout from a sepcific branch AND at a specific point int time
Next Topic:How to create a performance test
Goto Forum:
  


Current Time: Tue Jul 08 23:08:43 EDT 2025

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

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

Back to the top