Examples of addTextSegment()


Examples of com.intellij.codeInsight.template.Template.addTextSegment()

    Template template = templateManager.createTemplate("", "");
    template.setToReformat(true);

    template.addTextSegment("class ");
    template.addVariable(DartPresentableUtil.getExpression(myClassName), false);
    template.addTextSegment("{\n");
    template.addEndVariable();
    template.addTextSegment("\n}\n");

    final Editor openedEditor = navigate(project, anchor.getTextOffset(), anchor.getContainingFile().getVirtualFile());
    if (openedEditor != null) {
View Full Code Here

Examples of com.intellij.codeInsight.template.Template.addTextSegment()

    template.addTextSegment("class ");
    template.addVariable(DartPresentableUtil.getExpression(myClassName), false);
    template.addTextSegment("{\n");
    template.addEndVariable();
    template.addTextSegment("\n}\n");

    final Editor openedEditor = navigate(project, anchor.getTextOffset(), anchor.getContainingFile().getVirtualFile());
    if (openedEditor != null) {
      templateManager.startTemplate(openedEditor, template);
    }
View Full Code Here

Examples of com.intellij.codeInsight.template.Template.addTextSegment()

  private static void insertTestFunction(@NotNull Project project, @NotNull Editor editor, String name, boolean needNewline) {
    Template template = TemplateManager.getInstance(project).createTemplate("", "");
    Expression nameExpr = new ConstantNode(name);
    Expression expected = new ConstantNode("expected");
    Expression expr = new ConstantNode("expr");
    template.addTextSegment("\n" + (needNewline ? "\n" : ""));
    template.addVariable("name", nameExpr, nameExpr, true);
    template.addTextSegment("_test() ->\n");
    template.addTextSegment("?assertEqual(");
    template.addVariable(expected, true);
    template.addTextSegment(", ");
View Full Code Here

Examples of com.intellij.codeInsight.template.Template.addTextSegment()

    Expression nameExpr = new ConstantNode(name);
    Expression expected = new ConstantNode("expected");
    Expression expr = new ConstantNode("expr");
    template.addTextSegment("\n" + (needNewline ? "\n" : ""));
    template.addVariable("name", nameExpr, nameExpr, true);
    template.addTextSegment("_test() ->\n");
    template.addTextSegment("?assertEqual(");
    template.addVariable(expected, true);
    template.addTextSegment(", ");
    template.addVariable(expr, true);
    template.addTextSegment(").");
View Full Code Here

Examples of com.intellij.codeInsight.template.Template.addTextSegment()

    Expression expected = new ConstantNode("expected");
    Expression expr = new ConstantNode("expr");
    template.addTextSegment("\n" + (needNewline ? "\n" : ""));
    template.addVariable("name", nameExpr, nameExpr, true);
    template.addTextSegment("_test() ->\n");
    template.addTextSegment("?assertEqual(");
    template.addVariable(expected, true);
    template.addTextSegment(", ");
    template.addVariable(expr, true);
    template.addTextSegment(").");
    template.addEndVariable();
View Full Code Here

Examples of com.intellij.codeInsight.template.Template.addTextSegment()

    template.addTextSegment("\n" + (needNewline ? "\n" : ""));
    template.addVariable("name", nameExpr, nameExpr, true);
    template.addTextSegment("_test() ->\n");
    template.addTextSegment("?assertEqual(");
    template.addVariable(expected, true);
    template.addTextSegment(", ");
    template.addVariable(expr, true);
    template.addTextSegment(").");
    template.addEndVariable();
    template.setToIndent(true);
    template.setToReformat(true);
View Full Code Here

Examples of com.intellij.codeInsight.template.Template.addTextSegment()

    template.addTextSegment("_test() ->\n");
    template.addTextSegment("?assertEqual(");
    template.addVariable(expected, true);
    template.addTextSegment(", ");
    template.addVariable(expr, true);
    template.addTextSegment(").");
    template.addEndVariable();
    template.setToIndent(true);
    template.setToReformat(true);
    TemplateManager.getInstance(project).startTemplate(editor, template, null);
  }
View Full Code Here

Examples of com.intellij.codeInsight.template.Template.addTextSegment()

          editor.getCaretModel().moveToOffset(anchor.getTextRange().getStartOffset());

          TemplateManager manager = TemplateManager.getInstance(project);
          Template template = manager.createTemplate("", "");

          template.addTextSegment(((ErlangQVar) psiElement).getName());
          template.addTextSegment(" = ");
          template.addVariable(new ConstantNode("unbound"), true);
          template.addTextSegment("");
          template.addEndVariable();
          template.addTextSegment(",\n");
View Full Code Here

Examples of com.intellij.codeInsight.template.Template.addTextSegment()

          TemplateManager manager = TemplateManager.getInstance(project);
          Template template = manager.createTemplate("", "");

          template.addTextSegment(((ErlangQVar) psiElement).getName());
          template.addTextSegment(" = ");
          template.addVariable(new ConstantNode("unbound"), true);
          template.addTextSegment("");
          template.addEndVariable();
          template.addTextSegment(",\n");
View Full Code Here

Examples of com.intellij.codeInsight.template.Template.addTextSegment()

          Template template = manager.createTemplate("", "");

          template.addTextSegment(((ErlangQVar) psiElement).getName());
          template.addTextSegment(" = ");
          template.addVariable(new ConstantNode("unbound"), true);
          template.addTextSegment("");
          template.addEndVariable();
          template.addTextSegment(",\n");

          manager.startTemplate(editor, template);
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.