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
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
\r
private JLabel jLabelBinaryModule = null;\r
\r
- private JComboBox jComboBoxBinaryModule = null;\r
-\r
private JLabel jLabelOutputFileBasename = null;\r
\r
private JTextField jTextFieldOutputFileBasename = null;\r
\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
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
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
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
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
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
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
//\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
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