add calculation for max. datum size based on pcd default value input by user.
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 16 Oct 2006 09:43:12 +0000 (09:43 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 16 Oct 2006 09:43:12 +0000 (09:43 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1763 6f19259b-4bc3-4df7-8a09-765794883524

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

index b358652e03a398dfe2189db7b23c12f5d25ce5fe..27a52b66cd6e12a3179b3e9f8432b50b790425ae 100644 (file)
@@ -591,9 +591,9 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                         jComboBoxItemType.setSelectedItem(itemType);\r
                         jTextFieldMaxDatumSize.setEnabled(true);\r
                         jTextFieldMaxDatumSize.setVisible(true);\r
-                        jTextFieldMaxDatumSize.setText(jTablePcd.getValueAt(selectedRow, 4)+"");\r
+                        jTextFieldMaxDatumSize.setText(model.getValueAt(selectedRow, 4)+"");\r
                         jTextFieldPcdDefault.setEnabled(true);\r
-                        jTextFieldPcdDefault.setText(jTablePcd.getValueAt(selectedRow, 6)+"");\r
+                        jTextFieldPcdDefault.setText(model.getValueAt(selectedRow, 6)+"");\r
                         if (model.getValueAt(selectedRow, 5).equals("VOID*")) {\r
                             if (pcdInfo[1].equals("FEATURE_FLAG")) {\r
                                 jTextFieldMaxDatumSize.setVisible(false);\r
@@ -601,14 +601,14 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                             else if (pcdInfo[1].equals("FIXED_AT_BUILD")) {\r
                                 try{\r
                                     jTextFieldMaxDatumSize.setEnabled(false);\r
-                                    jTextFieldMaxDatumSize.setText(ffc.setMaxSizeForPointer(jTablePcd.getValueAt(selectedRow, 6)+"")+"");\r
+                                    jTextFieldMaxDatumSize.setText(ffc.setMaxSizeForPointer(model.getValueAt(selectedRow, 6)+"")+"");\r
                                 }\r
                                 catch(Exception except){\r
                                     JOptionPane.showMessageDialog(frame, "Unacceptable PCD Value: " + except.getMessage());\r
                                 }\r
                             }\r
                             else{\r
-                                jTextFieldMaxDatumSize.setText(jTablePcd.getValueAt(selectedRow, 4)+"");\r
+                                jTextFieldMaxDatumSize.setText(model.getValueAt(selectedRow, 4)+"");\r
                             }\r
                         }\r
                         else {\r
@@ -653,6 +653,11 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         }\r
     }\r
     \r
+    /**\r
+     * @param cName\r
+     * @param tsGuid\r
+     * @param sa sa[0]: HelpText; sa[1]: itemType in Msa; sa[2]: isBinary;\r
+     */\r
     private void getPcdInfo(String cName, String tsGuid, String[] sa) {\r
         String[][] saa = new String[ffc.getLibraryInstancesCount(moduleKey)][5];\r
         ffc.getLibraryInstances(moduleKey, saa);\r
@@ -1594,8 +1599,21 @@ private JButton getJButtonUpdatePcd() {
                 String oldItemType = model.getValueAt(row, 2)+"";\r
                 String newItemType = jComboBoxItemType.getSelectedItem()+"";\r
                 model.setValueAt(newItemType, row, 2);\r
-                model.setValueAt(jTextFieldMaxDatumSize.getText(), row, 4);\r
                 model.setValueAt(jTextFieldPcdDefault.isVisible()? jTextFieldPcdDefault.getText():jComboBoxFeatureFlagValue.getSelectedItem(), row, 6);\r
+                \r
+                String[] pcdInfo = {"", "", ""};\r
+                getPcdInfo (model.getValueAt(row, 0)+"", model.getValueAt(row, 1)+"", pcdInfo);\r
+                if (pcdInfo[1].equals("FIXED_AT_BUILD") && model.getValueAt(row, 5).equals("VOID*")) {\r
+                    try {\r
+                        jTextFieldMaxDatumSize.setText(ffc.setMaxSizeForPointer(model.getValueAt(row, 6)+"")+"");\r
+                    }\r
+                    catch (Exception exp) {\r
+                        JOptionPane.showMessageDialog(frame, "PCD Value MalFormed: " + exp.getMessage());\r
+                        return;\r
+                    }\r
+                }\r
+                model.setValueAt(jTextFieldMaxDatumSize.getText(), row, 4);\r
+                \r
                 if (oldItemType.equals("DYNAMIC") && !newItemType.equals("DYNAMIC")) {\r
                     pcdDynamicToNonDynamic(model.getValueAt(row, 0)+"", model.getValueAt(row, 1)+"");\r
                 }\r