]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
1. Fix the problem of adding PCD for different Arch.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdFrameworkModules.java
index 25a39c0a62fe73c4c5cbd3bb3bccdbf8ccb487e2..954d992e1d648c21efd159d939c122cbeaeb481c 100644 (file)
@@ -218,6 +218,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                         return;\r
                     }\r
                     //ToDo put Arch instead of null\r
+                    boolean errorOccurred = false;\r
                     for (int i = 0; i < vArchs.size(); ++i) {\r
                         String arch = vArchs.get(i);\r
                         al.add(arch);\r
@@ -237,12 +238,19 @@ public class FpdFrameworkModules extends IInternalFrame {
                            ffc.addFrameworkModulesPcdBuildDefs(mi, arch, null);\r
                        }\r
                        catch (Exception exception) {\r
-                           JOptionPane.showMessageDialog(frame, "PCD Insertion Fail. " + exception.getMessage());\r
+                           JOptionPane.showMessageDialog(frame, "Adding " + row[0] + " with SupArch " + arch + ": "+ exception.getMessage());\r
+                           errorOccurred = true;\r
                        }\r
                     }\r
                     \r
-                    \r
-                    JOptionPane.showMessageDialog(frame, "This Module with Arch "+ archsAdded +" Added Successfully.");\r
+                    String s = "This Module with Arch "+ archsAdded;\r
+                    if (errorOccurred) {\r
+                        s += " Added with Error. Platform may NOT Be Built."; \r
+                    }\r
+                    else {\r
+                        s += " Added Successfully.";\r
+                    }\r
+                    JOptionPane.showMessageDialog(frame,  s);\r
                     jTableFpdModules.changeSelection(modelFpdModules.getRowCount()-1, 0, false, false);\r
                 }\r
             });\r
@@ -361,7 +369,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                     String pg = sa[2];\r
                     String pv = sa[3];\r
                     String arch = sa[4];\r
-                    ModuleIdentification mi = getModuleId(sa[0] + " " + sa[1] + " " + sa[2] + " " + sa[3] + " " + sa[4]);\r
+                    ModuleIdentification mi = GlobalData.getModuleId(sa[0] + " " + sa[1] + " " + sa[2] + " " + sa[3] + " " + sa[4]);\r
                     mv = mi.getVersion();\r
                     pv = mi.getPackage().getVersion();\r
                     modelFpdModules.removeRow(selectedRow);\r
@@ -434,7 +442,7 @@ public class FpdFrameworkModules extends IInternalFrame {
             String[][] saa = new String[ffc.getFrameworkModulesCount()][5];\r
             ffc.getFrameworkModulesInfo(saa);\r
             for (int i = 0; i < saa.length; ++i) {\r
-                ModuleIdentification mi = getModuleId(saa[i][0]+ " "+saa[i][1]+" "+saa[i][2]+" "+saa[i][3]);\r
+                ModuleIdentification mi = GlobalData.getModuleId(saa[i][0]+ " "+saa[i][1]+" "+saa[i][2]+" "+saa[i][3]);\r
                 String[] row = {"", "", "", "", "", ""};\r
                 if (mi != null) {\r
                     row[0] = mi.getName();\r
@@ -507,43 +515,6 @@ public class FpdFrameworkModules extends IInternalFrame {
         this.setVisible(true);\r
         \r
     }\r
-    \r
-    private ModuleIdentification getModuleId(String key){\r
-        //\r
-        // Get ModuleGuid, ModuleVersion, PackageGuid, PackageVersion, Arch into string array.\r
-        //\r
-        String[] keyPart = key.split(" ");\r
-        Set<PackageIdentification> spi = GlobalData.getPackageList();\r
-        Iterator ispi = spi.iterator();\r
-        \r
-        while(ispi.hasNext()) {\r
-            PackageIdentification pi = (PackageIdentification)ispi.next();\r
-            if ( !pi.getGuid().equalsIgnoreCase(keyPart[2])){ \r
-\r
-                continue;\r
-            }\r
-            if (keyPart[3] != null && keyPart[3].length() > 0 && !keyPart[3].equals("null")){\r
-                if(!pi.getVersion().equals(keyPart[3])){\r
-                    continue;\r
-                }\r
-            }\r
-            Set<ModuleIdentification> smi = GlobalData.getModules(pi);\r
-            Iterator ismi = smi.iterator();\r
-            while(ismi.hasNext()) {\r
-                ModuleIdentification mi = (ModuleIdentification)ismi.next();\r
-                if (mi.getGuid().equalsIgnoreCase(keyPart[0])){\r
-                    if (keyPart[1] != null && keyPart[1].length() > 0 && !keyPart[1].equals("null")){\r
-                        if(!mi.getVersion().equals(keyPart[1])){\r
-                            continue;\r
-                        }\r
-                    }\r
-\r
-                    return mi;\r
-                }\r
-            }\r
-        }\r
-        return null;\r
-    }\r
 \r
 }  //  @jve:decl-index=0:visual-constraint="10,10"\r
 \r