1. Fix EDKT281 there are too many values in the list of Hob's Guid C Name. only the correlative values could be reserved in the list

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
This commit is contained in:
hche10x 2006-09-26 02:49:50 +00:00
parent 0e8d8bc75d
commit d48c170d67
7 changed files with 159 additions and 26 deletions

View File

@ -18,7 +18,7 @@ import java.util.Vector;
public class EnumerationData { public class EnumerationData {
// //
// Static data // Static data for externs definitions
// //
public final static String EXTERNS_PCD_IS_DRIVER = "Pcd Is Driver"; public final static String EXTERNS_PCD_IS_DRIVER = "Pcd Is Driver";
@ -42,6 +42,25 @@ public class EnumerationData {
public final static String EXTERNS_VIRTUAL_ADDRESS_MAP_CALL_BACK = "VirtualAddressMap"; public final static String EXTERNS_VIRTUAL_ADDRESS_MAP_CALL_BACK = "VirtualAddressMap";
public final static String EXTERNS_EXIT_BOOT_SERVICES_CALL_BACK = "ExitBootServices"; public final static String EXTERNS_EXIT_BOOT_SERVICES_CALL_BACK = "ExitBootServices";
//
// Static data for guid type
//
public final static String GUID_TYPE_DATA_HUB_RECORD = "DATA_HUB_RECORD";
public final static String GUID_TYPE_EFI_EVENT = "EFI_EVENT";
public final static String GUID_TYPE_EFI_SYSTEM_CONFIGURATION_TABLE = "EFI_SYSTEM_CONFIGURATION_TABLE";
public final static String GUID_TYPE_EFI_VARIABLE = "EFI_VARIABLE";
public final static String GUID_TYPE_GUID = "GUID";
public final static String GUID_TYPE_HII_PACKAGE_LIST = "HII_PACKAGE_LIST";
public final static String GUID_TYPE_HOB = "HOB";
public final static String GUID_TYPE_TOKEN_SPACE_GUID = "TOKEN_SPACE_GUID";
// //
// Common data // Common data
// //

View File

@ -36,6 +36,7 @@ import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification; import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.Events.EventsIdentification; import org.tianocore.frameworkwizard.module.Identifications.Events.EventsIdentification;
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
@ -313,6 +314,22 @@ public class EventsDlg extends IDialog {
// //
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid)); this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
//
// Get defined guids from dependent packages
//
Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
if (vpid.size() <= 0) {
Log
.wrn("Init Guid",
"This module hasn't defined any package dependency, so there is no guid value can be added for event");
}
//
// Init guids drop down list
//
Tools
.generateComboBoxByVector(jComboBoxGuidC_Name,
wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_EVENT));
if (this.id != null) { if (this.id != null) {
this.jComboBoxGuidC_Name.setSelectedItem(id.getName()); this.jComboBoxGuidC_Name.setSelectedItem(id.getName());
this.jComboBoxEventsType.setSelectedItem(id.getType()); this.jComboBoxEventsType.setSelectedItem(id.getType());
@ -436,7 +453,6 @@ public class EventsDlg extends IDialog {
Tools.generateComboBoxByVector(jComboBoxEventsType, ed.getVEventType()); Tools.generateComboBoxByVector(jComboBoxEventsType, ed.getVEventType());
Tools.generateComboBoxByVector(jComboBoxEventGroup, ed.getVEventGroup()); Tools.generateComboBoxByVector(jComboBoxEventGroup, ed.getVEventGroup());
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVEventUsage()); Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVEventUsage());
Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());
} }
/* /*
@ -474,6 +490,14 @@ public class EventsDlg extends IDialog {
// Check if all fields have correct data types // Check if all fields have correct data types
// //
//
// Check Name
//
if (this.jComboBoxGuidC_Name.getSelectedItem() == null) {
Log.wrn("Update Guids", "Please select one Event Name");
return false;
}
// //
// Check Name // Check Name
// //

View File

@ -275,7 +275,8 @@ public class GuidsDlg extends IDialog {
} }
Tools.generateComboBoxByVector(this.jComboBoxCName, Tools.generateComboBoxByVector(this.jComboBoxCName,
wt.getAllGuidDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid))); wt.getAllGuidDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid),
EnumerationData.GUID_TYPE_GUID));
if (this.id != null) { if (this.id != null) {
this.jComboBoxCName.setSelectedItem(id.getName()); this.jComboBoxCName.setSelectedItem(id.getName());

View File

@ -36,6 +36,7 @@ import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification; import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.Hobs.HobsIdentification; import org.tianocore.frameworkwizard.module.Identifications.Hobs.HobsIdentification;
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
@ -293,6 +294,23 @@ public class HobsDlg extends IDialog {
// //
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid)); this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
//
// Get defined guids from dependent packages
//
Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
if (vpid.size() <= 0) {
Log
.wrn("Init Guid",
"This module hasn't defined any package dependency, so there is no guid value can be added for hob");
}
//
// Init guids drop down list
//
Tools
.generateComboBoxByVector(jComboBoxGuidC_Name,
wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_HOB));
if (this.id != null) { if (this.id != null) {
this.jComboBoxGuidC_Name.setSelectedItem(id.getName()); this.jComboBoxGuidC_Name.setSelectedItem(id.getName());
this.jComboBoxHobType.setSelectedItem(id.getType()); this.jComboBoxHobType.setSelectedItem(id.getType());
@ -404,7 +422,6 @@ public class HobsDlg extends IDialog {
private void initFrame() { private void initFrame() {
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVHobUsage()); Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVHobUsage());
Tools.generateComboBoxByVector(jComboBoxHobType, ed.getVHobType()); Tools.generateComboBoxByVector(jComboBoxHobType, ed.getVHobType());
Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());
} }
/* /*
@ -442,6 +459,13 @@ public class HobsDlg extends IDialog {
// Check if all fields have correct data types // Check if all fields have correct data types
// //
//
// Check Name
//
if (this.jComboBoxGuidC_Name.getSelectedItem() == null) {
Log.wrn("Update Guids", "Please select one Hob Name");
return false;
}
// //
// Check Name // Check Name
// //

View File

@ -37,6 +37,7 @@ import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification; import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.SystemTables.SystemTablesIdentification; import org.tianocore.frameworkwizard.module.Identifications.SystemTables.SystemTablesIdentification;
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
@ -262,6 +263,23 @@ public class SystemTablesDlg extends IDialog {
// //
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid)); this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
//
// Get defined guids from dependent packages
//
Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
if (vpid.size() <= 0) {
Log
.wrn("Init Guid",
"This module hasn't defined any package dependency, so there is no guid value can be added for system table");
}
//
// Init guids drop down list
//
Tools
.generateComboBoxByVector(jComboBoxGuidC_Name,
wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_SYSTEM_CONFIGURATION_TABLE));
if (this.id != null) { if (this.id != null) {
this.jComboBoxGuidC_Name.setSelectedItem(id.getName()); this.jComboBoxGuidC_Name.setSelectedItem(id.getName());
this.jComboBoxUsage.setSelectedItem(id.getUsage()); this.jComboBoxUsage.setSelectedItem(id.getUsage());
@ -278,7 +296,8 @@ public class SystemTablesDlg extends IDialog {
* @param iFrame * @param iFrame
* *
*/ */
public SystemTablesDlg(SystemTablesIdentification inSystemTablesIdentification, IFrame iFrame, ModuleIdentification mid) { public SystemTablesDlg(SystemTablesIdentification inSystemTablesIdentification, IFrame iFrame,
ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inSystemTablesIdentification, mid); init(inSystemTablesIdentification, mid);
} }
@ -358,7 +377,6 @@ public class SystemTablesDlg extends IDialog {
*/ */
private void initFrame() { private void initFrame() {
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVSystemTableUsage()); Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVSystemTableUsage());
Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());
} }
/* /*
@ -396,6 +414,14 @@ public class SystemTablesDlg extends IDialog {
// Check if all fields have correct data types // Check if all fields have correct data types
// //
//
// Check Name
//
if (this.jComboBoxGuidC_Name.getSelectedItem() == null) {
Log.wrn("Update Guids", "Please select one System Table Name");
return false;
}
// //
// Check FeatureFlag // Check FeatureFlag
// //

View File

@ -37,6 +37,7 @@ import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification; import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.Variables.VariablesIdentification; import org.tianocore.frameworkwizard.module.Identifications.Variables.VariablesIdentification;
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
@ -116,8 +117,7 @@ public class VariablesDlg extends IDialog {
jTextFieldVariableName.setSize(new java.awt.Dimension(320, 20)); jTextFieldVariableName.setSize(new java.awt.Dimension(320, 20));
jTextFieldVariableName.setPreferredSize(new java.awt.Dimension(320, 20)); jTextFieldVariableName.setPreferredSize(new java.awt.Dimension(320, 20));
jTextFieldVariableName.setLocation(new java.awt.Point(168, 12)); jTextFieldVariableName.setLocation(new java.awt.Point(168, 12));
jTextFieldVariableName jTextFieldVariableName.setToolTipText("Enter a string; the tool will convert to Unicode hex");
.setToolTipText("Enter a string; the tool will convert to Unicode hex");
} }
return jTextFieldVariableName; return jTextFieldVariableName;
} }
@ -283,6 +283,22 @@ public class VariablesDlg extends IDialog {
// //
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid)); this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
//
// Get defined guids from dependent packages
//
Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
if (vpid.size() <= 0) {
Log
.wrn("Init Guid",
"This module hasn't defined any package dependency, so there is no guid value can be added for variable");
}
//
// Init guids drop down list
//
Tools
.generateComboBoxByVector(jComboBoxGuidC_Name,
wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_VARIABLE));
if (this.id != null) { if (this.id != null) {
this.jTextFieldVariableName.setText(id.getName()); this.jTextFieldVariableName.setText(id.getName());
this.jComboBoxGuidC_Name.setSelectedItem(id.getGuid()); this.jComboBoxGuidC_Name.setSelectedItem(id.getGuid());
@ -415,7 +431,6 @@ public class VariablesDlg extends IDialog {
*/ */
private void initFrame() { private void initFrame() {
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage()); Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage());
Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());
} }
/** /**
@ -438,6 +453,14 @@ public class VariablesDlg extends IDialog {
return false; return false;
} }
//
// Check Guid Value
//
if (this.jComboBoxGuidC_Name.getSelectedItem() == null) {
Log.wrn("Update Guids", "Please select one Varibale Guid value");
return false;
}
// //
// Check FeatureFlag // Check FeatureFlag
// //

View File

@ -416,12 +416,24 @@ public class WorkspaceTools {
@return Vector @return Vector
**/ **/
public Vector<String> getAllGuidDeclarationsFromPackage(PackageSurfaceArea spd) { public Vector<String> getAllGuidDeclarationsFromPackage(PackageSurfaceArea spd, String type) {
Vector<String> vector = new Vector<String>(); Vector<String> vector = new Vector<String>();
boolean isFound = false;
if (spd.getGuidDeclarations() != null) { if (spd.getGuidDeclarations() != null) {
if (spd.getGuidDeclarations().getEntryList().size() > 0) { if (spd.getGuidDeclarations().getEntryList().size() > 0) {
for (int index = 0; index < spd.getGuidDeclarations().getEntryList().size(); index++) { for (int index = 0; index < spd.getGuidDeclarations().getEntryList().size(); index++) {
Vector<String> vArch = Tools.convertListToVector(spd.getGuidDeclarations().getEntryList()
.get(index).getGuidTypeList());
for (int indexOfArch = 0; indexOfArch < vArch.size(); indexOfArch++) {
if (vArch.get(indexOfArch).equals(type)) {
isFound = true;
break;
}
}
if ((isFound) || (vArch == null) || (vArch.size() < 1)) {
vector.addElement(spd.getGuidDeclarations().getEntryList().get(index).getCName()); vector.addElement(spd.getGuidDeclarations().getEntryList().get(index).getCName());
isFound = false;
}
} }
} }
} }
@ -539,12 +551,14 @@ public class WorkspaceTools {
return vector; return vector;
} }
public Vector<String> getAllGuidDeclarationsFromWorkspace() { public Vector<String> getAllGuidDeclarationsFromWorkspace(String type) {
Vector<String> vector = new Vector<String>(); Vector<String> vector = new Vector<String>();
for (int index = 0; index < GlobalData.vPackageList.size(); index++) { for (int index = 0; index < GlobalData.vPackageList.size(); index++) {
Vector<String> v = getAllGuidDeclarationsFromPackage(GlobalData.openingPackageList Vector<String> v = getAllGuidDeclarationsFromPackage(
GlobalData.openingPackageList
.getPackageSurfaceAreaFromId(GlobalData.vPackageList .getPackageSurfaceAreaFromId(GlobalData.vPackageList
.get(index))); .get(index)),
type);
if (v != null && v.size() > 0) { if (v != null && v.size() > 0) {
vector.addAll(v); vector.addAll(v);
} }
@ -554,12 +568,14 @@ public class WorkspaceTools {
return vector; return vector;
} }
public Vector<String> getAllGuidDeclarationsFromPackages(Vector<PackageIdentification> vpid) { public Vector<String> getAllGuidDeclarationsFromPackages(Vector<PackageIdentification> vpid, String type) {
Vector<String> vector = new Vector<String>(); Vector<String> vector = new Vector<String>();
for (int index = 0; index < vpid.size(); index++) { for (int index = 0; index < vpid.size(); index++) {
Vector<String> v = getAllGuidDeclarationsFromPackage(GlobalData.openingPackageList Vector<String> v = getAllGuidDeclarationsFromPackage(
GlobalData.openingPackageList
.getPackageSurfaceAreaFromId(vpid .getPackageSurfaceAreaFromId(vpid
.get(index))); .get(index)),
type);
if (v != null && v.size() > 0) { if (v != null && v.size() > 0) {
vector.addAll(v); vector.addAll(v);
} }