RTA
RTA

Reputation: 1299

set the property value for eclipse preference page

There is a property "show line number" in (windows->preferences->editor->text editor) eclipse which i want to tick by java code. so how i fetch the key of that property and set the value in preference page.

Note: I need to set the "show line number" option by default true.

Upvotes: 1

Views: 306

Answers (2)

RTA
RTA

Reputation: 1299

this will be correct solution for requirement:

String lineNumbers = AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER; EditorsUI.getPreferenceStore().setValue(lineNumbers, true);

Upvotes: 0

logoff
logoff

Reputation: 3446

This tutorial shows how to access preferences from code. Try to search the property "show line numbers" and try to edit it.

Upvotes: 1

Related Questions