WI-20091 Rename refactoring produces unexpected results damaging code

(cherry picked from commit 599fd3e)
This commit is contained in:
Svetlana.Zemlyanskay
2013-10-30 18:53:06 +04:00
parent 09594c5161
commit 6fece30a44
2 changed files with 12 additions and 2 deletions
@@ -86,7 +86,7 @@ public class AutomaticRenamingDialog extends DialogWrapper {
myUsagePreviewPanel = new UsagePreviewPanel(myProject);
myUsageFileLabel = new JLabel();
populateData();
myTableModel = new MyTableModel();
myTableModel = new MyTableModel(renamer.allowChangeSuggestedName());
setTitle(myRenamer.getDialogTitle());
init();
}
@@ -300,6 +300,12 @@ public class AutomaticRenamingDialog extends DialogWrapper {
}
private class MyTableModel extends AbstractTableModel {
private final boolean myAllowRename;
private MyTableModel(boolean allowRename) {
myAllowRename = allowRename;
}
@Override
public int getColumnCount() {
return 3;
@@ -342,7 +348,7 @@ public class AutomaticRenamingDialog extends DialogWrapper {
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
return columnIndex != OLD_NAME_COLUMN;
return columnIndex != OLD_NAME_COLUMN && (myAllowRename || columnIndex != NEW_NAME_COLUMN);
}
@Override
@@ -166,6 +166,10 @@ public abstract class AutomaticRenamer {
return name;
}
public boolean allowChangeSuggestedName() {
return true;
}
public boolean isSelectedByDefault() {
return false;
}