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

View File

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

View File

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