It's all about the answers!

Ask a question

How to read RTC Eclipse preferences using the Java API?

Krasimir Malchev (56526) | asked Sep 20 '16, 8:28 a.m.

How can I read the values in the Window>Preferences>Team>Jazz Source Control>External Compare Tools preference page?

In particular I am interested to find if the checkbox "Use an external compare tool as the default open action" is selected and the name of the selected 2-way compare tool there.


Accepted answer

permanent link
Karthik Krishnan (8785111158) | answered Sep 20 '16, 8:39 a.m.
You can try to export the Eclipse preferences and it should look like below

/instance/\ Compare=C\:\\Program Files\\Beyond Compare 4\\BComp.exe
/instance/ Compare
Krasimir Malchev selected this answer as the correct answer

Krasimir Malchev commented Sep 20 '16, 10:14 a.m. | edited Sep 20 '16, 10:19 a.m.

Hello Karthik.
   Thanks for your answer!
   Indeed, I exported the preferences: File>Export>General>Preferences
   From the dump I found the node ids I was interested in
   I saw that there are several types of preferences (instance, configuration, etc. A nice tutorial can be found here:
     // org.eclipse.core.runtime.preferences
      InstanceScope instScope = InstanceScope.INSTANCE;
      IEclipsePreferences extCmpToolNode =
          instScope.getNode( "" );
      boolean openExtCmpToolByDefault = extCmpToolNode.getBoolean(
                             "external_compare_default_tool_preference_key", false);

Your answer

Register or to post your answer.