1. Finish Enhancement EDKT345: Support deleting multiple rows together when remove source files in MSA

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2294 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
hche10x 2007-01-24 08:20:08 +00:00
parent 4cb9d58c9b
commit ff7bc6c425
16 changed files with 144 additions and 64 deletions

View File

@ -189,7 +189,7 @@ public class ModuleBootModes extends IInternalFrame {
model.addColumn("Name");
model.addColumn("Usage");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -359,9 +359,14 @@ public class ModuleBootModes extends IInternalFrame {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vid.removeBootModes(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vid.removeBootModes(selectedRows[index]);
}
selectedRow = -1;
this.save();
}

View File

@ -189,7 +189,7 @@ public class ModuleBuildOptions extends IInternalFrame {
model.addColumn("Option String Value");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -364,9 +364,14 @@ public class ModuleBuildOptions extends IInternalFrame {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vid.removeBuildOptions(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vid.removeBuildOptions(selectedRows[index]);
}
selectedRow = -1;
this.save();
}

View File

@ -188,7 +188,7 @@ public class ModuleDataHubs extends IInternalFrame {
model.addColumn("Data Hub C_Name");
model.addColumn("Usage");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -356,9 +356,14 @@ public class ModuleDataHubs extends IInternalFrame {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vid.removeDataHubs(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vid.removeDataHubs(selectedRows[index]);
}
selectedRow = -1;
this.save();
}

View File

@ -194,7 +194,7 @@ public class ModuleEvents extends IInternalFrame {
model.addColumn("Type");
model.addColumn("Usage");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -385,9 +385,14 @@ public class ModuleEvents extends IInternalFrame {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vid.removeEvents(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vid.removeEvents(selectedRows[index]);
}
selectedRow = -1;
this.save();
}

View File

@ -189,7 +189,7 @@ public class ModuleExterns extends IInternalFrame implements ItemListener {
model.addColumn("Name");
model.addColumn("Value");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -452,9 +452,14 @@ public class ModuleExterns extends IInternalFrame implements ItemListener {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vid.removeExterns(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vid.removeExterns(selectedRows[index]);
}
selectedRow = -1;
this.save();
}

View File

@ -185,7 +185,7 @@ public class ModuleGuids extends IInternalFrame {
model.addColumn("Guid C_Name");
model.addColumn("Usage");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -353,9 +353,14 @@ public class ModuleGuids extends IInternalFrame {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vid.removeGuids(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vid.removeGuids(selectedRows[index]);
}
selectedRow = -1;
this.save();
}

View File

@ -185,7 +185,7 @@ public class ModuleHiiPackages extends IInternalFrame {
model.addColumn("Hii Package C_Name");
model.addColumn("Usage");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -356,9 +356,14 @@ public class ModuleHiiPackages extends IInternalFrame {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vid.removeHiiPackages(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vid.removeHiiPackages(selectedRows[index]);
}
selectedRow = -1;
this.save();
}

View File

@ -188,7 +188,7 @@ public class ModuleHobs extends IInternalFrame {
model.addColumn("Type");
model.addColumn("Usage");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -359,9 +359,14 @@ public class ModuleHobs extends IInternalFrame {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vid.removeHobs(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vid.removeHobs(selectedRows[index]);
}
selectedRow = -1;
this.save();
}

View File

@ -183,7 +183,7 @@ public class ModuleLibraryClassDefinitions extends IInternalFrame {
model.addColumn("Library Class Name");
model.addColumn("Usage");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -386,9 +386,14 @@ public class ModuleLibraryClassDefinitions extends IInternalFrame {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vLibraryClass.removeLibraryClass(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vLibraryClass.removeLibraryClass(selectedRows[index]);
}
selectedRow = -1;
this.save();
}

View File

@ -190,7 +190,7 @@ public class ModulePCDs extends IInternalFrame {
model.addColumn("Value");
model.addColumn("Usage");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -363,9 +363,14 @@ public class ModulePCDs extends IInternalFrame {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vid.removePcdCoded(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vid.removePcdCoded(selectedRows[index]);
}
selectedRow = -1;
this.save();
}

View File

@ -191,7 +191,7 @@ public class ModulePackageDependencies extends IInternalFrame {
model.addColumn("Package Name");
model.addColumn("Package Version");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -365,9 +365,14 @@ public class ModulePackageDependencies extends IInternalFrame {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vid.removePackageDependencies(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vid.removePackageDependencies(selectedRows[index]);
}
selectedRow = -1;
this.save();
}

View File

@ -192,7 +192,7 @@ public class ModulePpis extends IInternalFrame {
model.addColumn("Type");
model.addColumn("Usage");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -378,9 +378,14 @@ public class ModulePpis extends IInternalFrame {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vid.removePpis(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vid.removePpis(selectedRows[index]);
}
selectedRow = -1;
this.save();
}

View File

@ -194,7 +194,7 @@ public class ModuleProtocols extends IInternalFrame {
model.addColumn("Type");
model.addColumn("Usage");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -379,9 +379,14 @@ public class ModuleProtocols extends IInternalFrame {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vid.removeProtocols(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vid.removeProtocols(selectedRows[index]);
}
selectedRow = -1;
this.save();
}

View File

@ -187,7 +187,7 @@ public class ModuleSourceFiles extends IInternalFrame {
model.addColumn("Tool Code");
model.addColumn("Tool Chain Family");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -392,9 +392,14 @@ public class ModuleSourceFiles extends IInternalFrame {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vSourceFiles.removeSourceFiles(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vSourceFiles.removeSourceFiles(selectedRows[index]);
}
selectedRow = -1;
this.save();
}

View File

@ -187,7 +187,7 @@ public class ModuleSystemTables extends IInternalFrame {
model.addColumn("Guid C_Name");
model.addColumn("Usage");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -356,9 +356,14 @@ public class ModuleSystemTables extends IInternalFrame {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vid.removeSystemTables(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vid.removeSystemTables(selectedRows[index]);
}
selectedRow = -1;
this.save();
}

View File

@ -187,7 +187,7 @@ public class ModuleVariables extends IInternalFrame {
model.addColumn("Guid C_Name");
model.addColumn("Usage");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
@ -356,9 +356,14 @@ public class ModuleVariables extends IInternalFrame {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vid.removeVariables(selectedRow);
int selectedRows[] = this.jTable.getSelectedRows();
if (selectedRows != null) {
for (int index = selectedRows.length - 1; index > -1; index--) {
this.model.removeRow(selectedRows[index]);
this.vid.removeVariables(selectedRows[index]);
}
selectedRow = -1;
this.save();
}