IDEA-27194: Artifacts should delete old-named artifacts file wher I press apply button

This commit is contained in:
nik
2010-02-03 10:29:32 +03:00
parent 2333416c75
commit 0c377cb0be
@@ -41,6 +41,7 @@ public class SingleConfigurableEditor extends DialogWrapper {
private Configurable myConfigurable;
private JComponent myCenterPanel;
private String myDimensionKey;
private boolean myChangesWereApplied;
public SingleConfigurableEditor(Project project, Configurable configurable, @NonNls String dimensionKey) {
super(project, true);
@@ -108,6 +109,14 @@ public class SingleConfigurableEditor extends DialogWrapper {
HelpManager.getInstance().invokeHelp(myConfigurable.getHelpTopic());
}
@Override
public void doCancelAction() {
if (myChangesWereApplied) {
ApplicationManager.getApplication().saveAll();
}
super.doCancelAction();
}
protected void doOKAction() {
try {
if (myConfigurable.isModified()) myConfigurable.apply();
@@ -165,6 +174,7 @@ public class SingleConfigurableEditor extends DialogWrapper {
myPerformAction = true;
if (myConfigurable.isModified()) {
myConfigurable.apply();
myChangesWereApplied = true;
setCancelButtonText(CommonBundle.getCloseButtonText());
}
}