]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/LibraryClassDefsDlg.java
Changed spelling to manifest
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / module / ui / dialog / LibraryClassDefsDlg.java
index 8b5dfd980b182daafa89af793fc37db120ecf119..c475b4ab1bdcbeff159832fa15d0ca4454fcfc3e 100644 (file)
@@ -35,15 +35,17 @@ 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
- * The class is used to create, update Library Class Definition of MSA/MBD file\r
+ * The class is used to create, update Library Class Definition section of the MSA file\r
  * \r
  * It extends IDialog\r
  * \r
- **/\r
+ */\r
 public class LibraryClassDefsDlg extends IDialog {\r
 \r
     ///\r
@@ -211,9 +213,10 @@ public class LibraryClassDefsDlg extends IDialog {
     private JTextField getJTextFieldFeatureFlag() {\r
         if (jTextFieldFeatureFlag == null) {\r
             jTextFieldFeatureFlag = new JTextField();\r
-            jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 87, 320, 20));\r
+            jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168,197,320,20));\r
             jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));\r
             jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");\r
+            jTextFieldFeatureFlag.setEnabled(false);\r
         }\r
         return jTextFieldFeatureFlag;\r
     }\r
@@ -239,7 +242,7 @@ public class LibraryClassDefsDlg extends IDialog {
     private JScrollPane getJScrollPaneModuleList() {\r
         if (jScrollPaneModuleList == null) {\r
             jScrollPaneModuleList = new JScrollPane();\r
-            jScrollPaneModuleList.setBounds(new java.awt.Rectangle(168, 137, 320, 80));\r
+            jScrollPaneModuleList.setBounds(new java.awt.Rectangle(168, 112, 320, 80));\r
             jScrollPaneModuleList.setPreferredSize(new java.awt.Dimension(320, 80));\r
             jScrollPaneModuleList.setViewportView(getICheckBoxListSupModuleList());\r
         }\r
@@ -301,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
@@ -323,9 +326,26 @@ 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
+        //\r
+        // Init arch with module's arch\r
+        //\r
+        this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));\r
+        \r
+        //\r
+        // Get defined library classes from dependent packages\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
@@ -361,22 +381,23 @@ public class LibraryClassDefsDlg extends IDialog {
     private JPanel getJContentPane() {\r
         if (jContentPane == null) {\r
             jArchCheckBox = new ArchCheckBox();\r
-            jArchCheckBox.setBounds(new java.awt.Rectangle(168, 112, 320, 20));\r
+            jArchCheckBox.setBounds(new java.awt.Rectangle(168, 87, 320, 20));\r
             jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));\r
             jLabelHelpText = new JLabel();\r
             jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 168, 20));\r
             jLabelHelpText.setText("Help Text");\r
             jLabelModuleList = new JLabel();\r
-            jLabelModuleList.setBounds(new java.awt.Rectangle(12, 137, 168, 20));\r
+            jLabelModuleList.setBounds(new java.awt.Rectangle(12, 112, 168, 20));\r
             jLabelModuleList.setText("Supported Module Types");\r
             jLabelArch = new JLabel();\r
-            jLabelArch.setBounds(new java.awt.Rectangle(12, 112, 168, 20));\r
+            jLabelArch.setBounds(new java.awt.Rectangle(12, 87, 168, 20));\r
             jLabelArch.setText("Supported Architectures");\r
             jLabelFeatureFlag = new JLabel();\r
-            jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 87, 168, 20));\r
+            jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12,197,168,20));\r
             jLabelFeatureFlag.setText("Feature Flag Expression");\r
+            jLabelFeatureFlag.setEnabled(false);\r
             jLabelRecommendedInstanceGuid = new JLabel();\r
-            jLabelRecommendedInstanceGuid.setBounds(new java.awt.Rectangle(12, 112, 200, 20));\r
+            jLabelRecommendedInstanceGuid.setBounds(new java.awt.Rectangle(12, 87, 200, 20));\r
             jLabelRecommendedInstanceGuid.setText("Recommended Instance Guid");\r
             jLabelRecommendedInstanceGuid.setVisible(false);\r
             jLabelRecommendedInstanceVersion = new JLabel();\r
@@ -428,7 +449,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
@@ -470,7 +490,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