I would like to develop a plugin (toolbar button) for the Eclipse CDT, where users can easily switch between 8 and 4 space tabs and enable / disable soft tabs. (Why worry what you asked? Thanks to the coding guide in my organization for distinguishing tabs between C / C ++ legacy and new codes)
I managed to create buttons on the toolbar, but I could not find information for changing the editor settings (those that you usually find in the settings of the General โ Editors-> Text editors workspace).
Question 4587572 seems to cover a bit, but I'm still very new to the plugin, so I really don't get it.
I think I want to change the properties EDITOR_TAB_WIDTH and EDITOR_SPACES_FOR_TABS org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants for an executable text editor.
Not only a modification, I could not even read the properties with the following code. Just returns the default value: 30 I provided.
int width = Platform.getPreferencesService().getInt(
"org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants",
"EDITOR_TAB_WIDTH", 30, null);
My question is this: how do I change the tab settings of a working editor from my plugin?
Thank you very much for your help.
source
share