Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Preference page
Preference page [message #461780] Wed, 17 January 2007 05:02 Go to next message
Swetha is currently offline SwethaFriend
Messages: 68
Registered: July 2009
Member
Hi,

I have developed one view i.e, tree explorer...I want to configure the
properties of tree through preference page.
So, I have developed one preference page with two field editors like color
and font to tree item.

I added this preference page to Eclipse preferences list...The problem is,
after setting the properties and click on ok, how to apply those
properties to my view , where can I trigger that code..

Thanks in advance,
Swetha.
Re: Preference page [message #461782 is a reply to message #461780] Wed, 17 January 2007 05:24 Go to previous messageGo to next message
Boris Stepanov is currently offline Boris StepanovFriend
Messages: 68
Registered: July 2009
Member
Hello.

You can do that using listener.

Example:

IPreferenceStore preferenceStore = preferenceStoreFromPreferencePage;

IPropertyChangeListener listener = new IPropertyChangeListener()
{
public void propertyChange(PropertyChangeEvent event)
{
if (yourPropertyID.equals(event.getProperty()))
{
// update view
}
}
};
preferenceStore.addPropertyChangeListener(listener);

Sometimes propertyChange method in listener need synchronized modifier.

--
Boris Stepanov
Re: Preference page [message #461803 is a reply to message #461782] Wed, 17 January 2007 12:45 Go to previous message
Eclipse UserFriend
Originally posted by: peter_ossipov.mail.ru

Well, hello, Boris!
Nice to meet you!
In addition, you could make use of this code
/**
*
* @return preference store for this plug-in
*/
public static IPreferenceStore getPreferenceStore()
{
return Activator.getDefault().getPreferenceStore();
}
where Activator is your bundle activator.

Boris Stepanov wrote:
> Hello.
>
> You can do that using listener.
>
> Example:
>
> IPreferenceStore preferenceStore = preferenceStoreFromPreferencePage;
>
> IPropertyChangeListener listener = new IPropertyChangeListener()
> {
> public void propertyChange(PropertyChangeEvent event)
> {
> if (yourPropertyID.equals(event.getProperty()))
> {
> // update view
> }
> }
> };
> preferenceStore.addPropertyChangeListener(listener);
>
> Sometimes propertyChange method in listener need synchronized modifier.
>
I
Previous Topic:config.ini editor planned?
Next Topic:Is there Eclipse RCP Trainning?
Goto Forum:
  


Current Time: Fri Apr 26 05:45:46 GMT 2024

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

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

Back to the top