Skip to content

Instantly share code, notes, and snippets.

@louismrose
Last active December 16, 2015 07:09
Show Gist options
  • Save louismrose/5396370 to your computer and use it in GitHub Desktop.
Save louismrose/5396370 to your computer and use it in GitHub Desktop.
public void run(IAction action) {
if (getFirstElementInSelection() instanceof IFile) {
final IFile file = (IFile)getFirstElementInSelection();
String projectName = file.getProject().getName();
final EglFileGeneratingTemplateFactory factory = new EglFileGeneratingTemplateFactory();
final EglTemplate template = factory.load(Activator.getDefault().getBundle().getResource("transformations/my.egx").toURI());
// You'll need to loop over the list returned by this method, and
// log any errors somewhere.
template.getParseProblems();
template.populate("projectName", projectName);
template.process();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment