Utilize multi-thread support of JAVA to improve UI response time of opening FrameworkModules in a platform.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2488 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -836,6 +836,24 @@ public class FpdFrameworkModules extends IInternalFrame {
|
|||||||
new FpdFrameworkModules().setVisible(true);
|
new FpdFrameworkModules().setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class PcdSyncTask extends Thread {
|
||||||
|
|
||||||
|
public void run () {
|
||||||
|
Vector<String> vExceptions = new Vector<String>();
|
||||||
|
if (pcdSync(vExceptions)) {
|
||||||
|
JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "PCD in this platform are synchronized with those in MSA files.");
|
||||||
|
docConsole.setSaved(false);
|
||||||
|
}
|
||||||
|
if (vExceptions.size() > 0) {
|
||||||
|
String errorMsg = "";
|
||||||
|
for (int i = 0; i < vExceptions.size(); ++i) {
|
||||||
|
errorMsg += " " + vExceptions.get(i) + "\n";
|
||||||
|
}
|
||||||
|
JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "Error occurred during synchronization:\n" + errorMsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the default constructor
|
* This is the default constructor
|
||||||
*/
|
*/
|
||||||
@ -850,21 +868,14 @@ public class FpdFrameworkModules extends IInternalFrame {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private PcdSyncTask pst = null;
|
||||||
public FpdFrameworkModules(OpeningPlatformType opt) {
|
public FpdFrameworkModules(OpeningPlatformType opt) {
|
||||||
this(opt.getXmlFpd());
|
this(opt.getXmlFpd());
|
||||||
docConsole = opt;
|
docConsole = opt;
|
||||||
Vector<String> vExceptions = new Vector<String>();
|
if (pst == null) {
|
||||||
if (pcdSync(vExceptions)) {
|
pst = new PcdSyncTask();
|
||||||
JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "PCD in this platform are synchronized with those in MSA files.");
|
|
||||||
docConsole.setSaved(false);
|
|
||||||
}
|
|
||||||
if (vExceptions.size() > 0) {
|
|
||||||
String errorMsg = "";
|
|
||||||
for (int i = 0; i < vExceptions.size(); ++i) {
|
|
||||||
errorMsg += " " + vExceptions.get(i) + "\n";
|
|
||||||
}
|
|
||||||
JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "Error occurred during synchronization:\n" + errorMsg);
|
|
||||||
}
|
}
|
||||||
|
pst.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
|
private void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
|
||||||
|
Reference in New Issue
Block a user