]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.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 / module / ui / dialog / EventsDlg.java
index 6c435827e8f5ab7c52060d1d8fdeb569d14f8110..521528aa0d0d0c7d7ecb05dd3e4a414ca7a0c505 100644 (file)
@@ -36,6 +36,7 @@ import org.tianocore.frameworkwizard.common.ui.IFrame;
 import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
 import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
 import org.tianocore.frameworkwizard.module.Identifications.Events.EventsIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
 import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
 \r
 /**\r
@@ -307,12 +308,28 @@ public class EventsDlg extends IDialog {
     private void init(EventsIdentification inEventsId, ModuleIdentification mid) {\r
         init();\r
         this.id = inEventsId;\r
-        \r
+\r
         //\r
         // Init arch with module's arch\r
         //\r
         this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));\r
-        \r
+\r
+        //\r
+        // Get defined guids from dependent packages\r
+        //\r
+        Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+        if (vpid.size() <= 0) {\r
+            Log\r
+               .wrn("Init Guid",\r
+                    "This module hasn't defined any package dependency, so there is no guid value can be added for event");\r
+        }\r
+        //\r
+        // Init guids drop down list\r
+        //\r
+        Tools\r
+             .generateComboBoxByVector(jComboBoxGuidC_Name,\r
+                                       wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_EVENT));\r
+\r
         if (this.id != null) {\r
             this.jComboBoxGuidC_Name.setSelectedItem(id.getName());\r
             this.jComboBoxEventsType.setSelectedItem(id.getType());\r
@@ -436,7 +453,6 @@ public class EventsDlg extends IDialog {
         Tools.generateComboBoxByVector(jComboBoxEventsType, ed.getVEventType());\r
         Tools.generateComboBoxByVector(jComboBoxEventGroup, ed.getVEventGroup());\r
         Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVEventUsage());\r
-        Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());\r
     }\r
 \r
     /*\r
@@ -473,6 +489,14 @@ public class EventsDlg extends IDialog {
         //\r
         // Check if all fields have correct data types\r
         //\r
+        \r
+        //\r
+        // Check Name\r
+        //\r
+        if (this.jComboBoxGuidC_Name.getSelectedItem() == null) {\r
+            Log.wrn("Update Guids", "Please select one Event Name");\r
+            return false;\r
+        }\r
 \r
         //\r
         // Check Name\r