]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java
1. Fix EDKT281 there are too many values in the list of Hob's Guid C Name. only the...
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / workspace / WorkspaceTools.java
index 9c62ecde672525867f78af1ae0efdc5b11222f09..4e40d59efc16f54fd5d0db2018ae14ba5be93434 100644 (file)
@@ -416,12 +416,24 @@ public class WorkspaceTools {
      \r
      @return Vector\r
      **/\r
-    public Vector<String> getAllGuidDeclarationsFromPackage(PackageSurfaceArea spd) {\r
+    public Vector<String> getAllGuidDeclarationsFromPackage(PackageSurfaceArea spd, String type) {\r
         Vector<String> vector = new Vector<String>();\r
+        boolean isFound = false;\r
         if (spd.getGuidDeclarations() != null) {\r
             if (spd.getGuidDeclarations().getEntryList().size() > 0) {\r
                 for (int index = 0; index < spd.getGuidDeclarations().getEntryList().size(); index++) {\r
-                    vector.addElement(spd.getGuidDeclarations().getEntryList().get(index).getCName());\r
+                    Vector<String> vArch = Tools.convertListToVector(spd.getGuidDeclarations().getEntryList()\r
+                                                                        .get(index).getGuidTypeList());\r
+                    for (int indexOfArch = 0; indexOfArch < vArch.size(); indexOfArch++) {\r
+                        if (vArch.get(indexOfArch).equals(type)) {\r
+                            isFound = true;\r
+                            break;\r
+                        }\r
+                    }\r
+                    if ((isFound) || (vArch == null) || (vArch.size() < 1)) {\r
+                        vector.addElement(spd.getGuidDeclarations().getEntryList().get(index).getCName());\r
+                        isFound = false;\r
+                    }\r
                 }\r
             }\r
         }\r
@@ -467,12 +479,13 @@ public class WorkspaceTools {
         Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\r
     }\r
-    \r
+\r
     public Vector<String> getAllLibraryClassDefinitionsFromPackages(Vector<PackageIdentification> vpid) {\r
         Vector<String> vector = new Vector<String>();\r
         for (int index = 0; index < vpid.size(); index++) {\r
             Vector<String> v = getAllLibraryClassDefinitionsFromPackage(GlobalData.openingPackageList\r
-                                                                                                     .getPackageSurfaceAreaFromId(vpid.get(index)));\r
+                                                                                                     .getPackageSurfaceAreaFromId(vpid\r
+                                                                                                                                      .get(index)));\r
             if (v != null && v.size() > 0) {\r
                 vector.addAll(v);\r
             }\r
@@ -538,12 +551,14 @@ public class WorkspaceTools {
         return vector;\r
     }\r
 \r
-    public Vector<String> getAllGuidDeclarationsFromWorkspace() {\r
+    public Vector<String> getAllGuidDeclarationsFromWorkspace(String type) {\r
         Vector<String> vector = new Vector<String>();\r
         for (int index = 0; index < GlobalData.vPackageList.size(); index++) {\r
-            Vector<String> v = getAllGuidDeclarationsFromPackage(GlobalData.openingPackageList\r
+            Vector<String> v = getAllGuidDeclarationsFromPackage(\r
+                                                                 GlobalData.openingPackageList\r
                                                                                               .getPackageSurfaceAreaFromId(GlobalData.vPackageList\r
-                                                                                                                                                  .get(index)));\r
+                                                                                                                                                  .get(index)),\r
+                                                                 type);\r
             if (v != null && v.size() > 0) {\r
                 vector.addAll(v);\r
             }\r
@@ -553,12 +568,14 @@ public class WorkspaceTools {
         return vector;\r
     }\r
 \r
-    public Vector<String> getAllGuidDeclarationsFromPackages(Vector<PackageIdentification> vpid) {\r
+    public Vector<String> getAllGuidDeclarationsFromPackages(Vector<PackageIdentification> vpid, String type) {\r
         Vector<String> vector = new Vector<String>();\r
         for (int index = 0; index < vpid.size(); index++) {\r
-            Vector<String> v = getAllGuidDeclarationsFromPackage(GlobalData.openingPackageList\r
+            Vector<String> v = getAllGuidDeclarationsFromPackage(\r
+                                                                 GlobalData.openingPackageList\r
                                                                                               .getPackageSurfaceAreaFromId(vpid\r
-                                                                                                                               .get(index)));\r
+                                                                                                                               .get(index)),\r
+                                                                 type);\r
             if (v != null && v.size() > 0) {\r
                 vector.addAll(v);\r
             }\r
@@ -804,4 +821,27 @@ public class WorkspaceTools {
         }\r
         return vpid;\r
     }\r
+\r
+    public Vector<String> getAllModuleGuidXref() {\r
+        Vector<String> v = new Vector<String>();\r
+        for (int index = 0; index < GlobalData.openingModuleList.size(); index++) {\r
+            ModuleIdentification id = GlobalData.openingModuleList.getOpeningModuleByIndex(index).getId();\r
+            v.addElement(id.getGuid() + " " + id.getName());\r
+        }\r
+        return v;\r
+    }\r
+\r
+    public Vector<String> getModuleArch(ModuleIdentification id) {\r
+        Vector<String> v = new Vector<String>();\r
+        ModuleSurfaceArea msa = null;\r
+        if (id != null) {\r
+            msa = GlobalData.openingModuleList.getModuleSurfaceAreaFromId(id);\r
+        }\r
+        if (msa != null) {\r
+            if (msa.getModuleDefinitions() != null) {\r
+                v = Tools.convertListToVector(msa.getModuleDefinitions().getSupportedArchitectures());\r
+            }\r
+        }\r
+        return v;\r
+    }\r
 }\r