]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java
1. Restructure module description on main UI
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / workspace / WorkspaceTools.java
index a87ab07794cfd53a3b0dbe29e7db5efad65f58f7..e4800816cb6264b9e8ab66d188addc5a4fc6c1c4 100644 (file)
@@ -89,11 +89,11 @@ public class WorkspaceTools {
                 }\r
             }\r
         } catch (IOException e) {\r
-            e.printStackTrace();\r
+\r
         } catch (XmlException e) {\r
-            e.printStackTrace();\r
+\r
         } catch (Exception e) {\r
-            e.printStackTrace();\r
+\r
         }\r
         return modulePath;\r
     }\r
@@ -117,11 +117,11 @@ public class WorkspaceTools {
                }\r
            }\r
        } catch (IOException e) {\r
-           e.printStackTrace();\r
+\r
        } catch (XmlException e) {\r
-           e.printStackTrace();\r
+\r
        } catch (Exception e) {\r
-           e.printStackTrace();\r
+\r
        }\r
        return includePath;\r
    }\r
@@ -147,22 +147,54 @@ public class WorkspaceTools {
                 vPackageList.addElement(new PackageIdentification(id));\r
             } catch (IOException e) {\r
                 Log.err("Open Package Surface Area " + path, e.getMessage());\r
-                e.printStackTrace();\r
+\r
             } catch (XmlException e) {\r
                 Log.err("Open Package Surface Area " + path, e.getMessage());\r
-                e.printStackTrace();\r
+\r
             } catch (Exception e) {\r
                 Log.err("Open Package Surface Area " + path, "Invalid file type");\r
-                e.printStackTrace();\r
+\r
             }\r
         }\r
+        Tools.sortPackages(vPackageList, DataType.SORT_TYPE_ASCENDING);\r
         return vPackageList;\r
     }\r
+    \r
+    /**\r
+     Get all module basic information from a package\r
+    \r
+     @param id Package id\r
+     @return A vector includes all modules' basic information\r
+    \r
+    **/\r
+    public Vector<ModuleIdentification> getAllModules(PackageIdentification pid) {\r
+        Vector<ModuleIdentification> v = new Vector<ModuleIdentification>();\r
+        Vector<String> modulePaths = this.getAllModulesOfPackage(pid.getPath());\r
+        Identification id = null;\r
+        String modulePath = null;\r
+        \r
+        for (int index = 0; index < modulePaths.size(); index++) {\r
+            try {\r
+                modulePath = modulePaths.get(index);\r
+                id = getId(modulePath, OpenFile.openMsaFile(modulePath));\r
+            } catch (IOException e) {\r
+                Log.log("Error when Open Module Surface Area " + modulePath, e.getMessage());\r
+            } catch (XmlException e) {\r
+                Log.log("Error when Open Module Surface Area " + modulePath, e.getMessage());\r
+            } catch (Exception e) {\r
+                Log.log("Error when Open Module Surface Area " + modulePath, "Invalid file type " + e.getMessage());\r
+            }\r
+            v.addElement(new ModuleIdentification(id, pid));\r
+        }\r
+        Tools.sortModules(v, DataType.SORT_TYPE_ASCENDING);\r
+        return v;\r
+        \r
+    }\r
 \r
     /**\r
-     Get all package basic information form the FrameworkDatabase.db file\r
+     Get all module basic information form the FrameworkDatabase.db file\r
      \r
-     @return vPackageList A vector includes all packages' basic information\r
+     @return vModuleList A vector includes all modules' basic information\r
      \r
      */\r
     public Vector<ModuleIdentification> getAllModules() {\r
@@ -190,17 +222,14 @@ public class WorkspaceTools {
                     vModuleList.addElement(new ModuleIdentification(id, vPackageList.elementAt(indexI)));\r
                 } catch (IOException e) {\r
                     Log.err("Open Module Surface Area " + modulePath, e.getMessage());\r
-                    e.printStackTrace();\r
                 } catch (XmlException e) {\r
                     Log.err("Open Module Surface Area " + modulePath, e.getMessage());\r
-                    e.printStackTrace();\r
                 } catch (Exception e) {\r
                     Log.err("Open Module Surface Area " + modulePath, "Invalid file type");\r
-                    e.printStackTrace();\r
                 }\r
             }\r
         }\r
-\r
+        Tools.sortModules(vModuleList, DataType.SORT_TYPE_ASCENDING);\r
         return vModuleList;\r
     }\r
 \r
@@ -225,15 +254,13 @@ public class WorkspaceTools {
                 vPlatformList.addElement(new PlatformIdentification(id));\r
             } catch (IOException e) {\r
                 Log.err("Open Platform Surface Area " + path, e.getMessage());\r
-                e.printStackTrace();\r
             } catch (XmlException e) {\r
                 Log.err("Open Platform Surface Area " + path, e.getMessage());\r
-                e.printStackTrace();\r
             } catch (Exception e) {\r
                 Log.err("Open Platform Surface Area " + path, "Invalid file type");\r
-                e.printStackTrace();\r
             }\r
         }\r
+        Tools.sortPlatforms(vPlatformList, DataType.SORT_TYPE_ASCENDING);\r
         return vPlatformList;\r
     }\r
 \r
@@ -251,6 +278,7 @@ public class WorkspaceTools {
                 }\r
             }\r
         }\r
+        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -268,6 +296,7 @@ public class WorkspaceTools {
                 }\r
             }\r
         }\r
+        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -285,6 +314,7 @@ public class WorkspaceTools {
                 }\r
             }\r
         }\r
+        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -302,6 +332,7 @@ public class WorkspaceTools {
                 }\r
             }\r
         }\r
+        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -319,6 +350,7 @@ public class WorkspaceTools {
                 }\r
             }\r
         }\r
+        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -340,15 +372,13 @@ public class WorkspaceTools {
                 }\r
             } catch (IOException e) {\r
                 // TODO Auto-generated catch block\r
-                e.printStackTrace();\r
             } catch (XmlException e) {\r
                 // TODO Auto-generated catch block\r
-                e.printStackTrace();\r
             } catch (Exception e) {\r
                 // TODO Auto-generated catch block\r
-                e.printStackTrace();\r
             }\r
         }\r
+        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -368,15 +398,13 @@ public class WorkspaceTools {
                 }\r
             } catch (IOException e) {\r
                 // TODO Auto-generated catch block\r
-                e.printStackTrace();\r
             } catch (XmlException e) {\r
                 // TODO Auto-generated catch block\r
-                e.printStackTrace();\r
             } catch (Exception e) {\r
                 // TODO Auto-generated catch block\r
-                e.printStackTrace();\r
             }\r
         }\r
+        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -396,15 +424,13 @@ public class WorkspaceTools {
                 }\r
             } catch (IOException e) {\r
                 // TODO Auto-generated catch block\r
-                e.printStackTrace();\r
             } catch (XmlException e) {\r
                 // TODO Auto-generated catch block\r
-                e.printStackTrace();\r
             } catch (Exception e) {\r
                 // TODO Auto-generated catch block\r
-                e.printStackTrace();\r
             }\r
         }\r
+        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -424,15 +450,13 @@ public class WorkspaceTools {
                 }\r
             } catch (IOException e) {\r
                 // TODO Auto-generated catch block\r
-                e.printStackTrace();\r
             } catch (XmlException e) {\r
                 // TODO Auto-generated catch block\r
-                e.printStackTrace();\r
             } catch (Exception e) {\r
                 // TODO Auto-generated catch block\r
-                e.printStackTrace();\r
             }\r
         }\r
+        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -452,15 +476,13 @@ public class WorkspaceTools {
                 }\r
             } catch (IOException e) {\r
                 // TODO Auto-generated catch block\r
-                e.printStackTrace();\r
             } catch (XmlException e) {\r
                 // TODO Auto-generated catch block\r
-                e.printStackTrace();\r
             } catch (Exception e) {\r
                 // TODO Auto-generated catch block\r
-                e.printStackTrace();\r
             }\r
         }\r
+        Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
 \r
@@ -495,11 +517,11 @@ public class WorkspaceTools {
                         return vPackageList.elementAt(indexI);\r
                     }\r
                 } catch (IOException e) {\r
-                    e.printStackTrace();\r
+\r
                 } catch (XmlException e) {\r
-                    e.printStackTrace();\r
+                \r
                 } catch (Exception e) {\r
-                    e.printStackTrace();\r
+\r
                 }\r
             }\r
         }\r