| title | Creating a Preferences Editor Using the Preferences Framework |
|---|---|
| layout | default |
Preferences Editors are constructed by combining three main parts:
- panels containing controls for users to adjust a preference setting;
- a data store providing persistence for the user's selections; and
- enactors that respond to a user's settings.
The Preferences Framework provides all the lifecycle events, configuration hooks, and persistence infrastructure required to support hooking these pieces together, as well as providing some pre-existing panels and enactors that can be re-used if desired.
There are two main ways you will likely use the Preferences Framework:
- to add a Preferences Editor to a page
- In addition to the user interface for adjusting preferences, this mode will also add the data store and the enactors to the page.
- or to add only the data store and enactors to a page
- This mode allows a page to be responsive to saved preferences, even if there is no Preferences Editor on the page.
The configuration is the same for both of these modes; only the actual instantiation differs. This tutorial will teach both modes.