use of com.intellij.psi.PsiMember in project intellij-community by JetBrains.
the class GroovyGenerationInfo method insert.
@Override
public void insert(@NotNull PsiClass aClass, @Nullable PsiElement anchor, boolean before) throws IncorrectOperationException {
final T proto = getPsiMember();
if (proto instanceof GrMethod) {
GroovyChangeContextUtil.encodeContextInfo(((GrMethod) proto).getParameterList());
}
super.insert(aClass, anchor, before);
final T member = getPsiMember();
if (member == null)
return;
LOG.assertTrue(member instanceof GroovyPsiElement, member);
final GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(member.getProject());
final PsiElement prev = member.getPrevSibling();
if (prev != null && GroovyTokenTypes.mNLS == prev.getNode().getElementType()) {
prev.replace(factory.createLineTerminator(1));
} else if (prev instanceof PsiMember) {
member.getParent().getNode().addLeaf(GroovyTokenTypes.mNLS, "\n", member.getNode());
}
final PsiElement next = member.getNextSibling();
if (next != null && GroovyTokenTypes.mNLS == next.getNode().getElementType()) {
next.replace(factory.createLineTerminator(1));
} else if (next instanceof PsiMember) {
member.getParent().getNode().addLeaf(GroovyTokenTypes.mNLS, "\n", next.getNode());
}
if (member instanceof GrMethod) {
GroovyChangeContextUtil.decodeContextInfo(((GrMethod) member).getParameterList(), null, null);
}
JavaCodeStyleManager.getInstance(member.getProject()).shortenClassReferences(member);
adjustDocCommentIfExists(member);
}
use of com.intellij.psi.PsiMember in project intellij-community by JetBrains.
the class GrMemberSelectionTable method getOverrideIcon.
@Override
protected Icon getOverrideIcon(GrMemberInfo memberInfo) {
PsiMember member = memberInfo.getMember();
Icon overrideIcon = EMPTY_OVERRIDE_ICON;
if (member instanceof PsiMethod) {
if (Boolean.TRUE.equals(memberInfo.getOverrides())) {
overrideIcon = AllIcons.General.OverridingMethod;
} else if (Boolean.FALSE.equals(memberInfo.getOverrides())) {
overrideIcon = AllIcons.General.ImplementingMethod;
} else {
overrideIcon = EMPTY_OVERRIDE_ICON;
}
}
return overrideIcon;
}
use of com.intellij.psi.PsiMember in project intellij-community by JetBrains.
the class GrMemberSelectionTable method setVisibilityIcon.
@Override
protected void setVisibilityIcon(GrMemberInfo memberInfo, RowIcon icon) {
PsiMember member = memberInfo.getMember();
PsiModifierList modifiers = member != null ? member.getModifierList() : null;
if (modifiers != null) {
VisibilityIcons.setVisibilityIcon(modifiers, icon);
} else {
icon.setIcon(IconUtil.getEmptyIcon(true), VISIBILITY_ICON_POSITION);
}
}
use of com.intellij.psi.PsiMember in project intellij-community by JetBrains.
the class MissedTestsDialog method updateMethodsTable.
private void updateMethodsTable() {
List<MemberInfo> infos = TestIntegrationUtils.extractClassMethods(mySourceClass, myIncludeInheritedCb.isSelected());
Set<PsiMember> selectedMethods = new HashSet<>();
for (MemberInfo each : myTable.getSelectedMemberInfos()) {
selectedMethods.add(each.getMember());
}
for (MemberInfo each : infos) {
each.setChecked(selectedMethods.contains(each.getMember()));
}
myTable.setMemberInfos(infos);
}
use of com.intellij.psi.PsiMember in project intellij-community by JetBrains.
the class MemberSelectionTable method getOverrideIcon.
@Override
protected Icon getOverrideIcon(MemberInfo memberInfo) {
PsiMember member = memberInfo.getMember();
Icon overrideIcon = MemberSelectionTable.EMPTY_OVERRIDE_ICON;
if (member instanceof PsiMethod) {
if (Boolean.TRUE.equals(memberInfo.getOverrides())) {
overrideIcon = AllIcons.General.OverridingMethod;
} else if (Boolean.FALSE.equals(memberInfo.getOverrides())) {
overrideIcon = AllIcons.General.ImplementingMethod;
} else {
overrideIcon = MemberSelectionTable.EMPTY_OVERRIDE_ICON;
}
}
return overrideIcon;
}
Aggregations