\r
public class EnumerationData {\r
//\r
- // Static data\r
+ // Static data for externs definitions\r
//\r
public final static String EXTERNS_PCD_IS_DRIVER = "Pcd Is Driver";\r
\r
public final static String EXTERNS_VIRTUAL_ADDRESS_MAP_CALL_BACK = "VirtualAddressMap";\r
public final static String EXTERNS_EXIT_BOOT_SERVICES_CALL_BACK = "ExitBootServices";\r
\r
+ //\r
+ // Static data for guid type\r
+ //\r
+ public final static String GUID_TYPE_DATA_HUB_RECORD = "DATA_HUB_RECORD";\r
+ \r
+ public final static String GUID_TYPE_EFI_EVENT = "EFI_EVENT";\r
+ \r
+ public final static String GUID_TYPE_EFI_SYSTEM_CONFIGURATION_TABLE = "EFI_SYSTEM_CONFIGURATION_TABLE";\r
+ \r
+ public final static String GUID_TYPE_EFI_VARIABLE = "EFI_VARIABLE";\r
+ \r
+ public final static String GUID_TYPE_GUID = "GUID";\r
+ \r
+ public final static String GUID_TYPE_HII_PACKAGE_LIST = "HII_PACKAGE_LIST";\r
+ \r
+ public final static String GUID_TYPE_HOB = "HOB";\r
+ \r
+ public final static String GUID_TYPE_TOKEN_SPACE_GUID = "TOKEN_SPACE_GUID";\r
+ \r
//\r
// Common data\r
//\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.Events.EventsIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
\r
/**\r
private void init(EventsIdentification inEventsId, ModuleIdentification mid) {\r
init();\r
this.id = inEventsId;\r
- \r
+\r
//\r
// Init arch with module's arch\r
//\r
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));\r
- \r
+\r
+ //\r
+ // Get defined guids from dependent packages\r
+ //\r
+ Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+ if (vpid.size() <= 0) {\r
+ Log\r
+ .wrn("Init Guid",\r
+ "This module hasn't defined any package dependency, so there is no guid value can be added for event");\r
+ }\r
+ //\r
+ // Init guids drop down list\r
+ //\r
+ Tools\r
+ .generateComboBoxByVector(jComboBoxGuidC_Name,\r
+ wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_EVENT));\r
+\r
if (this.id != null) {\r
this.jComboBoxGuidC_Name.setSelectedItem(id.getName());\r
this.jComboBoxEventsType.setSelectedItem(id.getType());\r
Tools.generateComboBoxByVector(jComboBoxEventsType, ed.getVEventType());\r
Tools.generateComboBoxByVector(jComboBoxEventGroup, ed.getVEventGroup());\r
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVEventUsage());\r
- Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());\r
}\r
\r
/*\r
//\r
// Check if all fields have correct data types\r
//\r
+ \r
+ //\r
+ // Check Name\r
+ //\r
+ if (this.jComboBoxGuidC_Name.getSelectedItem() == null) {\r
+ Log.wrn("Update Guids", "Please select one Event Name");\r
+ return false;\r
+ }\r
\r
//\r
// Check Name\r
private void init(GuidsIdentification inGuidsId, ModuleIdentification mid) {\r
init();\r
this.id = inGuidsId;\r
- \r
+\r
//\r
// Init arch with module's arch\r
//\r
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));\r
- \r
+\r
//\r
// Get defined guids from dependent packages\r
//\r
}\r
\r
Tools.generateComboBoxByVector(this.jComboBoxCName,\r
- wt.getAllGuidDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));\r
+ wt.getAllGuidDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid),\r
+ EnumerationData.GUID_TYPE_GUID));\r
\r
if (this.id != null) {\r
this.jComboBoxCName.setSelectedItem(id.getName());\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.Hobs.HobsIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
\r
/**\r
//\r
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));\r
\r
+ //\r
+ // Get defined guids from dependent packages\r
+ //\r
+ Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+ if (vpid.size() <= 0) {\r
+ Log\r
+ .wrn("Init Guid",\r
+ "This module hasn't defined any package dependency, so there is no guid value can be added for hob");\r
+ }\r
+ //\r
+ // Init guids drop down list\r
+ //\r
+ Tools\r
+ .generateComboBoxByVector(jComboBoxGuidC_Name,\r
+ wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_HOB));\r
+\r
+\r
if (this.id != null) {\r
this.jComboBoxGuidC_Name.setSelectedItem(id.getName());\r
this.jComboBoxHobType.setSelectedItem(id.getType());\r
private void initFrame() {\r
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVHobUsage());\r
Tools.generateComboBoxByVector(jComboBoxHobType, ed.getVHobType());\r
- Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());\r
}\r
\r
/*\r
//\r
// Check if all fields have correct data types\r
//\r
-\r
+ \r
+ //\r
+ // Check Name\r
+ //\r
+ if (this.jComboBoxGuidC_Name.getSelectedItem() == null) {\r
+ Log.wrn("Update Guids", "Please select one Hob Name");\r
+ return false;\r
+ }\r
//\r
// Check Name\r
//\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.SystemTables.SystemTablesIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
\r
/**\r
private void init(SystemTablesIdentification inSystemTablesId, ModuleIdentification mid) {\r
init();\r
this.id = inSystemTablesId;\r
- \r
+\r
//\r
// Init arch with module's arch\r
//\r
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));\r
- \r
+\r
+ //\r
+ // Get defined guids from dependent packages\r
+ //\r
+ Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+ if (vpid.size() <= 0) {\r
+ Log\r
+ .wrn("Init Guid",\r
+ "This module hasn't defined any package dependency, so there is no guid value can be added for system table");\r
+ }\r
+ //\r
+ // Init guids drop down list\r
+ //\r
+ Tools\r
+ .generateComboBoxByVector(jComboBoxGuidC_Name,\r
+ wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_SYSTEM_CONFIGURATION_TABLE));\r
+\r
+\r
if (this.id != null) {\r
this.jComboBoxGuidC_Name.setSelectedItem(id.getName());\r
this.jComboBoxUsage.setSelectedItem(id.getUsage());\r
* @param iFrame\r
* \r
*/\r
- public SystemTablesDlg(SystemTablesIdentification inSystemTablesIdentification, IFrame iFrame, ModuleIdentification mid) {\r
+ public SystemTablesDlg(SystemTablesIdentification inSystemTablesIdentification, IFrame iFrame,\r
+ ModuleIdentification mid) {\r
super(iFrame, true);\r
init(inSystemTablesIdentification, mid);\r
}\r
*/\r
private void initFrame() {\r
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVSystemTableUsage());\r
- Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());\r
}\r
\r
/*\r
//\r
// Check if all fields have correct data types\r
//\r
+ \r
+ //\r
+ // Check Name\r
+ //\r
+ if (this.jComboBoxGuidC_Name.getSelectedItem() == null) {\r
+ Log.wrn("Update Guids", "Please select one System Table Name");\r
+ return false;\r
+ }\r
\r
//\r
// Check FeatureFlag\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.Variables.VariablesIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
\r
/**\r
jTextFieldVariableName.setSize(new java.awt.Dimension(320, 20));\r
jTextFieldVariableName.setPreferredSize(new java.awt.Dimension(320, 20));\r
jTextFieldVariableName.setLocation(new java.awt.Point(168, 12));\r
- jTextFieldVariableName\r
- .setToolTipText("Enter a string; the tool will convert to Unicode hex");\r
+ jTextFieldVariableName.setToolTipText("Enter a string; the tool will convert to Unicode hex");\r
}\r
return jTextFieldVariableName;\r
}\r
private void init(VariablesIdentification inVariablesId, ModuleIdentification mid) {\r
init();\r
this.id = inVariablesId;\r
- \r
+\r
//\r
// Init arch with module's arch\r
//\r
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));\r
\r
+ //\r
+ // Get defined guids from dependent packages\r
+ //\r
+ Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+ if (vpid.size() <= 0) {\r
+ Log\r
+ .wrn("Init Guid",\r
+ "This module hasn't defined any package dependency, so there is no guid value can be added for variable");\r
+ }\r
+ //\r
+ // Init guids drop down list\r
+ //\r
+ Tools\r
+ .generateComboBoxByVector(jComboBoxGuidC_Name,\r
+ wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_VARIABLE));\r
+\r
if (this.id != null) {\r
this.jTextFieldVariableName.setText(id.getName());\r
this.jComboBoxGuidC_Name.setSelectedItem(id.getGuid());\r
*/\r
private void initFrame() {\r
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage());\r
- Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());\r
}\r
\r
/**\r
//\r
// Check if all fields have correct data types\r
//\r
-\r
+ \r
//\r
// Check VariableName\r
//\r
Log.wrn("Update Variables", "Variable Name must be entered!");\r
return false;\r
}\r
+ \r
+ //\r
+ // Check Guid Value\r
+ //\r
+ if (this.jComboBoxGuidC_Name.getSelectedItem() == null) {\r
+ Log.wrn("Update Guids", "Please select one Varibale Guid value");\r
+ return false;\r
+ }\r
\r
//\r
// Check FeatureFlag\r
\r
@return Vector\r
**/\r
- public Vector<String> getAllGuidDeclarationsFromPackage(PackageSurfaceArea spd) {\r
+ public Vector<String> getAllGuidDeclarationsFromPackage(PackageSurfaceArea spd, String type) {\r
Vector<String> vector = new Vector<String>();\r
+ boolean isFound = false;\r
if (spd.getGuidDeclarations() != null) {\r
if (spd.getGuidDeclarations().getEntryList().size() > 0) {\r
for (int index = 0; index < spd.getGuidDeclarations().getEntryList().size(); index++) {\r
- vector.addElement(spd.getGuidDeclarations().getEntryList().get(index).getCName());\r
+ Vector<String> vArch = Tools.convertListToVector(spd.getGuidDeclarations().getEntryList()\r
+ .get(index).getGuidTypeList());\r
+ for (int indexOfArch = 0; indexOfArch < vArch.size(); indexOfArch++) {\r
+ if (vArch.get(indexOfArch).equals(type)) {\r
+ isFound = true;\r
+ break;\r
+ }\r
+ }\r
+ if ((isFound) || (vArch == null) || (vArch.size() < 1)) {\r
+ vector.addElement(spd.getGuidDeclarations().getEntryList().get(index).getCName());\r
+ isFound = false;\r
+ }\r
}\r
}\r
}\r
return vector;\r
}\r
\r
- public Vector<String> getAllGuidDeclarationsFromWorkspace() {\r
+ public Vector<String> getAllGuidDeclarationsFromWorkspace(String type) {\r
Vector<String> vector = new Vector<String>();\r
for (int index = 0; index < GlobalData.vPackageList.size(); index++) {\r
- Vector<String> v = getAllGuidDeclarationsFromPackage(GlobalData.openingPackageList\r
+ Vector<String> v = getAllGuidDeclarationsFromPackage(\r
+ GlobalData.openingPackageList\r
.getPackageSurfaceAreaFromId(GlobalData.vPackageList\r
- .get(index)));\r
+ .get(index)),\r
+ type);\r
if (v != null && v.size() > 0) {\r
vector.addAll(v);\r
}\r
return vector;\r
}\r
\r
- public Vector<String> getAllGuidDeclarationsFromPackages(Vector<PackageIdentification> vpid) {\r
+ public Vector<String> getAllGuidDeclarationsFromPackages(Vector<PackageIdentification> vpid, String type) {\r
Vector<String> vector = new Vector<String>();\r
for (int index = 0; index < vpid.size(); index++) {\r
- Vector<String> v = getAllGuidDeclarationsFromPackage(GlobalData.openingPackageList\r
+ Vector<String> v = getAllGuidDeclarationsFromPackage(\r
+ GlobalData.openingPackageList\r
.getPackageSurfaceAreaFromId(vpid\r
- .get(index)));\r
+ .get(index)),\r
+ type);\r
if (v != null && v.size() > 0) {\r
vector.addAll(v);\r
}\r