1. Finish Enhancement EDKT345: Support deleting multiple rows together when remove...
authorhche10x <hche10x@de2fecce-e211-0410-80a6-f3fac2684e05>
Wed, 24 Jan 2007 08:20:08 +0000 (08:20 +0000)
committerhche10x <hche10x@de2fecce-e211-0410-80a6-f3fac2684e05>
Wed, 24 Jan 2007 08:20:08 +0000 (08:20 +0000)
git-svn-id: https://edk2.tianocore.org/svn/edk2/trunk@2294 de2fecce-e211-0410-80a6-f3fac2684e05

16 files changed:
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBootModes.java
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBuildOptions.java
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDataHubs.java
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleGuids.java
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHiiPackages.java
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHobs.java
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleLibraryClassDefinitions.java
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePCDs.java
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePackageDependencies.java
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePpis.java
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleProtocols.java
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSystemTables.java
edk2/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleVariables.java

index ce4fa37..aee620d 100644 (file)
@@ -189,7 +189,7 @@ public class ModuleBootModes extends IInternalFrame {
             model.addColumn("Name");\r
             model.addColumn("Usage");\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
@@ -359,9 +359,14 @@ public class ModuleBootModes extends IInternalFrame {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vid.removeBootModes(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.removeBootModes(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r
index 178ae39..993d1b9 100644 (file)
@@ -189,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
@@ -364,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
index 642e21d..b2217f1 100644 (file)
@@ -188,7 +188,7 @@ public class ModuleDataHubs extends IInternalFrame {
             model.addColumn("Data Hub C_Name");\r
             model.addColumn("Usage");\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
@@ -356,9 +356,14 @@ public class ModuleDataHubs extends IInternalFrame {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vid.removeDataHubs(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.removeDataHubs(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r
index dd6bbde..31977b5 100644 (file)
@@ -194,7 +194,7 @@ public class ModuleEvents extends IInternalFrame {
             model.addColumn("Type");\r
             model.addColumn("Usage");\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
@@ -385,9 +385,14 @@ public class ModuleEvents extends IInternalFrame {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vid.removeEvents(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.removeEvents(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r
index 8082632..b1917dd 100644 (file)
@@ -189,7 +189,7 @@ public class ModuleExterns extends IInternalFrame implements ItemListener {
             model.addColumn("Name");\r
             model.addColumn("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
@@ -452,9 +452,14 @@ public class ModuleExterns extends IInternalFrame implements ItemListener {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vid.removeExterns(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.removeExterns(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r
index 4fa02d1..5c9d329 100644 (file)
@@ -185,7 +185,7 @@ public class ModuleGuids extends IInternalFrame {
             model.addColumn("Guid C_Name");\r
             model.addColumn("Usage");\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
@@ -353,9 +353,14 @@ public class ModuleGuids extends IInternalFrame {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vid.removeGuids(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.removeGuids(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r
index 4761257..5914b6a 100644 (file)
@@ -185,7 +185,7 @@ public class ModuleHiiPackages extends IInternalFrame {
             model.addColumn("Hii Package C_Name");\r
             model.addColumn("Usage");\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
@@ -356,9 +356,14 @@ public class ModuleHiiPackages extends IInternalFrame {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vid.removeHiiPackages(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.removeHiiPackages(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r
index e8125b6..465ebee 100644 (file)
@@ -188,7 +188,7 @@ public class ModuleHobs extends IInternalFrame {
             model.addColumn("Type");\r
             model.addColumn("Usage");\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
@@ -359,9 +359,14 @@ public class ModuleHobs extends IInternalFrame {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vid.removeHobs(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.removeHobs(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r
index ce5d86f..0968571 100644 (file)
@@ -183,7 +183,7 @@ public class ModuleLibraryClassDefinitions extends IInternalFrame {
             model.addColumn("Library Class Name");\r
             model.addColumn("Usage");\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
@@ -386,9 +386,14 @@ public class ModuleLibraryClassDefinitions extends IInternalFrame {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vLibraryClass.removeLibraryClass(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.vLibraryClass.removeLibraryClass(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r
index c6a5e8f..a504755 100644 (file)
@@ -190,7 +190,7 @@ public class ModulePCDs extends IInternalFrame {
             model.addColumn("Value");\r
             model.addColumn("Usage");\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
@@ -363,9 +363,14 @@ public class ModulePCDs extends IInternalFrame {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vid.removePcdCoded(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.removePcdCoded(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r
index 21e237e..3077f3d 100644 (file)
@@ -191,7 +191,7 @@ public class ModulePackageDependencies extends IInternalFrame {
             model.addColumn("Package Name");\r
             model.addColumn("Package Version");\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
@@ -365,9 +365,14 @@ public class ModulePackageDependencies extends IInternalFrame {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vid.removePackageDependencies(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.removePackageDependencies(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r
index 504f291..c7a3e42 100644 (file)
@@ -192,7 +192,7 @@ public class ModulePpis extends IInternalFrame {
             model.addColumn("Type");\r
             model.addColumn("Usage");\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
@@ -378,9 +378,14 @@ public class ModulePpis extends IInternalFrame {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vid.removePpis(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.removePpis(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r
index 1d8c933..61c5dd8 100644 (file)
@@ -194,7 +194,7 @@ public class ModuleProtocols extends IInternalFrame {
             model.addColumn("Type");\r
             model.addColumn("Usage");\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
@@ -379,9 +379,14 @@ public class ModuleProtocols extends IInternalFrame {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vid.removeProtocols(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.removeProtocols(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r
index 770a0a0..0d31e10 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
index 29bed2b..8bcb18c 100644 (file)
@@ -187,7 +187,7 @@ public class ModuleSystemTables extends IInternalFrame {
             model.addColumn("Guid C_Name");\r
             model.addColumn("Usage");\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
@@ -356,9 +356,14 @@ public class ModuleSystemTables extends IInternalFrame {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vid.removeSystemTables(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.removeSystemTables(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r
index 7038ee9..29eb4ff 100644 (file)
@@ -187,7 +187,7 @@ public class ModuleVariables extends IInternalFrame {
             model.addColumn("Guid C_Name");\r
             model.addColumn("Usage");\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
@@ -356,9 +356,14 @@ public class ModuleVariables extends IInternalFrame {
             if (jTable.isEditing()) {\r
                 jTable.getCellEditor().stopCellEditing();\r
             }\r
-            if (selectedRow > -1) {\r
-                this.model.removeRow(selectedRow);\r
-                this.vid.removeVariables(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.removeVariables(selectedRows[index]);\r
+                }\r
                 selectedRow = -1;\r
                 this.save();\r
             }\r