import org.tianocore.frameworkwizard.common.ui.IDialog;\r
import org.tianocore.frameworkwizard.common.ui.IFrame;\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdVector;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
\r
/**\r
* @param inPcdCodedId\r
* \r
*/\r
- private void init(PcdCodedIdentification inPcdCodedId) {\r
+ private void init(PcdCodedIdentification inPcdCodedId, ModuleIdentification mid) {\r
init();\r
this.id = inPcdCodedId;\r
+ \r
+ //\r
+ // Init arch with module's arch\r
+ //\r
+ this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));\r
+ \r
+ //\r
+ // Get defined pcds from dependent packages\r
+ //\r
+ Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+ if (vpid.size() <= 0) {\r
+ Log.wrn("Init Pcd", "This module hasn't defined any package dependency, so there is no pcd can be added");\r
+ }\r
+\r
+ pcd = wt.getAllPcdDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid));\r
+ for (int index = 0; index < pcd.size(); index++) {\r
+ jComboBoxCName.addItem(pcd.getPcd(index));\r
+ }\r
\r
if (this.id != null) {\r
for (int index = 0; index < this.jComboBoxCName.getItemCount(); index++) {\r
* @param iFrame\r
* \r
*/\r
- public PCDsDlg(PcdCodedIdentification inPcdCodedId, IFrame iFrame) {\r
+ public PCDsDlg(PcdCodedIdentification inPcdCodedId, IFrame iFrame, ModuleIdentification mid) {\r
super(iFrame, true);\r
- init(inPcdCodedId);\r
+ init(inPcdCodedId, mid);\r
}\r
\r
/**\r
* \r
*/\r
private void initFrame() {\r
- for (int index = 0; index < pcd.size(); index++) {\r
- jComboBoxCName.addItem(pcd.getPcd(index));\r
- }\r
-\r
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPcdUsage());\r
}\r
\r
//\r
// Check C_Name\r
//\r
+ if (this.jComboBoxCName.getSelectedItem() == null) {\r
+ Log.wrn("Update Pcd", "Please select one Pcd Name");\r
+ return false;\r
+ }\r
+\r
if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {\r
if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {\r
Log.wrn("Update PcdCoded", "Incorrect data type for C Name");\r
if (!isEmpty(this.jTextFieldTokenSpaceGuid.getText())) {\r
if (!DataValidation.isC_NameType(this.jTextFieldTokenSpaceGuid.getText())) {\r
Log.wrn("Update PcdCoded",\r
- "Incorrect data type for the selected pcd entry, please check in in spd file");\r
+ "Incorrect data type for the selected pcd entry, please check the datatype specified in the spd file");\r
return false;\r
}\r
}\r
|| pcd.getPcd(index).getType() == null || pcd.getPcd(index).getHelp() == null\r
|| isEmpty(pcd.getPcd(index).getHelp())) {\r
Log.wrn("select pcd entry when editing msa",\r
- "The selected is defined incorrectly.\r\nPlease check it in spd file");\r
+ "The selected value is defined incorrectly.\r\nPlease check it in the spd file");\r
} else {\r
this.jTextFieldTokenSpaceGuid.setText(pcd.getPcd(index).getGuidCName());\r
Tools.generateComboBoxByVector(this.jComboBoxItemType, pcd.getPcd(index).getType());\r