I set up my language preferences page in my UI project, and can access them inside the UI packages like this:
IPreferenceStore store = DSLActivator.getInstance().getPreferenceStore();
String data = store.getString("whatever");
Now, I want to access it from the main Xtext project (i.e., the one with the grammar, validator, etc.). However, my DSLActivator is inside an internal UI package. I could export it, but it seems it was not supposed to be. How else can I access preferences?
I have the same problem. I created an additional preferences page for an xtext DSL and I am able to configure values in the UI.
I want to access that configuration while running the xtext-maven-plugin. I tried the Platform approach and can confirm it's not available for Standalone setup (also not if adding the required dependencies).
The IPreferenceStoreAccess sits in the UI project, but I need the access from the generator project.
Is the proposed solution to add the UI project as a dependency?
I'm no longer convinced that the question was a good one.
In standalone setups, the data shouldn't even be pulled from some Eclipse configuration storage, but rather depend on the environment.
For invocations via xtext-maven-plugin, for example, the <configuration> section of the pom.xml should provide the values. Not sure if such functionality is already supported.
For now, I'll go and do an easy fallback, and provide configuration from environment or system properties.