fix EDKT189.
authorjlin16 <jlin16@de2fecce-e211-0410-80a6-f3fac2684e05>
Wed, 16 Aug 2006 17:37:34 +0000 (17:37 +0000)
committerjlin16 <jlin16@de2fecce-e211-0410-80a6-f3fac2684e05>
Wed, 16 Aug 2006 17:37:34 +0000 (17:37 +0000)
and remove FFS file Guid text field from ModuleSaOptions pane.

git-svn-id: https://edk2.tianocore.org/svn/edk2/trunk@1298 de2fecce-e211-0410-80a6-f3fac2684e05

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

index 0a15d31..ee0a1e6 100644 (file)
@@ -345,13 +345,34 @@ public class FpdFrameworkModules extends IInternalFrame {
 \r
                     ArrayList<String> al = fpdMsa.get(mg + mv + pg + pv);\r
                     if (al == null) {\r
-                        al = new ArrayList<String>();\r
-                        fpdMsa.put(mg + mv + pg + pv, al);\r
+                        //\r
+                        // if existing ModuleSA does not specify version info.\r
+                        //\r
+                        al = fpdMsa.get(mg + "null" + pg + "null");\r
+                        if (al == null) {\r
+                            al = fpdMsa.get(mg + "null" + pg + pv);\r
+                            if (al == null){\r
+                                al = fpdMsa.get(mg + mv + pg + "null");\r
+                                if (al == null) {\r
+                                    al = new ArrayList<String>();\r
+                                    fpdMsa.put(mg + mv + pg + pv, al);    \r
+                                }\r
+                            }\r
+                        }\r
                     }\r
+                    //\r
+                    // filter from module SupArchs what archs has been added.\r
+                    //\r
                     for (int i = 0; i < al.size(); ++i) {\r
                         vArchs.remove(al.get(i));\r
                     }\r
                     //\r
+                    // check whether archs conform to SupArch of platform.\r
+                    //\r
+                    Vector<Object> platformSupArch = new Vector<Object>();\r
+                    ffc.getPlatformDefsSupportedArchs(platformSupArch);\r
+                    vArchs.retainAll(platformSupArch);\r
+                    //\r
                     // Archs this Module supported have already been added.\r
                     //\r
                     if (vArchs.size() == 0) {\r
@@ -574,6 +595,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                     if (arch == null) {\r
                         // if no arch specified in ModuleSA\r
                         fpdMsa.remove(mg + mv + pg + pv);\r
+                        \r
                     } else {\r
                         ArrayList<String> al = fpdMsa.get(mg + mv + pg + pv);\r
                         al.remove(arch);\r
@@ -648,7 +670,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                     row[typeColForFpdModTable] = mi.getModuleType();\r
                     row[pkgNameColForFpdModTable] = mi.getPackage().getName();\r
                     row[pkgVerColForFpdModTable] = mi.getPackage().getVersion();\r
-                    row[archColForFpdModTable] = saa[i][4];\r
+                    row[archColForFpdModTable] = saa[i][ffcModArch];\r
                     try {\r
                         row[pathColForFpdModTable] = GlobalData.getMsaFile(mi).getPath().substring(\r
                                                                                       System.getenv("WORKSPACE")\r
@@ -656,15 +678,18 @@ public class FpdFrameworkModules extends IInternalFrame {
                     } catch (Exception e) {\r
                         JOptionPane.showMessageDialog(frame, "Show FPD Modules:" + e.getMessage());\r
                     }\r
+                    \r
+                    modelFpdModules.addRow(row);\r
+                    String fpdMsaKey = saa[i][ffcModGuid] + row[modVerColForFpdModTable]\r
+                                                                + saa[i][ffcPkgGuid] + row[pkgVerColForFpdModTable];\r
+                    ArrayList<String> al = fpdMsa.get(fpdMsaKey);\r
+                    if (al == null) {\r
+                        al = new ArrayList<String>();\r
+                        fpdMsa.put(fpdMsaKey, al);\r
+                    }\r
+                    al.add(saa[i][ffcModArch]);\r
                 }\r
-                modelFpdModules.addRow(row);\r
-                ArrayList<String> al = fpdMsa.get(saa[i][ffcModGuid] + saa[i][ffcModVer]\r
-                                                  + saa[i][ffcPkgGuid] + saa[i][ffcPkgVer]);\r
-                if (al == null) {\r
-                    al = new ArrayList<String>();\r
-                    fpdMsa.put(saa[i][ffcModGuid] + saa[i][ffcModVer] + saa[i][ffcPkgGuid] + saa[i][ffcPkgVer], al);\r
-                }\r
-                al.add(saa[i][ffcModArch]);\r
+                \r
 \r
             }\r
             TableSorter sorter = (TableSorter)jTableFpdModules.getModel();\r
index 0ab921b..27533b4 100644 (file)
@@ -1086,6 +1086,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             jLabelFfsFileGuid = new JLabel();\r
             jLabelFfsFileGuid.setText("FFS File GUID");\r
             jLabelFfsFileGuid.setPreferredSize(new java.awt.Dimension(90,16));\r
+            jLabelFfsFileGuid.setVisible(false);\r
             jLabelFvBinding = new JLabel();\r
             jLabelFvBinding.setText("FV Binding");\r
             jLabelFvBinding.setPreferredSize(new java.awt.Dimension(90,16));\r
@@ -1145,6 +1146,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         if (jTextFieldFileGuid == null) {\r
             jTextFieldFileGuid = new JTextField();\r
             jTextFieldFileGuid.setPreferredSize(new java.awt.Dimension(300,20));\r
+            jTextFieldFileGuid.setVisible(false);\r
             jTextFieldFileGuid.addFocusListener(new java.awt.event.FocusAdapter() {\r
                 public void focusLost(java.awt.event.FocusEvent e) {\r
                     String originalFileGuid = ffc.getFfsFileNameGuid(moduleKey);\r