1 11 12 package org.eclipse.ui.internal.editors.text; 13 14 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; 15 16 import org.eclipse.jface.preference.IPreferenceStore; 17 18 import org.eclipse.ui.editors.text.TextEditorPreferenceConstants; 19 import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; 20 21 22 27 public class EditorsPluginPreferenceInitializer extends AbstractPreferenceInitializer { 28 29 33 public void initializeDefaultPreferences() { 34 IPreferenceStore store= EditorsPlugin.getDefault().getPreferenceStore(); 35 TextEditorPreferenceConstants.initializeDefaultValues(store); 36 migrateOverviewRulerPreference(store); 37 } 38 39 45 private void migrateOverviewRulerPreference(IPreferenceStore store) { 46 String preference= AbstractDecoratedTextEditorPreferenceConstants.EDITOR_OVERVIEW_RULER; 47 String postfix= "_migration"; String MIGRATED= "migrated_3.1"; String migrationKey= preference + postfix; 50 51 String migrationValue= store.getString(migrationKey); 52 if (!MIGRATED.equals(migrationValue)) { 53 store.setValue(migrationKey, MIGRATED); 54 if (!store.getBoolean(preference)) 55 store.setValue(preference, true); 56 } 57 } 58 } 59 | Popular Tags |