Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Restoring Default Preferences for all preferences
Restoring Default Preferences for all preferences [message #1269924] Wed, 12 March 2014 10:17 Go to next message
El Arbi Aboussoror is currently offline El Arbi AboussororFriend
Messages: 90
Registered: June 2010
Member
Hi,

I'm wondering how to programmatically restore the default settings for all the preferences available in a product. I'm a bit confused with scopes and stores Sad

I tried this:

  public static void restoreAllPreferencesToDefault() throws BackingStoreException {
    IEclipsePreferences rootNode = PreferencesService.getDefault().getRootNode();
    clearAll(rootNode);
  }

  private static void clearAll(Preferences node) throws BackingStoreException {
    node.clear();
    String[] names = node.childrenNames();
    for (String name : names) {
      clearAll(node.node(name));
    }
  }


But I'm not sure it solves the problem correctly ??
Re: Restoring Default Preferences for all preferences [message #1289312 is a reply to message #1269924] Wed, 09 April 2014 07:57 Go to previous message
Hussein MHANNA is currently offline Hussein MHANNAFriend
Messages: 45
Registered: February 2014
Location: LAVAL
Member
Hi,

You can restore the default value of a preferences by using : PlatformUI.getPreferenceStore().setToDefault(YOUR_PREFERENCE_NAME);

Hussein


ALL4TEC
Previous Topic:No 'Project Explorer' entry in 'Show in' menu
Next Topic:"Program received signal SIGSEGV, Segmentation fault" all over in Luna under Ubuntu 13.10
Goto Forum:
  


Current Time: Thu Mar 28 11:28:39 GMT 2024

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

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

Back to the top