Rex Feral
Rex Feral

Reputation: 488

Changing Open Help Search Preferences

I've fount a way to change Open Help Search Preferences through code by:

IEclipsePreferences pref = InstanceScope.INSTANCE.getNode(HelpBasePlugin.PLUGIN_ID);

pref.put(IHelpBaseConstants.P_KEY_SEARCH_FROM_BROWSER, "whatever");
//apparently the second String is unimportant as it will always change "Open Help Search" to "In the dynamic help view"

Anyway, now I want to change Open Help Search back to In a browser

However, looking through IHelpBaseConstants, I see there are only values and keys for Open help view documents.

Are there other classes, API's or things I might have missed out on that can change Help Preferences?

Upvotes: 0

Views: 19

Answers (1)

greg-449
greg-449

Reputation: 111162

This preference is a Boolean value so you should be using:

pref.putBoolean(IHelpBaseConstants.P_KEY_SEARCH_FROM_BROWSER, true/false);

An arbitrary value appears to work because the getBoolean code uses:

Boolean.valueOf(result).booleanValue();

to convert the preference string. This treats anything other than the string true as being false.

Upvotes: 1

Related Questions