Examples of GroovyPsiElementFactory


Examples of org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory

      editor.getCaretModel().moveToOffset(leftBound.getTextRange().getStartOffset());
    }
  }

  private static GrMethodCall buildStepDefinitionByStep(@NotNull final GherkinStep step) {
    final GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(step.getProject());

    final Step cucumberStep = new Step(Collections.<Comment>emptyList(), step.getKeyword().getText(), step.getStepName(), 0, null, null);

    SnippetGenerator generator = new SnippetGenerator(new GroovySnippet());
    final String fqnPendingException;
    if (GrCucumberUtil.isCucumber_1_1_orAbove(step)) {
      fqnPendingException = "cucumber.api.PendingException";
    } else {
      fqnPendingException = "cucumber.runtime.PendingException";
    }
    StringBuilder snippet = escapePattern( generator.getSnippet(cucumberStep).replace("PendingException", fqnPendingException));

    return (GrMethodCall)factory.createStatementFromText(snippet, step);
  }
View Full Code Here

Examples of org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory

    }

    @Override
    protected PsiMethod findOrCreateSetUpMethod(PsiClass clazz) throws IncorrectOperationException {
        LOG.assertTrue(clazz.getLanguage() == LanguageLookup.getInstance().groovy());
        final GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(clazz.getProject());

        final PsiMethod patternMethod = createSetUpPatternMethod(factory);

        final PsiClass baseClass = clazz.getSuperClass();
        if (baseClass != null) {
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.