From 5f0b744eaefe84e9c7ee776a091d973c7f35d5bd Mon Sep 17 00:00:00 2001 From: wuyizhong Date: Wed, 8 Nov 2006 08:22:05 +0000 Subject: [PATCH] To fix bug T400. If user select a Repackage=false package during creating a FAR, give warning and a choose to continue or not. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1917 6f19259b-4bc3-4df7-8a09-765794883524 --- .../far/createui/CreateStepTwo.java | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java index feecb7167e..c0a64be53b 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java @@ -22,6 +22,7 @@ import java.util.Vector; import javax.swing.JButton; import javax.swing.JLabel; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; @@ -101,7 +102,7 @@ public class CreateStepTwo extends IDialog implements MouseListener { jComboBoxPackage = new ICheckBoxList(); WorkspaceTools wt = new WorkspaceTools(); Vector v = new Vector(); - packageVector = wt.getAllRepackagablePackages(); + packageVector = wt.getAllPackages(); Iterator iter = packageVector.iterator(); while (iter.hasNext()) { PackageIdentification item = iter.next(); @@ -255,6 +256,32 @@ public class CreateStepTwo extends IDialog implements MouseListener { Log.wrn("Create far", "Choose at least one package and/or platform."); return; } + + // + // If some packages a Repackage=false, give a warning message + // + List selectedPackages = getSelectedPackages(); + WorkspaceTools wt = new WorkspaceTools(); + List allRepackablePackages = wt.getAllRepackagablePackages(); + + List unRepackablePackages = new Vector(); + String msg = "Following selected packages: \n"; + Iterator iter = selectedPackages.iterator(); + while (iter.hasNext()) { + PackageIdentification item = iter.next(); + if (!allRepackablePackages.contains(item)) { + unRepackablePackages.add(item); + msg += item.getName() + "\n"; + } + } + msg += "is un-Repackagable. Do you want to continue? "; + + if (unRepackablePackages.size() > 0) { + if(JOptionPane.showConfirmDialog(null, msg, "Warning", JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION) { + return ; + } + } + if (stepThree == null) { stepThree = new CreateStepThree(this, true, this); }