use of com.jetbrains.lang.dart.psi.DartReturnType in project intellij-plugins by JetBrains.
the class CreateGetterSetterFix method buildFunctionsText.
@Override
protected Template buildFunctionsText(final TemplateManager templateManager, final DartComponent namedComponent) {
final DartReturnType returnType = PsiTreeUtil.getChildOfType(namedComponent, DartReturnType.class);
final DartType dartType = PsiTreeUtil.getChildOfType(namedComponent, DartType.class);
final String typeText = returnType == null ? DartPresentableUtil.buildTypeText(namedComponent, dartType, null) : DartPresentableUtil.buildTypeText(namedComponent, returnType, null);
final Template template = templateManager.createTemplate(getClass().getName(), DART_TEMPLATE_GROUP);
template.setToReformat(true);
if (myStrategy == Strategy.GETTER || myStrategy == Strategy.GETTERSETTER) {
buildGetter(template, namedComponent.getName(), typeText, namedComponent.isStatic());
}
if (myStrategy == Strategy.SETTER || myStrategy == Strategy.GETTERSETTER) {
buildSetter(template, namedComponent.getName(), typeText, namedComponent.isStatic());
}
return template;
}
Aggregations