1. Fix EDKT528: Framework wizard should not force user to specify a GuidCName for...
authorhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 8 Mar 2007 05:48:32 +0000 (05:48 +0000)
committerhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 8 Mar 2007 05:48:32 +0000 (05:48 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2430 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsIdentification.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsIdentification.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HobsDlg.java

index 6dcb91e..3eb9b85 100644 (file)
@@ -704,6 +704,9 @@ public class Tools {
      * \r
      */\r
     public static boolean isEmpty(String strValue) {\r
+        if (strValue == null) {\r
+            return true;\r
+        }\r
         if (strValue.length() > 0) {\r
             return false;\r
         }\r
index 24e1683..bbb22e5 100644 (file)
@@ -17,6 +17,8 @@ package org.tianocore.frameworkwizard.module.Identifications.Events;
 \r
 import java.util.Vector;\r
 \r
+import org.tianocore.frameworkwizard.common.DataType;\r
+\r
 public class EventsIdentification {\r
 \r
     //\r
@@ -38,6 +40,7 @@ public class EventsIdentification {
 \r
     public EventsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5, String arg6) {\r
         this.name = (arg0 == null ? "" : arg0);\r
+        this.name = (this.name == DataType.EMPTY_SELECT_ITEM ? "" : this.name);\r
         this.type = (arg1 == null ? "" : arg1);\r
         this.usage = (arg2 == null ? "" : arg2);\r
         this.featureFlag = (arg3 == null ? "" : arg3);\r
index e2144fa..7b9dadd 100644 (file)
@@ -17,6 +17,8 @@ package org.tianocore.frameworkwizard.module.Identifications.Hobs;
 \r
 import java.util.Vector;\r
 \r
+import org.tianocore.frameworkwizard.common.DataType;\r
+\r
 public class HobsIdentification {\r
 \r
     //\r
@@ -36,6 +38,7 @@ public class HobsIdentification {
 \r
     public HobsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5) {\r
         this.name = (arg0 == null ? "" : arg0);\r
+        this.name = (this.name == DataType.EMPTY_SELECT_ITEM ? "" : this.name);\r
         this.type = (arg1 == null ? "" : arg1);\r
         this.usage = (arg2 == null ? "" : arg2);\r
         this.featureFlag = (arg3 == null ? "" : arg3);\r
index 31977b5..354be3d 100644 (file)
@@ -461,7 +461,7 @@ public class ModuleEvents extends IInternalFrame {
                             e.setEventType(EventTypes.Enum.forString(vid.getEvents(index).getGroup()));\r
                         }\r
                         se.addNewEventTypes();\r
-                        se.setEventTypesArray(ce.getEventTypesList().size() - 1, e);\r
+                        se.setEventTypesArray(se.getEventTypesList().size() - 1, e);\r
                     }\r
                 }\r
             }\r
index 552a77d..10e3a17 100644 (file)
@@ -330,9 +330,17 @@ public class EventsDlg extends IDialog {
         Tools\r
              .generateComboBoxByVector(iComboBoxGuidC_Name,\r
                                        wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_EVENT));\r
+        \r
+        this.iComboBoxGuidC_Name.insertItemAt(DataType.EMPTY_SELECT_ITEM, 0);\r
+        this.iComboBoxGuidC_Name.setSelectedIndex(0);\r
 \r
         if (this.id != null) {\r
-            this.iComboBoxGuidC_Name.setSelectedItem(id.getName());\r
+            String tmpName = id.getName();\r
+            if (isEmpty(tmpName)) {\r
+                tmpName = DataType.EMPTY_SELECT_ITEM;\r
+            }\r
+\r
+            this.iComboBoxGuidC_Name.setSelectedItem(tmpName);\r
             this.jComboBoxEventsType.setSelectedItem(id.getType());\r
             this.jComboBoxUsage.setSelectedItem(id.getUsage());\r
             this.jTextAreaHelpText.setText(id.getHelp());\r
@@ -424,7 +432,7 @@ public class EventsDlg extends IDialog {
             jContentPane.add(jStarLabel1, null);\r
             jContentPane.add(jLabelEventType, null);\r
             jContentPane.add(getJComboBoxEventsType(), null);\r
-            jContentPane.add(jStarLabel2, null);\r
+            //jContentPane.add(jStarLabel2, null);\r
             jContentPane.add(jLabelC_Name, null);\r
             jContentPane.add(getIComboBoxGuidC_Name(), null);\r
             jContentPane.add(jStarLabel3, null);\r
@@ -494,20 +502,8 @@ public class EventsDlg extends IDialog {
         //\r
         // Check Name\r
         //\r
-        if (this.iComboBoxGuidC_Name.getSelectedItem() == null) {\r
-            Log.wrn("Update Guids", "Please select one Event Name");\r
-            return false;\r
-        }\r
-\r
-        //\r
-        // Check Name\r
-        //\r
-        if (isEmpty(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {\r
-            Log.wrn("Update Events", "Event Name couldn't be empty");\r
-            return false;\r
-        }\r
-\r
-        if (!isEmpty(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {\r
+        String tmpName = this.iComboBoxGuidC_Name.getSelectedItem().toString();\r
+        if (!tmpName.equals(DataType.EMPTY_SELECT_ITEM) && isEmpty(tmpName)) {\r
             if (!DataValidation.isC_NameType(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {\r
                 Log.wrn("Update Events", "Incorrect data type for Event Name");\r
                 return false;\r
index 73a1869..caf1649 100644 (file)
@@ -310,10 +310,16 @@ public class HobsDlg extends IDialog {
         Tools\r
              .generateComboBoxByVector(iComboBoxGuidC_Name,\r
                                        wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_HOB));\r
+        this.iComboBoxGuidC_Name.insertItemAt(DataType.EMPTY_SELECT_ITEM, 0);\r
+        this.iComboBoxGuidC_Name.setSelectedIndex(0);\r
 \r
 \r
         if (this.id != null) {\r
-            this.iComboBoxGuidC_Name.setSelectedItem(id.getName());\r
+            String tmpName = id.getName();\r
+            if (isEmpty(tmpName)) {\r
+                tmpName = DataType.EMPTY_SELECT_ITEM;\r
+            }\r
+            this.iComboBoxGuidC_Name.setSelectedItem(tmpName);    \r
             this.jComboBoxHobType.setSelectedItem(id.getType());\r
             this.jComboBoxUsage.setSelectedItem(id.getUsage());\r
             this.jTextAreaHelpText.setText(id.getHelp());\r
@@ -395,7 +401,6 @@ public class HobsDlg extends IDialog {
             jContentPane.setLayout(null);\r
             jContentPane.setPreferredSize(new java.awt.Dimension(485, 215));\r
 \r
-            jContentPane.add(jStarLabel1, null);\r
             jContentPane.add(jLabelC_Name, null);\r
             jContentPane.add(getIComboBoxGuidC_Name(), null);\r
             jContentPane.add(jStarLabel2, null);\r
@@ -463,19 +468,8 @@ public class HobsDlg extends IDialog {
         //\r
         // Check Name\r
         //\r
-        if (this.iComboBoxGuidC_Name.getSelectedItem() == null) {\r
-            Log.wrn("Update Guids", "Please select one Hob Name");\r
-            return false;\r
-        }\r
-        //\r
-        // Check Name\r
-        //\r
-        if (isEmpty(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {\r
-            Log.wrn("Update Hobs", "Hob Guid C Name must be entered!");\r
-            return false;\r
-        }\r
-\r
-        if (!isEmpty(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {\r
+        String tmpName = this.iComboBoxGuidC_Name.getSelectedItem().toString();\r
+        if (!tmpName.equals(DataType.EMPTY_SELECT_ITEM) && isEmpty(tmpName)) {\r
             if (!DataValidation.isC_NameType(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {\r
                 Log.wrn("Update Hobs", "Incorrect data type for Hob Name");\r
                 return false;\r