]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Fix EDKT323 (Only dependent packages' ppis can be added to module's ppi section)
authorhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 22 Sep 2006 08:48:00 +0000 (08:48 +0000)
committerhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 22 Sep 2006 08:48:00 +0000 (08:48 +0000)
2. Fix EDKT324 (Only dependent packages' protocols can be added to module's protocol section.)
3. Fix EDKT325 (Only dependent packages' pcds can be added to module's pcd section.)
4. Fix EDKT326 (Only dependent packages' guids can be added to module's guid section.)
5. Fix EDKT327 (Only dependent packages' library can be added to module's library section.)

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1599 6f19259b-4bc3-4df7-8a09-765794883524

12 files changed:
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleGuids.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleLibraryClassDefinitions.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePCDs.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePpis.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleProtocols.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/LibraryClassDefsDlg.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PCDsDlg.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PpisDlg.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ProtocolsDlg.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java

index dc71bbc1942d95d6d25010fe34338aa5bf62540f..44ccfa1fb1da243bdf81c59ccbbf7de9c50967d9 100644 (file)
@@ -171,6 +171,22 @@ public class OpeningPackageList {
         return null;\r
     }\r
     \r
+    public PackageIdentification getIdByGuidVersion(String guid, String version) {\r
+        for (int index = 0; index < vOpeningPackageList.size(); index++) {\r
+            PackageIdentification id = vOpeningPackageList.elementAt(index).getId();\r
+            if (version != null) {\r
+                if (id.getGuid().equals(guid) && id.getVersion().equals(version)) {\r
+                    return id;\r
+                }\r
+            } else {\r
+                if (id.getGuid().equals(guid)) {\r
+                    return id;\r
+                }\r
+            }\r
+        }\r
+        return null;\r
+    }\r
+    \r
     public void setNew(PackageIdentification id, boolean isNew) {\r
         int index = findIndexOfListById(id);\r
         if (index > -1) {\r
index 3724525a24fa8ae5d6abac893015a015a3462fc4..d55ba0fb392690bf09e8980a973082a356ac853d 100644 (file)
@@ -283,7 +283,7 @@ public class ModuleGuids extends IInternalFrame {
     }\r
 \r
     private void showEdit(int index) {\r
-        GuidsDlg dlg = new GuidsDlg(vid.getGuids(index), new IFrame());\r
+        GuidsDlg dlg = new GuidsDlg(vid.getGuids(index), new IFrame(), omt.getId());\r
         int result = dlg.showDialog();\r
         if (result == DataType.RETURN_TYPE_OK) {\r
             if (index == -1) {\r
index 1decd0fa32b87e8bed4a98f885f84a3da9b4f7e7..25d64514cd1c34423c0324e300a8aff63ebf67b7 100644 (file)
@@ -340,7 +340,7 @@ public class ModuleLibraryClassDefinitions extends IInternalFrame {
     }\r
 \r
     private void showEdit(int index) {\r
-        LibraryClassDefsDlg mcdd = new LibraryClassDefsDlg(vLibraryClass.getLibraryClass(index), new IFrame());\r
+        LibraryClassDefsDlg mcdd = new LibraryClassDefsDlg(vLibraryClass.getLibraryClass(index), new IFrame(), omt.getId());\r
         int result = mcdd.showDialog();\r
         if (result == DataType.RETURN_TYPE_OK) {\r
             if (index == -1) {\r
index 3531399a42902aa1a78ba3f975b1e2b1ca82f144..0c3b2fd6603ae9a826e6dc70424023595c0bd97c 100644 (file)
@@ -293,7 +293,7 @@ public class ModulePCDs extends IInternalFrame {
     }\r
 \r
     private void showEdit(int index) {\r
-        PCDsDlg dlg = new PCDsDlg(vid.getPcdCoded(index), new IFrame());\r
+        PCDsDlg dlg = new PCDsDlg(vid.getPcdCoded(index), new IFrame(), omt.getId());\r
         int result = dlg.showDialog();\r
         if (result == DataType.RETURN_TYPE_OK) {\r
             if (index == -1) {\r
index 793bf849372073d248d51da51ee3ec89c873ec27..ce817642eff7cc3ca4b3028188a4770be67e46ac 100644 (file)
@@ -308,7 +308,7 @@ public class ModulePpis extends IInternalFrame {
     }\r
 \r
     private void showEdit(int index) {\r
-        PpisDlg dlg = new PpisDlg(vid.getPpis(index), new IFrame());\r
+        PpisDlg dlg = new PpisDlg(vid.getPpis(index), new IFrame(), omt.getId());\r
         int result = dlg.showDialog();\r
         if (result == DataType.RETURN_TYPE_OK) {\r
             if (index == -1) {\r
index bf728a563378b3f200bed129726649d87f9ff14a..b0cdc1233066e8d7d14a05b626d60f501327ae07 100644 (file)
@@ -309,7 +309,7 @@ public class ModuleProtocols extends IInternalFrame {
     }\r
 \r
     private void showEdit(int index) {\r
-        ProtocolsDlg dlg = new ProtocolsDlg(vid.getProtocols(index), new IFrame());\r
+        ProtocolsDlg dlg = new ProtocolsDlg(vid.getProtocols(index), new IFrame(), omt.getId());\r
         int result = dlg.showDialog();\r
         if (result == DataType.RETURN_TYPE_OK) {\r
             if (index == -1) {\r
index 05f2703406e0f156559ed938cf729f2e04eedea5..4c6e2a7088f6c8c5165bad143902a174dc078c77 100644 (file)
@@ -33,7 +33,9 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
 import org.tianocore.frameworkwizard.common.ui.IDialog;\r
 import org.tianocore.frameworkwizard.common.ui.IFrame;\r
 import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
 import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
 import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
 \r
 /**\r
@@ -255,9 +257,17 @@ public class GuidsDlg extends IDialog {
      * @param inGuidsId\r
      * \r
      */\r
-    private void init(GuidsIdentification inGuidsId) {\r
+    private void init(GuidsIdentification inGuidsId, ModuleIdentification mid) {\r
         init();\r
         this.id = inGuidsId;\r
+        \r
+        Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+        if (vpid.size() <= 0) {\r
+            Log.wrn("Init Guid", "This module hasn't defined any package dependency, so there is no guid can be added");\r
+        }\r
+\r
+        Tools.generateComboBoxByVector(this.jComboBoxCName,\r
+                                       wt.getAllGuidDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));\r
 \r
         if (this.id != null) {\r
             this.jComboBoxCName.setSelectedItem(id.getName());\r
@@ -275,9 +285,9 @@ public class GuidsDlg extends IDialog {
      * @param iFrame\r
      * \r
      */\r
-    public GuidsDlg(GuidsIdentification inGuidsIdentification, IFrame iFrame) {\r
+    public GuidsDlg(GuidsIdentification inGuidsIdentification, IFrame iFrame, ModuleIdentification mid) {\r
         super(iFrame, true);\r
-        init(inGuidsIdentification);\r
+        init(inGuidsIdentification, mid);\r
     }\r
 \r
     /**\r
@@ -356,7 +366,6 @@ public class GuidsDlg extends IDialog {
      * \r
      */\r
     private void initFrame() {\r
-        Tools.generateComboBoxByVector(jComboBoxCName, wt.getAllGuidDeclarationsFromWorkspace());\r
         Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVGuidUsage());\r
     }\r
 \r
@@ -398,6 +407,11 @@ public class GuidsDlg extends IDialog {
         //\r
         // Check Name\r
         //\r
+        if (this.jComboBoxCName.getSelectedItem() == null) {\r
+            Log.wrn("Update Guids", "Please select one Guid Name");\r
+            return false;\r
+        }\r
+\r
         if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {\r
             if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {\r
                 Log.wrn("Update Guids", "Incorrect data type for Guid Name");\r
index 1f825438fe138875556186462fd9adacaaf7468b..87708b836c7b248ee8f774dd8f54250bd3481c36 100644 (file)
@@ -35,7 +35,9 @@ import org.tianocore.frameworkwizard.common.ui.IDialog;
 import org.tianocore.frameworkwizard.common.ui.IFrame;\r
 import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
 import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
 import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
 import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
 \r
 /**\r
@@ -302,9 +304,9 @@ public class LibraryClassDefsDlg extends IDialog {
      This is the default constructor\r
      \r
      **/\r
-    public LibraryClassDefsDlg(LibraryClassIdentification inLibraryClassIdentification, IFrame iFrame) {\r
+    public LibraryClassDefsDlg(LibraryClassIdentification inLibraryClassIdentification, IFrame iFrame, ModuleIdentification mid) {\r
         super(iFrame, true);\r
-        init(inLibraryClassIdentification);\r
+        init(inLibraryClassIdentification, mid);\r
     }\r
 \r
     /**\r
@@ -324,9 +326,18 @@ public class LibraryClassDefsDlg extends IDialog {
      This method initializes this\r
      \r
      **/\r
-    private void init(LibraryClassIdentification inLibraryClassIdentification) {\r
+    private void init(LibraryClassIdentification inLibraryClassIdentification, ModuleIdentification mid) {\r
         init();\r
         this.lcid = inLibraryClassIdentification;\r
+        \r
+        Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+        if (vpid.size() <= 0) {\r
+            Log.wrn("Init Library Class", "This module hasn't defined any package dependency, so there is no library class can be added");\r
+        }\r
+        \r
+        Tools.generateComboBoxByVector(this.jComboBoxLibraryClassName,\r
+                                       wt.getAllLibraryClassDefinitionsFromPackages(wt.getPackageDependenciesOfModule(mid)));\r
+\r
         if (lcid != null) {\r
             this.jComboBoxLibraryClassName.setSelectedItem(lcid.getLibraryClassName());\r
             this.jComboBoxUsage.setSelectedItem(lcid.getUsage());\r
@@ -430,7 +441,6 @@ public class LibraryClassDefsDlg extends IDialog {
      \r
      **/\r
     private void initFrame() {\r
-        Tools.generateComboBoxByVector(jComboBoxLibraryClassName, wt.getAllLibraryClassDefinitionsFromWorkspace());\r
         Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVLibraryUsage());\r
         this.iCheckBoxListModule.setAllItems(ed.getVFrameworkModuleTypes());\r
     }\r
@@ -472,7 +482,7 @@ public class LibraryClassDefsDlg extends IDialog {
         // Check LibraryClass\r
         //\r
         if (this.jComboBoxLibraryClassName.getSelectedItem() == null) {\r
-            Log.wrn("Update Library Class Definitions", "No Library Class can be added");\r
+            Log.wrn("Update Library Class Definitions", "Please select one Library Class");\r
             return false;\r
         }\r
         if (!DataValidation.isLibraryClass(this.jComboBoxLibraryClassName.getSelectedItem().toString())) {\r
index 81a4dfe3daa3a96b5ccbb01375f80f9368cc6687..58b983dad7c64f12ece2b82168bcb5f1515d0f24 100644 (file)
@@ -36,8 +36,10 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
 import org.tianocore.frameworkwizard.common.ui.IDialog;\r
 import org.tianocore.frameworkwizard.common.ui.IFrame;\r
 import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
 import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedIdentification;\r
 import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdVector;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
 import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
 \r
 /**\r
@@ -307,9 +309,19 @@ public class PCDsDlg extends IDialog implements ItemListener {
      * @param inPcdCodedId\r
      * \r
      */\r
-    private void init(PcdCodedIdentification inPcdCodedId) {\r
+    private void init(PcdCodedIdentification inPcdCodedId, ModuleIdentification mid) {\r
         init();\r
         this.id = inPcdCodedId;\r
+        \r
+        Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+        if (vpid.size() <= 0) {\r
+            Log.wrn("Init Pcd", "This module hasn't defined any package dependency, so there is no pcd can be added");\r
+        }\r
+\r
+        pcd = wt.getAllPcdDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid));\r
+        for (int index = 0; index < pcd.size(); index++) {\r
+            jComboBoxCName.addItem(pcd.getPcd(index));\r
+        }\r
 \r
         if (this.id != null) {\r
             for (int index = 0; index < this.jComboBoxCName.getItemCount(); index++) {\r
@@ -335,9 +347,9 @@ public class PCDsDlg extends IDialog implements ItemListener {
      * @param iFrame\r
      * \r
      */\r
-    public PCDsDlg(PcdCodedIdentification inPcdCodedId, IFrame iFrame) {\r
+    public PCDsDlg(PcdCodedIdentification inPcdCodedId, IFrame iFrame, ModuleIdentification mid) {\r
         super(iFrame, true);\r
-        init(inPcdCodedId);\r
+        init(inPcdCodedId, mid);\r
     }\r
 \r
     /**\r
@@ -441,10 +453,6 @@ public class PCDsDlg extends IDialog implements ItemListener {
      * \r
      */\r
     private void initFrame() {\r
-        for (int index = 0; index < pcd.size(); index++) {\r
-            jComboBoxCName.addItem(pcd.getPcd(index));\r
-        }\r
-\r
         Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPcdUsage());\r
     }\r
 \r
@@ -486,6 +494,11 @@ public class PCDsDlg extends IDialog implements ItemListener {
         //\r
         // Check C_Name\r
         //\r
+        if (this.jComboBoxCName.getSelectedItem() == null) {\r
+            Log.wrn("Update Pcd", "Please select one Pcd Name");\r
+            return false;\r
+        }\r
+\r
         if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {\r
             if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {\r
                 Log.wrn("Update PcdCoded", "Incorrect data type for C Name");\r
index 77d64f4f49c6a29e3f250a08a71b46d13753584e..1d294e03690bf8896f0e4c2e920b6c5005c71222 100644 (file)
@@ -36,7 +36,9 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
 import org.tianocore.frameworkwizard.common.ui.IDialog;\r
 import org.tianocore.frameworkwizard.common.ui.IFrame;\r
 import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
 import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
 import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
 \r
 /**\r
@@ -249,10 +251,6 @@ public class PpisDlg extends IDialog implements ItemListener {
         return jButtonCancel;\r
     }\r
 \r
-    public static void main(String[] args) {\r
-\r
-    }\r
-\r
     /**\r
      * This method initializes this\r
      * \r
@@ -266,16 +264,25 @@ public class PpisDlg extends IDialog implements ItemListener {
     }\r
 \r
     /**\r
-     * This method initializes this Fill values to all fields if these values are\r
-     * not empty\r
-     * \r
-     * @param inProtocolsId\r
-     * \r
-     */\r
-    private void init(PpisIdentification inPpisId) {\r
+     This method initializes this Fill values to all fields if these values are\r
+     not empty\r
+     \r
+     @param inPpisId\r
+     @param mid\r
+     \r
+     **/\r
+    private void init(PpisIdentification inPpisId, ModuleIdentification mid) {\r
         init();\r
         this.id = inPpisId;\r
 \r
+        Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+        if (vpid.size() <= 0) {\r
+            Log.wrn("Init Ppi", "This module hasn't defined any package dependency, so there is no ppi can be added");\r
+        }\r
+\r
+        Tools.generateComboBoxByVector(this.jComboBoxCName,\r
+                                       wt.getAllPpiDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));\r
+\r
         if (this.id != null) {\r
             this.jComboBoxCName.setSelectedItem(id.getName());\r
             this.jComboBoxPpiType.setSelectedItem(id.getType());\r
@@ -293,9 +300,9 @@ public class PpisDlg extends IDialog implements ItemListener {
      * @param iFrame\r
      * \r
      */\r
-    public PpisDlg(PpisIdentification inPpisIdentification, IFrame iFrame) {\r
+    public PpisDlg(PpisIdentification inPpisIdentification, IFrame iFrame, ModuleIdentification mid) {\r
         super(iFrame, true);\r
-        init(inPpisIdentification);\r
+        init(inPpisIdentification, mid);\r
     }\r
 \r
     /**\r
@@ -370,7 +377,6 @@ public class PpisDlg extends IDialog implements ItemListener {
      * \r
      */\r
     private void initFrame() {\r
-        Tools.generateComboBoxByVector(jComboBoxCName, wt.getAllPpiDeclarationsFromWorkspace());\r
         Tools.generateComboBoxByVector(jComboBoxPpiType, ed.getVPpiType());\r
         Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage());\r
     }\r
@@ -413,6 +419,11 @@ public class PpisDlg extends IDialog implements ItemListener {
         //\r
         // Check Name\r
         //\r
+        if (this.jComboBoxCName.getSelectedItem() == null) {\r
+            Log.wrn("Update Ppis", "Please select one Ppi/PpiNotify Name");\r
+            return false;\r
+        }\r
+\r
         if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {\r
             if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {\r
                 Log.wrn("Update Ppis", "Incorrect data type for Ppi/PpiNotify Name");\r
index 72db12838c5e36a13ba7a6d28d5dc7cf8de808e4..5108cbc44a780f03d0ba25560d49f4b699a83dc4 100644 (file)
@@ -37,7 +37,9 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
 import org.tianocore.frameworkwizard.common.ui.IDialog;\r
 import org.tianocore.frameworkwizard.common.ui.IFrame;\r
 import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
 import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
 import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
 \r
 /**\r
@@ -284,9 +286,17 @@ public class ProtocolsDlg extends IDialog implements ItemListener {
      * @param inProtocolsId\r
      * \r
      */\r
-    private void init(ProtocolsIdentification inProtocolsId) {\r
+    private void init(ProtocolsIdentification inProtocolsId, ModuleIdentification mid) {\r
         init();\r
         this.id = inProtocolsId;\r
+        \r
+        Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+        if (vpid.size() <= 0) {\r
+            Log.wrn("Init Protocol", "This module hasn't defined any package dependency, so there is no protocol can be added");\r
+        }\r
+\r
+        Tools.generateComboBoxByVector(this.jComboBoxCName,\r
+                                       wt.getAllProtocolDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));\r
 \r
         if (this.id != null) {\r
             this.jComboBoxCName.setSelectedItem(id.getName());\r
@@ -305,9 +315,9 @@ public class ProtocolsDlg extends IDialog implements ItemListener {
      * @param iFrame\r
      * \r
      */\r
-    public ProtocolsDlg(ProtocolsIdentification inProtocolsIdentification, IFrame iFrame) {\r
+    public ProtocolsDlg(ProtocolsIdentification inProtocolsIdentification, IFrame iFrame, ModuleIdentification mid) {\r
         super(iFrame, true);\r
-        init(inProtocolsIdentification);\r
+        init(inProtocolsIdentification, mid);\r
     }\r
 \r
     /**\r
@@ -397,7 +407,6 @@ public class ProtocolsDlg extends IDialog implements ItemListener {
      */\r
     private void initFrame() {\r
         Tools.generateComboBoxByVector(jComboBoxProtocolType, ed.getVProtocolType());\r
-        Tools.generateComboBoxByVector(jComboBoxCName, wt.getAllProtocolDeclarationsFromWorkspace());\r
         Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVProtocolUsage());\r
     }\r
 \r
@@ -439,6 +448,11 @@ public class ProtocolsDlg extends IDialog implements ItemListener {
         //\r
         // Check Name\r
         //\r
+        if (this.jComboBoxCName.getSelectedItem() == null) {\r
+            Log.wrn("Update protocols", "Please select one Protocol/ProtocolNotify Name");\r
+            return false;\r
+        }\r
+\r
         if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {\r
             if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {\r
                 Log.wrn("Update Protocols", "Incorrect data type for Protocol/ProtocolNotify Name");\r
index e022eb1d3a2e9e56ce276c3623a2af6a43690457..9c62ecde672525867f78af1ae0efdc5b11222f09 100644 (file)
@@ -25,6 +25,7 @@ import org.tianocore.DbPathAndFilename;
 import org.tianocore.IndustryStdIncludesDocument.IndustryStdIncludes;\r
 import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;\r
 import org.tianocore.MsaFilesDocument.MsaFiles;\r
+import org.tianocore.PackageDependenciesDocument.PackageDependencies;\r
 import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;\r
 import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;\r
 import org.tianocore.SourceFilesDocument.SourceFiles;\r
@@ -327,7 +328,7 @@ public class WorkspaceTools {
                         }\r
                     }\r
                     if (!isFind) {\r
-                        v.addElement(id);    \r
+                        v.addElement(id);\r
                     }\r
                 }\r
             }\r
@@ -466,6 +467,20 @@ public class WorkspaceTools {
         Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
         return vector;\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
+            if (v != null && v.size() > 0) {\r
+                vector.addAll(v);\r
+            }\r
+\r
+        }\r
+        Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+        return vector;\r
+    }\r
 \r
     public Vector<String> getAllProtocolDeclarationsFromWorkspace() {\r
         Vector<String> vector = new Vector<String>();\r
@@ -481,6 +496,20 @@ public class WorkspaceTools {
         return vector;\r
     }\r
 \r
+    public Vector<String> getAllProtocolDeclarationsFromPackages(Vector<PackageIdentification> vpid) {\r
+        Vector<String> vector = new Vector<String>();\r
+        for (int index = 0; index < vpid.size(); index++) {\r
+            Vector<String> v = getAllProtocolDeclarationsFromPackage(GlobalData.openingPackageList\r
+                                                                                                  .getPackageSurfaceAreaFromId(vpid\r
+                                                                                                                                   .get(index)));\r
+            if (v != null && v.size() > 0) {\r
+                vector.addAll(v);\r
+            }\r
+        }\r
+        Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+        return vector;\r
+    }\r
+\r
     public Vector<String> getAllPpiDeclarationsFromWorkspace() {\r
         Vector<String> vector = new Vector<String>();\r
         for (int index = 0; index < GlobalData.vPackageList.size(); index++) {\r
@@ -495,6 +524,20 @@ public class WorkspaceTools {
         return vector;\r
     }\r
 \r
+    public Vector<String> getAllPpiDeclarationsFromPackages(Vector<PackageIdentification> vpid) {\r
+        Vector<String> vector = new Vector<String>();\r
+        for (int index = 0; index < vpid.size(); index++) {\r
+            Vector<String> v = getAllPpiDeclarationsFromPackage(GlobalData.openingPackageList\r
+                                                                                             .getPackageSurfaceAreaFromId(vpid\r
+                                                                                                                              .get(index)));\r
+            if (v != null && v.size() > 0) {\r
+                vector.addAll(v);\r
+            }\r
+        }\r
+        Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+        return vector;\r
+    }\r
+\r
     public Vector<String> getAllGuidDeclarationsFromWorkspace() {\r
         Vector<String> vector = new Vector<String>();\r
         for (int index = 0; index < GlobalData.vPackageList.size(); index++) {\r
@@ -510,6 +553,21 @@ public class WorkspaceTools {
         return vector;\r
     }\r
 \r
+    public Vector<String> getAllGuidDeclarationsFromPackages(Vector<PackageIdentification> vpid) {\r
+        Vector<String> vector = new Vector<String>();\r
+        for (int index = 0; index < vpid.size(); index++) {\r
+            Vector<String> v = getAllGuidDeclarationsFromPackage(GlobalData.openingPackageList\r
+                                                                                              .getPackageSurfaceAreaFromId(vpid\r
+                                                                                                                               .get(index)));\r
+            if (v != null && v.size() > 0) {\r
+                vector.addAll(v);\r
+            }\r
+\r
+        }\r
+        Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+        return vector;\r
+    }\r
+\r
     public PcdVector getAllPcdDeclarationsFromWorkspace() {\r
         PcdVector vector = new PcdVector();\r
         for (int index = 0; index < GlobalData.openingPackageList.size(); index++) {\r
@@ -525,6 +583,21 @@ public class WorkspaceTools {
         return vector;\r
     }\r
 \r
+    public PcdVector getAllPcdDeclarationsFromPackages(Vector<PackageIdentification> vpid) {\r
+        PcdVector vector = new PcdVector();\r
+        for (int index = 0; index < vpid.size(); index++) {\r
+            PcdVector v = getAllPcdDeclarationsFromPackage(GlobalData.openingPackageList\r
+                                                                                        .getPackageSurfaceAreaFromId(vpid\r
+                                                                                                                         .get(index)));\r
+            if (v != null && v.size() > 0) {\r
+                vector.addAll(v);\r
+            }\r
+\r
+        }\r
+        Sort.sortPcds(vector, DataType.SORT_TYPE_ASCENDING);\r
+        return vector;\r
+    }\r
+\r
     /**\r
      Find a module's package's id\r
      \r
@@ -705,4 +778,30 @@ public class WorkspaceTools {
 \r
         return v;\r
     }\r
+\r
+    /**\r
+     Get a module's all package dependencies\r
+     \r
+     @param mid The module id\r
+     @return A vector of all package dependency ids\r
+     \r
+     **/\r
+    public Vector<PackageIdentification> getPackageDependenciesOfModule(ModuleIdentification mid) {\r
+        Vector<PackageIdentification> vpid = new Vector<PackageIdentification>();\r
+        ModuleSurfaceArea msa = GlobalData.openingModuleList.getModuleSurfaceAreaFromId(mid);\r
+        if (msa != null) {\r
+            PackageDependencies pd = msa.getPackageDependencies();\r
+            if (pd != null) {\r
+                for (int index = 0; index < pd.getPackageList().size(); index++) {\r
+                    String guid = pd.getPackageList().get(index).getPackageGuid();\r
+                    String version = pd.getPackageList().get(index).getPackageVersion();\r
+                    PackageIdentification pid = GlobalData.openingPackageList.getIdByGuidVersion(guid, version);\r
+                    if (pid != null) {\r
+                        vpid.addElement(pid);\r
+                    }\r
+                }\r
+            }\r
+        }\r
+        return vpid;\r
+    }\r
 }\r