use of org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMember in project intellij-community by JetBrains.
the class GrChangeMemberVisibilityModifierBase method processIntention.
@Override
protected void processIntention(@NotNull PsiElement element, @NotNull Project project, Editor editor) throws IncorrectOperationException {
final PsiElement parent = element.getParent();
if (!(parent instanceof GrMember))
return;
((GrMember) parent).getModifierList().setModifierProperty(myModifier, true);
}
use of org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMember in project intellij-community by JetBrains.
the class GrClassMemberReferenceVisitor method visitReferenceExpression.
@Override
public void visitReferenceExpression(@NotNull GrReferenceExpression ref) {
GrExpression qualifier = ref.getQualifier();
if (qualifier != null && !(PsiUtil.isThisOrSuperRef(qualifier))) {
qualifier.accept(this);
if (!(qualifier instanceof GrReferenceExpression) || !(((GrReferenceExpression) qualifier).resolve() instanceof PsiClass)) {
return;
}
}
PsiElement resolved = ref.resolve();
if (resolved instanceof GrMember) {
PsiClass containingClass = ((GrMember) resolved).getContainingClass();
if (isPartOf(myClass, containingClass)) {
visitClassMemberReferenceElement((GrMember) resolved, ref);
}
}
}
use of org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMember in project intellij-community by JetBrains.
the class GrMemberInfo method extractClassMembers.
public static void extractClassMembers(PsiClass subclass, List<GrMemberInfo> result, Filter<GrMember> filter, final boolean extractInterfacesDeep) {
if (!(subclass instanceof GrTypeDefinition))
return;
if (extractInterfacesDeep) {
extractSuperInterfaces(subclass, filter, result, ContainerUtil.<PsiClass>newHashSet());
} else {
PsiClass[] interfaces = subclass.getInterfaces();
GrReferenceList sourceRefList = subclass.isInterface() ? ((GrTypeDefinition) subclass).getExtendsClause() : ((GrTypeDefinition) subclass).getImplementsClause();
for (PsiClass anInterface : interfaces) {
if (anInterface instanceof GrTypeDefinition && filter.includeMember((GrMember) anInterface)) {
result.add(new GrMemberInfo((GrMember) anInterface, true, sourceRefList));
}
}
}
PsiClass[] innerClasses = subclass.getInnerClasses();
for (PsiClass innerClass : innerClasses) {
if (innerClass instanceof GrTypeDefinition && filter.includeMember((GrMember) innerClass)) {
result.add(new GrMemberInfo((GrMember) innerClass));
}
}
GrMethod[] methods = ((GrTypeDefinition) subclass).getCodeMethods();
for (GrMethod method : methods) {
if (!method.isConstructor() && filter.includeMember(method)) {
result.add(new GrMemberInfo(method));
}
}
GrField[] fields = ((GrTypeDefinition) subclass).getCodeFields();
for (final GrField field : fields) {
if (filter.includeMember(field)) {
result.add(new GrMemberInfo(field));
}
}
}
Aggregations