]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBuildOptions.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 / ModuleBuildOptions.java
index 076f820ae8e44b1f56d6b134b9990c23f0f7c1af..993d1b9dcbc3786c994bb83ec82772f23a05f8d8 100644 (file)
@@ -93,6 +93,8 @@ public class ModuleBuildOptions extends IInternalFrame {
     private IDefaultTableModel model = null;\r
 \r
     private int selectedRow = -1;\r
+    \r
+    private IFrame parentFrame = null;\r
 \r
     /**\r
      This method initializes jButtonAdd \r
@@ -187,7 +189,7 @@ public class ModuleBuildOptions extends IInternalFrame {
 \r
             model.addColumn("Option String Value");\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
@@ -265,10 +267,11 @@ public class ModuleBuildOptions extends IInternalFrame {
      @param inBuildOptions The input BuildOptionsDocument.BuildOptions\r
      \r
      **/\r
-    public ModuleBuildOptions(OpeningModuleType inOmt) {\r
+    public ModuleBuildOptions(OpeningModuleType inOmt, IFrame iFrame) {\r
         super();\r
         this.omt = inOmt;\r
         this.msa = omt.getXmlMsa();\r
+        this.parentFrame = iFrame;\r
         init(msa.getModuleBuildOptions());\r
         this.setVisible(true);\r
     }\r
@@ -294,7 +297,7 @@ public class ModuleBuildOptions extends IInternalFrame {
     }\r
 \r
     private void showEdit(int index) {\r
-        BuildOptionsDlg dlg = new BuildOptionsDlg(vid.getBuildOptions(index), new IFrame(), omt.getId());\r
+        BuildOptionsDlg dlg = new BuildOptionsDlg(vid.getBuildOptions(index), this.parentFrame, omt.getId());\r
         int result = dlg.showDialog();\r
         if (result == DataType.RETURN_TYPE_OK) {\r
             if (index == -1) {\r
@@ -361,9 +364,14 @@ public class ModuleBuildOptions extends IInternalFrame {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vid.removeBuildOptions(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.vid.removeBuildOptions(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r