safe delete should not start callback when "safe" checkbox is not on

This commit is contained in:
Anna Kozlova
2014-04-03 17:15:54 +02:00
parent 1daf8f50df
commit df9e6aa2aa
@@ -197,7 +197,7 @@ public class SafeDeleteDialog extends DialogWrapper {
@Override
protected void doOKAction() {
if (myCallback != null) {
if (myCallback != null && isSafeDelete()) {
myCallback.run(this);
} else {
super.doOKAction();
@@ -220,4 +220,11 @@ public class SafeDeleteDialog extends DialogWrapper {
}
}
}
private boolean isSafeDelete() {
if (isDelete()) {
return myCbSafeDelete.isSelected();
}
return true;
}
}