]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java
Do not display token number for Pcd in ModuleSA and Dynamic Pcd editors for FPD file.
[mirror_edk2.git] / Tools / Java / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdModuleSA.java
index ac8841c7907ffa893a83895fbb0868f9ae93a033..18cb1603b9c50627297604f5ecb599d3de5ecfac 100644 (file)
@@ -688,6 +688,9 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             model.addColumn("DefaultValue");\r
             \r
             jTablePcd.getColumnModel().getColumn(0).setMinWidth(250);\r
+            \r
+            TableColumn tokenColumn = jTablePcd.getColumnModel().getColumn(3);\r
+            jTablePcd.removeColumn(tokenColumn);\r
                         \r
             jTablePcd.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
             jTablePcd.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\r
@@ -1282,6 +1285,19 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         }\r
         return jPanelModuleSaOpts;\r
     }\r
+    \r
+    private Vector<String> getVectorFromString (String s) {\r
+        if (s == null || s.equals("null")) {\r
+            s = "";\r
+        }\r
+        String[] sa1 = s.split(" ");\r
+        Vector<String> v = new Vector<String>();\r
+        for (int i = 0; i < sa1.length; ++i) {\r
+            v.add(sa1[i]);\r
+        }\r
+        return v;\r
+    }\r
+    \r
     /**\r
      * This method initializes jTextField      \r
      *         \r
@@ -1303,11 +1319,24 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                         return;\r
                     }\r
                     \r
-                    ffc.setFvBinding(moduleKey, newFvBinding);\r
+                    Vector<String> oldFvList = getVectorFromString (originalFvBinding);\r
+                    Vector<String> newFvList = getVectorFromString (newFvBinding);\r
                     String moduleInfo[] = moduleKey.split(" ");\r
-                    String fvNames[] = newFvBinding.split(" ");\r
-                    for (int i = 0; i < fvNames.length; ++i) {\r
-                        ffc.addModuleIntoBuildOptionsUserExtensions(fvNames[i], moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]);\r
+                    ffc.setFvBinding(moduleKey, newFvBinding);\r
+                    //\r
+                    // remove module from Fvs that not in newFvList now.\r
+                    //\r
+                    oldFvList.removeAll(newFvList);\r
+                    for (int j = 0; j < oldFvList.size(); ++j) {\r
+                        ffc.removeModuleInBuildOptionsUserExtensions(oldFvList.get(j), moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]);    \r
+                    }\r
+                    //\r
+                    // add module to Fvs that were not in oldFvList.\r
+                    //\r
+                    oldFvList = getVectorFromString (originalFvBinding);\r
+                    newFvList.removeAll(oldFvList);\r
+                    for (int i = 0; i < newFvList.size(); ++i) {\r
+                        ffc.addModuleIntoBuildOptionsUserExtensions(newFvList.get(i), moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]);\r
                     }\r
                     docConsole.setSaved(false);\r
                 }\r