Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 07:21 Go to next message
Thomas Kratz is currently offline Thomas KratzFriend
Messages: 165
Registered: July 2009
Senior Member
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] Tue, 14 April 2009 00:14 Go to previous messageGo to next message
Susan F. McCourt is currently offline Susan F. McCourtFriend
Messages: 16
Registered: July 2009
Junior Member
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 06:41 Go to previous messageGo to next message
Thomas Kratz is currently offline Thomas KratzFriend
Messages: 165
Registered: July 2009
Senior Member
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 16:12 Go to previous messageGo to next message
Thomas Kratz is currently offline Thomas KratzFriend
Messages: 165
Registered: July 2009
Senior Member
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 17:52 Go to previous message
Susan F. McCourt is currently offline Susan F. McCourtFriend
Messages: 16
Registered: July 2009
Junior Member
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: Fri Apr 19 22:41:27 GMT 2024

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

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

Back to the top