Package org.antlr.stringtemplate

Examples of org.antlr.stringtemplate.StringTemplateGroup.lookupTemplate()


    FileReader reader;
    String output = "";
    try {
      reader = new FileReader(toolTemplate());
      StringTemplateGroup templates = new StringTemplateGroup(reader);
      StringTemplate cdfTemplate = templates.lookupTemplate("cdfFile");
      cdfTemplate.setAttribute("cls", this);
      output = cdfTemplate.toString();
    } catch (FileNotFoundException e) {
      ToolPlugin.showError("Error generating Tool source", e);
    }
View Full Code Here


  }

  public void writePrxFile(String templateFileName) throws IOException, CoreException{
    FileReader reader = new FileReader(templateFileName);
    StringTemplateGroup templates = new StringTemplateGroup(reader);
    StringTemplate prxTemplate = templates.lookupTemplate("prxFile");
    prxTemplate.setAttribute("plan", this);
    String output = prxTemplate.toString();
    if (this.document != null && this.provider != null){
      this.document.set(output);
      this.provider.saveDocument(new NullProgressMonitor(), this.file, this.document, true);
View Full Code Here

    FileReader reader;
    String output = "";
    try {
      reader = new FileReader(toolTemplate());
      StringTemplateGroup templates = new StringTemplateGroup(reader);
      StringTemplate cdfTemplate = templates.lookupTemplate("cdfFile");
      cdfTemplate.setAttribute("cls", this);
      output = cdfTemplate.toString();
    } catch (FileNotFoundException e) {
      ToolModelActivator.showError("Error generating Tool source", e);
    }
View Full Code Here

  }

  public void writePrxFile(String templateFileName) throws IOException, CoreException{
    FileReader reader = new FileReader(templateFileName);
    StringTemplateGroup templates = new StringTemplateGroup(reader);
    StringTemplate prxTemplate = templates.lookupTemplate("prxFile");
    prxTemplate.setAttribute("plan", this);
    String output = prxTemplate.toString();
    if (this.document != null && this.provider != null){
      this.document.set(output);
      this.provider.saveDocument(new NullProgressMonitor(), this.file, this.document, true);
View Full Code Here

    try {
      URL url = Platform.getBundle(ToolPlugin.PLUGIN_ID).getEntry("StringTemplates/Tool/" + templateFileName);
      templateFile = new File(FileLocator.toFileURL(url).toURI());
      reader = new FileReader(templateFile);
      StringTemplateGroup templates = new StringTemplateGroup(reader);
      StringTemplate wexTemplate = templates.lookupTemplate(templateNam);
      for (TemplateAttribute att : attributes){
        wexTemplate.setAttribute(att.name, att.value);
      }
      output = wexTemplate.toString();
    } catch (FileNotFoundException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.