public static void invoke(
      final Project project,
      final PsiElement[] roots,
      final PsiType type,
      final TypeMigrationRules rules,
      final Editor editor) {
    if (Util.canBeMigrated(roots)) {
      TypeMigrationDialog dialog =
          new TypeMigrationDialog.SingleElement(project, roots, type, rules);
      dialog.show();
      return;
    }

    CommonRefactoringUtil.showErrorHint(
        project,
        editor,
        RefactoringBundle.message(
            "only.fields.variables.of.methods.of.valid.type.can.be.considered"),
        RefactoringBundle.message("unable.to.start.type.migration"),
        null);
  }
예제 #2
0
 protected JComponent createCenterPanel() {
   if (Util.anyFieldsWithGettersPresent(myClassMembersList)) {
     return myPanel.createReplaceFieldsWithGettersPanel();
   } else return null;
 }