mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
WI-20091 Rename refactoring produces unexpected results damaging code
(cherry picked from commit 599fd3e)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user