use of org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrEnumConstant in project intellij-community by JetBrains.
the class GrEnumConstantInfo method inferArgTypes.
@Nullable
@Override
protected PsiType[] inferArgTypes() {
GrEnumConstant call = getCall();
GrArgumentList argList = call.getArgumentList();
if (argList != null) {
return PsiUtil.getArgumentTypes(argList);
} else {
return PsiType.EMPTY_ARRAY;
}
}
use of org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrEnumConstant in project intellij-community by JetBrains.
the class GrEnumConstantInitializerImpl method getBaseClass.
private PsiClass getBaseClass() {
PsiElement parent = getParent();
LOG.assertTrue(parent instanceof GrEnumConstant);
PsiClass containingClass = ((GrEnumConstant) parent).getContainingClass();
LOG.assertTrue(containingClass != null);
return containingClass;
}
use of org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrEnumConstant in project intellij-community by JetBrains.
the class ClassGenerator method writeMembers.
public void writeMembers(StringBuilder text, PsiClass typeDefinition) {
if (typeDefinition instanceof GrEnumTypeDefinition) {
final GrEnumConstant[] enumConstants = ((GrEnumTypeDefinition) typeDefinition).getEnumConstants();
for (GrEnumConstant constant : enumConstants) {
classItemGenerator.writeEnumConstant(text, constant);
text.append(',');
}
if (enumConstants.length > 0) {
//text.removeFromTheEnd(1).append(";\n");
text.delete(text.length() - 1, text.length());
}
text.append(";\n");
}
writeAllMethods(text, classItemGenerator.collectMethods(typeDefinition), typeDefinition);
if (typeDefinition instanceof GrTypeDefinition) {
for (GrMembersDeclaration declaration : ((GrTypeDefinition) typeDefinition).getMemberDeclarations()) {
if (declaration instanceof GrVariableDeclaration) {
classItemGenerator.writeVariableDeclarations(text, (GrVariableDeclaration) declaration);
}
}
for (PsiClass inner : typeDefinition.getInnerClasses()) {
writeTypeDefinition(text, inner, false, false);
text.append('\n');
}
}
classItemGenerator.writePostponed(text, typeDefinition);
}
Aggregations