import org.tianocore.frameworkwizard.common.ui.IFrame;\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
\r
/**\r
This is the default constructor\r
\r
**/\r
- public LibraryClassDefsDlg(LibraryClassIdentification inLibraryClassIdentification, IFrame iFrame) {\r
+ public LibraryClassDefsDlg(LibraryClassIdentification inLibraryClassIdentification, IFrame iFrame, ModuleIdentification mid) {\r
super(iFrame, true);\r
- init(inLibraryClassIdentification);\r
+ init(inLibraryClassIdentification, mid);\r
}\r
\r
/**\r
This method initializes this\r
\r
**/\r
- private void init(LibraryClassIdentification inLibraryClassIdentification) {\r
+ private void init(LibraryClassIdentification inLibraryClassIdentification, ModuleIdentification mid) {\r
init();\r
this.lcid = inLibraryClassIdentification;\r
+ \r
+ Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+ if (vpid.size() <= 0) {\r
+ Log.wrn("Init Library Class", "This module hasn't defined any package dependency, so there is no library class can be added");\r
+ }\r
+ \r
+ Tools.generateComboBoxByVector(this.jComboBoxLibraryClassName,\r
+ wt.getAllLibraryClassDefinitionsFromPackages(wt.getPackageDependenciesOfModule(mid)));\r
+\r
if (lcid != null) {\r
this.jComboBoxLibraryClassName.setSelectedItem(lcid.getLibraryClassName());\r
this.jComboBoxUsage.setSelectedItem(lcid.getUsage());\r
\r
**/\r
private void initFrame() {\r
- Tools.generateComboBoxByVector(jComboBoxLibraryClassName, wt.getAllLibraryClassDefinitionsFromWorkspace());\r
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVLibraryUsage());\r
this.iCheckBoxListModule.setAllItems(ed.getVFrameworkModuleTypes());\r
}\r
// Check LibraryClass\r
//\r
if (this.jComboBoxLibraryClassName.getSelectedItem() == null) {\r
- Log.wrn("Update Library Class Definitions", "No Library Class can be added");\r
+ Log.wrn("Update Library Class Definitions", "Please select one Library Class");\r
return false;\r
}\r
if (!DataValidation.isLibraryClass(this.jComboBoxLibraryClassName.getSelectedItem().toString())) {\r