For encapsulated sections in FFS layout in FpdBuildOptions, if no longer exists sections in an encapsulated section, remove from UI that section to be consistent with contents in FPD file.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1930 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jlin16
2006-11-10 09:13:10 +00:00
parent 9723bdde15
commit d73991a143
3 changed files with 46 additions and 18 deletions

View File

@ -457,14 +457,27 @@ public class FpdBuildOptions extends IInternalFrame {
initFfsTable(); initFfsTable();
this.addInternalFrameListener(new InternalFrameAdapter() { this.addInternalFrameListener(new InternalFrameAdapter() {
public void internalFrameDeactivated(InternalFrameEvent e) { public void internalFrameDeactivated(InternalFrameEvent e) {
if (jTableAntTasks.isEditing()) {
jTableAntTasks.getCellEditor().stopCellEditing();
}
if (jTableOptions.isEditing()) {
jTableOptions.getCellEditor().stopCellEditing();
}
stopEditingInTables ();
}
});
}
private void stopEditingInTables () {
if (jTableFfs.isEditing()) { if (jTableFfs.isEditing()) {
jTableFfs.getCellEditor().stopCellEditing(); jTableFfs.getCellEditor().stopCellEditing();
} }
if (jTableFfsSection.isEditing()) { if (jTableFfsSection.isEditing()) {
jTableFfsSection.getCellEditor().stopCellEditing(); jTableFfsSection.getCellEditor().stopCellEditing();
} }
if (jTableAntTasks.isEditing()) { if (jTableFfsSections.isEditing()) {
jTableAntTasks.getCellEditor().stopCellEditing(); jTableFfsSections.getCellEditor().stopCellEditing();
} }
if (jTableFfsSubSection.isEditing()) { if (jTableFfsSubSection.isEditing()) {
jTableFfsSubSection.getCellEditor().stopCellEditing(); jTableFfsSubSection.getCellEditor().stopCellEditing();
@ -472,11 +485,6 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTableFfsAttribs.isEditing()) { if (jTableFfsAttribs.isEditing()) {
jTableFfsAttribs.getCellEditor().stopCellEditing(); jTableFfsAttribs.getCellEditor().stopCellEditing();
} }
if (jTableOptions.isEditing()) {
jTableOptions.getCellEditor().stopCellEditing();
}
}
});
} }
/** /**
@ -629,6 +637,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTableFfs.getSelectedRow() < 0) { if (jTableFfs.getSelectedRow() < 0) {
return; return;
} }
stopEditingInTables();
docConsole.setSaved(false); docConsole.setSaved(false);
ffc.removeBuildOptionsFfs(jTableFfs.getSelectedRow()); ffc.removeBuildOptionsFfs(jTableFfs.getSelectedRow());
ffsTableModel.removeRow(jTableFfs.getSelectedRow()); ffsTableModel.removeRow(jTableFfs.getSelectedRow());
@ -758,6 +767,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTableFfs.getSelectedRow() < 0) { if (jTableFfs.getSelectedRow() < 0) {
return; return;
} }
stopEditingInTables();
if (jTableFfsAttribs.getSelectedRow() >= 0) { if (jTableFfsAttribs.getSelectedRow() >= 0) {
docConsole.setSaved(false); docConsole.setSaved(false);
ffsAttributesTableModel.removeRow(jTableFfsAttribs.getSelectedRow()); ffsAttributesTableModel.removeRow(jTableFfsAttribs.getSelectedRow());
@ -1067,6 +1077,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTableFfs.getSelectedRow() < 0 || jTableFfsSection.getSelectedRow() < 0) { if (jTableFfs.getSelectedRow() < 0 || jTableFfsSection.getSelectedRow() < 0) {
return; return;
} }
stopEditingInTables();
docConsole.setSaved(false); docConsole.setSaved(false);
sectionTableModel.removeRow(jTableFfsSection.getSelectedRow()); sectionTableModel.removeRow(jTableFfsSection.getSelectedRow());
ffc.removeBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(), ffc.removeBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(),
@ -1116,15 +1127,22 @@ public class FpdBuildOptions extends IInternalFrame {
jButtonFfsSubSectionRemove.setText("Remove"); jButtonFfsSubSectionRemove.setText("Remove");
jButtonFfsSubSectionRemove.addActionListener(new java.awt.event.ActionListener() { jButtonFfsSubSectionRemove.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) { public void actionPerformed(java.awt.event.ActionEvent e) {
if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0 int selectedFfsRow = jTableFfs.getSelectedRow();
|| jTableFfsSubSection.getSelectedRow() < 0) { int selectedSectionsRow = jTableFfsSections.getSelectedRow();
int selectedSubSectionRow = jTableFfsSubSection.getSelectedRow();
if (selectedFfsRow < 0 || selectedSectionsRow < 0
|| selectedSubSectionRow < 0) {
return; return;
} }
stopEditingInTables();
docConsole.setSaved(false); docConsole.setSaved(false);
subsectionsTableModel.removeRow(jTableFfsSubSection.getSelectedRow()); subsectionsTableModel.removeRow(selectedSubSectionRow);
ffc.removeBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(), ffc.removeBuildOptionsFfsSectionsSectionsSection(selectedFfsRow,
jTableFfsSections.getSelectedRow(), selectedSectionsRow,
jTableFfsSubSection.getSelectedRow()); selectedSubSectionRow);
if (subsectionsTableModel.getRowCount() == 0) {
sectionsTableModel.removeRow(selectedSectionsRow);
}
} }
}); });
} }
@ -1172,6 +1190,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0) { if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0) {
return; return;
} }
stopEditingInTables();
docConsole.setSaved(false); docConsole.setSaved(false);
sectionsTableModel.removeRow(jTableFfsSections.getSelectedRow()); sectionsTableModel.removeRow(jTableFfsSections.getSelectedRow());
ffc.removeBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(), ffc.removeBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(),

View File

@ -402,6 +402,9 @@ public class FpdFileContents {
String[][] saaLib = new String[libCount][5]; String[][] saaLib = new String[libCount][5];
getLibraryInstances(moduleKey, saaLib); getLibraryInstances(moduleKey, saaLib);
ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey); ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);
if (mi == null) {
throw new Exception ("Module does NOT exist in workspace.");
}
Vector<ModuleIdentification> vMi = new Vector<ModuleIdentification>(); Vector<ModuleIdentification> vMi = new Vector<ModuleIdentification>();
// //
// create vector for module & library instance MIs. // create vector for module & library instance MIs.
@ -417,6 +420,9 @@ public class FpdFileContents {
for (int j = 0; j < vMi.size(); ++j) { for (int j = 0; j < vMi.size(); ++j) {
ModuleIdentification nextMi = vMi.get(j); ModuleIdentification nextMi = vMi.get(j);
if (nextMi == null) {
continue;
}
if (WorkspaceProfile.pcdInMsa(saaModuleSaPcd[i][0], saaModuleSaPcd[i][1], nextMi)) { if (WorkspaceProfile.pcdInMsa(saaModuleSaPcd[i][0], saaModuleSaPcd[i][1], nextMi)) {
continue nextPcd; continue nextPcd;
} }

View File

@ -160,6 +160,9 @@ public class FpdModuleSA extends JDialog implements ActionListener {
jTabbedPane.setSelectedIndex(0); jTabbedPane.setSelectedIndex(0);
initPcdBuildDefinition(i); initPcdBuildDefinition(i);
ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey); ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);
if (mi == null) {
return;
}
int tabIndex = jTabbedPane.indexOfTab("Libraries"); int tabIndex = jTabbedPane.indexOfTab("Libraries");
if (mi.isLibrary()) { if (mi.isLibrary()) {
jTabbedPane.setEnabledAt(tabIndex, false); jTabbedPane.setEnabledAt(tabIndex, false);