Change FrameworkModules selection to next module in platform after remove one module.
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 10 Oct 2006 04:28:15 +0000 (04:28 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 10 Oct 2006 04:28:15 +0000 (04:28 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1700 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java

index b15e5d2..1acb42e 100644 (file)
@@ -358,6 +358,9 @@ public class FpdFileContents {
                 if (!cursor.isText()) {\r
                     break;\r
                 }\r
                 if (!cursor.isText()) {\r
                     break;\r
                 }\r
+                if (cursor.getObject() == null) {\r
+                    break;\r
+                }\r
                 String s = cursor.getTextValue();\r
                 if (s.matches(regExpNewLineAndSpaces)) {\r
                     continue;\r
                 String s = cursor.getTextValue();\r
                 if (s.matches(regExpNewLineAndSpaces)) {\r
                     continue;\r
index 214c56b..2e5bbd7 100644 (file)
@@ -727,7 +727,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                     if (selectedRow < 0) {\r
                         return;\r
                     }\r
                     if (selectedRow < 0) {\r
                         return;\r
                     }\r
-                    \r
+                    int nextSelection = selectedRow;\r
 \r
                     TableSorter sorter = (TableSorter) jTableFpdModules.getModel();\r
                     selectedRow = sorter.getModelRowIndex(selectedRow);\r
 \r
                     TableSorter sorter = (TableSorter) jTableFpdModules.getModel();\r
                     selectedRow = sorter.getModelRowIndex(selectedRow);\r
@@ -761,7 +761,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                         ffc.removeModuleSA(selectedRow);    \r
                     }\r
                     catch (Exception exp) {\r
                         ffc.removeModuleSA(selectedRow);    \r
                     }\r
                     catch (Exception exp) {\r
-                        JOptionPane.showMessageDialog(frame, exp.getCause() + exp.getMessage());\r
+                        JOptionPane.showMessageDialog(frame, exp.getMessage());\r
                         return;\r
                     }\r
                     \r
                         return;\r
                     }\r
                     \r
@@ -780,6 +780,10 @@ public class FpdFrameworkModules extends IInternalFrame {
                     }\r
                     \r
                     modelFpdModules.removeRow(selectedRow);\r
                     }\r
                     \r
                     modelFpdModules.removeRow(selectedRow);\r
+                    if (nextSelection >= jTableFpdModules.getRowCount()) {\r
+                        nextSelection = jTableFpdModules.getRowCount() - 1;\r
+                    }\r
+                    jTableFpdModules.changeSelection(nextSelection, 0, false, false);\r
                     docConsole.setSaved(false);\r
                 }\r
             });\r
                     docConsole.setSaved(false);\r
                 }\r
             });\r
index 6ddf7cc..fcb78f3 100644 (file)
@@ -4,7 +4,6 @@ import java.awt.BorderLayout;
 import java.awt.Dimension;\r
 import java.awt.Toolkit;\r
 \r
 import java.awt.Dimension;\r
 import java.awt.Toolkit;\r
 \r
-import javax.swing.DefaultCellEditor;\r
 import javax.swing.JFrame;\r
 import javax.swing.JOptionPane;\r
 import javax.swing.JPanel;\r
 import javax.swing.JFrame;\r
 import javax.swing.JOptionPane;\r
 import javax.swing.JPanel;\r