Skip to main content



      Home
Home » Eclipse Projects » Equinox » How to enable AUTO_UPDATE in 3.5M6
How to enable AUTO_UPDATE in 3.5M6 [message #128950] Fri, 10 April 2009 03:21 Go to next message
Eclipse UserFriend
I see something has changed on the Preferences side. In my RCP app I
have code like:

Preferences pref = ProvSDKUIActivator.getDefault()
.getPluginPreferences();
// See if automatic search is enabled at all
if (pref.getBoolean(PreferenceConstants.PREF_AUTO_UPDATE_ENABLE D) ==
false) {
pref.setValue(PreferenceConstants.PREF_AUTO_UPDATE_ENABLED, true);

}
pref.setValue(PreferenceConstants.PREF_UPDATE_ON_STARTUP, true);
pref.setValue(PreferenceConstants.PREF_DOWNLOAD_ONLY, true);

How would I do this with 3.5 ?

Regards Thomas
Re: How to enable AUTO_UPDATE in 3.5M6 [message #129046 is a reply to message #128950] Mon, 13 April 2009 20:14 Go to previous messageGo to next message
Eclipse UserFriend
Thomas wrote:
> I see something has changed on the Preferences side. In my RCP app I
> have code like:
>
> Preferences pref = ProvSDKUIActivator.getDefault()
> .getPluginPreferences();
> // See if automatic search is enabled at all
> if
> (pref.getBoolean(PreferenceConstants.PREF_AUTO_UPDATE_ENABLE D) == false) {
> pref.setValue(PreferenceConstants.PREF_AUTO_UPDATE_ENABLED,
> true);
>
> }
> pref.setValue(PreferenceConstants.PREF_UPDATE_ON_STARTUP, true);
> pref.setValue(PreferenceConstants.PREF_DOWNLOAD_ONLY, true);
>
> How would I do this with 3.5 ?

The preferences for auto-update moved from the bundle
org.eclipse.equinox.p2.ui.sdk to org.eclipse.equinox.p2.ui.sdk.scheduler.

In M6, you need to ensure your app uses the scheduler bundle, not
ProvSDKUIActivator, and use the constants and prefs from its activator.

As of today (and in the 20090414 I-build), the prefs have changed scope
from the instance scope to the p2 profile. See
AutomaticUpdatePlugin.getPreferences() for how that is done.

If you are worried about following the migration of these preferences in
your app, take a look at PreferenceInitializer.migratePreferences() in
the scheduler bundle.

The related bugs are
https://bugs.eclipse.org/bugs/show_bug.cgi?id=222498
https://bugs.eclipse.org/bugs/show_bug.cgi?id=258539

susan
Re: How to enable AUTO_UPDATE in 3.5M6 [message #129265 is a reply to message #129046] Thu, 16 April 2009 02:41 Go to previous messageGo to next message
Eclipse UserFriend
Hi Susan,

can you clarify some questions (see below) ?

Susan McCourt schrieb:
> Thomas wrote:
>> I see something has changed on the Preferences side. In my RCP app I
>> have code like:
>>
>> Preferences pref = ProvSDKUIActivator.getDefault()
>> .getPluginPreferences();
>> // See if automatic search is enabled at all
>> if
>> (pref.getBoolean(PreferenceConstants.PREF_AUTO_UPDATE_ENABLE D) ==
>> false) {
>>
>> pref.setValue(PreferenceConstants.PREF_AUTO_UPDATE_ENABLED, true);
>>
>> }
>> pref.setValue(PreferenceConstants.PREF_UPDATE_ON_STARTUP, true);
>> pref.setValue(PreferenceConstants.PREF_DOWNLOAD_ONLY, true);
>>
>> How would I do this with 3.5 ?
>
> The preferences for auto-update moved from the bundle
> org.eclipse.equinox.p2.ui.sdk to org.eclipse.equinox.p2.ui.sdk.scheduler.
>
> In M6, you need to ensure your app uses the scheduler bundle, not
> ProvSDKUIActivator, and use the constants and prefs from its activator.
>
What exactly do I have to change here ?
Re: How to enable AUTO_UPDATE in 3.5M6 [message #129317 is a reply to message #129046] Thu, 16 April 2009 12:12 Go to previous messageGo to next message
Eclipse UserFriend
Will there be working code like
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.equinox /p2/examples/org.eclipse.equinox.p2.examples.rcp.prestartupd ate/src/org/eclipse/equinox/p2/examples/rcp/prestartupdate/P 2Util.java?root=RT_Project&view=markup
based on 3.5 code ?

That would be what I need.
Re: How to enable AUTO_UPDATE in 3.5M6 [message #129945 is a reply to message #129265] Mon, 27 April 2009 13:52 Go to previous message
Eclipse UserFriend
Thomas wrote:
> Hi Susan,
>
> can you clarify some questions (see below) ?
>
> Susan McCourt schrieb:
>> Thomas wrote:
>>> I see something has changed on the Preferences side. In my RCP app I
>>> have code like:
>>>
>>> Preferences pref = ProvSDKUIActivator.getDefault()
>>> .getPluginPreferences();
>>> // See if automatic search is enabled at all
>>> if
>>> (pref.getBoolean(PreferenceConstants.PREF_AUTO_UPDATE_ENABLE D) ==
>>> false) {
>>>
>>> pref.setValue(PreferenceConstants.PREF_AUTO_UPDATE_ENABLED, true);
>>>
>>> }
>>> pref.setValue(PreferenceConstants.PREF_UPDATE_ON_STARTUP, true);
>>> pref.setValue(PreferenceConstants.PREF_DOWNLOAD_ONLY, true);
>>>
>>> How would I do this with 3.5 ?
>>
>> The preferences for auto-update moved from the bundle
>> org.eclipse.equinox.p2.ui.sdk to org.eclipse.equinox.p2.ui.sdk.scheduler.
>>
>> In M6, you need to ensure your app uses the scheduler bundle, not
>> ProvSDKUIActivator, and use the constants and prefs from its activator.
>>
> What exactly do I have to change here ?

Preferences pref =
AutomaticUpdatePlugin().getDefault().getPreferenceStore();

Get the prefs from AutomaticUpdatePlugin() instead of ProvSDKUIActivator.

Then use the PreferenceConstants defined in that bundle
(org.eclipse.equinox.p2.ui.sdk.scheduler) instead of PreferenceConstants
in the other bundle.
Previous Topic:OSGi Communit Event Call for Papers
Next Topic:Re: Configure Jetty in OSGi
Goto Forum:
  


Current Time: Sun Aug 31 04:40:42 EDT 2025

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

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

Back to the top