]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SystemTablesDlg.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 / SystemTablesDlg.java
index 924010be8c166f0a485be0ffc7ae9b0faca5b7bc..9b5cc6ed0859ca9845ed9df557ddaeef0df3cf6c 100644 (file)
@@ -37,6 +37,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.SystemTables.SystemTablesIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
 import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
 \r
 /**\r
@@ -256,12 +257,29 @@ public class SystemTablesDlg extends IDialog {
     private void init(SystemTablesIdentification inSystemTablesId, ModuleIdentification mid) {\r
         init();\r
         this.id = inSystemTablesId;\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 system table");\r
+        }\r
+        //\r
+        // Init guids drop down list\r
+        //\r
+        Tools\r
+             .generateComboBoxByVector(jComboBoxGuidC_Name,\r
+                                       wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_SYSTEM_CONFIGURATION_TABLE));\r
+\r
+\r
         if (this.id != null) {\r
             this.jComboBoxGuidC_Name.setSelectedItem(id.getName());\r
             this.jComboBoxUsage.setSelectedItem(id.getUsage());\r
@@ -278,7 +296,8 @@ public class SystemTablesDlg extends IDialog {
      * @param iFrame\r
      * \r
      */\r
-    public SystemTablesDlg(SystemTablesIdentification inSystemTablesIdentification, IFrame iFrame, ModuleIdentification mid) {\r
+    public SystemTablesDlg(SystemTablesIdentification inSystemTablesIdentification, IFrame iFrame,\r
+                           ModuleIdentification mid) {\r
         super(iFrame, true);\r
         init(inSystemTablesIdentification, mid);\r
     }\r
@@ -358,7 +377,6 @@ public class SystemTablesDlg extends IDialog {
      */\r
     private void initFrame() {\r
         Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVSystemTableUsage());\r
-        Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());\r
     }\r
 \r
     /*\r
@@ -395,6 +413,14 @@ public class SystemTablesDlg 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 System Table Name");\r
+            return false;\r
+        }\r
 \r
         //\r
         // Check FeatureFlag\r