X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FJava%2FSource%2FFrameworkWizard%2Fsrc%2Forg%2Ftianocore%2Fframeworkwizard%2Fplatform%2Fui%2FFpdModuleSA.java;h=e46a9bbeaff6377fcdf5b3d93b18ee8b7f6f2ef5;hp=f58c09570d4a724b9d4f08ad61eb64f9c879934f;hb=8cc715257a4ff625a9db7c51b051a3c36c194598;hpb=f893f7562bd8ca68f04863bf45f3f5754f281ecf 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 f58c09570d..e46a9bbeaf 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 errorMsg = new Vector(); 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 errorMsg) throws MultipleInstanceException, NoInstanceException{ ModuleIdentification mi = WorkspaceProfile.getModuleId(key); PackageIdentification[] depPkgList = null; @@ -401,7 +417,12 @@ public class FpdModuleSA extends JDialog implements ActionListener { } ArrayList 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); @@ -541,6 +562,7 @@ public class FpdModuleSA extends JDialog implements ActionListener { private void showClassToResolved(){ libClassTableModel.setRowCount(0); + libInstanceTableModel.setRowCount(0); if (classConsumed == null || classConsumed.size() == 0) { return; } @@ -556,7 +578,7 @@ public class FpdModuleSA extends JDialog implements ActionListener { libClassTableModel.addRow(s); } } - libInstanceTableModel.setRowCount(0); + } private void addLibInstance (ModuleIdentification libMi) throws Exception{ @@ -1175,12 +1197,22 @@ public class FpdModuleSA extends JDialog implements ActionListener { libInstanceTableModel.getValueAt(row, 2), libInstanceTableModel.getValueAt(row, 3), libInstanceTableModel.getValueAt(row, 4)}; selectedInstancesTableModel.addRow(s); + + Vector errorMsg = new Vector(); 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(); } }); @@ -1786,8 +1818,21 @@ private JButton getJButtonUpdatePcd() { String cName = model.getValueAt(row, 0)+""; String tsGuid = model.getValueAt(row, 1)+""; String oldItemType = model.getValueAt(row, 2)+""; + String dataType = model.getValueAt(row, 5)+""; String newItemType = jComboBoxItemType.getSelectedItem()+""; String newValue = jTextFieldPcdDefault.isVisible()? jTextFieldPcdDefault.getText():jComboBoxFeatureFlagValue.getSelectedItem()+""; + if (newValue.length() == 0){ + + if (dataType.equals("UINT8") || dataType.equals("UINT16") || dataType.equals("UINT32") || dataType.equals("UINT64")) { + newValue = "0"; + } + if (dataType.equals("BOOLEAN")){ + newValue = "FALSE"; + } + if (dataType.equals("VOID*")) { + newValue = "L\"\""; + } + } String[] pcdInfo = {"", "", ""}; Vector validPcdTypes = new Vector();