Examples of FileTemplate


Examples of com.intellij.ide.fileTemplates.FileTemplate

    final PsiDirectory directory = manager.findDirectory(sourceRoot);
    assert directory != null : sourceRoot.getPresentableUrl();

    final FileTemplateManager templateManager = FileTemplateManager.getInstance();
    final FileTemplate validationTemplate = templateManager.getJ2eeTemplate(StrutsFileTemplateGroupDescriptorFactory.VALIDATION_XML);

    final PsiDirectory packageDirectoryInSourceRoot = RefactoringUtil.createPackageDirectoryInSourceRoot(targetPackage, sourceRoot);
    try {
      final String filename = path == null ? actionClass.getName() + "-validation.xml" : actionClass.getName() + "-" + path + "-validation.xml";
      final PsiElement psiElement = FileTemplateUtil.createFromTemplate(validationTemplate, filename, null, packageDirectoryInSourceRoot);
View Full Code Here

Examples of com.intellij.ide.fileTemplates.FileTemplate

  protected PsiElement[] create(final String newName, final PsiDirectory directory) throws Exception {
    @NonNls final String fileName = getFileName(newName);

    final Module module = ModuleUtilCore.findModuleForPsiElement(directory);
    StrutsFileTemplateProvider templateProvider = new StrutsFileTemplateProvider(module);
    final FileTemplate strutsXmlTemplate = templateProvider.determineFileTemplate();
    final PsiElement file = FileTemplateUtil.createFromTemplate(strutsXmlTemplate,
                                                                fileName,
                                                                null,
                                                                directory);
    return new PsiElement[]{file};
View Full Code Here

Examples of com.intellij.ide.fileTemplates.FileTemplate

        return null;
    }

    //todo: taken from 12 implementation, remove when retire 11.1 compatibility
    public PsiMethod createSetUpPatternMethod(JVMElementFactory factory) {
        final FileTemplate template = FileTemplateManager.getInstance().getCodeTemplate(getSetUpMethodFileTemplateDescriptor().getFileName());
        return factory.createMethodFromText(StringUtil.replace(template.getText(), "${BODY}\n", ""), null);
    }
View Full Code Here

Examples of com.intellij.ide.fileTemplates.FileTemplate

    public static PsiFile createFromTemplate(@NotNull final PsiDirectory directory,
                                             @NotNull final String name,
                                             @NotNull String fileName,
                                             @NotNull String templateName,
                                             @NonNls String... parameters) throws IncorrectOperationException {
        final FileTemplate template = FileTemplateManager.getInstance().getInternalTemplate(templateName);

        Properties properties = new Properties(FileTemplateManager.getInstance().getDefaultProperties());
        JavaTemplateUtil.setPackageNameAttribute(properties, directory);
        properties.setProperty(NAME_TEMPLATE_PROPERTY, name);
        properties.setProperty(LOW_CASE_NAME_TEMPLATE_PROPERTY, name.substring(0, 1).toLowerCase() + name.substring(1));
        for (int i = 0; i < parameters.length; i += 2) {
            properties.setProperty(parameters[i], parameters[i + 1]);
        }
        String text;
        try {
            text = template.getText(properties);
        } catch (Exception e) {
            throw new RuntimeException("Unable to load template for " + FileTemplateManager.getInstance().internalTemplateToSubject(templateName),
                    e);
        }
View Full Code Here

Examples of com.k42b3.espeon.model.FileTemplate

    this.setTitle("Generate");

    this.setLayout(new BorderLayout());


    this.tm = new FileTemplate();

    JScrollPane scrTable = new JScrollPane(new JTable(this.tm));
   
    scrTable.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));   
   
View Full Code Here

Examples of org.g4studio.core.tplengine.FileTemplate

    Dto dto = new BaseDto();
    dto.put("menuList", menuList);
    dto.put("key", key);
    dto.put("authorizelevel", authorizelevel);
    TemplateEngine engine = TemplateEngineFactory.getTemplateEngine(TemplateType.VELOCITY);
    DefaultTemplate template = new FileTemplate();
    template.setTemplateResource(TagHelper.getTemplatePath(getClass().getName()));
    StringWriter writer = engine.mergeTemplate(template, dto);
    try {
      pageContext.getOut().write(writer.toString());
    } catch (IOException e) {
      log.error(G4Constants.Exception_Head + e.getMessage());
View Full Code Here

Examples of org.g4studio.core.tplengine.FileTemplate

        Dto dto = new BaseDto();
        dto.put("deptList", deptList);
        dto.put("userList", userList);
        dto.put("deptid", deptid);
    TemplateEngine engine = TemplateEngineFactory.getTemplateEngine(TemplateType.VELOCITY);
    DefaultTemplate template = new FileTemplate();
    template.setTemplateResource(TagHelper.getTemplatePath(getClass().getName()));
    StringWriter writer = engine.mergeTemplate(template, dto);
    try {
      pageContext.getOut().write(writer.toString());
    } catch (IOException e) {
      log.error(G4Constants.Exception_Head + e.getMessage());
View Full Code Here

Examples of org.g4studio.core.tplengine.FileTemplate

        Dto dto = new BaseDto();
        dto.put("deptList", deptList);
        dto.put("roleList", roleList);
        dto.put("deptid", deptid);
    TemplateEngine engine = TemplateEngineFactory.getTemplateEngine(TemplateType.VELOCITY);
    DefaultTemplate template = new FileTemplate();
    template.setTemplateResource(TagHelper.getTemplatePath(getClass().getName()));
    StringWriter writer = engine.mergeTemplate(template, dto);
    try {
      pageContext.getOut().write(writer.toString());
    } catch (IOException e) {
      log.error(G4Constants.Exception_Head + e.getMessage());
View Full Code Here

Examples of org.g4studio.core.tplengine.FileTemplate

    dto.put("userInfo", userInfo);
    List menuList = getMenuList();
    dto.put("menuList", menuList);
    dto.put("paramList", WebUtils.getParamList(request));
    TemplateEngine engine = TemplateEngineFactory.getTemplateEngine(TemplateType.VELOCITY);
    DefaultTemplate template = new FileTemplate();
    template.setTemplateResource(TagHelper.getTemplatePath(getClass().getName()));
    StringWriter writer = engine.mergeTemplate(template, dto);
    try {
      pageContext.getOut().write(writer.toString());
    } catch (IOException e) {
      log.error(G4Constants.Exception_Head + e.getMessage());
View Full Code Here

Examples of org.g4studio.core.tplengine.FileTemplate

      }
    }
    Dto dto = new BaseDto();
    dto.put("menuList", menuList);
    TemplateEngine engine = TemplateEngineFactory.getTemplateEngine(TemplateType.VELOCITY);
    DefaultTemplate template = new FileTemplate();
    template.setTemplateResource(TagHelper.getTemplatePath(getClass().getName()));
    StringWriter writer = engine.mergeTemplate(template, dto);
    try {
      pageContext.getOut().write(writer.toString());
    } catch (IOException e) {
      log.error(G4Constants.Exception_Head + e.getMessage());
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.