]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HobsDlg.java
1. Fix EDKT321 A module's all top level elements' arch should be in range of the...
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / module / ui / dialog / HobsDlg.java
index d46958be1b730ae34c8cd9742b4a8b4c5cc58faa..eaba4c6c973f92021a6f47fdac901f1492308461 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
  \r
- The file is used to create, update Hob of MSA/MBD file\r
+ The file is used to create, update Hob section of the MSA file\r
  \r
  Copyright (c) 2006, Intel Corporation\r
  All rights reserved. This program and the accompanying materials\r
@@ -34,11 +34,14 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
 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.Hobs.HobsIdentification;\r
 import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
 \r
 /**\r
- * The class is used to create, update Hob of the MSA file It extends JDialog\r
+ * The class is used to create, update Hob of the MSA file \r
+ * \r
+ * It extends IDialog\r
  * \r
  */\r
 public class HobsDlg extends IDialog {\r
@@ -185,9 +188,10 @@ public class HobsDlg extends IDialog {
     private JTextField getJTextFieldFeatureFlag() {\r
         if (jTextFieldFeatureFlag == null) {\r
             jTextFieldFeatureFlag = new JTextField();\r
-            jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 132, 320, 20));\r
+            jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 157, 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
@@ -280,10 +284,15 @@ public class HobsDlg extends IDialog {
      * @param inHobsId\r
      * \r
      */\r
-    private void init(HobsIdentification inHobsId) {\r
+    private void init(HobsIdentification inHobsId, ModuleIdentification mid) {\r
         init();\r
         this.id = inHobsId;\r
-\r
+        \r
+        //\r
+        // Init arch with module's arch\r
+        //\r
+        this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));\r
+        \r
         if (this.id != null) {\r
             this.jComboBoxGuidC_Name.setSelectedItem(id.getName());\r
             this.jComboBoxHobType.setSelectedItem(id.getType());\r
@@ -301,9 +310,9 @@ public class HobsDlg extends IDialog {
      * @param iFrame\r
      * \r
      */\r
-    public HobsDlg(HobsIdentification inHobsIdentification, IFrame iFrame) {\r
+    public HobsDlg(HobsIdentification inHobsIdentification, IFrame iFrame, ModuleIdentification mid) {\r
         super(iFrame, true);\r
-        init(inHobsIdentification);\r
+        init(inHobsIdentification, mid);\r
     }\r
 \r
     /**\r
@@ -352,14 +361,15 @@ public class HobsDlg extends IDialog {
             jLabelHelpText.setText("Help Text");\r
 \r
             jLabelFeatureFlag = new JLabel();\r
-            jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 132, 155, 20));\r
+            jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 157, 155, 20));\r
             jLabelFeatureFlag.setText("Feature Flag Expression");\r
+            jLabelFeatureFlag.setEnabled(false);\r
 \r
             jLabelArch = new JLabel();\r
-            jLabelArch.setBounds(new java.awt.Rectangle(12, 157, 155, 20));\r
+            jLabelArch.setBounds(new java.awt.Rectangle(12, 132, 155, 20));\r
             jLabelArch.setText("Supported Architectures");\r
             jArchCheckBox = new ArchCheckBox();\r
-            jArchCheckBox.setBounds(new java.awt.Rectangle(168, 157, 320, 20));\r
+            jArchCheckBox.setBounds(new java.awt.Rectangle(168, 132, 320, 20));\r
             jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));\r
 \r
             jContentPane = new JPanel();\r
@@ -436,7 +446,7 @@ public class HobsDlg extends IDialog {
         // Check Name\r
         //\r
         if (isEmpty(this.jComboBoxGuidC_Name.getSelectedItem().toString())) {\r
-            Log.wrn("Update Hobs", "Hob Guid C Name must not be empty");\r
+            Log.wrn("Update Hobs", "Hob Guid C Name must be entered!");\r
             return false;\r
         }\r
 \r