Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Default Preferences initialize from product?
Default Preferences initialize from product? [message #323039] Wed, 05 December 2007 12:27 Go to next message
Eclipse UserFriend
Hello,

Is there a way to initalize preferences using the product customization?
Adding /instance/ or /default/ nodes to the preferences.ini does not
seem to work.

Thanks,
Phil
Re: Default Preferences initialize from product? [message #323045 is a reply to message #323039] Wed, 05 December 2007 19:16 Go to previous messageGo to next message
Eclipse UserFriend
You need to define your product as follows:

<extension
id="your_product_id"
point="org.eclipse.core.runtime.products">
<product
application="com.yourcompany.YourApplicationApplication"
name="Your Application">
<property
name="preferenceCustomization"
value="plugin_customization.ini"/>
<property
name="aboutImage"
value="icons/x.gif"/>
<property
...../>
</product>
</extension>

and create the plugin_customization.ini file in your product plugin like
the following:

org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=false
org.eclipse.ui/DOCK_PERSPECTIVE_BAR=left
org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
....

Snjeza

Philipp Kursawe wrote:
> Hello,
>
> Is there a way to initalize preferences using the product customization?
> Adding /instance/ or /default/ nodes to the preferences.ini does not
> seem to work.
>
> Thanks,
> Phil
Re: Default Preferences initialize from product? [message #323052 is a reply to message #323045] Thu, 06 December 2007 06:43 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Snjeza,

I am aware of product customization. It works for all the eclipse UI
stuff that you mention in your example. But for my own preferences it
does not work.

Snjezana Peco wrote:
> You need to define your product as follows:
>
> <extension
> id="your_product_id"
> point="org.eclipse.core.runtime.products">
> <product
> application="com.yourcompany.YourApplicationApplication"
> name="Your Application">
> <property
> name="preferenceCustomization"
> value="plugin_customization.ini"/>
> <property
> name="aboutImage"
> value="icons/x.gif"/>
> <property
> ...../>
> </product>
> </extension>
>
> and create the plugin_customization.ini file in your product plugin like
> the following:
>
> org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
> org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=false
> org.eclipse.ui/DOCK_PERSPECTIVE_BAR=left
> org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
> ...
>
> Snjeza
>
> Philipp Kursawe wrote:
>> Hello,
>>
>> Is there a way to initalize preferences using the product
>> customization? Adding /instance/ or /default/ nodes to the
>> preferences.ini does not seem to work.
>>
>> Thanks,
>> Phil
Re: Default Preferences initialize from product? [message #323056 is a reply to message #323052] Thu, 06 December 2007 11:41 Go to previous messageGo to next message
Eclipse UserFriend
Philipp,

You can use preference initializer class like the following:

<extension point="org.eclipse.core.runtime.preferences">
<initializer
class="com.yourcomany.preferences.YourPreferenceInitializer "/>
</extension>

The YourPrefrenceInitializer class would extend the
AbstractPreferenceInitializer class and implement
the initializeDefaultPreferences method.

Snjeza


Philipp Kursawe wrote:
> Thanks Snjeza,
>
> I am aware of product customization. It works for all the eclipse UI
> stuff that you mention in your example. But for my own preferences it
> does not work.
>
> Snjezana Peco wrote:
>> You need to define your product as follows:
>>
>> <extension
>> id="your_product_id"
>> point="org.eclipse.core.runtime.products">
>> <product
>> application="com.yourcompany.YourApplicationApplication"
>> name="Your Application">
>> <property
>> name="preferenceCustomization"
>> value="plugin_customization.ini"/>
>> <property
>> name="aboutImage"
>> value="icons/x.gif"/>
>> <property
>> ...../>
>> </product>
>> </extension>
>>
>> and create the plugin_customization.ini file in your product plugin
>> like the following:
>>
>> org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
>> org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=false
>> org.eclipse.ui/DOCK_PERSPECTIVE_BAR=left
>> org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
>> ...
>>
>> Snjeza
>>
>> Philipp Kursawe wrote:
>>> Hello,
>>>
>>> Is there a way to initalize preferences using the product
>>> customization? Adding /instance/ or /default/ nodes to the
>>> preferences.ini does not seem to work.
>>>
>>> Thanks,
>>> Phil
Re: Default Preferences initialize from product? [message #323057 is a reply to message #323056] Thu, 06 December 2007 11:59 Go to previous message
Eclipse UserFriend
Snjezana Peco wrote:
> Philipp,
>
> You can use preference initializer class like the following:
>
> <extension point="org.eclipse.core.runtime.preferences">
> <initializer
> class="com.yourcomany.preferences.YourPreferenceInitializer "/>
> </extension>
>
> The YourPrefrenceInitializer class would extend the
> AbstractPreferenceInitializer class and implement
> the initializeDefaultPreferences method.
>
> Snjeza
>
>
> Philipp Kursawe wrote:
>> Thanks Snjeza,
>>
>> I am aware of product customization. It works for all the eclipse UI
>> stuff that you mention in your example. But for my own preferences it
>> does not work.
>>
>> Snjezana Peco wrote:
>>> You need to define your product as follows:
>>>
>>> <extension
>>> id="your_product_id"
>>> point="org.eclipse.core.runtime.products">
>>> <product
>>> application="com.yourcompany.YourApplicationApplication"
>>> name="Your Application">
>>> <property
>>> name="preferenceCustomization"
>>> value="plugin_customization.ini"/>
>>> <property
>>> name="aboutImage"
>>> value="icons/x.gif"/>
>>> <property
>>> ...../>
>>> </product>
>>> </extension>
>>>
>>> and create the plugin_customization.ini file in your product plugin
>>> like the following:
>>>
>>> org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
>>> org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=false
>>> org.eclipse.ui/DOCK_PERSPECTIVE_BAR=left
>>> org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
>>> ...
>>>
>>> Snjeza
>>>
>>> Philipp Kursawe wrote:
>>>> Hello,
>>>>
>>>> Is there a way to initalize preferences using the product
>>>> customization? Adding /instance/ or /default/ nodes to the
>>>> preferences.ini does not seem to work.
>>>>
>>>> Thanks,
>>>> Phil
Using this construct:

private final Preferences prefs = new
DefaultScope().getNode(ReprioritizerPlugin.getId());

I am able to finally get the values defined in the products customization.

Thanks for your help!

Phil
Previous Topic:Eclipse Europa hangs often
Next Topic:generating site.xml in headless mode
Goto Forum:
  


Current Time: Thu Jul 17 18:34:39 EDT 2025

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

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

Back to the top