use of com.intellij.refactoring.memberPullUp.PullUpProcessor in project intellij-community by JetBrains.
the class GrExtractInterfaceHandler method extractInterface.
public static PsiClass extractInterface(PsiDirectory targetDir, PsiClass aClass, String interfaceName, MemberInfo[] selectedMembers, DocCommentPolicy javaDocPolicy) throws IncorrectOperationException {
PsiClass anInterface = JavaDirectoryService.getInstance().createInterface(targetDir, interfaceName);
PsiJavaCodeReferenceElement ref = ExtractSuperClassUtil.createExtendingReference(anInterface, aClass, selectedMembers);
final PsiReferenceList referenceList = aClass.isInterface() ? aClass.getExtendsList() : aClass.getImplementsList();
assert referenceList != null;
referenceList.add(ref);
PullUpProcessor pullUpHelper = new PullUpProcessor(aClass, anInterface, selectedMembers, javaDocPolicy);
pullUpHelper.moveMembersToBase();
return anInterface;
}
Aggregations