Search in sources :

Example 1 with Result

use of com.intellij.codeInsight.template.Result in project intellij-plugins by JetBrains.

the class DartClassNameMethodNameMacro method calculateResult.

@Override
public Result calculateResult(@NotNull Expression[] params, final ExpressionContext context) {
    final Result classNameResult = (new DartClassNameMacro()).calculateResult(params, context);
    final Result methodNameResult = (new DartMethodNameMacro()).calculateResult(params, context);
    if (classNameResult != null && methodNameResult != null) {
        return new TextResult(classNameResult.toString() + "." + methodNameResult.toString());
    } else if (classNameResult == null && methodNameResult != null) {
        return new TextResult(methodNameResult.toString());
    } else if (classNameResult != null) {
        return new TextResult(classNameResult.toString());
    } else {
        return null;
    }
}
Also used : TextResult(com.intellij.codeInsight.template.TextResult) Result(com.intellij.codeInsight.template.Result) TextResult(com.intellij.codeInsight.template.TextResult)

Aggregations

Result (com.intellij.codeInsight.template.Result)1 TextResult (com.intellij.codeInsight.template.TextResult)1