From: jlin16 Date: Tue, 29 Aug 2006 06:01:11 +0000 (+0000) Subject: Add check before adding msa file to spd file. X-Git-Tag: edk2-stable201903~24474 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=04a13d6c501bd4b70331a11a88d480bb254a3693 Add check before adding msa file to spd file. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1400 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdMsaFiles.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdMsaFiles.java index b4ed73a3a5..efaf0ef53f 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdMsaFiles.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdMsaFiles.java @@ -333,7 +333,6 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{ */ public void actionPerformed(ActionEvent arg0) { - docConsole.setSaved(false); if (arg0.getSource() == jButtonOk) { this.save(); this.dispose(); @@ -350,9 +349,16 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{ JOptionPane.showMessageDialog(this, "Msa File is NOT PathAndFilename type."); return; } + + String dirPrefix = Tools.dirForNewSpd.substring(0, Tools.dirForNewSpd.lastIndexOf(File.separator)); + if (!new File(dirPrefix + File.separator + jTextField.getText()).exists()) { + JOptionPane.showMessageDialog(this, "File NOT Exists in Current Package."); + return; + } model.addRow(row); jTable.changeSelection(model.getRowCount()-1, 0, false, false); sfc.genSpdMsaFiles(row[0], null, null, null); + docConsole.setSaved(false); } // // remove selected line @@ -365,6 +371,7 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{ if (rowSelected >= 0) { model.removeRow(rowSelected); sfc.removeSpdMsaFile(rowSelected); + docConsole.setSaved(false); } } @@ -374,6 +381,7 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{ } model.setRowCount(0); sfc.removeSpdMsaFile(); + docConsole.setSaved(false); } }