Add/ modify preference page [message #1038998] |
Thu, 11 April 2013 11:50  |
Eclipse User |
|
|
|
Hey,
again probably a rather simple question... I want to add a preference page to my editor. What I did is
public class ExamplePreferencePage extends LanguageRootPreferencePage {
@Override
protected void createFieldEditors() {
super.createFieldEditors();
BooleanFieldEditor booleanFieldEditor = new BooleanFieldEditor("name", "label", getFieldEditorParent());
booleanFieldEditor.setPreferenceStore(doGetPreferenceStore());
addField(booleanFieldEditor);
}
}
and I registered it in the EditorUiModule via
public Class<? extends org.eclipse.xtext.ui.editor.preferences.LanguageRootPreferencePage> bindLanguageRootPreferencePage() {
return org.grammaticalframework.eclipse.ui.editor.preferences.GFLanguageRootPreferencePage.class;
}
But when I try to open that page I get the following error: "The currently displayed page contains invalid values."
What am I doing wrong? And how can I modify/ extend an existing preference page (e.g. "Compiler")?
Cheers,
Maximilian
|
|
|
|
|
Re: Add/ modify preference page [message #1047446 is a reply to message #1039412] |
Tue, 23 April 2013 04:01  |
Eclipse User |
|
|
|
Now I want to access my preferences. So I tried it via the preferenceService
String pref = Platform.getPreferencesService().getString(INIEditorActivator.getInstance().getBundle().getSymbolicName(), PREF, "", null);
and also via
String pref = preferenceStoreAccess.getPreferenceStore().getString(PREF);
The preference is properly saved in the same file as the other preferences of the editor. Why doesn't my approach work? And especially how can I get it working?
EDIT:
Of course I just solved it after posting... with the filename it makes things easy of course...
[Updated on: Tue, 23 April 2013 04:06] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.25295 seconds