change table column positions in tables of FrameworkModules and horizontal scrollbar...
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 14 Aug 2006 20:23:11 +0000 (20:23 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 14 Aug 2006 20:23:11 +0000 (20:23 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1259 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/SurfaceAreaQuery.java

index e6a372a36e0b0e76e810949686928bef59efd79c..ad207ff3bad91d6a3e66f09525d64a086734f136 100644 (file)
@@ -80,20 +80,28 @@ public class FpdFrameworkModules extends IInternalFrame {
 \r
     private ArrayList<ModuleIdentification> miList = null;\r
 \r
-    private final int ModNameCol = 0;\r
-\r
-    private final int ModVerCol = 1;\r
-\r
-    private final int PkgNameCol = 2;\r
-\r
-    private final int PkgVerCol = 3;\r
-\r
-    private final int ArchCol = 4;\r
+    private final int ModNameColForAllModTable = 0;\r
+    \r
+    private final int PkgNameColForAllModTable = 1;\r
+    \r
+    private final int PathColForAllModTable = 2;\r
+    \r
+    private final int PkgVerColForAllModTable = 3;\r
+    \r
+    private final int ModVerColForAllModTable = 4;\r
+    \r
+    private final int ModNameColForFpdModTable = 0;\r
+    \r
+    private final int PkgNameColForFpdModTable = 1;\r
+    \r
+    private final int PathColForFpdModTable = 2;\r
+    \r
+    private final int ArchColForFpdModTable = 3;\r
+    \r
+    private final int PkgVerColForFpdModTable = 4;\r
 \r
-    private final int Path4Col = 4;\r
+    private final int ModVerColForFpdModTable = 5;\r
 \r
-    private final int Path5Col = 5;\r
-    \r
     private final int ModNameMinWidth = 168;\r
     \r
     private final int ModNamePrefWidth = 200;\r
@@ -199,31 +207,33 @@ public class FpdFrameworkModules extends IInternalFrame {
             sorter.setTableHeader(jTableAllModules.getTableHeader());\r
             jTableAllModules.setRowHeight(20);\r
             modelAllModules.addColumn("<html>Module<br>Name</html>");\r
-            modelAllModules.addColumn("<html>Module<br>Version</html>");\r
             modelAllModules.addColumn("<html>Package<br>Name</html>");\r
-            modelAllModules.addColumn("<html>Package<br>Version</html>");\r
             modelAllModules.addColumn("Path");\r
+            modelAllModules.addColumn("<html>Package<br>Version</html>");\r
+            modelAllModules.addColumn("<html>Module<br>Version</html>");\r
+            \r
             javax.swing.table.TableColumn column = null;\r
-            column = jTableAllModules.getColumnModel().getColumn(ModNameCol);\r
+            column = jTableAllModules.getColumnModel().getColumn(ModNameColForAllModTable);\r
             column.setPreferredWidth(ModNamePrefWidth);\r
             column.setMinWidth(ModNameMinWidth);\r
-            column = jTableAllModules.getColumnModel().getColumn(ModVerCol);\r
+            column = jTableAllModules.getColumnModel().getColumn(ModVerColForAllModTable);\r
             column.setPreferredWidth(VerPrefWidth);\r
             column.setMaxWidth(VerMaxWidth);\r
             column.setMinWidth(VerMinWidth);\r
-            column = jTableAllModules.getColumnModel().getColumn(PkgNameCol);\r
+            column = jTableAllModules.getColumnModel().getColumn(PkgNameColForAllModTable);\r
             column.setPreferredWidth(PkgNamePrefWidth);\r
             column.setMinWidth(PkgNameMinWidth);\r
             column.setMaxWidth(PkgNameMaxWidth);\r
-            column = jTableAllModules.getColumnModel().getColumn(PkgVerCol);\r
+            column = jTableAllModules.getColumnModel().getColumn(PkgVerColForAllModTable);\r
             column.setPreferredWidth(VerPrefWidth);\r
             column.setMaxWidth(VerMaxWidth);\r
             column.setMinWidth(VerMinWidth);\r
-            column = jTableAllModules.getColumnModel().getColumn(Path4Col);\r
+            column = jTableAllModules.getColumnModel().getColumn(PathColForAllModTable);\r
             column.setPreferredWidth(PathPrefWidth);\r
             column.setMinWidth(PathMinWidth);\r
 \r
             jTableAllModules.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
+                       jTableAllModules.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);\r
         }\r
         return jTableAllModules;\r
     }\r
@@ -263,7 +273,7 @@ public class FpdFrameworkModules extends IInternalFrame {
 \r
                     TableSorter sorter = (TableSorter) jTableAllModules.getModel();\r
                     selectedRow = sorter.modelIndex(selectedRow);\r
-                    String path = modelAllModules.getValueAt(selectedRow, Path4Col) + "";\r
+                    String path = modelAllModules.getValueAt(selectedRow, PathColForAllModTable) + "";\r
                     ModuleIdentification mi = miList.get(selectedRow);\r
                     Vector<String> vArchs = null;\r
                     try {\r
@@ -305,11 +315,15 @@ public class FpdFrameworkModules extends IInternalFrame {
                         String arch = vArchs.get(i);\r
                         al.add(arch);\r
                         archsAdded += arch + " ";\r
-                        String[] row = { "", mv, "", pv, arch, path };\r
+                        String[] row = { "", "", "", "", "", "" };\r
 \r
                         if (mi != null) {\r
-                            row[ModNameCol] = mi.getName();\r
-                            row[PkgNameCol] = mi.getPackage().getName();\r
+                            row[ModNameColForFpdModTable] = mi.getName();\r
+                            row[PkgNameColForFpdModTable] = mi.getPackage().getName();\r
+                            row[PathColForFpdModTable] = path;\r
+                            row[ArchColForFpdModTable] = arch;\r
+                            row[PkgVerColForFpdModTable] = pv;\r
+                            row[ModVerColForFpdModTable] = mv;\r
 \r
                         }\r
                         modelFpdModules.addRow(row);\r
@@ -319,7 +333,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                             //ToDo : specify archs need to add.\r
                             ffc.addFrameworkModulesPcdBuildDefs(mi, arch, null);\r
                         } catch (Exception exception) {\r
-                            JOptionPane.showMessageDialog(frame, "Adding " + row[ModNameCol] + " with SupArch " + arch\r
+                            JOptionPane.showMessageDialog(frame, "Adding " + row[ModNameColForFpdModTable] + " with SupArch " + arch\r
                                                                  + ": " + exception.getMessage());\r
                             errorOccurred = true;\r
                         }\r
@@ -383,36 +397,38 @@ public class FpdFrameworkModules extends IInternalFrame {
             sorter.setTableHeader(jTableFpdModules.getTableHeader());\r
             jTableFpdModules.setRowHeight(20);\r
             modelFpdModules.addColumn("<html>Module<br>Name</html>");\r
-            modelFpdModules.addColumn("<html>Module<br>Version</html>");\r
             modelFpdModules.addColumn("<html>Package<br>Name</html>");\r
-            modelFpdModules.addColumn("<html>Package<br>Version</html>");\r
-            modelFpdModules.addColumn("<html>Supported<br>Architectures</html>");\r
             modelFpdModules.addColumn("Path");\r
+            modelFpdModules.addColumn("<html>Supported<br>Architectures</html>");\r
+            modelFpdModules.addColumn("<html>Package<br>Version</html>");\r
+            modelFpdModules.addColumn("<html>Module<br>Version</html>");\r
+            \r
             javax.swing.table.TableColumn column = null;\r
-            column = jTableFpdModules.getColumnModel().getColumn(ModNameCol);\r
+            column = jTableFpdModules.getColumnModel().getColumn(ModNameColForFpdModTable);\r
             column.setPreferredWidth(ModNamePrefWidth);\r
             column.setMinWidth(ModNameMinWidth);\r
-            column = jTableFpdModules.getColumnModel().getColumn(ModVerCol);\r
+            column = jTableFpdModules.getColumnModel().getColumn(ModVerColForFpdModTable);\r
             column.setPreferredWidth(VerPrefWidth);\r
             column.setMaxWidth(VerMaxWidth);\r
             column.setMinWidth(VerMinWidth);\r
-            column = jTableFpdModules.getColumnModel().getColumn(PkgNameCol);\r
+            column = jTableFpdModules.getColumnModel().getColumn(PkgNameColForFpdModTable);\r
             column.setPreferredWidth(PkgNamePrefWidth);\r
             column.setMinWidth(PkgNameMinWidth);\r
             column.setMaxWidth(PkgNameMaxWidth);\r
-            column = jTableFpdModules.getColumnModel().getColumn(PkgVerCol);\r
+            column = jTableFpdModules.getColumnModel().getColumn(PkgVerColForFpdModTable);\r
             column.setPreferredWidth(VerPrefWidth);\r
             column.setMaxWidth(VerMaxWidth);\r
             column.setMinWidth(VerMinWidth);\r
-            column = jTableFpdModules.getColumnModel().getColumn(ArchCol);\r
+            column = jTableFpdModules.getColumnModel().getColumn(ArchColForFpdModTable);\r
             column.setPreferredWidth(ArchPrefWidth);\r
             column.setMaxWidth(ArchMaxWidth);\r
             column.setMinWidth(ArchMinWidth);\r
-            column = jTableFpdModules.getColumnModel().getColumn(Path5Col);\r
+            column = jTableFpdModules.getColumnModel().getColumn(PathColForFpdModTable);\r
             column.setPreferredWidth(PathPrefWidth);\r
             column.setMinWidth(PathMinWidth);\r
 \r
             jTableFpdModules.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
+                       jTableFpdModules.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);\r
         }\r
         return jTableFpdModules;\r
     }\r
@@ -452,11 +468,11 @@ public class FpdFrameworkModules extends IInternalFrame {
 \r
                     String[] sa = new String[5];\r
                     ffc.getFrameworkModuleInfo(selectedRow, sa);\r
-                    String mg = sa[ModNameCol];\r
-                    String mv = sa[ModVerCol];\r
-                    String pg = sa[PkgNameCol];\r
-                    String pv = sa[PkgVerCol];\r
-                    String arch = sa[ArchCol];\r
+                    String mg = sa[0];\r
+                    String mv = sa[1];\r
+                    String pg = sa[2];\r
+                    String pv = sa[3];\r
+                    String arch = sa[4];\r
                     settingDlg.setKey(mg + " " + mv + " " + pg + " " + pv + " " + arch, selectedRow, docConsole);\r
                     settingDlg.setVisible(true);\r
                 }\r
@@ -487,14 +503,14 @@ public class FpdFrameworkModules extends IInternalFrame {
 \r
                     String[] sa = new String[5];\r
                     ffc.getFrameworkModuleInfo(selectedRow, sa);\r
-                    String mg = sa[ModNameCol];\r
-                    String mv = sa[ModVerCol];\r
-                    String pg = sa[PkgNameCol];\r
-                    String pv = sa[PkgVerCol];\r
-                    String arch = sa[ArchCol];\r
-                    ModuleIdentification mi = GlobalData.getModuleId(sa[ModNameCol] + " " + sa[ModVerCol] + " "\r
-                                                                     + sa[PkgNameCol] + " " + sa[PkgVerCol] + " "\r
-                                                                     + sa[ArchCol]);\r
+                    String mg = sa[0];\r
+                    String mv = sa[1];\r
+                    String pg = sa[2];\r
+                    String pv = sa[3];\r
+                    String arch = sa[4];\r
+                    ModuleIdentification mi = GlobalData.getModuleId(sa[0] + " " + sa[1] + " "\r
+                                                                     + sa[2] + " " + sa[3] + " "\r
+                                                                     + sa[4]);\r
                     mv = mi.getVersion();\r
                     pv = mi.getPackage().getVersion();\r
                     modelFpdModules.removeRow(selectedRow);\r
@@ -565,17 +581,17 @@ public class FpdFrameworkModules extends IInternalFrame {
             String[][] saa = new String[ffc.getFrameworkModulesCount()][5];\r
             ffc.getFrameworkModulesInfo(saa);\r
             for (int i = 0; i < saa.length; ++i) {\r
-                ModuleIdentification mi = GlobalData.getModuleId(saa[i][ModNameCol] + " " + saa[i][ModVerCol] + " "\r
-                                                                 + saa[i][PkgNameCol] + " " + saa[i][PkgVerCol]);\r
+                ModuleIdentification mi = GlobalData.getModuleId(saa[i][0] + " " + saa[i][1] + " "\r
+                                                                 + saa[i][2] + " " + saa[i][3]);\r
                 String[] row = { "", "", "", "", "", "" };\r
                 if (mi != null) {\r
-                    row[ModNameCol] = mi.getName();\r
-                    row[ModVerCol] = mi.getVersion();\r
-                    row[PkgNameCol] = mi.getPackage().getName();\r
-                    row[PkgVerCol] = mi.getPackage().getVersion();\r
-                    row[ArchCol] = saa[i][ArchCol];\r
+                    row[ModNameColForFpdModTable] = mi.getName();\r
+                    row[ModVerColForFpdModTable] = mi.getVersion();\r
+                    row[PkgNameColForFpdModTable] = mi.getPackage().getName();\r
+                    row[PkgVerColForFpdModTable] = mi.getPackage().getVersion();\r
+                    row[ArchColForFpdModTable] = saa[i][4];\r
                     try {\r
-                        row[Path5Col] = GlobalData.getMsaFile(mi).getPath().substring(\r
+                        row[PathColForFpdModTable] = GlobalData.getMsaFile(mi).getPath().substring(\r
                                                                                       System.getenv("WORKSPACE")\r
                                                                                             .length() + 1);\r
                     } catch (Exception e) {\r
@@ -583,13 +599,13 @@ public class FpdFrameworkModules extends IInternalFrame {
                     }\r
                 }\r
                 modelFpdModules.addRow(row);\r
-                ArrayList<String> al = fpdMsa.get(saa[i][ModNameCol] + row[ModVerCol] + saa[i][PkgNameCol]\r
-                                                  + row[PkgVerCol]);\r
+                ArrayList<String> al = fpdMsa.get(saa[i][0] + saa[i][1]\r
+                                                  + saa[i][2] +  saa[i][3]);\r
                 if (al == null) {\r
                     al = new ArrayList<String>();\r
-                    fpdMsa.put(saa[i][ModNameCol] + row[ModVerCol] + saa[i][PkgNameCol] + row[PkgVerCol], al);\r
+                    fpdMsa.put(saa[i][0] + saa[i][1] + saa[i][2] + saa[i][3], al);\r
                 }\r
-                al.add(saa[i][Path4Col]);\r
+                al.add(saa[i][4]);\r
 \r
             }\r
         }\r
@@ -614,12 +630,12 @@ public class FpdFrameworkModules extends IInternalFrame {
             Iterator ismi = smi.iterator();\r
             while (ismi.hasNext()) {\r
                 ModuleIdentification mi = (ModuleIdentification) ismi.next();\r
-                s[ModNameCol] = mi.getName();\r
-                s[ModVerCol] = mi.getVersion();\r
-                s[PkgNameCol] = pi.getName();\r
-                s[PkgVerCol] = pi.getVersion();\r
+                s[ModNameColForAllModTable] = mi.getName();\r
+                s[ModVerColForAllModTable] = mi.getVersion();\r
+                s[PkgNameColForAllModTable] = pi.getName();\r
+                s[PkgVerColForAllModTable] = pi.getVersion();\r
                 try {\r
-                    s[Path4Col] = GlobalData.getMsaFile(mi).getPath()\r
+                    s[PathColForAllModTable] = GlobalData.getMsaFile(mi).getPath()\r
                                             .substring(System.getenv("WORKSPACE").length() + 1);\r
                 } catch (Exception e) {\r
                     JOptionPane.showMessageDialog(frame, "Show All Modules:" + e.getMessage());\r
index a3b08065b3cbf6c621fe8bf2d0455a6234e3e233..11a278326a8f35114d3339233f655a40995f5c05 100644 (file)
@@ -369,13 +369,13 @@ public class SurfaceAreaQuery {
             while(ispi.hasNext()) {\r
                 PackageIdentification pi = ispi.next();\r
                 if (packageVersion != null) {\r
-                    if (pi.getGuid().equals(packageGuid) && pi.getVersion().equals(packageVersion)) {\r
+                    if (pi.getGuid().equalsIgnoreCase(packageGuid) && pi.getVersion().equals(packageVersion)) {\r
                         packageIdList[i] = pi;\r
                         break;\r
                     } \r
                 }\r
                 else {\r
-                    if (pi.getGuid().equals(packageGuid)) {\r
+                    if (pi.getGuid().equalsIgnoreCase(packageGuid)) {\r
                         if (pi.getVersion() != null && pi.getVersion().compareTo(ver) > 0){\r
                             ver = pi.getVersion();\r
                             packageIdList[i] = pi;\r