summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>2006-10-21 04:05:01 +0000
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>2006-10-21 04:05:01 +0000
commit91621725935f62c2c50be3695f7fee4966f08ab0 (patch)
treefc17404366932b2b52a054bb863b905066eecb85 /Tools
parent92a4a910df99b2151e501b76f311575f2e1ebe9a (diff)
downloadedk2-platforms-91621725935f62c2c50be3695f7fee4966f08ab0.tar.xz
Fix the problem of not sync. module order list in FVs when user change the FvBinding for a ModuleSA.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1808 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools')
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java11
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java34
2 files changed, 40 insertions, 5 deletions
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
index fc49cd4151..bc47248073 100644
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
@@ -1991,7 +1991,16 @@ public class FpdFileContents {
}
public void removeModuleInBuildOptionsUserExtensions (String fvName, String moduleGuid, String moduleVersion, String packageGuid, String packageVersion, String arch) {
- if (getUserExtsIncModCount(fvName) > 0) {
+ //
+ // if there is only one module before remove operation, the whole user extension should be removed.
+ //
+ int moduleAmount = getUserExtsIncModCount(fvName);
+ if (moduleAmount == 1) {
+ removeBuildOptionsUserExtensions(fvName);
+ return;
+ }
+
+ if (moduleAmount > 1) {
XmlCursor cursor = getfpdBuildOpts().newCursor();
QName elementUserExts = new QName (xmlNs, "UserExtensions");
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java
index ac8841c790..5d26337411 100644
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java
@@ -1282,6 +1282,19 @@ public class FpdModuleSA extends JDialog implements ActionListener {
}
return jPanelModuleSaOpts;
}
+
+ private Vector<String> getVectorFromString (String s) {
+ if (s == null || s.equals("null")) {
+ s = "";
+ }
+ String[] sa1 = s.split(" ");
+ Vector<String> v = new Vector<String>();
+ for (int i = 0; i < sa1.length; ++i) {
+ v.add(sa1[i]);
+ }
+ return v;
+ }
+
/**
* This method initializes jTextField
*
@@ -1303,11 +1316,24 @@ public class FpdModuleSA extends JDialog implements ActionListener {
return;
}
- ffc.setFvBinding(moduleKey, newFvBinding);
+ Vector<String> oldFvList = getVectorFromString (originalFvBinding);
+ Vector<String> newFvList = getVectorFromString (newFvBinding);
String moduleInfo[] = moduleKey.split(" ");
- String fvNames[] = newFvBinding.split(" ");
- for (int i = 0; i < fvNames.length; ++i) {
- ffc.addModuleIntoBuildOptionsUserExtensions(fvNames[i], moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]);
+ ffc.setFvBinding(moduleKey, newFvBinding);
+ //
+ // remove module from Fvs that not in newFvList now.
+ //
+ oldFvList.removeAll(newFvList);
+ for (int j = 0; j < oldFvList.size(); ++j) {
+ ffc.removeModuleInBuildOptionsUserExtensions(oldFvList.get(j), moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]);
+ }
+ //
+ // add module to Fvs that were not in oldFvList.
+ //
+ oldFvList = getVectorFromString (originalFvBinding);
+ newFvList.removeAll(oldFvList);
+ for (int i = 0; i < newFvList.size(); ++i) {
+ ffc.addModuleIntoBuildOptionsUserExtensions(newFvList.get(i), moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]);
}
docConsole.setSaved(false);
}