IDEA-169476 Run configurations are too easily deleted

Disable deletion in Run/Debug popups at all
This commit is contained in:
Vassiliy.Kudryashov
2018-06-01 00:33:10 +03:00
parent 1076f7f221
commit 8d411fc95f
@@ -144,13 +144,6 @@ public class ChooseRunConfigurationPopup implements ExecutorProvider {
});
popup.registerAction("deleteConfiguration", KeyStroke.getKeyStroke("DELETE"), new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
popup.removeSelected();
}
});
popup.registerAction("deleteConfiguration_bksp", KeyStroke.getKeyStroke("BACK_SPACE"), new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -159,9 +152,6 @@ public class ChooseRunConfigurationPopup implements ExecutorProvider {
speedSearch.backspace();
speedSearch.update();
}
else {
popup.removeSelected();
}
}
});
@@ -778,33 +768,6 @@ public class ChooseRunConfigurationPopup implements ExecutorProvider {
return new RunListElementRenderer(this, hasSideBar);
}
public void removeSelected() {
final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
if (!propertiesComponent.isTrueValue("run.configuration.delete.ad")) {
propertiesComponent.setValue("run.configuration.delete.ad", Boolean.toString(true));
}
final int index = getSelectedIndex();
if (index == -1) {
return;
}
final Object o = getListModel().get(index);
if (o instanceof ItemWrapper && ((ItemWrapper)o).canBeDeleted()) {
deleteConfiguration(myProject, (RunnerAndConfigurationSettings)((ItemWrapper)o).getValue());
getListModel().deleteItem(o);
final List<Object> values = getListStep().getValues();
values.remove(o);
if (index < values.size()) {
onChildSelectedFor(values.get(index));
}
else if (index - 1 >= 0) {
onChildSelectedFor(values.get(index - 1));
}
}
}
@Override
protected boolean isResizable() {
return true;