Using IMemento and DialogSettings

Preferences are designed to be values persisted in the workspace (or project) that can be consumed by both UI and non-UI components. The preference support also handles changes and default values.

However, it's not always the case that values need to be persisted in the preference store. Certain values are specific to views such as the order of columns in a table view, or whether the sort order is increasing or decreasing. Furthermore, it's possible to have multiple views in different windows that have different sort orders.

IMementos are a means to store view-specific rendering data in a way that can be saved by the workbench when the window closes, and re-opened when the perspective is brought back.

DialogSettings are a more general way of storing values. Despite the name, these are not limited to dialogs.

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

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