]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java
Fixed wording for Legacy FlashMap.h Header question
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / module / ui / MsaHeader.java
index 18757ae473b55bd6576281a2e96870a158015d71..bf7afce417a1b7a7eaceff60240e8fbb0140aca7 100644 (file)
@@ -20,6 +20,7 @@ import java.awt.event.ComponentEvent;
 import java.awt.event.FocusEvent;\r
 import java.util.Vector;\r
 \r
+import javax.swing.ButtonGroup;\r
 import javax.swing.JButton;\r
 import javax.swing.JCheckBox;\r
 import javax.swing.JComboBox;\r
@@ -44,6 +45,7 @@ import org.tianocore.frameworkwizard.common.Tools;
 import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;\r
 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;\r
 import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
+import javax.swing.JRadioButton;\r
 \r
 /**\r
  The class is used to create, update MsaHeader of MSA file\r
@@ -123,8 +125,6 @@ public class MsaHeader extends IInternalFrame {
 \r
     private JLabel jLabelBinaryModule = null;\r
 \r
-    private JComboBox jComboBoxBinaryModule = null;\r
-\r
     private JLabel jLabelOutputFileBasename = null;\r
 \r
     private JTextField jTextFieldOutputFileBasename = null;\r
@@ -194,6 +194,10 @@ public class MsaHeader extends IInternalFrame {
 \r
     private EnumerationData ed = new EnumerationData();\r
 \r
+    private JRadioButton jRadioButtonBinaryModuleTrue = null;\r
+\r
+    private JRadioButton jRadioButtonBinaryModuleFalse = null;\r
+\r
     /**\r
      * This method initializes jCheckBoxIa32    \r
      *  \r
@@ -599,29 +603,6 @@ public class MsaHeader extends IInternalFrame {
         return jTextAreaCopyright;\r
     }\r
 \r
-    /**\r
-     * This method initializes jComboBoxBinaryModule    \r
-     *  \r
-     * @return javax.swing.JComboBox    \r
-     */\r
-    private JComboBox getJComboBoxBinaryModule() {\r
-        if (jComboBoxBinaryModule == null) {\r
-            jComboBoxBinaryModule = new JComboBox();\r
-            jComboBoxBinaryModule.setBounds(new java.awt.Rectangle(valueCol, 480, valueWidth, 20));\r
-            jComboBoxBinaryModule.setPreferredSize(new java.awt.Dimension(valueWidth, 20));\r
-            jComboBoxBinaryModule.addFocusListener(this);\r
-            jComboBoxBinaryModule.setToolTipText("<html>Modules are either source modules <br>"\r
-                                                 + "which can be compiled or binary <br>"\r
-                                                 + "modules which are linked.  <br>"\r
-                                                 + "A module cannot contain both. <br>"\r
-                                                 + "The GUID numbers should be identical <br>"\r
-                                                 + "for a binary and source MSA, <br>"\r
-                                                 + "however the BINARY MSA should have <br>"\r
-                                                 + "a higher version number.</html>");\r
-        }\r
-        return jComboBoxBinaryModule;\r
-    }\r
-\r
     /**\r
      * This method initializes jTextFieldOutputFileBasename \r
      *  \r
@@ -798,9 +779,9 @@ public class MsaHeader extends IInternalFrame {
                 this.setSelectedItems(Tools.convertListToVector(md.getSupportedArchitectures()));\r
             }\r
             if (md.getBinaryModule()) {\r
-                this.jComboBoxBinaryModule.setSelectedIndex(1);\r
+                this.jRadioButtonBinaryModuleTrue.setSelected(true);\r
             } else {\r
-                this.jComboBoxBinaryModule.setSelectedIndex(0);\r
+                this.jRadioButtonBinaryModuleFalse.setSelected(true);\r
             }\r
             if (md.getOutputFileBasename() != null) {\r
                 this.jTextFieldOutputFileBasename.setText(md.getOutputFileBasename());\r
@@ -917,7 +898,6 @@ public class MsaHeader extends IInternalFrame {
             jContentPane.add(jLabelOutputFileBasename, null);\r
             jContentPane.add(getJTextFieldOutputFileBasename(), null);\r
             jContentPane.add(jLabelBinaryModule, null);\r
-            jContentPane.add(getJComboBoxBinaryModule(), null);\r
             jContentPane.add(jLabelArch, null);\r
 \r
             jStarLabel1 = new StarLabel();\r
@@ -963,11 +943,15 @@ public class MsaHeader extends IInternalFrame {
             jContentPane.add(getJCheckBoxArm(), null);\r
             jContentPane.add(getJCheckBoxPpc(), null);\r
 \r
-            \r
             jContentPane.add(getJCheckBoxPcd(), null);\r
             jContentPane.add(getJComboBoxPcdIsDriver(), null);\r
-            \r
             jContentPane.add(getJCheckBoxFlashMap(), null);\r
+\r
+            ButtonGroup bg = new ButtonGroup();\r
+            jContentPane.add(getJRadioButtonBinaryModuleTrue(), null);\r
+            jContentPane.add(getJRadioButtonBinaryModuleFalse(), null);\r
+            bg.add(getJRadioButtonBinaryModuleTrue());\r
+            bg.add(getJRadioButtonBinaryModuleFalse());\r
         }\r
         return jContentPane;\r
     }\r
@@ -1146,7 +1130,6 @@ public class MsaHeader extends IInternalFrame {
     private void initFrame() {\r
         EnumerationData ed = new EnumerationData();\r
         Tools.generateComboBoxByVector(jComboBoxModuleType, ed.getVModuleType());\r
-        Tools.generateComboBoxByVector(jComboBoxBinaryModule, ed.getVBoolean());\r
         this.setSelectedItems(ed.getVSupportedArchitectures());\r
     }\r
 \r
@@ -1186,15 +1169,14 @@ public class MsaHeader extends IInternalFrame {
         Tools.resizeComponentWidth(this.jTextFieldURL, intCurrentWidth, intPreferredWidth);\r
         Tools.resizeComponentWidth(this.jScrollPaneCopyright, intCurrentWidth, intPreferredWidth);\r
         Tools.resizeComponentWidth(this.jScrollPaneDescription, intCurrentWidth, intPreferredWidth);\r
-        // Tools.resizeComponentWidth(this.jTextFieldSpecification, intCurrentWidth, intPreferredWidth);\r
+        Tools.resizeComponentWidth(this.jTextFieldSpecification, intCurrentWidth, intPreferredWidth);\r
         Tools.resizeComponentWidth(this.jTextFieldAbstract, intCurrentWidth, intPreferredWidth);\r
-        // Tools.resizeComponentWidth(this.jComboBoxModuleType, intCurrentWidth, intPreferredWidth);\r
-        // Tools.resizeComponentWidth(this.jComboBoxBinaryModule, intCurrentWidth, intPreferredWidth);\r
+        Tools.resizeComponentWidth(this.jComboBoxModuleType, intCurrentWidth, intPreferredWidth);\r
         Tools.resizeComponentWidth(this.jTextFieldOutputFileBasename, intCurrentWidth, intPreferredWidth);\r
-        // Tools.resizeComponentWidth(this.jComboBoxPcdIsDriver, intCurrentWidth, intPreferredWidth);\r
+        Tools.resizeComponentWidth(this.jComboBoxPcdIsDriver, intCurrentWidth, intPreferredWidth);\r
 \r
         Tools.relocateComponentX(this.jButtonGenerateGuid, intCurrentWidth, intPreferredWidth,\r
-                                 DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON - 5);\r
+                                 DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON);\r
     }\r
 \r
     public void focusLost(FocusEvent arg0) {\r
@@ -1391,14 +1373,21 @@ public class MsaHeader extends IInternalFrame {
         //\r
         // Check Binary Module Type\r
         //\r
-        if (arg0.getSource() == this.jComboBoxBinaryModule) {\r
-            if (jComboBoxBinaryModule.getSelectedItem().toString().equals(DataType.TRUE)) {\r
+        if (arg0.getSource() == this.jRadioButtonBinaryModuleTrue) {\r
+            if (jRadioButtonBinaryModuleTrue.isSelected()) {\r
                 if (md.getBinaryModule()) {\r
                     return;\r
                 } else {\r
                     md.setBinaryModule(true);\r
                 }\r
-            } else if (jComboBoxBinaryModule.getSelectedItem().toString().equals(DataType.FALSE)) {\r
+            }\r
+        }\r
+\r
+        //\r
+        // Check Binary Module Type\r
+        //\r
+        if (arg0.getSource() == this.jRadioButtonBinaryModuleFalse) {\r
+            if (jRadioButtonBinaryModuleFalse.isSelected()) {\r
                 if (md.getBinaryModule()) {\r
                     md.setBinaryModule(false);\r
                 } else {\r
@@ -1613,10 +1602,56 @@ public class MsaHeader extends IInternalFrame {
         if (jCheckBoxFlashMap == null) {\r
             jCheckBoxFlashMap = new JCheckBox();\r
             jCheckBoxFlashMap.setBounds(new java.awt.Rectangle(labelCol, 555, 480, 20));\r
-            jCheckBoxFlashMap.setText("Are you using a legacy FlashMap header file?");\r
+            jCheckBoxFlashMap.setText("Does this module require a legacy FlashMap header file?");\r
             jCheckBoxFlashMap.addFocusListener(this);\r
         }\r
         return jCheckBoxFlashMap;\r
     }\r
-    \r
+\r
+    /**\r
+     * This method initializes jRadioButtonBinaryModuleTrue    \r
+     *         \r
+     * @return javax.swing.JRadioButton        \r
+     */\r
+    private JRadioButton getJRadioButtonBinaryModuleTrue() {\r
+        if (jRadioButtonBinaryModuleTrue == null) {\r
+            jRadioButtonBinaryModuleTrue = new JRadioButton();\r
+            jRadioButtonBinaryModuleTrue.setBounds(new java.awt.Rectangle(valueCol, 480, 140, 20));\r
+            jRadioButtonBinaryModuleTrue.setText("True");\r
+            jRadioButtonBinaryModuleTrue.setSelected(true);\r
+            jRadioButtonBinaryModuleTrue.addFocusListener(this);\r
+            jRadioButtonBinaryModuleTrue.setToolTipText("<html>Modules are either source modules <br>"\r
+                                                        + "which can be compiled or binary <br>"\r
+                                                        + "modules which are linked.  <br>"\r
+                                                        + "A module cannot contain both. <br>"\r
+                                                        + "The GUID numbers should be identical <br>"\r
+                                                        + "for a binary and source MSA, <br>"\r
+                                                        + "however the BINARY MSA should have <br>"\r
+                                                        + "a higher version number.</html>");\r
+        }\r
+        return jRadioButtonBinaryModuleTrue;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jRadioButtonBinaryModuleFalse   \r
+     *         \r
+     * @return javax.swing.JRadioButton        \r
+     */\r
+    private JRadioButton getJRadioButtonBinaryModuleFalse() {\r
+        if (jRadioButtonBinaryModuleFalse == null) {\r
+            jRadioButtonBinaryModuleFalse = new JRadioButton();\r
+            jRadioButtonBinaryModuleFalse.setBounds(new java.awt.Rectangle(valueCol + 140, 480, 140, 20));\r
+            jRadioButtonBinaryModuleFalse.setText("False");\r
+            jRadioButtonBinaryModuleFalse.addFocusListener(this);\r
+            jRadioButtonBinaryModuleFalse.setToolTipText("<html>Modules are either source modules <br>"\r
+                                                         + "which can be compiled or binary <br>"\r
+                                                         + "modules which are linked.  <br>"\r
+                                                         + "A module cannot contain both. <br>"\r
+                                                         + "The GUID numbers should be identical <br>"\r
+                                                         + "for a binary and source MSA, <br>"\r
+                                                         + "however the BINARY MSA should have <br>"\r
+                                                         + "a higher version number.</html>");\r
+        }\r
+        return jRadioButtonBinaryModuleFalse;\r
+    }\r
 }\r