It's all about the answers!

Ask a question

How to read RTC Eclipse preferences using the Java API?


0
1
Krasimir Malchev (5611) | 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.

Thanks!

Accepted answer


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

/instance/org.eclipse.ui.ide/IMPORT_FILES_AND_FOLDERS_VIRTUAL_FOLDER_MODE=prompt
/instance/com.ibm.team.filesystem.rcp.core/com.ibm.team.filesystem.rcp.core.SandboxListening=true
/instance/com.ibm.team.filesystem.ide.ui/external_compare_tool_merge_executable_path_pref_key_Beyond\ Compare=C\:\\Program Files\\Beyond Compare 4\\BComp.exe
/instance/com.ibm.team.filesystem.ide.ui/external_compare_previously_selected_compare_tool=Beyond Compare
/instance/com.ibm.team.filesystem.ide.ui/external_compare_default_tool_preference_key=true
Krasimir Malchev selected this answer as the correct answer

Comments
1
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: http://www.vogella.com/tutorials/EclipsePreferences/article.html).
     // org.eclipse.core.runtime.preferences
      InstanceScope instScope = InstanceScope.INSTANCE;
      IEclipsePreferences extCmpToolNode =
          instScope.getNode( "com.ibm.team.filesystem.ide.ui" );
      boolean openExtCmpToolByDefault = extCmpToolNode.getBoolean(
                             "external_compare_default_tool_preference_key", false);

Your answer


Register or to post your answer.