Preferences Spy for Eclipse IDE and RCP


Figuring out, which preference is changed, when editing a certain preference in the user interface (i.e. Preference-Dialog), may be difficult.

Let the Preference Spy help you with this issue.

Preferences in Eclipse

The preferences in Eclipse are stored hierarchically. So there is one root node and the other preferences are usually stored for each plug-in, which may be identified by the nodepath.

The nodepath usually contains the Bundle-SymbolicName of the plug-in, which defines a certain preference, but you may also define a custom nodepath.

In the following image the preferences are shown hierarchically. On top of the tree you may see recently changed preferences with bold font, like it is also done with recently changed values in the about:config of the Firefox web browser. The non bold preferences are shown by pressing the second toolbar button, which is used in order to show all currently set preferences.

Explanation of the toolbar buttons of the spy:

  1. Toogle between hierarchical and flat layout
  2. Show all preferences with at least one value
  3. Toogle tracing recently changed preferences
  4. Expand or collapse all preferences in case hierarchical layout is chosen
  5. Remove certain or all entries from the preference spy part

Events fired by the Preference Spy

The PreferenceSpyEventTopics class contains certain Topics, which are consumed by the Preference Spy. Especially the “TOPIC_PREFERENCESPY/PREFERENCE/CHANGED” topic may also be interesting for other developers since it notifies, if any preference is changed. You may receive this event like this:

    public void preferenceChanged(
            @UIEventTopic(PreferenceSpyEventTopics.PREFERENCESPY_PREFERENCE_CHANGED) PreferenceChangeEvent event) {

            // print new property value to console

 Further Plans

At first I like to admit that the project is hosted on Github [1] and we really appreciate feedback.

You can also get the preference spy from the following update site [2] and install it directly. The newest version will always be available on this update site.

Another aim of this project is that the preference spy will become an official spy of the E4 tools project. [3]




This entry was posted in Simon Scholz and tagged , , , . Bookmark the permalink.