Store Variable Name as Hex data array in dynamic pcd build definitions.
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 7 Aug 2006 09:55:27 +0000 (09:55 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 7 Aug 2006 09:55:27 +0000 (09:55 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1205 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java

index 3fd3f9e..416889a 100644 (file)
@@ -3,6 +3,7 @@ package org.tianocore.frameworkwizard.platform.ui;
 import java.awt.BorderLayout;\r
 \r
 import javax.swing.ButtonGroup;\r
+import javax.swing.JOptionPane;\r
 import javax.swing.JPanel;\r
 import javax.swing.JScrollPane;\r
 import javax.swing.JTable;\r
@@ -12,6 +13,8 @@ import javax.swing.event.ListSelectionListener;
 import javax.swing.table.DefaultTableModel;\r
 \r
 import org.tianocore.PlatformSurfaceAreaDocument;\r
+import org.tianocore.frameworkwizard.common.DataValidation;\r
+import org.tianocore.frameworkwizard.common.Tools;\r
 import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;\r
 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;\r
 import javax.swing.JCheckBox;\r
@@ -244,7 +247,10 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
             jRadioButtonHii.setSelected(true);\r
             String[][] saa = new String[ffc.getDynamicPcdSkuInfoCount(i)][7];\r
             ffc.getDynamicPcdSkuInfos(i, saa);\r
-            jTextFieldVarName.setText(saa[0][1]);\r
+            \r
+            String varDisplayName = Tools.convertUnicodeHexStringToString(saa[0][1]);\r
+            jTextFieldVarName.setText(varDisplayName);\r
+            \r
             jTextFieldVarGuid.setText(saa[0][2]);\r
             jTextFieldVarOffset.setText(saa[0][3]);\r
             jTextFieldHiiDefaultValue.setText(saa[0][4]);\r
@@ -274,7 +280,8 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
         \r
         else if (saa[i][1] != null) {\r
             jRadioButtonHii.setSelected(true);\r
-            jTextFieldVarName.setText(saa[i][1]);\r
+            String varDisplayName = Tools.convertUnicodeHexStringToString(saa[i][1]);\r
+            jTextFieldVarName.setText(varDisplayName);\r
             jTextFieldVarGuid.setText(saa[i][2]);\r
             jTextFieldVarOffset.setText(saa[i][3]);\r
             jTextFieldHiiDefaultValue.setText(saa[i][4]);\r
@@ -507,7 +514,7 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
         }\r
         return jButtonSkuInfoUpdate;\r
     }\r
-\r
+    \r
     private void updateSkuInfo (int pcdSelected) {\r
         int skuCount = ffc.getDynamicPcdSkuInfoCount(pcdSelected);\r
         \r
@@ -518,16 +525,40 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
         String value = null;\r
         String vpdOffset = null;\r
         if (jRadioButtonHii.isSelected()) {\r
-            varName = jTextFieldVarName.getText();\r
+            varName = Tools.convertStringToUnicodeHexString(jTextFieldVarName.getText());\r
+            if (varName.length() == 0) {\r
+                JOptionPane.showMessageDialog(this, "Variable Name is Empty.");\r
+                return;\r
+            }\r
             varGuid = jTextFieldVarGuid.getText();\r
+            if (varGuid.length() == 0) {\r
+                JOptionPane.showMessageDialog(this, "Variable GUID is Empty.");\r
+                return;\r
+            }\r
             varOffset = jTextFieldVarOffset.getText();\r
+            if (!DataValidation.isHex64BitDataType(varOffset)) {\r
+                JOptionPane.showMessageDialog(this, "Variable Offset is NOT Hex64BitDataType.");\r
+                return;\r
+            }\r
             hiiDefault = jTextFieldHiiDefaultValue.getText();\r
+            if (!DataValidation.isDefaultValueType(hiiDefault)) {\r
+                JOptionPane.showMessageDialog(this, "Default Value is NOT DefaultValueType.");\r
+                return;\r
+            }\r
         }\r
         if (jRadioButtonVpd.isSelected()) {\r
             vpdOffset = jTextFieldVpdOffset.getText();\r
+            if (!DataValidation.isHex64BitDataType(vpdOffset)) {\r
+                JOptionPane.showMessageDialog(this, "VPD Offset is NOT Hex64BitDataType.");\r
+                return;\r
+            }\r
         }\r
         if (jRadioButtonDefaultValue.isSelected()) {\r
             value = jTextFieldDefaultValue.getText();\r
+            if (!DataValidation.isDefaultValueType(value)) {\r
+                JOptionPane.showMessageDialog(this, "Value is NOT DefaultValueType.");\r
+                return;\r
+            }\r
         }\r
         //\r
         // SKU disabled. only modify data for default SKU.\r
index 56bebc5..d2ef999 100644 (file)
@@ -791,7 +791,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             selectedInstancesTableModel.addColumn("PackageVersion");\r
             jTableSelectedInstances = new JTable(selectedInstancesTableModel);\r
             jTableSelectedInstances.setRowHeight(20);\r
-            jTableSelectedInstances.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);\r
+            jTableSelectedInstances.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);\r
             jTableSelectedInstances.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
             \r
         }\r
@@ -896,7 +896,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             libInstanceTableModel.addColumn("PackageVersion");\r
             jTableLibInstances = new JTable(libInstanceTableModel);\r
             jTableLibInstances.setRowHeight(20);\r
-            jTableLibInstances.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);\r
+            jTableLibInstances.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);\r
             jTableLibInstances.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
             \r
         }\r