]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Modify the way of pcd warning message reporting to be a total in the end.
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 14 Nov 2006 07:14:04 +0000 (07:14 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 14 Nov 2006 07:14:04 +0000 (07:14 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1948 6f19259b-4bc3-4df7-8a09-765794883524

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

index cca9738a11e68ba3cf75335b8fa86358dbb52642..1c41daf1fec410d55b147f203cf98466e4409911 100644 (file)
@@ -383,7 +383,7 @@ public class FpdFileContents {
         cursor.dispose();\r
     }\r
     \r
-    public boolean adjustPcd (int seqModuleSa) throws Exception {\r
+    public boolean adjustPcd (int seqModuleSa, Vector<String> vExceptions) throws Exception {\r
         boolean dataModified = false;\r
         ModuleSADocument.ModuleSA moduleSa = getModuleSA(seqModuleSa);\r
         int pcdCount = getPcdDataCount(seqModuleSa);\r
@@ -403,6 +403,7 @@ public class FpdFileContents {
         getLibraryInstances(moduleKey, saaLib);\r
         ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);\r
         if (mi == null) {\r
+            vExceptions.add("Module " + mg + " does NOT exist in workspace.");\r
             throw new Exception ("Module does NOT exist in workspace.");\r
         }\r
         Vector<ModuleIdentification> vMi = new Vector<ModuleIdentification>();\r
@@ -413,7 +414,9 @@ public class FpdFileContents {
         for (int j = 0; j < saaLib.length; ++j) {\r
             String libKey = saaLib[j][1] + " " + saaLib[j][2] + " " + saaLib[j][3] + " " + saaLib[j][4];\r
             ModuleIdentification libMi = WorkspaceProfile.getModuleId(libKey);\r
-            vMi.add(libMi);\r
+            if (libMi != null) {\r
+                vMi.add(libMi);\r
+            }\r
         }\r
         \r
     nextPcd:for (int i = 0; i < saaModuleSaPcd.length; ++i) {\r
@@ -458,8 +461,13 @@ public class FpdFileContents {
                         //\r
                         // ToDo Error \r
                         //\r
-                        throw new PcdDeclNotFound("No Declaration for PCD Entry " + msaPcd.getCName() + " in Module "\r
-                                                  + mi.getName());\r
+                        String errorMessage = "No Declaration for PCD Entry " + msaPcd.getCName() + " in Module "\r
+                        + mi.getName();\r
+                        if (i != 0) {\r
+                            errorMessage += " Library Instance " + vMi.get(i).getName(); \r
+                        }\r
+                        vExceptions.add(errorMessage);\r
+                        throw new PcdDeclNotFound(errorMessage);\r
                     }\r
                     //\r
                     // AddItem to ModuleSA PcdBuildDefinitions\r
index 75f7474a02489437221ef6841b70cf54b30405e2..74b84626e5f98e457366a3528e7cdd0b1bcda2a8 100644 (file)
@@ -672,7 +672,8 @@ public class FpdFrameworkModules extends IInternalFrame {
     \r
     private void showSettingsDlg (int row) {\r
         try {\r
-            if (ffc.adjustPcd(row)) {\r
+            Vector<String> vExceptions = new Vector<String>();\r
+            if (ffc.adjustPcd(row, vExceptions)) {\r
                 JOptionPane.showMessageDialog(frame, "Pcd entries sync. with those in MSA files.");\r
                 docConsole.setSaved(false);\r
             }\r
@@ -852,9 +853,17 @@ public class FpdFrameworkModules extends IInternalFrame {
     public FpdFrameworkModules(OpeningPlatformType opt) {\r
         this(opt.getXmlFpd());\r
         docConsole = opt;\r
-        if (pcdSync()) {\r
+        Vector<String> vExceptions = new Vector<String>();\r
+        if (pcdSync(vExceptions)) {\r
             JOptionPane.showMessageDialog(frame, "PCD in this platform are synchronized with those in MSA files.");    \r
         }\r
+        if (vExceptions.size() > 0) {\r
+            String errorMsg = "";\r
+            for (int i = 0; i < vExceptions.size(); ++i) {\r
+                errorMsg += " " + vExceptions.get(i);\r
+            }\r
+            JOptionPane.showMessageDialog(frame, "Error occurred during synchronization:" + errorMsg);\r
+        }\r
     }\r
 \r
     private void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {\r
@@ -916,16 +925,16 @@ public class FpdFrameworkModules extends IInternalFrame {
         \r
     }\r
 \r
-    private boolean pcdSync() {\r
+    private boolean pcdSync(Vector<String> v) {\r
         boolean synced = false;\r
         for (int i = 0; i < jTableFpdModules.getRowCount(); ++i) {\r
             try {\r
-                if (ffc.adjustPcd(i)) {\r
+                if (ffc.adjustPcd(i, v)) {\r
                     synced = true;\r
                 }\r
             }\r
             catch (Exception exp) {\r
-                JOptionPane.showMessageDialog(frame, exp.getMessage());\r
+//                JOptionPane.showMessageDialog(frame, exp.getMessage());\r
                 continue;\r
             }\r
         }\r