]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/LibraryClassDefsDlg.java
1. Fix EDKT323 (Only dependent packages' ppis can be added to module's ppi section)
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / module / ui / dialog / LibraryClassDefsDlg.java
index 1f825438fe138875556186462fd9adacaaf7468b..87708b836c7b248ee8f774dd8f54250bd3481c36 100644 (file)
@@ -35,7 +35,9 @@ import org.tianocore.frameworkwizard.common.ui.IDialog;
 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
@@ -302,9 +304,9 @@ public class LibraryClassDefsDlg extends IDialog {
      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
@@ -324,9 +326,18 @@ public class LibraryClassDefsDlg extends IDialog {
      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
@@ -430,7 +441,6 @@ public class LibraryClassDefsDlg extends IDialog {
      \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
@@ -472,7 +482,7 @@ public class LibraryClassDefsDlg extends IDialog {
         // 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