Add check before adding msa file to spd file.
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 29 Aug 2006 06:01:11 +0000 (06:01 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 29 Aug 2006 06:01:11 +0000 (06:01 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1400 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdMsaFiles.java

index b4ed73a3a55868961c133f373795efcc6c4ed4e2..efaf0ef53fcff072776094b3a0519974a29262c4 100644 (file)
@@ -333,7 +333,6 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
      */\r
     public void actionPerformed(ActionEvent arg0) {\r
         \r
-        docConsole.setSaved(false);\r
         if (arg0.getSource() == jButtonOk) {\r
             this.save();\r
             this.dispose();\r
@@ -350,9 +349,16 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
                 JOptionPane.showMessageDialog(this, "Msa File is NOT PathAndFilename type.");\r
                 return;\r
             }\r
+            \r
+            String dirPrefix = Tools.dirForNewSpd.substring(0, Tools.dirForNewSpd.lastIndexOf(File.separator));\r
+            if (!new File(dirPrefix + File.separator + jTextField.getText()).exists()) {\r
+                JOptionPane.showMessageDialog(this, "File NOT Exists in Current Package.");\r
+                return;\r
+            }\r
             model.addRow(row);\r
             jTable.changeSelection(model.getRowCount()-1, 0, false, false);\r
             sfc.genSpdMsaFiles(row[0], null, null, null);\r
+            docConsole.setSaved(false);\r
         }\r
         //\r
         // remove selected line\r
@@ -365,6 +371,7 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
             if (rowSelected >= 0) {\r
                 model.removeRow(rowSelected);\r
                 sfc.removeSpdMsaFile(rowSelected);\r
+                docConsole.setSaved(false);\r
             }\r
         }\r
 \r
@@ -374,6 +381,7 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
             }\r
             model.setRowCount(0);\r
             sfc.removeSpdMsaFile();\r
+            docConsole.setSaved(false);\r
         }\r
 \r
     }\r