You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by ni...@apache.org on 2001/06/25 00:35:43 UTC
cvs commit: jakarta-ant-antidote/src/java/org/apache/tools/ant/gui/core ProjectManager.java
nickdavis 01/06/24 15:35:43
Modified: src/java/org/apache/tools/ant/gui/core ProjectManager.java
Log:
fix for : closing a new project and selecting save when prompted does
not allow you to save the project.
Revision Changes Path
1.4 +12 -2 jakarta-ant-antidote/src/java/org/apache/tools/ant/gui/core/ProjectManager.java
Index: ProjectManager.java
===================================================================
RCS file: /home/cvs/jakarta-ant-antidote/src/java/org/apache/tools/ant/gui/core/ProjectManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ProjectManager.java 2001/06/04 18:52:47 1.3
+++ ProjectManager.java 2001/06/24 22:35:42 1.4
@@ -63,6 +63,8 @@
import org.apache.tools.ant.gui.acs.ACSProjectElement;
import org.apache.tools.ant.gui.acs.ACSTargetElement;
+import org.apache.tools.ant.gui.command.SaveCmd;
+
import org.apache.tools.ant.gui.event.BuildEventType;
import org.apache.tools.ant.gui.event.ProjectSavedEvent;
@@ -91,7 +93,7 @@
*
* XXX need to add property change listeners support.
*
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
* @author Simeon Fitch
*/
public class ProjectManager {
@@ -248,7 +250,15 @@
}
if (select == JOptionPane.YES_OPTION) {
- save(project);
+
+ // Try to save the project
+ SaveCmd cmd = new SaveCmd(_context);
+ cmd.run();
+
+ // If it is still modified, then the save was canceled.
+ if (doc.isModified()) {
+ select = JOptionPane.CANCEL_OPTION;
+ }
}
if (select != JOptionPane.CANCEL_OPTION) {