1. Fix EDKT281 there are too many values in the list of Hob's Guid C Name. only the...
authorhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 26 Sep 2006 02:49:50 +0000 (02:49 +0000)
committerhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 26 Sep 2006 02:49:50 +0000 (02:49 +0000)
2. Fix EDKT282 there are too many selected values in the list of Variable Guid C Name of MSA
3. Fix EDKT283 there are too many selected values in the list of SystemTable Guid C Name of MSA
Add rules for get guid when editing event/guid/hob/variable/systemtable
a. Get all guids from current module's dependency packages
b. For each guid, only when it hasn't defined any type or has specific type for current editing item(event/guid/hob/variable/systemtable), it can be added into drop down list.

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

Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HobsDlg.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SystemTablesDlg.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java

index 3ee49a4..0bb3f5e 100644 (file)
@@ -18,7 +18,7 @@ import java.util.Vector;
 \r
 public class EnumerationData {\r
     //\r
-    // Static data\r
+    // Static data for externs definitions\r
     //\r
     public final static String EXTERNS_PCD_IS_DRIVER = "Pcd Is Driver";\r
     \r
@@ -42,6 +42,25 @@ public class EnumerationData {
     public final static String EXTERNS_VIRTUAL_ADDRESS_MAP_CALL_BACK = "VirtualAddressMap";\r
     public final static String EXTERNS_EXIT_BOOT_SERVICES_CALL_BACK = "ExitBootServices";\r
     \r
+    //\r
+    // Static data for guid type\r
+    //\r
+    public final static String GUID_TYPE_DATA_HUB_RECORD = "DATA_HUB_RECORD";\r
+    \r
+    public final static String GUID_TYPE_EFI_EVENT = "EFI_EVENT";\r
+    \r
+    public final static String GUID_TYPE_EFI_SYSTEM_CONFIGURATION_TABLE = "EFI_SYSTEM_CONFIGURATION_TABLE";\r
+    \r
+    public final static String GUID_TYPE_EFI_VARIABLE = "EFI_VARIABLE";\r
+    \r
+    public final static String GUID_TYPE_GUID = "GUID";\r
+    \r
+    public final static String GUID_TYPE_HII_PACKAGE_LIST = "HII_PACKAGE_LIST";\r
+    \r
+    public final static String GUID_TYPE_HOB = "HOB";\r
+    \r
+    public final static String GUID_TYPE_TOKEN_SPACE_GUID = "TOKEN_SPACE_GUID";\r
+    \r
     //\r
     // Common data\r
     //\r
index 6c43582..521528a 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
index e0475a5..d3063be 100644 (file)
@@ -260,12 +260,12 @@ public class GuidsDlg extends IDialog {
     private void init(GuidsIdentification inGuidsId, ModuleIdentification mid) {\r
         init();\r
         this.id = inGuidsId;\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
@@ -275,7 +275,8 @@ public class GuidsDlg extends IDialog {
         }\r
 \r
         Tools.generateComboBoxByVector(this.jComboBoxCName,\r
-                                       wt.getAllGuidDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));\r
+                                       wt.getAllGuidDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid),\r
+                                                                             EnumerationData.GUID_TYPE_GUID));\r
 \r
         if (this.id != null) {\r
             this.jComboBoxCName.setSelectedItem(id.getName());\r
index eaba4c6..3b76c3c 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.Hobs.HobsIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
 import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
 \r
 /**\r
@@ -293,6 +294,23 @@ public class HobsDlg extends IDialog {
         //\r
         this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));\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 hob");\r
+        }\r
+        //\r
+        // Init guids drop down list\r
+        //\r
+        Tools\r
+             .generateComboBoxByVector(jComboBoxGuidC_Name,\r
+                                       wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_HOB));\r
+\r
+\r
         if (this.id != null) {\r
             this.jComboBoxGuidC_Name.setSelectedItem(id.getName());\r
             this.jComboBoxHobType.setSelectedItem(id.getType());\r
@@ -404,7 +422,6 @@ public class HobsDlg extends IDialog {
     private void initFrame() {\r
         Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVHobUsage());\r
         Tools.generateComboBoxByVector(jComboBoxHobType, ed.getVHobType());\r
-        Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());\r
     }\r
 \r
     /*\r
@@ -441,7 +458,14 @@ public class HobsDlg extends IDialog {
         //\r
         // Check if all fields have correct data types\r
         //\r
-\r
+        \r
+        //\r
+        // Check Name\r
+        //\r
+        if (this.jComboBoxGuidC_Name.getSelectedItem() == null) {\r
+            Log.wrn("Update Guids", "Please select one Hob Name");\r
+            return false;\r
+        }\r
         //\r
         // Check Name\r
         //\r
index 924010b..9b5cc6e 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
index 34f7ba0..65c8d61 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.Variables.VariablesIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
 import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
 \r
 /**\r
@@ -116,8 +117,7 @@ public class VariablesDlg extends IDialog {
             jTextFieldVariableName.setSize(new java.awt.Dimension(320, 20));\r
             jTextFieldVariableName.setPreferredSize(new java.awt.Dimension(320, 20));\r
             jTextFieldVariableName.setLocation(new java.awt.Point(168, 12));\r
-            jTextFieldVariableName\r
-                                  .setToolTipText("Enter a string; the tool will convert to Unicode hex");\r
+            jTextFieldVariableName.setToolTipText("Enter a string; the tool will convert to Unicode hex");\r
         }\r
         return jTextFieldVariableName;\r
     }\r
@@ -277,12 +277,28 @@ public class VariablesDlg extends IDialog {
     private void init(VariablesIdentification inVariablesId, ModuleIdentification mid) {\r
         init();\r
         this.id = inVariablesId;\r
-        \r
+\r
         //\r
         // Init arch with module's arch\r
         //\r
         this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));\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 variable");\r
+        }\r
+        //\r
+        // Init guids drop down list\r
+        //\r
+        Tools\r
+             .generateComboBoxByVector(jComboBoxGuidC_Name,\r
+                                       wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_VARIABLE));\r
+\r
         if (this.id != null) {\r
             this.jTextFieldVariableName.setText(id.getName());\r
             this.jComboBoxGuidC_Name.setSelectedItem(id.getGuid());\r
@@ -415,7 +431,6 @@ public class VariablesDlg extends IDialog {
      */\r
     private void initFrame() {\r
         Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage());\r
-        Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());\r
     }\r
 \r
     /**\r
@@ -429,7 +444,7 @@ public class VariablesDlg extends IDialog {
         //\r
         // Check if all fields have correct data types\r
         //\r
-\r
+        \r
         //\r
         // Check VariableName\r
         //\r
@@ -437,6 +452,14 @@ public class VariablesDlg extends IDialog {
             Log.wrn("Update Variables", "Variable Name must be entered!");\r
             return false;\r
         }\r
+        \r
+        //\r
+        // Check Guid Value\r
+        //\r
+        if (this.jComboBoxGuidC_Name.getSelectedItem() == null) {\r
+            Log.wrn("Update Guids", "Please select one Varibale Guid value");\r
+            return false;\r
+        }\r
 \r
         //\r
         // Check FeatureFlag\r
index f0586b1..4e40d59 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
@@ -539,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
@@ -554,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