Eclipse Restore Defaults Feature

Is there a programmatic method to achieve the same results as clicking "Restore Defaults" on the Eclipse preference page?

I already know how the field editor system and preference store work.

Thank!:)

+2


source to share


1 answer


Method of seems like a good candidate. setToDefault()

IPreferenceStore

You can see EditorsUI

using this function:

public static void useQuickDiffPreferencePage(IPreferenceStore store) {
  MarkerAnnotationPreferences.useQuickDiffPreferencePage(store);
  store.setToDefault(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_ALWAYS_ON);
  store.setToDefault(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_CHARACTER_MODE);
  store.setToDefault(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_DEFAULT_PROVIDER);
}

      



Or into a resetToDefaultSettings()

class methodHeapWalkingManager

:

/**
 * Resets the preferences controlled by this manager to their default settings
 */
public void resetToDefaultSettings(){
  JDIDebugPlugin.getDefault().getPluginPreferences().setToDefault(JDIDebugPlugin.PREF_SHOW_REFERENCES_IN_VAR_VIEW);
  JDIDebugPlugin.getDefault().getPluginPreferences().setToDefault(JDIDebugPlugin.PREF_ALL_REFERENCES_MAX_COUNT);
  JDIDebugPlugin.getDefault().getPluginPreferences().setToDefault(JDIDebugPlugin.PREF_ALL_INSTANCES_MAX_COUNT);
}

      

+3


source







All Articles