Examples of lookupTemplate()


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

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

  }

  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

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) {
      ToolModelActivator.showError("Error generating Tool source", e);
    }
View Full Code Here

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

  }

  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

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

    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

Examples of org.jahia.data.templates.JahiaTemplatesPackage.lookupTemplate()

        }
        if (site != null) {
            JahiaTemplatesPackage pkg = getTemplatePackage(site
                    .getTemplatePackageName());
            if (pkg != null && pkg.getTemplateMap().containsKey(templateName)) {
                displayName = pkg.lookupTemplate(templateName).getDisplayName();
            }
        }
        if (null == displayName) {
            logger
                    .warn("Unable to lookup display name for the template named '"
View Full Code Here

Examples of org.jahia.data.templates.JahiaTemplatesPackage.lookupTemplate()

        }
        if (site != null) {
            JahiaTemplatesPackage pkg = getTemplatePackage(site
                    .getTemplatePackageName());
            if (pkg != null && pkg.getTemplateMap().containsKey(templateName)) {
                description = pkg.lookupTemplate(templateName).getDescription();
            }
        }
        return description;
    }
View Full Code Here

Examples of org.jahia.data.templates.JahiaTemplatesPackage.lookupTemplate()

    public String getTemplateSourcePath(String templateName, int siteId) {
        String sourcePath = null;
        JahiaTemplatesPackage pkg = getTemplatePackage(siteId);
        if (pkg != null && pkg.getTemplateMap().containsKey(templateName)) {
            sourcePath = pkg.lookupTemplate(templateName).getFilePath();
        }
        if (null == sourcePath) {
            logger
                    .warn("Unable to lookup the source path for the template named '"
                            + templateName + "' in the site with ID=" + siteId);
View Full Code Here

Examples of org.stringtemplate.v4.STGroup.lookupTemplate()

    STGroup group = new STGroupFile(tmpdir + "/t.stg");
    // try to get an undefined template.
    // This will add an entry to the "templates" field in STGroup, however
    // this should not be returned.
    group.lookupTemplate("t2");

    Set<String> names = group.getTemplateNames();

    // Should only contain "t" and "main" (not "t2")
    assertEquals(2, names.size());
View Full Code Here

Examples of org.stringtemplate.v4.STGroupFile.lookupTemplate()

    STGroup group = new STGroupFile(tmpdir + "/t.stg");
    // try to get an undefined template.
    // This will add an entry to the "templates" field in STGroup, however
    // this should not be returned.
    group.lookupTemplate("t2");

    Set<String> names = group.getTemplateNames();

    // Should only contain "t" and "main" (not "t2")
    assertEquals(2, names.size());
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.