Fix the bug of Pcd value update in FrameworkModule settings. remove the curious warning message of pcd type can not be changed.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1942 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jlin16
2006-11-14 03:19:42 +00:00
parent 5ab95f33d1
commit f893f7562b
3 changed files with 16 additions and 11 deletions

View File

@ -313,6 +313,7 @@ public class FpdBuildOptions extends IInternalFrame {
private final int argWidth = 400; private final int argWidth = 400;
private boolean ffsSelection = false; private boolean ffsSelection = false;
private int selectedFfsTableRow = -1;
/** /**
* This method initializes jPanel * This method initializes jPanel
@ -812,6 +813,7 @@ public class FpdBuildOptions extends IInternalFrame {
ffc.getBuildOptionsFfs(row, sArray, lhm, alSections, alSection); ffc.getBuildOptionsFfs(row, sArray, lhm, alSections, alSection);
ffsSelection = true; ffsSelection = true;
jTextFieldEncapType.setText(sArray[1]); jTextFieldEncapType.setText(sArray[1]);
ffsSelection = false;
for (int i = 0; i < alSection.size(); ++i) { for (int i = 0; i < alSection.size(); ++i) {
String[] sectionRow = { alSection.get(i) }; String[] sectionRow = { alSection.get(i) };
sectionTableModel.addRow(sectionRow); sectionTableModel.addRow(sectionRow);
@ -830,6 +832,7 @@ public class FpdBuildOptions extends IInternalFrame {
String[] attribRow = { key, lhm.get(key) }; String[] attribRow = { key, lhm.get(key) };
ffsAttributesTableModel.addRow(attribRow); ffsAttributesTableModel.addRow(attribRow);
} }
selectedFfsTableRow = row;
} }
} }
}); });
@ -995,7 +998,7 @@ public class FpdBuildOptions extends IInternalFrame {
public void insertUpdate(DocumentEvent arg0) { public void insertUpdate(DocumentEvent arg0) {
if (ffsSelection) { if (ffsSelection) {
ffsSelection = false; // ffsSelection = false;
return; return;
} }
if (docConsole != null) { if (docConsole != null) {
@ -1005,7 +1008,7 @@ public class FpdBuildOptions extends IInternalFrame {
public void removeUpdate(DocumentEvent arg0) { public void removeUpdate(DocumentEvent arg0) {
if (ffsSelection) { if (ffsSelection) {
ffsSelection = false; // ffsSelection = false;
return; return;
} }
if (docConsole != null) { if (docConsole != null) {
@ -1021,10 +1024,10 @@ public class FpdBuildOptions extends IInternalFrame {
}); });
jTextFieldEncapType.addFocusListener(new java.awt.event.FocusAdapter() { jTextFieldEncapType.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent e) { public void focusLost(java.awt.event.FocusEvent e) {
if (jTableFfs.getSelectedRow() < 0) { if (selectedFfsTableRow < 0) {
return; return;
} }
ffc.updateBuildOptionsFfsSectionsType(jTableFfs.getSelectedRow(), jTextFieldEncapType.getText()); ffc.updateBuildOptionsFfsSectionsType(selectedFfsTableRow, jTextFieldEncapType.getText());
} }
}); });

View File

@ -121,7 +121,7 @@ public class FpdFvOptions extends JDialog {
*/ */
private void initialize() { private void initialize() {
this.setSize(650, 400); this.setSize(650, 400);
// this.setModal(true); this.setModal(true);
this.setTitle("FV Options"); this.setTitle("FV Options");
this.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); this.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
this.setContentPane(getJContentPane()); this.setContentPane(getJContentPane());

View File

@ -1787,24 +1787,23 @@ private JButton getJButtonUpdatePcd() {
String tsGuid = model.getValueAt(row, 1)+""; String tsGuid = model.getValueAt(row, 1)+"";
String oldItemType = model.getValueAt(row, 2)+""; String oldItemType = model.getValueAt(row, 2)+"";
String newItemType = jComboBoxItemType.getSelectedItem()+""; String newItemType = jComboBoxItemType.getSelectedItem()+"";
String newValue = jTextFieldPcdDefault.isVisible()? jTextFieldPcdDefault.getText():jComboBoxFeatureFlagValue.getSelectedItem()+"";
model.setValueAt(jTextFieldPcdDefault.isVisible()? jTextFieldPcdDefault.getText():jComboBoxFeatureFlagValue.getSelectedItem(), row, 6);
String[] pcdInfo = {"", "", ""}; String[] pcdInfo = {"", "", ""};
Vector<String> validPcdTypes = new Vector<String>(); Vector<String> validPcdTypes = new Vector<String>();
getPcdInfo (moduleKey, cName, tsGuid, pcdInfo, validPcdTypes); getPcdInfo (moduleKey, cName, tsGuid, pcdInfo, validPcdTypes);
if (pcdInfo[1].equals("FIXED_AT_BUILD") && model.getValueAt(row, 5).equals("VOID*")) { if (pcdInfo[1].equals("FIXED_AT_BUILD") && model.getValueAt(row, 5).equals("VOID*")) {
try { try {
jTextFieldMaxDatumSize.setText(ffc.setMaxSizeForPointer(model.getValueAt(row, 6)+"")+""); jTextFieldMaxDatumSize.setText(ffc.setMaxSizeForPointer(newValue)+"");
} }
catch (Exception exp) { catch (Exception exp) {
JOptionPane.showMessageDialog(frame, "PCD Value MalFormed: " + exp.getMessage()); JOptionPane.showMessageDialog(frame, "PCD Value MalFormed: " + exp.getMessage());
return; return;
} }
} }
model.setValueAt(jTextFieldMaxDatumSize.getText(), row, 4); String newMaxDatumSize = jTextFieldMaxDatumSize.getText();
if (newItemType != oldItemType) { if (!newItemType.equals(oldItemType)) {
Vector<ModuleIdentification> moduleInfo = new Vector<ModuleIdentification>(); Vector<ModuleIdentification> moduleInfo = new Vector<ModuleIdentification>();
try { try {
boolean changable = itemTypeCouldBeChanged (cName, tsGuid, newItemType, moduleInfo); boolean changable = itemTypeCouldBeChanged (cName, tsGuid, newItemType, moduleInfo);
@ -1830,8 +1829,11 @@ private JButton getJButtonUpdatePcd() {
model.setValueAt(newItemType, row, 2); model.setValueAt(newItemType, row, 2);
} }
ffc.updatePcdData(moduleKey, cName, tsGuid, model.getValueAt(row, 2)+"", model.getValueAt(row, 4)+"", model.getValueAt(row, 6)+""); ffc.updatePcdData(moduleKey, cName, tsGuid, model.getValueAt(row, 2)+"", newMaxDatumSize, newValue);
docConsole.setSaved(false); docConsole.setSaved(false);
model.setValueAt(newValue, row, 6);
model.setValueAt(newMaxDatumSize, row, 4);
} }
}); });
} }