Example #1
0
 @Override
 protected void addCustomElementsToCentralPanel(JPanel panel) {
   myJavaDocPanel = new DocCommentPanel(RefactoringBundle.message("javadoc.for.abstracts"));
   myJavaDocPanel.setPolicy(JavaRefactoringSettings.getInstance().PULL_UP_MEMBERS_JAVADOC);
   boolean hasJavadoc = false;
   for (MemberInfo info : myMemberInfos) {
     final PsiMember member = info.getMember();
     if (myMemberInfoModel.isAbstractEnabled(info) && member instanceof PsiDocCommentOwner) {
       info.setToAbstract(myMemberInfoModel.isAbstractWhenDisabled(info));
       if (((PsiDocCommentOwner) member).getDocComment() != null) {
         hasJavadoc = true;
         break;
       }
     }
   }
   UIUtil.setEnabled(myJavaDocPanel, hasJavadoc, true);
   panel.add(myJavaDocPanel, BorderLayout.EAST);
 }
 protected void doAction() {
   if (!myCallback.checkConflicts(this)) return;
   JavaRefactoringSettings.getInstance().PULL_UP_MEMBERS_JAVADOC = myJavaDocPanel.getPolicy();
   final PsiClass superClass = getSuperClass();
   String name = superClass.getQualifiedName();
   if (name != null) {
     StatisticsManager.getInstance()
         .incUseCount(
             new StatisticsInfo(PULL_UP_STATISTICS_KEY + myClass.getQualifiedName(), name));
   }
   List<MemberInfo> infos = getSelectedMemberInfos();
   invokeRefactoring(
       new PullUpProcessor(
           myClass,
           superClass,
           infos.toArray(new MemberInfo[infos.size()]),
           new DocCommentPolicy(getJavaDocPolicy())));
   close(OK_EXIT_CODE);
 }
Example #3
0
 public int getJavaDocPolicy() {
   return myJavaDocPanel.getPolicy();
 }