@Override
  protected void canRun() throws ConfigurationException {
    final Project project = sourceMethod.getProject();
    final PsiNameHelper nameHelper = PsiNameHelper.getInstance(project);
    if (myCreateInnerClassButton.isSelected()) {
      final String innerClassName = getInnerClassName().trim();
      if (!nameHelper.isIdentifier(innerClassName)) throw new ConfigurationException(
        JavaRareRefactoringsBundle.message("dialog.message.invalid.inner.class.name", innerClassName));
      final PsiClass containingClass = sourceMethod.getContainingClass();
      if (containingClass != null && containingClass.findInnerClassByName(innerClassName, false) != null) {
        throw new ConfigurationException(JavaRareRefactoringsBundle.message("dialog.message.inner.class.with.name.already.exist", innerClassName));
      }
    } else if (useExistingClassButton.isSelected()) {
      final String className = existingClassField.getText().trim();
      if (className.length() == 0 || !nameHelper.isQualifiedName(className)) {
        throw new ConfigurationException(JavaRareRefactoringsBundle.message("dialog.message.invalid.qualified.wrapper.class.name", className));
      }
      final Object item = myFieldsCombo.getSelectedItem();
      if (item == null) {
        throw new ConfigurationException(JavaRareRefactoringsBundle.message("dialog.message.wrapper.field.not.found"));
      }
    } else {
      final String className = getClassName();
      if (className.length() == 0 || !nameHelper.isIdentifier(className)) {
        throw new ConfigurationException(JavaRareRefactoringsBundle.message("dialog.message.invalid.wrapper.class.name", className));
      }
      final String packageName = getPackageName();

      if (packageName.length() == 0 || !nameHelper.isQualifiedName(packageName)) {
        throw new ConfigurationException(JavaRareRefactoringsBundle.message("dialog.message.invalid.wrapper.class.package.name", packageName));
      }
    }
  }
@Override
  protected void canRun()