diff options
author | jlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-11-20 05:21:41 +0000 |
---|---|---|
committer | jlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-11-20 05:21:41 +0000 |
commit | a883d8c9de0d5bb7da45117afdcb74ab54d8bb21 (patch) | |
tree | c11d3ab7d0fe59a15be4c2bc62bfd77f9a783362 | |
parent | b00c892423d6cbeb90c64c072ad919a64f08b37a (diff) | |
download | edk2-a883d8c9de0d5bb7da45117afdcb74ab54d8bb21.zip edk2-a883d8c9de0d5bb7da45117afdcb74ab54d8bb21.tar.gz edk2-a883d8c9de0d5bb7da45117afdcb74ab54d8bb21.tar.bz2 |
Fix the no library instance in UI display when some exception occurs.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1982 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java | 51 |
1 files changed, 41 insertions, 10 deletions
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java index 2f3dec9..579f561 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java @@ -196,18 +196,24 @@ public class FpdModuleSA extends JDialog implements ActionListener { }
public void initLibraries(String key) {
+ libClassTableModel.setRowCount(0);
+ libInstanceTableModel.setRowCount(0);
+ selectedInstancesTableModel.setRowCount(0);
+ Vector<String> errorMsg = new Vector<String>();
try {
//
// display library classes that need to be resolved. also potential instances for them.
//
- resolveLibraryInstances(moduleKey);
+ resolveLibraryInstances(moduleKey, errorMsg);
} catch (Exception e) {
- JOptionPane.showMessageDialog(frame, e.getCause() + " " + e.getMessage());
+ String exceptionMsg = e.getCause() + " " + e.getMessage();
+ errorMsg.add(exceptionMsg);
+ JOptionPane.showMessageDialog(frame, exceptionMsg);
}
//
// display lib instances already selected for key
//
- selectedInstancesTableModel.setRowCount(0);
+
int instanceCount = ffc.getLibraryInstancesCount(key);
if (instanceCount != 0) {
String[][] saa = new String[instanceCount][5];
@@ -226,15 +232,25 @@ public class FpdModuleSA extends JDialog implements ActionListener { // re-evaluate lib instance usage when adding a already-selected lib instance.
//
try {
- resolveLibraryInstances(saa[i][1] + " " + saa[i][2] + " " + saa[i][3] + " " + saa[i][4]);
+ resolveLibraryInstances(saa[i][1] + " " + saa[i][2] + " " + saa[i][3] + " " + saa[i][4], errorMsg);
} catch (Exception e) {
- JOptionPane.showMessageDialog(frame, e.getCause() + " " + e.getMessage());
+ String exceptionMsg = e.getCause() + " " + e.getMessage();
+ if (!errorMsg.contains(exceptionMsg)) {
+ JOptionPane.showMessageDialog(frame, e.getCause() + " " + e.getMessage());
+ }
}
selectedInstancesTableModel.addRow(saa[i]);
}
}
}
+ if (errorMsg.size() > 0) {
+ String errors = "";
+ for (int i = 0; i < errorMsg.size(); ++i) {
+ errors += " " + errorMsg.get(i) + "\n";
+ }
+ JOptionPane.showMessageDialog(frame, errors);
+ }
showClassToResolved();
}
@@ -326,7 +342,7 @@ public class FpdModuleSA extends JDialog implements ActionListener { }
}
- private void resolveLibraryInstances(String key) throws MultipleInstanceException, NoInstanceException{
+ private void resolveLibraryInstances(String key, Vector<String> errorMsg) throws MultipleInstanceException, NoInstanceException{
ModuleIdentification mi = WorkspaceProfile.getModuleId(key);
PackageIdentification[] depPkgList = null;
@@ -401,7 +417,12 @@ public class FpdModuleSA extends JDialog implements ActionListener { }
ArrayList<String> instances = getInstancesForClass(cls, depPkgList);
if (instances.size() == 0) {
- throw new NoInstanceException (cls.className);
+// throw new NoInstanceException (cls.className);
+ String exceptionMsg = new NoInstanceException (cls.className).getMessage();
+ if (!errorMsg.contains(exceptionMsg)) {
+ errorMsg.add(exceptionMsg);
+ }
+
}
classInstanceMap.put(cls, instances);
@@ -540,7 +561,7 @@ public class FpdModuleSA extends JDialog implements ActionListener { }
private void showClassToResolved(){
- libClassTableModel.setRowCount(0);
+
if (classConsumed == null || classConsumed.size() == 0) {
return;
}
@@ -556,7 +577,7 @@ public class FpdModuleSA extends JDialog implements ActionListener { libClassTableModel.addRow(s);
}
}
- libInstanceTableModel.setRowCount(0);
+
}
private void addLibInstance (ModuleIdentification libMi) throws Exception{
@@ -1175,12 +1196,22 @@ public class FpdModuleSA extends JDialog implements ActionListener { libInstanceTableModel.getValueAt(row, 2), libInstanceTableModel.getValueAt(row, 3),
libInstanceTableModel.getValueAt(row, 4)};
selectedInstancesTableModel.addRow(s);
+
+ Vector<String> errorMsg = new Vector<String>();
try {
- resolveLibraryInstances(instanceValue);
+ resolveLibraryInstances(instanceValue, errorMsg);
}
catch (Exception exp) {
JOptionPane.showMessageDialog(frame, exp.getMessage());
}
+
+ if (errorMsg.size() > 0) {
+ String errors = "";
+ for (int i = 0; i < errorMsg.size(); ++i) {
+ errors += " " + errorMsg.get(i) + "\n";
+ }
+ JOptionPane.showMessageDialog(frame, errors);
+ }
showClassToResolved();
}
});
|