|
Re: Change PLUGIN_ID field in generated UI activator [message #1797534 is a reply to message #1797531] |
Thu, 01 November 2018 10:53 |
|
how do you exactly change plugin id in your setup.
the code that generates the activator is at
org.eclipse.xtext.xtext.generator.XtextGeneratorTemplates.createEclipsePluginActivator(IXtextProjectConfig, List<? extends IXtextGeneratorLanguage>)
public static final String PLUGIN_ID = "«projectConfig.eclipsePlugin.name»";
=> if you correctly handle your project config then it works ootb.
alternatively you can bind a custom XtextGeneratorTemplates that customizes the activator generation
you can use a custom binding like
Workflow {
component = XtextGenerator {
configuration = EntitiesGeneratorModule {
public class EntitiesGeneratorModule extends DefaultGeneratorModule {
public Class<? extends XtextGeneratorNaming> bindNaming() {
return StateMachineGeneratorNaming.class;
}
public static class StateMachineGeneratorNaming extends XtextGeneratorNaming {
@Override
public String getWebBasePackage(Grammar grammar) {
if (grammar.getName().equals("org.eclipse.xtext.web.example.entities.Entities")) {
return "org.eclipse.xtext.web.example.jetty";
} else {
return super.getWebBasePackage(grammar);
}
}
}
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03257 seconds