mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-169476 Run configurations are too easily deleted
Disable deletion in Run/Debug popups at all
This commit is contained in:
-37
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user