package jetbrains.mps.ide.platform.refactoring;

/*Generated by MPS */

import jetbrains.mps.annotations.GeneratedClass;
import com.intellij.refactoring.RefactoringBundle;
import org.jetbrains.annotations.NotNull;
import com.intellij.openapi.project.Project;

@GeneratedClass(node = "r:986938bb-bdb1-4307-b062-e4647a4db0f9(jetbrains.mps.ide.platform.refactoring)/1685972956014334002", model = "r:986938bb-bdb1-4307-b062-e4647a4db0f9(jetbrains.mps.ide.platform.refactoring)")
public class RenameDialog extends StringChooserDialog {
  private static String REFACTORING_NAME = RefactoringBundle.message("rename.title");

  public RenameDialog(@NotNull Project project, String oldName, String nodeType) {
    super(project, REFACTORING_NAME, RefactoringBundle.message("rename.0.and.its.usages.to", String.format("%s '%s'", nodeType, oldName)), oldName);
  }

  public static String getNewName(Project project, String oldName, String node) {
    RenameDialog dialog = new RenameDialog(project, oldName, node);
    dialog.show();
    return dialog.getResultValue();
  }
}
