}\r
\r
public void initLibraries(String key) {\r
+ libClassTableModel.setRowCount(0);\r
+ libInstanceTableModel.setRowCount(0);\r
+ selectedInstancesTableModel.setRowCount(0);\r
+ Vector<String> errorMsg = new Vector<String>();\r
try {\r
//\r
// display library classes that need to be resolved. also potential instances for them.\r
//\r
- resolveLibraryInstances(moduleKey);\r
+ resolveLibraryInstances(moduleKey, errorMsg);\r
} catch (Exception e) {\r
- JOptionPane.showMessageDialog(frame, e.getCause() + " " + e.getMessage());\r
+ String exceptionMsg = e.getCause() + " " + e.getMessage();\r
+ errorMsg.add(exceptionMsg);\r
+ JOptionPane.showMessageDialog(frame, exceptionMsg);\r
}\r
//\r
// display lib instances already selected for key\r
//\r
- selectedInstancesTableModel.setRowCount(0);\r
+ \r
int instanceCount = ffc.getLibraryInstancesCount(key);\r
if (instanceCount != 0) {\r
String[][] saa = new String[instanceCount][5];\r
// re-evaluate lib instance usage when adding a already-selected lib instance.\r
//\r
try {\r
- resolveLibraryInstances(saa[i][1] + " " + saa[i][2] + " " + saa[i][3] + " " + saa[i][4]);\r
+ resolveLibraryInstances(saa[i][1] + " " + saa[i][2] + " " + saa[i][3] + " " + saa[i][4], errorMsg);\r
} catch (Exception e) {\r
- JOptionPane.showMessageDialog(frame, e.getCause() + " " + e.getMessage());\r
+ String exceptionMsg = e.getCause() + " " + e.getMessage();\r
+ if (!errorMsg.contains(exceptionMsg)) {\r
+ JOptionPane.showMessageDialog(frame, e.getCause() + " " + e.getMessage());\r
+ }\r
}\r
selectedInstancesTableModel.addRow(saa[i]);\r
}\r
}\r
}\r
\r
+ if (errorMsg.size() > 0) {\r
+ String errors = "";\r
+ for (int i = 0; i < errorMsg.size(); ++i) {\r
+ errors += " " + errorMsg.get(i) + "\n";\r
+ }\r
+ JOptionPane.showMessageDialog(frame, errors);\r
+ }\r
showClassToResolved();\r
}\r
\r
}\r
}\r
\r
- private void resolveLibraryInstances(String key) throws MultipleInstanceException, NoInstanceException{\r
+ private void resolveLibraryInstances(String key, Vector<String> errorMsg) throws MultipleInstanceException, NoInstanceException{\r
ModuleIdentification mi = WorkspaceProfile.getModuleId(key);\r
PackageIdentification[] depPkgList = null;\r
\r
}\r
ArrayList<String> instances = getInstancesForClass(cls, depPkgList);\r
if (instances.size() == 0) {\r
- throw new NoInstanceException (cls.className);\r
+// throw new NoInstanceException (cls.className);\r
+ String exceptionMsg = new NoInstanceException (cls.className).getMessage();\r
+ if (!errorMsg.contains(exceptionMsg)) {\r
+ errorMsg.add(exceptionMsg); \r
+ }\r
+ \r
}\r
classInstanceMap.put(cls, instances);\r
\r
\r
private void showClassToResolved(){\r
libClassTableModel.setRowCount(0);\r
+ libInstanceTableModel.setRowCount(0);\r
if (classConsumed == null || classConsumed.size() == 0) {\r
return;\r
}\r
libClassTableModel.addRow(s);\r
}\r
}\r
- libInstanceTableModel.setRowCount(0);\r
+ \r
}\r
\r
private void addLibInstance (ModuleIdentification libMi) throws Exception{\r
libInstanceTableModel.getValueAt(row, 2), libInstanceTableModel.getValueAt(row, 3),\r
libInstanceTableModel.getValueAt(row, 4)};\r
selectedInstancesTableModel.addRow(s);\r
+ \r
+ Vector<String> errorMsg = new Vector<String>();\r
try {\r
- resolveLibraryInstances(instanceValue);\r
+ resolveLibraryInstances(instanceValue, errorMsg);\r
}\r
catch (Exception exp) {\r
JOptionPane.showMessageDialog(frame, exp.getMessage());\r
}\r
+ \r
+ if (errorMsg.size() > 0) {\r
+ String errors = "";\r
+ for (int i = 0; i < errorMsg.size(); ++i) {\r
+ errors += " " + errorMsg.get(i) + "\n";\r
+ }\r
+ JOptionPane.showMessageDialog(frame, errors);\r
+ }\r
showClassToResolved();\r
}\r
});\r
String cName = model.getValueAt(row, 0)+"";\r
String tsGuid = model.getValueAt(row, 1)+"";\r
String oldItemType = model.getValueAt(row, 2)+"";\r
+ String dataType = model.getValueAt(row, 5)+"";\r
String newItemType = jComboBoxItemType.getSelectedItem()+"";\r
String newValue = jTextFieldPcdDefault.isVisible()? jTextFieldPcdDefault.getText():jComboBoxFeatureFlagValue.getSelectedItem()+""; \r
+ if (newValue.length() == 0){\r
+ \r
+ if (dataType.equals("UINT8") || dataType.equals("UINT16") || dataType.equals("UINT32") || dataType.equals("UINT64")) {\r
+ newValue = "0";\r
+ }\r
+ if (dataType.equals("BOOLEAN")){\r
+ newValue = "FALSE";\r
+ }\r
+ if (dataType.equals("VOID*")) {\r
+ newValue = "L\"\"";\r
+ }\r
+ }\r
\r
String[] pcdInfo = {"", "", ""};\r
Vector<String> validPcdTypes = new Vector<String>();\r