1. Fix EDKT528: Framework wizard should not force user to specify a GuidCName for all HOB types

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2430 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
hche10x 2007-03-08 05:48:32 +00:00
parent a30ae9faea
commit 5b396948e7
6 changed files with 31 additions and 32 deletions

View File

@ -704,6 +704,9 @@ public class Tools {
*
*/
public static boolean isEmpty(String strValue) {
if (strValue == null) {
return true;
}
if (strValue.length() > 0) {
return false;
}

View File

@ -17,6 +17,8 @@ package org.tianocore.frameworkwizard.module.Identifications.Events;
import java.util.Vector;
import org.tianocore.frameworkwizard.common.DataType;
public class EventsIdentification {
//
@ -38,6 +40,7 @@ public class EventsIdentification {
public EventsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5, String arg6) {
this.name = (arg0 == null ? "" : arg0);
this.name = (this.name == DataType.EMPTY_SELECT_ITEM ? "" : this.name);
this.type = (arg1 == null ? "" : arg1);
this.usage = (arg2 == null ? "" : arg2);
this.featureFlag = (arg3 == null ? "" : arg3);

View File

@ -17,6 +17,8 @@ package org.tianocore.frameworkwizard.module.Identifications.Hobs;
import java.util.Vector;
import org.tianocore.frameworkwizard.common.DataType;
public class HobsIdentification {
//
@ -36,6 +38,7 @@ public class HobsIdentification {
public HobsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5) {
this.name = (arg0 == null ? "" : arg0);
this.name = (this.name == DataType.EMPTY_SELECT_ITEM ? "" : this.name);
this.type = (arg1 == null ? "" : arg1);
this.usage = (arg2 == null ? "" : arg2);
this.featureFlag = (arg3 == null ? "" : arg3);

View File

@ -461,7 +461,7 @@ public class ModuleEvents extends IInternalFrame {
e.setEventType(EventTypes.Enum.forString(vid.getEvents(index).getGroup()));
}
se.addNewEventTypes();
se.setEventTypesArray(ce.getEventTypesList().size() - 1, e);
se.setEventTypesArray(se.getEventTypesList().size() - 1, e);
}
}
}

View File

@ -331,8 +331,16 @@ public class EventsDlg extends IDialog {
.generateComboBoxByVector(iComboBoxGuidC_Name,
wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_EVENT));
this.iComboBoxGuidC_Name.insertItemAt(DataType.EMPTY_SELECT_ITEM, 0);
this.iComboBoxGuidC_Name.setSelectedIndex(0);
if (this.id != null) {
this.iComboBoxGuidC_Name.setSelectedItem(id.getName());
String tmpName = id.getName();
if (isEmpty(tmpName)) {
tmpName = DataType.EMPTY_SELECT_ITEM;
}
this.iComboBoxGuidC_Name.setSelectedItem(tmpName);
this.jComboBoxEventsType.setSelectedItem(id.getType());
this.jComboBoxUsage.setSelectedItem(id.getUsage());
this.jTextAreaHelpText.setText(id.getHelp());
@ -424,7 +432,7 @@ public class EventsDlg extends IDialog {
jContentPane.add(jStarLabel1, null);
jContentPane.add(jLabelEventType, null);
jContentPane.add(getJComboBoxEventsType(), null);
jContentPane.add(jStarLabel2, null);
//jContentPane.add(jStarLabel2, null);
jContentPane.add(jLabelC_Name, null);
jContentPane.add(getIComboBoxGuidC_Name(), null);
jContentPane.add(jStarLabel3, null);
@ -494,20 +502,8 @@ public class EventsDlg extends IDialog {
//
// Check Name
//
if (this.iComboBoxGuidC_Name.getSelectedItem() == null) {
Log.wrn("Update Guids", "Please select one Event Name");
return false;
}
//
// Check Name
//
if (isEmpty(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {
Log.wrn("Update Events", "Event Name couldn't be empty");
return false;
}
if (!isEmpty(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {
String tmpName = this.iComboBoxGuidC_Name.getSelectedItem().toString();
if (!tmpName.equals(DataType.EMPTY_SELECT_ITEM) && isEmpty(tmpName)) {
if (!DataValidation.isC_NameType(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {
Log.wrn("Update Events", "Incorrect data type for Event Name");
return false;

View File

@ -310,10 +310,16 @@ public class HobsDlg extends IDialog {
Tools
.generateComboBoxByVector(iComboBoxGuidC_Name,
wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_HOB));
this.iComboBoxGuidC_Name.insertItemAt(DataType.EMPTY_SELECT_ITEM, 0);
this.iComboBoxGuidC_Name.setSelectedIndex(0);
if (this.id != null) {
this.iComboBoxGuidC_Name.setSelectedItem(id.getName());
String tmpName = id.getName();
if (isEmpty(tmpName)) {
tmpName = DataType.EMPTY_SELECT_ITEM;
}
this.iComboBoxGuidC_Name.setSelectedItem(tmpName);
this.jComboBoxHobType.setSelectedItem(id.getType());
this.jComboBoxUsage.setSelectedItem(id.getUsage());
this.jTextAreaHelpText.setText(id.getHelp());
@ -395,7 +401,6 @@ public class HobsDlg extends IDialog {
jContentPane.setLayout(null);
jContentPane.setPreferredSize(new java.awt.Dimension(485, 215));
jContentPane.add(jStarLabel1, null);
jContentPane.add(jLabelC_Name, null);
jContentPane.add(getIComboBoxGuidC_Name(), null);
jContentPane.add(jStarLabel2, null);
@ -463,19 +468,8 @@ public class HobsDlg extends IDialog {
//
// Check Name
//
if (this.iComboBoxGuidC_Name.getSelectedItem() == null) {
Log.wrn("Update Guids", "Please select one Hob Name");
return false;
}
//
// Check Name
//
if (isEmpty(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {
Log.wrn("Update Hobs", "Hob Guid C Name must be entered!");
return false;
}
if (!isEmpty(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {
String tmpName = this.iComboBoxGuidC_Name.getSelectedItem().toString();
if (!tmpName.equals(DataType.EMPTY_SELECT_ITEM) && isEmpty(tmpName)) {
if (!DataValidation.isC_NameType(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {
Log.wrn("Update Hobs", "Incorrect data type for Hob Name");
return false;