Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Add/ modify preference page
Add/ modify preference page [message #1038998] Thu, 11 April 2013 15:50 Go to next message
Maximilian Girlich is currently offline Maximilian GirlichFriend
Messages: 17
Registered: March 2013
Junior Member
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 #1039081 is a reply to message #1038998] Thu, 11 April 2013 18:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
HI,

I could not reproduce that with your sample code and Xtext 2.4.0


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Add/ modify preference page [message #1039412 is a reply to message #1039081] Fri, 12 April 2013 06:17 Go to previous messageGo to next message
Maximilian Girlich is currently offline Maximilian GirlichFriend
Messages: 17
Registered: March 2013
Junior Member
I found the mistake... When registering the page in Extensions I accidently deleted the extensionFactory in front of the class...
Re: Add/ modify preference page [message #1047446 is a reply to message #1039412] Tue, 23 April 2013 08:01 Go to previous message
Maximilian Girlich is currently offline Maximilian GirlichFriend
Messages: 17
Registered: March 2013
Junior Member
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 08:06]

Report message to a moderator

Previous Topic:Xtext 2.3.1 Debugging does not work after Project->Clean
Next Topic:How to refresh a model cache when an external resource changes?
Goto Forum:
  


Current Time: Fri Apr 19 07:40:46 GMT 2024

Powered by FUDForum. Page generated in 0.01905 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top