]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
1.change GlobalData to WorkspaceProfile.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdFrameworkModules.java
index 06d0d0da1942db92e78407a9d39184f11b6362a5..e0c1167925bb07095607dfa49e7527fc0e78d989 100644 (file)
@@ -16,7 +16,7 @@ import javax.swing.table.DefaultTableModel;
 import org.tianocore.PlatformSurfaceAreaDocument;\r
 import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;\r
 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;\r
-import org.tianocore.frameworkwizard.platform.ui.global.GlobalData;\r
+import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;\r
 import org.tianocore.frameworkwizard.platform.ui.id.ModuleIdentification;\r
 import org.tianocore.frameworkwizard.platform.ui.id.PackageIdentification;\r
 \r
@@ -326,7 +326,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                     ModuleIdentification mi = miList.get(selectedRow);\r
                     Vector<String> vArchs = null;\r
                     try {\r
-                        vArchs = GlobalData.getModuleSupArchs(mi);\r
+                        vArchs = WorkspaceProfile.getModuleSupArchs(mi);\r
                     }\r
                     catch (Exception exp) {\r
                         JOptionPane.showMessageDialog(frame, exp.getMessage());\r
@@ -418,7 +418,9 @@ public class FpdFrameworkModules extends IInternalFrame {
                         s += " was added Successfully.";\r
                     }\r
                     JOptionPane.showMessageDialog(frame, s);\r
-                    jTableFpdModules.changeSelection(modelFpdModules.getRowCount() - 1, 0, false, false);\r
+                    TableSorter sorterFpdModules = (TableSorter)jTableFpdModules.getModel();\r
+                    int viewIndex = sorterFpdModules.getModelToView()[modelFpdModules.getRowCount() - 1];\r
+                    jTableFpdModules.changeSelection(viewIndex, 0, false, false);\r
                 }\r
             });\r
         }\r
@@ -591,7 +593,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                     String pg = sa[ffcPkgGuid];\r
                     String pv = sa[ffcPkgVer];\r
                     String arch = sa[ffcModArch];\r
-                    ModuleIdentification mi = GlobalData.getModuleId(mg + " " + mv + " " + pg + " " + pv + " " + arch);\r
+                    ModuleIdentification mi = WorkspaceProfile.getModuleId(mg + " " + mv + " " + pg + " " + pv + " " + arch);\r
                     mv = mi.getVersion();\r
                     pv = mi.getPackage().getVersion();\r
                     modelFpdModules.removeRow(selectedRow);\r
@@ -644,7 +646,7 @@ public class FpdFrameworkModules extends IInternalFrame {
 \r
     private void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {\r
         try {\r
-            GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db", System.getenv("WORKSPACE"));\r
+            WorkspaceProfile.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db", System.getenv("WORKSPACE"));\r
         }\r
         catch(Exception e){\r
             JOptionPane.showMessageDialog(frame, "Error occurred when getting module data.");\r
@@ -663,7 +665,7 @@ 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][ffcModGuid] + " " + saa[i][ffcModVer] + " "\r
+                ModuleIdentification mi = WorkspaceProfile.getModuleId(saa[i][ffcModGuid] + " " + saa[i][ffcModVer] + " "\r
                                                                  + saa[i][ffcPkgGuid] + " " + saa[i][ffcPkgVer]);\r
                 String[] row = { "", "", "", "", "", "", "" };\r
                 if (mi != null) {\r
@@ -674,14 +676,13 @@ public class FpdFrameworkModules extends IInternalFrame {
                     row[pkgVerColForFpdModTable] = mi.getPackage().getVersion();\r
                     row[archColForFpdModTable] = saa[i][ffcModArch];\r
                     try {\r
-                        row[pathColForFpdModTable] = GlobalData.getMsaFile(mi).getPath().substring(\r
+                        row[pathColForFpdModTable] = WorkspaceProfile.getMsaFile(mi).getPath().substring(\r
                                                                                       System.getenv("WORKSPACE")\r
                                                                                             .length() + 1);\r
                     } catch (Exception e) {\r
                         JOptionPane.showMessageDialog(frame, "Show FPD Modules:" + e.getMessage());\r
                     }\r
                     \r
-                    modelFpdModules.addRow(row);\r
                     String fpdMsaKey = saa[i][ffcModGuid] + row[modVerColForFpdModTable]\r
                                                                 + saa[i][ffcPkgGuid] + row[pkgVerColForFpdModTable];\r
                     ArrayList<String> al = fpdMsa.get(fpdMsaKey);\r
@@ -691,7 +692,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                     }\r
                     al.add(saa[i][ffcModArch]);\r
                 }\r
-                \r
+                modelFpdModules.addRow(row);\r
 \r
             }\r
             TableSorter sorter = (TableSorter)jTableFpdModules.getModel();\r
@@ -707,14 +708,14 @@ public class FpdFrameworkModules extends IInternalFrame {
         if (miList == null) {\r
             miList = new ArrayList<ModuleIdentification>();\r
         }\r
-        Set<PackageIdentification> spi = GlobalData.getPackageList();\r
+        Set<PackageIdentification> spi = WorkspaceProfile.getPackageList();\r
         Iterator ispi = spi.iterator();\r
 \r
         while (ispi.hasNext()) {\r
             PackageIdentification pi = (PackageIdentification) ispi.next();\r
             String[] s = { "", "", "", "", "", "" };\r
 \r
-            Set<ModuleIdentification> smi = GlobalData.getModules(pi);\r
+            Set<ModuleIdentification> smi = WorkspaceProfile.getModules(pi);\r
             Iterator ismi = smi.iterator();\r
             while (ismi.hasNext()) {\r
                 ModuleIdentification mi = (ModuleIdentification) ismi.next();\r
@@ -724,7 +725,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                 s[pkgNameColForAllModTable] = pi.getName();\r
                 s[pkgVerColForAllModTable] = pi.getVersion();\r
                 try {\r
-                    s[pathColForAllModTable] = GlobalData.getMsaFile(mi).getPath()\r
+                    s[pathColForAllModTable] = WorkspaceProfile.getMsaFile(mi).getPath()\r
                                             .substring(System.getenv("WORKSPACE").length() + 1);\r
                 } catch (Exception e) {\r
                     JOptionPane.showMessageDialog(frame, "Show All Modules:" + e.getMessage());\r