package com.opcoach.e4.preferences.example.pages;

import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.ColorFieldEditor;
import org.eclipse.jface.preference.ComboFieldEditor;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.jface.resource.StringConverter;
import org.eclipse.swt.graphics.RGB;

import com.opcoach.e4.preferences.ScopedPreferenceStore;

public class DefaultValuesInitializer extends AbstractPreferenceInitializer
{

	public DefaultValuesInitializer()
	{
		// TODO Auto-generated constructor stub
	}

	@Override
	public void initializeDefaultPreferences()
	{
		IPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE, "com.opcoach.e4.preferences.example");	
		
		System.out.println("Enter in default Preference Initializer");
	
		store.setDefault("rootPageValue", "DEFAULT ROOT PAGE VALUE");
		store.setDefault("page1", "DEFAULT PAGE 1 VALUE");
		store.setDefault("page2", "DEFAULT PAGE 2 VALUE");
		
		store.setDefault("prefCombo", "value2");
		store.setDefault("prefColor", StringConverter.asString(new RGB(0,255,0)));
		store.setDefault("prefBoolean",true);
		store.setDefault("prefString","Default string value");
				
		
		
		
	}

}

@@ -163,24 +163,23 @@
 erences.
-Instance
+Default
 Scope;%0Ai
@@ -200,260 +200,52 @@
 pse.
-jface.preference.BooleanFieldEditor;%0Aimport org.eclipse.jface.preference.ColorFieldEditor;%0Aimport org.eclipse.jface.preference.ComboFieldEditor;%0Aimport org.eclipse.jface.preference.IPreferenceStore;%0Aimport org.eclipse.jface.preference.StringFieldEditor
+core.runtime.preferences.IEclipsePreferences
 ;%0Aim
@@ -334,64 +334,100 @@
 GB;%0A
-%0A
 import 
-com.opcoach.e4.preferences.ScopedPreferenceStore
+org.osgi.framework.FrameworkUtil;%0Aimport org.osgi.service.prefs.BackingStoreException
 ;%0A%0Ap
@@ -649,16 +649,23 @@
 )%0A%09%7B%0A%09%09I
+Eclipse
 Preferen
@@ -670,199 +670,139 @@
 ence
-Store store = new ScopedPreferenceStore(InstanceScope.INSTANCE, %22com.opcoach.e4.preferences.example%22
+s node = DefaultScope.INSTANCE.getNode(FrameworkUtil.getBundle(getClass()).getSymbolicName()
 );
-%09
 %0A%09
-%09
 %0A%09%09
-System.out.println(%22Enter in default Preference Initializer%22);%0A%09%0A%09%09store.setDefaul
+if (node != null)%0A%09%09%7B%0A%09%09%09node.pu
 t(%22r
@@ -842,39 +842,32 @@
  VALUE%22);%0A%09%09
-store.setDefaul
+%09node.pu
 t(%22page1%22, %22
@@ -888,39 +888,32 @@
  VALUE%22);%0A%09%09
+%09
-store.setDefaul
+node.pu
 t(%22page2%22, %22
@@ -941,31 +941,24 @@
 );%0A%09%09%0A%09%09
-store.setDefaul
+%09node.pu
 t(%22prefC
@@ -973,39 +973,32 @@
 value2%22);%0A%09%09
-store.setDefaul
+%09node.pu
 t(%22prefColor
@@ -1047,32 +1047,32 @@
 0)));%0A%09%09
-store.setDefault
+%09node.putBoolean
 (%22prefBo
@@ -1091,23 +1091,16 @@
 ;%0A%09%09
-store.setDefaul
+%09node.pu
 t(%22p
@@ -1138,16 +1138,84 @@
 e%22);%0A%09%09%09
+%0A%09%09%09try %7B node.flush();  %7D  catch (BackingStoreException e) %7B %7D%0A%09%09%7D%09
 %09%0A%09%09%0A%09%09%0A

Change the way to set the default preferences