]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java
1. Fix EDKT323 (Only dependent packages' ppis can be added to module's ppi section)
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / module / ui / dialog / GuidsDlg.java
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