]> git.proxmox.com Git - mirror_edk2.git/commitdiff
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 6dcb91e931537ec8f6da5a70a9b229653a54809e..3eb9b85455186d51d58c423ed1ed673c57366b6b 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 24e168335deff0760eb58553fd7a8545210dce87..bbb22e594a5b6df3c5a1d09bac3f95e90fc2571b 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 e2144fa5835d4356036d7a2c98147a7d7b0ffe3b..7b9dadd15e6d20eea5bf0005a20d2551a24d3af8 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 31977b5bb0d980539e44cc097e82f7f783422568..354be3ddae178575c6c4127591e936fd54fadaaf 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 552a77dd463232aaf81f1ed7fe3b3e147023ff0b..10e3a174ca4ae37feb1c61f999b6480e3bd0d850 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 73a1869a7f15e85c4b4c692ce6594310bddc48b7..caf1649984271f3eca291d270e89dd8b0fe41183 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