Chapter 5. Storing Preferences and Settings

An IDE is powerful as it provides a number of different utility windows to help the developer as they do their job. It becomes more powerful when they can customize it to their own taste, whether it is something as simple as colors, or something more targeted such as filters. The preference store in Eclipse allows users to customize it in the way they want.

In this chapter we shall:

  • Read and write preferences from a PreferenceStore
  • Create a PreferencePage using FieldEditors
  • Implement additional FieldEditors
  • Explain the difference between IEclipsePreferences and IPreferenceStore
  • Cover settings and mementos for storing transient state

Storing preferences

A user preference is a stored configuration option that persists between different Eclipse runtimes. Preferences are simple values (int, String, boolean, and so on) and are identified with a String key, typically prefixed with the plug-in's identifier. Preferences can also be edited via a standard preference panel injected with an extension point. They can also be imported and exported from an Eclipse workbench using File | Import/Export | Preferences and saved as an epf (Eclipse Preference File).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset