]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java
1. Finish Enhancement EDKT345: Support deleting multiple rows together when remove...
[mirror_edk2.git] / Tools / Java / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / module / ui / ModuleSourceFiles.java
index 770a0a0f3f93d7b2ace37fa0f794c5dbe63dc201..0d31e1052506ac06b2e27a1aa50522168e31adf3 100644 (file)
@@ -187,7 +187,7 @@ public class ModuleSourceFiles extends IInternalFrame {
             model.addColumn("Tool Code");\r
             model.addColumn("Tool Chain Family");\r
 \r
-            jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
+            jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);\r
             jTable.getSelectionModel().addListSelectionListener(this);\r
             jTable.getModel().addTableModelListener(this);\r
             jTable.addMouseListener(this);\r
@@ -392,9 +392,14 @@ public class ModuleSourceFiles extends IInternalFrame {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vSourceFiles.removeSourceFiles(selectedRow);\r
+            \r
+            int selectedRows[] = this.jTable.getSelectedRows();\r
+            \r
+            if (selectedRows != null) {\r
+                for (int index = selectedRows.length - 1; index > -1; index--) {\r
+                    this.model.removeRow(selectedRows[index]);\r
+                    this.vSourceFiles.removeSourceFiles(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r