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 / FpdDynamicPcdBuildDefinitions.java
index c846160..2dd39b4 100644 (file)
@@ -11,6 +11,7 @@ import javax.swing.ListSelectionModel;
 import javax.swing.event.ListSelectionEvent;\r
 import javax.swing.event.ListSelectionListener;\r
 import javax.swing.table.DefaultTableModel;\r
+import javax.swing.table.TableColumn;\r
 \r
 import org.tianocore.PlatformSurfaceAreaDocument;\r
 import org.tianocore.frameworkwizard.common.DataValidation;\r
@@ -84,6 +85,7 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
     public void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {\r
         if (ffc == null) {\r
             ffc = new FpdFileContents(fpd);\r
+            ffc.initDynPcdMap();\r
         }\r
         String[][] saa = new String[ffc.getDynamicPcdBuildDataCount()][5];\r
         ffc.getDynamicPcdBuildData(saa);\r
@@ -154,7 +156,8 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
             modelPcd.addColumn("DatumType");\r
             jTableDynPcd = new JTable(modelPcd);\r
             jTableDynPcd.setRowHeight(20);\r
-            \r
+            TableColumn tokenColumn = jTableDynPcd.getColumnModel().getColumn(1);\r
+            jTableDynPcd.removeColumn(tokenColumn);\r
             jTableDynPcd.getColumnModel().getColumn(0).setMinWidth(250);\r
             \r
             jTableDynPcd.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
@@ -556,6 +559,9 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
                 if (jRadioButtonHii.isSelected()) {\r
                     ffc.genDynamicPcdBuildDataSkuInfo("0", varName, varGuid, varOffset, hiiDefault, null, null, pcdSelected);\r
                     ArrayList<String> al = ffc.getDynPcdMapValue(cName + " " + tsGuid);\r
+                    if (al == null) {\r
+                        return;\r
+                    }\r
                     for (int i = 0; i < al.size(); ++i) {\r
                         String mKey = moduleInfo (al.get(i));\r
                         ffc.updatePcdData(mKey, cName, tsGuid, null, null, hiiDefault);\r
@@ -564,6 +570,9 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
                 else if (jRadioButtonVpd.isSelected()){\r
                     ffc.genDynamicPcdBuildDataSkuInfo("0", null, null, null, null, vpdOffset, null, pcdSelected);\r
                     ArrayList<String> al = ffc.getDynPcdMapValue(cName + " " + tsGuid);\r
+                    if (al == null) {\r
+                        return;\r
+                    }\r
                     for (int i = 0; i < al.size(); ++i) {\r
                         String mKey = moduleInfo (al.get(i));\r
                         ffc.updatePcdData(mKey, cName, tsGuid, null, null, vpdOffset);\r
@@ -572,6 +581,9 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
                 else{\r
                     ffc.genDynamicPcdBuildDataSkuInfo("0", null, null, null, null, null, value, pcdSelected);\r
                     ArrayList<String> al = ffc.getDynPcdMapValue(cName + " " + tsGuid);\r
+                    if (al == null) {\r
+                        return;\r
+                    }\r
                     for (int i = 0; i < al.size(); ++i) {\r
                         String mKey = moduleInfo (al.get(i));\r
                         ffc.updatePcdData(mKey, cName, tsGuid, null, null, value);\r