jTabbedPane.setSelectedIndex(0);\r
initPcdBuildDefinition(i);\r
ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);\r
+ if (mi == null) {\r
+ return;\r
+ }\r
int tabIndex = jTabbedPane.indexOfTab("Libraries");\r
if (mi.isLibrary()) {\r
jTabbedPane.setEnabledAt(tabIndex, false);\r
}\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
//\r
oldFvList.removeAll(newFvList);\r
for (int j = 0; j < oldFvList.size(); ++j) {\r
- ffc.removeModuleInBuildOptionsUserExtensions(oldFvList.get(j), moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]); \r
+ ffc.removeModuleInBuildOptionsUserExtensions(oldFvList.get(j), "IMAGES", 1, moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]); \r
}\r
//\r
// add module to Fvs that were not in oldFvList.\r
oldFvList = getVectorFromString (originalFvBinding);\r
newFvList.removeAll(oldFvList);\r
for (int i = 0; i < newFvList.size(); ++i) {\r
- ffc.addModuleIntoBuildOptionsUserExtensions(newFvList.get(i), moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]);\r
+ ffc.addModuleIntoBuildOptionsUserExtensions(newFvList.get(i), "IMAGES", 1, moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]);\r
}\r
docConsole.setSaved(false);\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
- model.setValueAt(jTextFieldPcdDefault.isVisible()? jTextFieldPcdDefault.getText():jComboBoxFeatureFlagValue.getSelectedItem(), row, 6);\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
getPcdInfo (moduleKey, cName, tsGuid, pcdInfo, validPcdTypes);\r
if (pcdInfo[1].equals("FIXED_AT_BUILD") && model.getValueAt(row, 5).equals("VOID*")) {\r
try {\r
- jTextFieldMaxDatumSize.setText(ffc.setMaxSizeForPointer(model.getValueAt(row, 6)+"")+"");\r
+ jTextFieldMaxDatumSize.setText(ffc.setMaxSizeForPointer(newValue)+"");\r
}\r
catch (Exception exp) {\r
JOptionPane.showMessageDialog(frame, "PCD Value MalFormed: " + exp.getMessage());\r
return;\r
}\r
}\r
- model.setValueAt(jTextFieldMaxDatumSize.getText(), row, 4);\r
+ String newMaxDatumSize = jTextFieldMaxDatumSize.getText();\r
\r
- if (newItemType != oldItemType) {\r
+ if (!newItemType.equals(oldItemType)) {\r
Vector<ModuleIdentification> moduleInfo = new Vector<ModuleIdentification>();\r
try {\r
boolean changable = itemTypeCouldBeChanged (cName, tsGuid, newItemType, moduleInfo);\r
model.setValueAt(newItemType, row, 2);\r
}\r
\r
- ffc.updatePcdData(moduleKey, cName, tsGuid, model.getValueAt(row, 2)+"", model.getValueAt(row, 4)+"", model.getValueAt(row, 6)+"");\r
+ ffc.updatePcdData(moduleKey, cName, tsGuid, model.getValueAt(row, 2)+"", newMaxDatumSize, newValue);\r
docConsole.setSaved(false);\r
+ model.setValueAt(newValue, row, 6);\r
+ model.setValueAt(newMaxDatumSize, row, 4);\r
+ \r
}\r
});\r
}\r