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.Guids.GuidsIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
\r
/**\r
* @param inGuidsId\r
* \r
*/\r
- private void init(GuidsIdentification inGuidsId) {\r
+ private void init(GuidsIdentification inGuidsId, ModuleIdentification mid) {\r
init();\r
this.id = inGuidsId;\r
+ \r
+ Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+ if (vpid.size() <= 0) {\r
+ Log.wrn("Init Guid", "This module hasn't defined any package dependency, so there is no guid can be added");\r
+ }\r
+\r
+ Tools.generateComboBoxByVector(this.jComboBoxCName,\r
+ wt.getAllGuidDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));\r
\r
if (this.id != null) {\r
this.jComboBoxCName.setSelectedItem(id.getName());\r
* @param iFrame\r
* \r
*/\r
- public GuidsDlg(GuidsIdentification inGuidsIdentification, IFrame iFrame) {\r
+ public GuidsDlg(GuidsIdentification inGuidsIdentification, IFrame iFrame, ModuleIdentification mid) {\r
super(iFrame, true);\r
- init(inGuidsIdentification);\r
+ init(inGuidsIdentification, mid);\r
}\r
\r
/**\r
* \r
*/\r
private void initFrame() {\r
- Tools.generateComboBoxByVector(jComboBoxCName, wt.getAllGuidDeclarationsFromWorkspace());\r
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVGuidUsage());\r
}\r
\r
//\r
// Check Name\r
//\r
+ if (this.jComboBoxCName.getSelectedItem() == null) {\r
+ Log.wrn("Update Guids", "Please select one Guid 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 Guids", "Incorrect data type for Guid Name");\r