git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2430
6f19259b-4bc3-4df7-8a09-
765794883524
* \r
*/\r
public static boolean isEmpty(String strValue) {\r
* \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
if (strValue.length() > 0) {\r
return false;\r
}\r
\r
import java.util.Vector;\r
\r
\r
import java.util.Vector;\r
\r
+import org.tianocore.frameworkwizard.common.DataType;\r
+\r
public class EventsIdentification {\r
\r
//\r
public class EventsIdentification {\r
\r
//\r
\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
\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
this.type = (arg1 == null ? "" : arg1);\r
this.usage = (arg2 == null ? "" : arg2);\r
this.featureFlag = (arg3 == null ? "" : arg3);\r
\r
import java.util.Vector;\r
\r
\r
import java.util.Vector;\r
\r
+import org.tianocore.frameworkwizard.common.DataType;\r
+\r
public class HobsIdentification {\r
\r
//\r
public class HobsIdentification {\r
\r
//\r
\r
public HobsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5) {\r
this.name = (arg0 == null ? "" : arg0);\r
\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
this.type = (arg1 == null ? "" : arg1);\r
this.usage = (arg2 == null ? "" : arg2);\r
this.featureFlag = (arg3 == null ? "" : arg3);\r
e.setEventType(EventTypes.Enum.forString(vid.getEvents(index).getGroup()));\r
}\r
se.addNewEventTypes();\r
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
Tools\r
.generateComboBoxByVector(iComboBoxGuidC_Name,\r
wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_EVENT));\r
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
\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
this.jComboBoxEventsType.setSelectedItem(id.getType());\r
this.jComboBoxUsage.setSelectedItem(id.getUsage());\r
this.jTextAreaHelpText.setText(id.getHelp());\r
jContentPane.add(jStarLabel1, null);\r
jContentPane.add(jLabelEventType, null);\r
jContentPane.add(getJComboBoxEventsType(), null);\r
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
jContentPane.add(jLabelC_Name, null);\r
jContentPane.add(getIComboBoxGuidC_Name(), null);\r
jContentPane.add(jStarLabel3, null);\r
//\r
// Check Name\r
//\r
//\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
if (!DataValidation.isC_NameType(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {\r
Log.wrn("Update Events", "Incorrect data type for Event Name");\r
return false;\r
Tools\r
.generateComboBoxByVector(iComboBoxGuidC_Name,\r
wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_HOB));\r
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
\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
this.jComboBoxHobType.setSelectedItem(id.getType());\r
this.jComboBoxUsage.setSelectedItem(id.getUsage());\r
this.jTextAreaHelpText.setText(id.getHelp());\r
jContentPane.setLayout(null);\r
jContentPane.setPreferredSize(new java.awt.Dimension(485, 215));\r
\r
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
jContentPane.add(jLabelC_Name, null);\r
jContentPane.add(getIComboBoxGuidC_Name(), null);\r
jContentPane.add(jStarLabel2, null);\r
//\r
// Check Name\r
//\r
//\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
if (!DataValidation.isC_NameType(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {\r
Log.wrn("Update Hobs", "Incorrect data type for Hob Name");\r
return false;\r