Preference page [message #461780] |
Wed, 17 January 2007 00:02  |
Eclipse User |
|
|
|
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 #461803 is a reply to message #461782] |
Wed, 17 January 2007 07:45  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02855 seconds