Utilize multi-thread support of JAVA to improve UI response time of opening Framework...
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 20 Mar 2007 03:02:13 +0000 (03:02 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 20 Mar 2007 03:02:13 +0000 (03:02 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2488 6f19259b-4bc3-4df7-8a09-765794883524

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

index e219ee3..902c12a 100644 (file)
@@ -836,6 +836,24 @@ public class FpdFrameworkModules extends IInternalFrame {
         new FpdFrameworkModules().setVisible(true);\r
     }\r
 \r
+    private class PcdSyncTask extends Thread {\r
+        \r
+        public void run () {\r
+            Vector<String> vExceptions = new Vector<String>();\r
+            if (pcdSync(vExceptions)) {\r
+                JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "PCD in this platform are synchronized with those in MSA files.");    \r
+                docConsole.setSaved(false);\r
+            }\r
+            if (vExceptions.size() > 0) {\r
+                String errorMsg = "";\r
+                for (int i = 0; i < vExceptions.size(); ++i) {\r
+                    errorMsg += " " + vExceptions.get(i) + "\n";\r
+                }\r
+                JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "Error occurred during synchronization:\n" + errorMsg);\r
+            }\r
+        }\r
+    }\r
+\r
     /**\r
      * This is the default constructor\r
      */\r
@@ -850,21 +868,14 @@ public class FpdFrameworkModules extends IInternalFrame {
 \r
     }\r
 \r
+    private PcdSyncTask pst = null;\r
     public FpdFrameworkModules(OpeningPlatformType opt) {\r
         this(opt.getXmlFpd());\r
         docConsole = opt;\r
-        Vector<String> vExceptions = new Vector<String>();\r
-        if (pcdSync(vExceptions)) {\r
-            JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "PCD in this platform are synchronized with those in MSA files.");    \r
-            docConsole.setSaved(false);\r
-        }\r
-        if (vExceptions.size() > 0) {\r
-            String errorMsg = "";\r
-            for (int i = 0; i < vExceptions.size(); ++i) {\r
-                errorMsg += " " + vExceptions.get(i) + "\n";\r
-            }\r
-            JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "Error occurred during synchronization:\n" + errorMsg);\r
+        if (pst == null) {\r
+            pst = new PcdSyncTask();\r
         }\r
+        pst.start();\r
     }\r
 \r
     private void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {\r