Fixed wording for Legacy FlashMap.h Header question
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / module / ui / MsaHeader.java
CommitLineData
a13899c5 1/** @file\r
2 \r
3 The file is used to create, update MsaHeader of MSA file\r
4 \r
5 Copyright (c) 2006, Intel Corporation\r
6 All rights reserved. This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10 \r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13 \r
14 **/\r
15\r
16package org.tianocore.frameworkwizard.module.ui;\r
17\r
18import java.awt.event.ActionEvent;\r
19import java.awt.event.ComponentEvent;\r
20import java.awt.event.FocusEvent;\r
739c6b04 21import java.util.Vector;\r
a13899c5 22\r
b63cc1b6 23import javax.swing.ButtonGroup;\r
a13899c5 24import javax.swing.JButton;\r
739c6b04 25import javax.swing.JCheckBox;\r
a13899c5 26import javax.swing.JComboBox;\r
27import javax.swing.JLabel;\r
28import javax.swing.JPanel;\r
29import javax.swing.JScrollPane;\r
30import javax.swing.JTextArea;\r
31import javax.swing.JTextField;\r
32\r
3b7a9058 33import org.tianocore.ExternsDocument;\r
9a8d6d9f 34import org.tianocore.ModuleDefinitionsDocument;\r
a13899c5 35import org.tianocore.ModuleSurfaceAreaDocument;\r
36import org.tianocore.ModuleTypeDef;\r
37import org.tianocore.MsaHeaderDocument;\r
3b7a9058 38import org.tianocore.PcdDriverTypes;\r
a13899c5 39import org.tianocore.LicenseDocument.License;\r
40import org.tianocore.frameworkwizard.common.DataType;\r
41import org.tianocore.frameworkwizard.common.DataValidation;\r
42import org.tianocore.frameworkwizard.common.EnumerationData;\r
43import org.tianocore.frameworkwizard.common.Log;\r
a13899c5 44import org.tianocore.frameworkwizard.common.Tools;\r
79cb6fdb 45import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;\r
a13899c5 46import org.tianocore.frameworkwizard.common.ui.IInternalFrame;\r
47import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
b63cc1b6 48import javax.swing.JRadioButton;\r
a13899c5 49\r
50/**\r
51 The class is used to create, update MsaHeader of MSA file\r
52 It extends IInternalFrame\r
53 \r
54\r
55\r
56 **/\r
57public class MsaHeader extends IInternalFrame {\r
58\r
59 ///\r
60 /// Define class Serial Version UID\r
61 ///\r
62 private static final long serialVersionUID = -8152099582923006900L;\r
63\r
9d0ac02b 64 private int dialogWidth = 500;\r
3b7a9058 65\r
9d0ac02b 66 private int dialogHeight = 630;\r
3b7a9058 67\r
0f6a6511 68 private final int labelWidth = 155;\r
69 \r
70 private int valueWidth = 320;\r
71 \r
72 private final int labelCol = 12;\r
73 \r
74 private final int valueCol = 168;\r
a13899c5 75 //\r
76 //Define class members\r
77 //\r
78 private JPanel jContentPane = null;\r
79\r
80 private JLabel jLabelBaseName = null;\r
81\r
82 private JTextField jTextFieldBaseName = null;\r
83\r
84 private JLabel jLabelGuid = null;\r
85\r
86 private JTextField jTextFieldGuid = null;\r
87\r
88 private JLabel jLabelVersion = null;\r
89\r
90 private JTextField jTextFieldVersion = null;\r
91\r
92 private JButton jButtonGenerateGuid = null;\r
93\r
94 private JLabel jLabelLicense = null;\r
95\r
96 private JTextArea jTextAreaLicense = null;\r
97\r
98 private JLabel jLabelCopyright = null;\r
99\r
100 private JLabel jLabelDescription = null;\r
101\r
102 private JTextArea jTextAreaDescription = null;\r
103\r
104 private JLabel jLabelSpecification = null;\r
105\r
106 private JTextField jTextFieldSpecification = null;\r
107\r
108 private JButton jButtonOk = null;\r
109\r
110 private JButton jButtonCancel = null;\r
111\r
112 private JScrollPane jScrollPaneLicense = null;\r
113\r
114 private JScrollPane jScrollPaneDescription = null;\r
115\r
116 private JLabel jLabelAbstract = null;\r
117\r
118 private JTextField jTextFieldAbstract = null;\r
119\r
120 private JLabel jLabelModuleType = null;\r
121\r
122 private JComboBox jComboBoxModuleType = null;\r
123\r
739c6b04 124 private JLabel jLabelArch = null;\r
125\r
126 private JLabel jLabelBinaryModule = null;\r
127\r
739c6b04 128 private JLabel jLabelOutputFileBasename = null;\r
129\r
130 private JTextField jTextFieldOutputFileBasename = null;\r
131\r
132 private JScrollPane jScrollPaneCopyright = null;\r
133\r
134 private JTextArea jTextAreaCopyright = null;\r
135\r
136 private JLabel jLabelURL = null;\r
137\r
138 private JTextField jTextFieldURL = null;\r
139\r
140 private JScrollPane jScrollPane = null;\r
141\r
a13899c5 142 private StarLabel jStarLabel1 = null;\r
143\r
144 private StarLabel jStarLabel2 = null;\r
145\r
146 private StarLabel jStarLabel4 = null;\r
147\r
148 private StarLabel jStarLabel5 = null;\r
149\r
150 private StarLabel jStarLabel6 = null;\r
151\r
152 private StarLabel jStarLabel7 = null;\r
153\r
154 private StarLabel jStarLabel8 = null;\r
155\r
156 private StarLabel jStarLabel10 = null;\r
157\r
158 private StarLabel jStarLabel12 = null;\r
159\r
739c6b04 160 private StarLabel jStarLabel13 = null;\r
a13899c5 161\r
739c6b04 162 private StarLabel jStarLabel14 = null;\r
a13899c5 163\r
739c6b04 164 private JCheckBox jCheckBoxIa32 = null;\r
a13899c5 165\r
739c6b04 166 private JCheckBox jCheckBoxX64 = null;\r
a13899c5 167\r
739c6b04 168 private JCheckBox jCheckBoxIpf = null;\r
169\r
170 private JCheckBox jCheckBoxEbc = null;\r
171\r
172 private JCheckBox jCheckBoxArm = null;\r
173\r
174 private JCheckBox jCheckBoxPpc = null;\r
3b7a9058 175\r
176 private JComboBox jComboBoxPcdIsDriver = null;\r
177\r
178 private JCheckBox jCheckBoxPcd = null;\r
179\r
180 private JCheckBox jCheckBoxFlashMap = null;\r
181\r
739c6b04 182 //\r
183 // Not used for UI\r
184 //\r
185 private MsaHeaderDocument.MsaHeader msaHeader = null;\r
186\r
187 private ModuleDefinitionsDocument.ModuleDefinitions md = null;\r
188\r
189 private ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = null;\r
a13899c5 190\r
3b7a9058 191 private ExternsDocument.Externs ex = null;\r
192\r
a13899c5 193 private OpeningModuleType omt = null;\r
2003a22e 194\r
9a8d6d9f 195 private EnumerationData ed = new EnumerationData();\r
a13899c5 196\r
b63cc1b6 197 private JRadioButton jRadioButtonBinaryModuleTrue = null;\r
198\r
199 private JRadioButton jRadioButtonBinaryModuleFalse = null;\r
200\r
739c6b04 201 /**\r
202 * This method initializes jCheckBoxIa32 \r
203 * \r
204 * @return javax.swing.JCheckBox \r
205 */\r
206 private JCheckBox getJCheckBoxIa32() {\r
207 if (jCheckBoxIa32 == null) {\r
208 jCheckBoxIa32 = new JCheckBox();\r
0f6a6511 209 jCheckBoxIa32.setBounds(new java.awt.Rectangle(valueCol, 505, 55, 20));\r
739c6b04 210 jCheckBoxIa32.setText("IA32");\r
211 jCheckBoxIa32.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);\r
212 jCheckBoxIa32.addFocusListener(this);\r
213 }\r
214 return jCheckBoxIa32;\r
215 }\r
216\r
217 /**\r
218 * This method initializes jCheckBoxX64 \r
219 * \r
220 * @return javax.swing.JCheckBox \r
221 */\r
222 private JCheckBox getJCheckBoxX64() {\r
223 if (jCheckBoxX64 == null) {\r
224 jCheckBoxX64 = new JCheckBox();\r
0f6a6511 225 jCheckBoxX64.setBounds(new java.awt.Rectangle(valueCol + 55, 505, 53, 20));\r
739c6b04 226 jCheckBoxX64.setText("X64");\r
227 jCheckBoxX64.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);\r
228 jCheckBoxX64.addFocusListener(this);\r
229 }\r
230 return jCheckBoxX64;\r
231 }\r
232\r
233 /**\r
234 * This method initializes jCheckBoxIpf \r
235 * \r
236 * @return javax.swing.JCheckBox \r
237 */\r
238 private JCheckBox getJCheckBoxIpf() {\r
239 if (jCheckBoxIpf == null) {\r
240 jCheckBoxIpf = new JCheckBox();\r
0f6a6511 241 jCheckBoxIpf.setBounds(new java.awt.Rectangle(valueCol + 110, 505, 52, 20));\r
739c6b04 242 jCheckBoxIpf.setText("IPF");\r
243 jCheckBoxIpf.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);\r
244 jCheckBoxIpf.addFocusListener(this);\r
245 }\r
246 return jCheckBoxIpf;\r
247 }\r
248\r
249 /**\r
250 * This method initializes jCheckBoxEbc \r
251 * \r
252 * @return javax.swing.JCheckBox \r
253 */\r
254 private JCheckBox getJCheckBoxEbc() {\r
255 if (jCheckBoxEbc == null) {\r
256 jCheckBoxEbc = new JCheckBox();\r
0f6a6511 257 jCheckBoxEbc.setBounds(new java.awt.Rectangle(valueCol + 165, 505, 53, 20));\r
739c6b04 258 jCheckBoxEbc.setText("EBC");\r
259 jCheckBoxEbc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);\r
260 jCheckBoxEbc.addFocusListener(this);\r
261 }\r
262 return jCheckBoxEbc;\r
263 }\r
264\r
265 /**\r
266 * This method initializes jCheckBoxArm \r
267 * \r
268 * @return javax.swing.JCheckBox \r
269 */\r
270 private JCheckBox getJCheckBoxArm() {\r
271 if (jCheckBoxArm == null) {\r
272 jCheckBoxArm = new JCheckBox();\r
0f6a6511 273 jCheckBoxArm.setBounds(new java.awt.Rectangle(valueCol + 220, 505, 54, 20));\r
739c6b04 274 jCheckBoxArm.setText("ARM");\r
275 jCheckBoxArm.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);\r
276 jCheckBoxArm.addFocusListener(this);\r
277 }\r
278 return jCheckBoxArm;\r
279 }\r
280\r
281 /**\r
282 * This method initializes jCheckBoxPpc \r
283 * \r
284 * @return javax.swing.JCheckBox \r
285 */\r
286 private JCheckBox getJCheckBoxPpc() {\r
287 if (jCheckBoxPpc == null) {\r
288 jCheckBoxPpc = new JCheckBox();\r
0f6a6511 289 jCheckBoxPpc.setBounds(new java.awt.Rectangle(valueCol + 285, 505, 53, 20));\r
739c6b04 290 jCheckBoxPpc.setText("PPC");\r
291 jCheckBoxPpc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);\r
292 jCheckBoxPpc.addFocusListener(this);\r
293 }\r
294 return jCheckBoxPpc;\r
295 }\r
296\r
a13899c5 297 /**\r
298 This method initializes jTextFieldBaseName \r
299 \r
300 @return javax.swing.JTextField jTextFieldBaseName\r
301 \r
302 **/\r
303 private JTextField getJTextFieldBaseName() {\r
304 if (jTextFieldBaseName == null) {\r
305 jTextFieldBaseName = new JTextField();\r
0f6a6511 306 jTextFieldBaseName.setBounds(new java.awt.Rectangle(valueCol, 10, valueWidth, 20));\r
a13899c5 307 jTextFieldBaseName.setPreferredSize(new java.awt.Dimension(320, 20));\r
308 jTextFieldBaseName.addFocusListener(this);\r
f51ee52b 309 jTextFieldBaseName.setToolTipText("A brief Identifier, such as USB I/O Library, of the module");\r
a13899c5 310 }\r
311 return jTextFieldBaseName;\r
312 }\r
313\r
314 /**\r
315 This method initializes jTextFieldGuid \r
316 \r
317 @return javax.swing.JTextField jTextFieldGuid\r
318 \r
319 **/\r
320 private JTextField getJTextFieldGuid() {\r
321 if (jTextFieldGuid == null) {\r
322 jTextFieldGuid = new JTextField();\r
323 jTextFieldGuid.setPreferredSize(new java.awt.Dimension(250, 20));\r
0f6a6511 324 jTextFieldGuid.setLocation(new java.awt.Point(valueCol, 60));\r
a13899c5 325 jTextFieldGuid.setSize(new java.awt.Dimension(250, 20));\r
326 jTextFieldGuid.addFocusListener(this);\r
f51ee52b 327 jTextFieldGuid.setToolTipText("Guaranteed Unique Identification Number, Registry Format (8-4-4-4-12)");\r
a13899c5 328 }\r
329 return jTextFieldGuid;\r
330 }\r
331\r
332 /**\r
333 This method initializes jTextFieldVersion \r
334 \r
335 @return javax.swing.JTextField jTextFieldVersion\r
336 \r
337 **/\r
338 private JTextField getJTextFieldVersion() {\r
339 if (jTextFieldVersion == null) {\r
340 jTextFieldVersion = new JTextField();\r
0f6a6511 341 jTextFieldVersion.setPreferredSize(new java.awt.Dimension(valueWidth, 20));\r
342 jTextFieldVersion.setLocation(new java.awt.Point(valueCol, 85));\r
343 jTextFieldVersion.setSize(new java.awt.Dimension(valueWidth, 20));\r
a13899c5 344 jTextFieldVersion.addFocusListener(this);\r
f51ee52b 345 jTextFieldVersion.setToolTipText("A Version Number, 1.0, 1, 1.01, 1.0.1");\r
a13899c5 346 }\r
347 return jTextFieldVersion;\r
348 }\r
349\r
350 /**\r
351 This method initializes jButtonGenerateGuid \r
352 \r
353 @return javax.swing.JButton jButtonGenerateGuid\r
354 \r
355 **/\r
356 private JButton getJButtonGenerateGuid() {\r
357 if (jButtonGenerateGuid == null) {\r
0f6a6511 358 int genGuidCol = valueCol + 285;\r
a13899c5 359 jButtonGenerateGuid = new JButton();\r
360 jButtonGenerateGuid.setPreferredSize(new java.awt.Dimension(65, 20));\r
361 jButtonGenerateGuid.setSize(new java.awt.Dimension(65, 20));\r
0f6a6511 362 jButtonGenerateGuid.setLocation(new java.awt.Point(genGuidCol, 60));\r
a13899c5 363 jButtonGenerateGuid.setText("GEN");\r
364 jButtonGenerateGuid.addActionListener(this);\r
365 }\r
366 return jButtonGenerateGuid;\r
367 }\r
368\r
369 /**\r
370 This method initializes jTextAreaLicense \r
371 \r
372 @return javax.swing.JTextArea jTextAreaLicense\r
373 \r
374 **/\r
375 private JTextArea getJTextAreaLicense() {\r
376 if (jTextAreaLicense == null) {\r
377 jTextAreaLicense = new JTextArea();\r
378 jTextAreaLicense.setText("");\r
379 jTextAreaLicense.setLineWrap(true);\r
380 jTextAreaLicense.addFocusListener(this);\r
2003a22e 381 jTextAreaLicense.setWrapStyleWord(true);\r
382 jTextAreaLicense.setSelectionStart(0);\r
383 jTextAreaLicense.setSelectionEnd(0);\r
f51ee52b 384 jTextAreaLicense.setToolTipText("The License for this Module.");\r
a13899c5 385 }\r
386 return jTextAreaLicense;\r
387 }\r
388\r
389 /**\r
390 This method initializes jTextAreaDescription \r
391 \r
392 @return javax.swing.JTextArea jTextAreaDescription\r
393 \r
394 **/\r
395 private JTextArea getJTextAreaDescription() {\r
396 if (jTextAreaDescription == null) {\r
397 jTextAreaDescription = new JTextArea();\r
398 jTextAreaDescription.setLineWrap(true);\r
399 jTextAreaDescription.addFocusListener(this);\r
623db5ca 400 jTextAreaDescription.setToolTipText("A verbose description of the module.");\r
2003a22e 401 jTextAreaDescription.setWrapStyleWord(true);\r
9a8d6d9f 402 jTextAreaDescription.setSelectionStart(0);\r
403 jTextAreaDescription.setSelectionEnd(0);\r
a13899c5 404 }\r
405 return jTextAreaDescription;\r
406 }\r
407\r
408 /**\r
409 This method initializes jTextFieldSpecification \r
410 \r
411 @return javax.swing.JTextField jTextFieldSpecification\r
412 \r
413 **/\r
414 private JTextField getJTextFieldSpecification() {\r
415 if (jTextFieldSpecification == null) {\r
0f6a6511 416 int specWidth = valueWidth + 50;\r
a13899c5 417 jTextFieldSpecification = new JTextField();\r
3b7a9058 418\r
0f6a6511 419 jTextFieldSpecification.setPreferredSize(new java.awt.Dimension(specWidth, 20));\r
c06e8657 420 jTextFieldSpecification.setText("FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052");\r
9d0ac02b 421 jTextFieldSpecification.setBorder(null);\r
3b7a9058 422\r
0f6a6511 423 jTextFieldSpecification.setSize(new java.awt.Dimension(specWidth, 20));\r
424 jTextFieldSpecification.setLocation(new java.awt.Point(labelCol, dialogHeight - 30));\r
a13899c5 425 jTextFieldSpecification.setEditable(false);\r
426 jTextFieldSpecification.addFocusListener(this);\r
a13899c5 427 }\r
428 return jTextFieldSpecification;\r
429 }\r
430\r
431 /**\r
432 This method initializes jButtonOk \r
433 \r
434 @return javax.swing.JButton jButtonOk\r
435 \r
436 **/\r
437 private JButton getJButtonOk() {\r
438 if (jButtonOk == null) {\r
439 jButtonOk = new JButton();\r
440 jButtonOk.setText("OK");\r
441 jButtonOk.setPreferredSize(new java.awt.Dimension(90, 20));\r
442 jButtonOk.setBounds(new java.awt.Rectangle(390, 455, 90, 20));\r
443 jButtonOk.addActionListener(this);\r
444 jButtonOk.setVisible(false);\r
445 }\r
446 return jButtonOk;\r
447 }\r
448\r
449 /**\r
450 This method initializes jButtonCancel \r
451 \r
452 @return javax.swing.JButton jButtonCancel\r
453 \r
454 **/\r
455 private JButton getJButtonCancel() {\r
456 if (jButtonCancel == null) {\r
457 jButtonCancel = new JButton();\r
458 jButtonCancel.setText("Cancel");\r
459 jButtonCancel.setBounds(new java.awt.Rectangle(390, 445, 90, 20));\r
460 jButtonCancel.addActionListener(this);\r
461 jButtonCancel.setPreferredSize(new java.awt.Dimension(90, 20));\r
462 jButtonCancel.setVisible(false);\r
463 }\r
464 return jButtonCancel;\r
465 }\r
466\r
467 /**\r
468 This method initializes jScrollPaneLicense \r
469 \r
470 @return javax.swing.JScrollPane jScrollPaneLicense\r
471 \r
472 **/\r
473 private JScrollPane getJScrollPaneLicense() {\r
474 if (jScrollPaneLicense == null) {\r
475 jScrollPaneLicense = new JScrollPane();\r
476 jScrollPaneLicense.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);\r
0f6a6511 477 jScrollPaneLicense.setSize(new java.awt.Dimension(valueWidth, 120));\r
478 jScrollPaneLicense.setLocation(new java.awt.Point(valueCol, 305));\r
a13899c5 479 jScrollPaneLicense.setViewportView(getJTextAreaLicense());\r
0f6a6511 480 jScrollPaneLicense.setPreferredSize(new java.awt.Dimension(valueWidth, 120));\r
a13899c5 481 }\r
482 return jScrollPaneLicense;\r
483 }\r
484\r
485 /**\r
486 This method initializes jScrollPaneDescription \r
487 \r
488 @return javax.swing.JScrollPane jScrollPaneDescription\r
489 \r
490 **/\r
491 private JScrollPane getJScrollPaneDescription() {\r
492 if (jScrollPaneDescription == null) {\r
493 jScrollPaneDescription = new JScrollPane();\r
494 jScrollPaneDescription.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);\r
0f6a6511 495 jScrollPaneDescription.setSize(new java.awt.Dimension(valueWidth, 120));\r
496 jScrollPaneDescription.setLocation(new java.awt.Point(valueCol, 135));\r
a13899c5 497 jScrollPaneDescription.setViewportView(getJTextAreaDescription());\r
0f6a6511 498 jScrollPaneDescription.setPreferredSize(new java.awt.Dimension(valueWidth, 120));\r
a13899c5 499 }\r
500 return jScrollPaneDescription;\r
501 }\r
502\r
503 /**\r
504 This method initializes jTextFieldAbstract \r
505 \r
506 @return javax.swing.JTextField jTextFieldAbstract\r
507 \r
508 **/\r
509 private JTextField getJTextFieldAbstract() {\r
510 if (jTextFieldAbstract == null) {\r
511 jTextFieldAbstract = new JTextField();\r
0f6a6511 512 jTextFieldAbstract.setPreferredSize(new java.awt.Dimension(valueWidth, 20));\r
513 jTextFieldAbstract.setLocation(new java.awt.Point(valueCol, 110));\r
514 jTextFieldAbstract.setSize(new java.awt.Dimension(valueWidth, 20));\r
a13899c5 515 jTextFieldAbstract.addFocusListener(this);\r
623db5ca 516 jTextFieldAbstract.setToolTipText("A one sentence description of this module.");\r
a13899c5 517 }\r
518 return jTextFieldAbstract;\r
519 }\r
520\r
521 /**\r
522 This method initializes jComboBoxModuleType \r
523 \r
524 @return javax.swing.JComboBox jComboBoxModuleType\r
525 \r
526 **/\r
527 private JComboBox getJComboBoxModuleType() {\r
528 if (jComboBoxModuleType == null) {\r
529 jComboBoxModuleType = new JComboBox();\r
0f6a6511 530 jComboBoxModuleType.setBounds(new java.awt.Rectangle(valueCol, 35, valueWidth, 20));\r
531 jComboBoxModuleType.setPreferredSize(new java.awt.Dimension(valueWidth, 20));\r
a13899c5 532 jComboBoxModuleType.addFocusListener(this);\r
533 }\r
534 return jComboBoxModuleType;\r
535 }\r
536\r
537 /**\r
739c6b04 538 This method initializes jTextFieldURL \r
a13899c5 539 \r
739c6b04 540 @return javax.swing.JTextField \r
a13899c5 541 \r
542 **/\r
a13899c5 543 private JTextField getJTextFieldURL() {\r
544 if (jTextFieldURL == null) {\r
545 jTextFieldURL = new JTextField();\r
0f6a6511 546 jTextFieldURL.setPreferredSize(new java.awt.Dimension(valueWidth, 20));\r
547 jTextFieldURL.setLocation(new java.awt.Point(valueCol, 430));\r
548 jTextFieldURL.setSize(new java.awt.Dimension(valueWidth, 20));\r
a13899c5 549 jTextFieldURL.addFocusListener(this);\r
623db5ca 550 jTextFieldURL.setToolTipText("A URL for the latest version of the license.");\r
a13899c5 551 }\r
552 return jTextFieldURL;\r
553 }\r
554\r
555 /**\r
739c6b04 556 This method initializes jScrollPane \r
557 \r
558 @return javax.swing.JScrollPane \r
559 \r
560 **/\r
a13899c5 561 private JScrollPane getJScrollPane() {\r
562 if (jScrollPane == null) {\r
563 jScrollPane = new JScrollPane();\r
564 jScrollPane.setViewportView(getJContentPane());\r
565 }\r
566 return jScrollPane;\r
567 }\r
568\r
739c6b04 569 /**\r
570 This method initializes jScrollPaneCopyright \r
571 \r
572 @return javax.swing.JScrollPane \r
573 \r
574 **/\r
575 private JScrollPane getJScrollPaneCopyright() {\r
576 if (jScrollPaneCopyright == null) {\r
577 jScrollPaneCopyright = new JScrollPane();\r
0f6a6511 578 jScrollPaneCopyright.setBounds(new java.awt.Rectangle(valueCol, 260, valueWidth, 40));\r
579 jScrollPaneCopyright.setPreferredSize(new java.awt.Dimension(valueWidth, 40));\r
739c6b04 580 jScrollPaneCopyright.setViewportView(getJTextAreaCopyright());\r
0f6a6511 581 jScrollPaneCopyright.setSize(new java.awt.Dimension(valueWidth, 40));\r
739c6b04 582 }\r
583 return jScrollPaneCopyright;\r
584 }\r
a13899c5 585\r
739c6b04 586 /**\r
587 This method initializes jTextAreaCopyright \r
588 \r
589 @return javax.swing.JTextArea \r
590 \r
591 **/\r
592 private JTextArea getJTextAreaCopyright() {\r
593 if (jTextAreaCopyright == null) {\r
594 jTextAreaCopyright = new JTextArea();\r
595 jTextAreaCopyright.setLineWrap(true);\r
596 jTextAreaCopyright.addFocusListener(this);\r
597 jTextAreaCopyright.setWrapStyleWord(true);\r
598 jTextAreaCopyright.setSelectionStart(0);\r
599 jTextAreaCopyright.setSelectionEnd(0);\r
0f6a6511 600 jTextAreaCopyright.setBounds(new java.awt.Rectangle(0, 0, valueWidth, 40));\r
623db5ca 601 jTextAreaCopyright.setToolTipText("One or more copyright lines.");\r
739c6b04 602 }\r
603 return jTextAreaCopyright;\r
604 }\r
605\r
739c6b04 606 /**\r
607 * This method initializes jTextFieldOutputFileBasename \r
608 * \r
609 * @return javax.swing.JTextField \r
610 */\r
611 private JTextField getJTextFieldOutputFileBasename() {\r
612 if (jTextFieldOutputFileBasename == null) {\r
613 jTextFieldOutputFileBasename = new JTextField();\r
0f6a6511 614 jTextFieldOutputFileBasename.setBounds(new java.awt.Rectangle(valueCol, 455, valueWidth, 20));\r
615 jTextFieldOutputFileBasename.setPreferredSize(new java.awt.Dimension(valueWidth, 20));\r
739c6b04 616 jTextFieldOutputFileBasename.addFocusListener(this);\r
623db5ca 617 jTextFieldOutputFileBasename.setToolTipText("Enter a single word for generated output file names.");\r
739c6b04 618 }\r
619 return jTextFieldOutputFileBasename;\r
a13899c5 620 }\r
621\r
3b7a9058 622 /**\r
623 * This method initializes jComboBoxPcdIsDriver \r
624 * \r
625 * @return javax.swing.JComboBox \r
626 */\r
627 private JComboBox getJComboBoxPcdIsDriver() {\r
628 if (jComboBoxPcdIsDriver == null) {\r
629 jComboBoxPcdIsDriver = new JComboBox();\r
0f6a6511 630 jComboBoxPcdIsDriver.setPreferredSize(new java.awt.Dimension(valueWidth, 20));\r
631 jComboBoxPcdIsDriver.setBounds(new java.awt.Rectangle(valueCol, 530, valueWidth, 20));\r
3b7a9058 632 jComboBoxPcdIsDriver.addItemListener(this);\r
d933fc5f 633 jComboBoxPcdIsDriver.addFocusListener(this);\r
3b7a9058 634 jComboBoxPcdIsDriver.setEnabled(false);\r
635 Tools.generateComboBoxByVector(jComboBoxPcdIsDriver, ed.getVPcdDriverTypes());\r
0f6a6511 636 jComboBoxPcdIsDriver.setVisible(false);\r
3b7a9058 637 }\r
638 return jComboBoxPcdIsDriver;\r
639 }\r
640\r
a13899c5 641 /**\r
642 This is the default constructor\r
643 \r
644 **/\r
645 public MsaHeader() {\r
646 super();\r
647 init();\r
648 this.setVisible(true);\r
649 }\r
650\r
651 /**\r
652 This is the override edit constructor\r
653 \r
654 @param inMsaHeader The input data of MsaHeaderDocument.MsaHeader\r
655 \r
656 **/\r
657 public MsaHeader(OpeningModuleType inMsa) {\r
658 super();\r
659 this.omt = inMsa;\r
660 this.msa = omt.getXmlMsa();\r
2003a22e 661\r
9a8d6d9f 662 // \r
663 // Set module definitions default value\r
664 //\r
665 if (msa.getModuleDefinitions() == null) {\r
2003a22e 666 ModuleDefinitionsDocument.ModuleDefinitions md = ModuleDefinitionsDocument.ModuleDefinitions.Factory\r
667 .newInstance();\r
9a8d6d9f 668 md.setOutputFileBasename(msa.getMsaHeader().getModuleName());\r
669 md.setBinaryModule(false);\r
670 md.setSupportedArchitectures(ed.getVSupportedArchitectures());\r
671 msa.setModuleDefinitions(md);\r
672 }\r
3b7a9058 673\r
674 //\r
675 // Init items of Header, Definitions and Externs\r
676 //\r
a13899c5 677 init(msa.getMsaHeader());\r
739c6b04 678 init(msa.getModuleDefinitions());\r
3b7a9058 679 init(msa.getExterns());\r
680\r
a13899c5 681 this.setVisible(true);\r
682 this.setViewMode(false);\r
683 }\r
684\r
685 /**\r
686 Disable all components when the mode is view\r
687 \r
688 @param isView true - The view mode; false - The non-view mode\r
689 \r
690 **/\r
691 public void setViewMode(boolean isView) {\r
a13899c5 692 if (isView) {\r
693 this.jTextFieldBaseName.setEnabled(!isView);\r
694 this.jTextFieldGuid.setEnabled(!isView);\r
695 this.jTextFieldVersion.setEnabled(!isView);\r
696 this.jTextAreaLicense.setEnabled(!isView);\r
739c6b04 697 this.jTextAreaCopyright.setEnabled(!isView);\r
a13899c5 698 this.jTextAreaDescription.setEnabled(!isView);\r
699 this.jTextFieldSpecification.setEnabled(!isView);\r
700 this.jTextFieldAbstract.setEnabled(!isView);\r
701 this.jComboBoxModuleType.setEnabled(!isView);\r
702 this.jButtonCancel.setEnabled(!isView);\r
703 this.jButtonGenerateGuid.setEnabled(!isView);\r
704 this.jButtonOk.setEnabled(!isView);\r
705 }\r
706 }\r
707\r
708 /**\r
709 This method initializes this\r
710 \r
711 **/\r
712 private void init() {\r
9d0ac02b 713 this.setSize(dialogWidth, dialogHeight);\r
714 this.setPreferredSize(new java.awt.Dimension(dialogWidth, dialogHeight));\r
a13899c5 715 this.setContentPane(getJScrollPane());\r
716 this.setTitle("Module Surface Area Header");\r
717 initFrame();\r
718 }\r
719\r
720 /**\r
721 This method initializes this\r
722 Fill values to all fields if these values are not empty\r
723 \r
724 @param inMsaHeader The input data of MsaHeaderDocument.MsaHeader\r
725 \r
726 **/\r
727 private void init(MsaHeaderDocument.MsaHeader inMsaHeader) {\r
728 init();\r
729 if (inMsaHeader != null) {\r
730 setMsaHeader(inMsaHeader);\r
731 if (this.msaHeader.getModuleName() != null) {\r
732 this.jTextFieldBaseName.setText(this.msaHeader.getModuleName());\r
733 }\r
734 if (this.msaHeader.getModuleType() != null) {\r
735 this.jComboBoxModuleType.setSelectedItem(this.msaHeader.getModuleType().toString());\r
736 }\r
737 if (this.msaHeader.getGuidValue() != null) {\r
738 this.jTextFieldGuid.setText(this.msaHeader.getGuidValue());\r
739 }\r
740 if (this.msaHeader.getVersion() != null) {\r
741 this.jTextFieldVersion.setText(this.msaHeader.getVersion());\r
742 }\r
743 if (this.msaHeader.getAbstract() != null) {\r
744 this.jTextFieldAbstract.setText(this.msaHeader.getAbstract());\r
745 }\r
746 if (this.msaHeader.getDescription() != null) {\r
747 this.jTextAreaDescription.setText(this.msaHeader.getDescription());\r
9a8d6d9f 748 jTextAreaDescription.setSelectionStart(0);\r
749 jTextAreaDescription.setSelectionEnd(0);\r
a13899c5 750 }\r
751 if (this.msaHeader.getCopyright() != null) {\r
739c6b04 752 this.jTextAreaCopyright.setText(this.msaHeader.getCopyright());\r
a13899c5 753 }\r
754 if (this.msaHeader.getLicense() != null) {\r
755 this.jTextAreaLicense.setText(this.msaHeader.getLicense().getStringValue());\r
9a8d6d9f 756 jTextAreaLicense.setSelectionStart(0);\r
757 jTextAreaLicense.setSelectionEnd(0);\r
a13899c5 758 }\r
759 if (this.msaHeader.getLicense() != null && this.msaHeader.getLicense().getURL() != null) {\r
760 this.jTextFieldURL.setText(this.msaHeader.getLicense().getURL());\r
761 }\r
762 if (this.msaHeader.getSpecification() != null) {\r
763 this.jTextFieldSpecification.setText(this.msaHeader.getSpecification());\r
764 }\r
765 }\r
766 }\r
767\r
739c6b04 768 /**\r
769 This method initializes this\r
770 Fill values to all fields if these values are not empty\r
771 \r
772 @param inMsaHeader The input data of MsaHeaderDocument.MsaHeader\r
773 \r
774 **/\r
775 private void init(ModuleDefinitionsDocument.ModuleDefinitions inMd) {\r
739c6b04 776 if (inMd != null) {\r
777 this.md = inMd;\r
778 if (md.getSupportedArchitectures() != null) {\r
779 this.setSelectedItems(Tools.convertListToVector(md.getSupportedArchitectures()));\r
780 }\r
781 if (md.getBinaryModule()) {\r
b63cc1b6 782 this.jRadioButtonBinaryModuleTrue.setSelected(true);\r
739c6b04 783 } else {\r
b63cc1b6 784 this.jRadioButtonBinaryModuleFalse.setSelected(true);\r
739c6b04 785 }\r
786 if (md.getOutputFileBasename() != null) {\r
787 this.jTextFieldOutputFileBasename.setText(md.getOutputFileBasename());\r
788 }\r
789 }\r
790 }\r
791\r
3b7a9058 792 /**\r
793 This method initializes this\r
794 Fill values to all fields if these values are not empty\r
795 \r
796 @param inEx The input data of ExternsDocument.Externs\r
797 \r
798 **/\r
799 private void init(ExternsDocument.Externs inEx) {\r
800 if (inEx != null) {\r
801 this.ex = inEx;\r
802 if (ex.getPcdIsDriver() != null) {\r
803 this.jCheckBoxPcd.setSelected(true);\r
804 this.jComboBoxPcdIsDriver.setEnabled(true);\r
805 this.jComboBoxPcdIsDriver.setSelectedItem(ex.getPcdIsDriver());\r
0f6a6511 806 // TODO: If the module type is DXE_DRIVER, set PCD_DXE_DRIVER\r
807 // If the module type is PEIM, set PCD_PEI_DRIVER\r
808 // If the module type is anything else, unset this!\r
3b7a9058 809 }\r
810 this.jCheckBoxFlashMap.setSelected(ex.getTianoR8FlashMapH());\r
811 }\r
812 }\r
813\r
a13899c5 814 /**\r
815 This method initializes jContentPane\r
816 \r
817 @return javax.swing.JPanel jContentPane\r
818 \r
819 **/\r
820 private JPanel getJContentPane() {\r
821 if (jContentPane == null) {\r
822\r
823 jLabelURL = new JLabel();\r
824 jLabelURL.setText("License URL");\r
0f6a6511 825 jLabelURL.setLocation(new java.awt.Point(labelCol, 430));\r
826 jLabelURL.setSize(new java.awt.Dimension(labelWidth, 20));\r
a13899c5 827 jLabelBaseName = new JLabel();\r
828 jLabelBaseName.setText("Module Name");\r
0f6a6511 829 jLabelBaseName.setBounds(new java.awt.Rectangle(labelCol, 10, labelWidth, 20));\r
a13899c5 830 jLabelModuleType = new JLabel();\r
0f6a6511 831 jLabelModuleType.setBounds(new java.awt.Rectangle(labelCol, 35, labelWidth, 20));\r
a13899c5 832 jLabelModuleType.setText("Module Type");\r
833 jLabelGuid = new JLabel();\r
834 jLabelGuid.setText("Guid Value");\r
0f6a6511 835 jLabelGuid.setLocation(new java.awt.Point(labelCol, 60));\r
836 jLabelGuid.setSize(new java.awt.Dimension(labelWidth, 20));\r
a13899c5 837 jLabelVersion = new JLabel();\r
838 jLabelVersion.setText("Version");\r
0f6a6511 839 jLabelVersion.setLocation(new java.awt.Point(labelCol, 85));\r
840 jLabelVersion.setSize(new java.awt.Dimension(labelWidth, 20));\r
a13899c5 841 jLabelAbstract = new JLabel();\r
842 jLabelAbstract.setText("Abstract");\r
0f6a6511 843 jLabelAbstract.setLocation(new java.awt.Point(labelCol, 110));\r
844 jLabelAbstract.setSize(new java.awt.Dimension(labelWidth, 20));\r
a13899c5 845 jLabelDescription = new JLabel();\r
846 jLabelDescription.setText("Description");\r
0f6a6511 847 jLabelDescription.setLocation(new java.awt.Point(labelCol, 135));\r
848 jLabelDescription.setSize(new java.awt.Dimension(labelWidth, 20));\r
a13899c5 849 jLabelCopyright = new JLabel();\r
850 jLabelCopyright.setText("Copyright");\r
0f6a6511 851 jLabelCopyright.setLocation(new java.awt.Point(labelCol, 260));\r
852 jLabelCopyright.setSize(new java.awt.Dimension(labelWidth, 20));\r
a13899c5 853 jLabelLicense = new JLabel();\r
854 jLabelLicense.setText("License");\r
0f6a6511 855 jLabelLicense.setLocation(new java.awt.Point(labelCol, 305));\r
856 jLabelLicense.setSize(new java.awt.Dimension(labelWidth, 20));\r
739c6b04 857 jLabelOutputFileBasename = new JLabel();\r
0f6a6511 858 jLabelOutputFileBasename.setBounds(new java.awt.Rectangle(labelCol, 455, labelWidth, 20));\r
739c6b04 859 jLabelOutputFileBasename.setText("Output File Basename");\r
860 jLabelBinaryModule = new JLabel();\r
0f6a6511 861 jLabelBinaryModule.setBounds(new java.awt.Rectangle(labelCol, 480, labelWidth, 20));\r
739c6b04 862 jLabelBinaryModule.setText("Binary Module");\r
863 jLabelArch = new JLabel();\r
0f6a6511 864 jLabelArch.setBounds(new java.awt.Rectangle(labelCol, 505, labelWidth, 20));\r
739c6b04 865 jLabelArch.setText("Supported Architectures");\r
a13899c5 866 jLabelSpecification = new JLabel();\r
867 jLabelSpecification.setText("Specification");\r
0f6a6511 868 jLabelSpecification.setLocation(new java.awt.Point(labelCol, 530));\r
869 jLabelSpecification.setSize(new java.awt.Dimension(labelWidth, 20));\r
a13899c5 870\r
871 jContentPane = new JPanel();\r
872 jContentPane.setLayout(null);\r
9d0ac02b 873 jContentPane.setPreferredSize(new java.awt.Dimension(dialogWidth - 10, dialogHeight - 10));\r
3b7a9058 874\r
739c6b04 875 jContentPane.addFocusListener(this);\r
a13899c5 876\r
877 jContentPane.add(jLabelBaseName, null);\r
878 jContentPane.add(getJTextFieldBaseName(), null);\r
879 jContentPane.add(jLabelGuid, null);\r
880 jContentPane.add(getJTextFieldGuid(), null);\r
881 jContentPane.add(jLabelVersion, null);\r
882 jContentPane.add(getJTextFieldVersion(), null);\r
883 jContentPane.add(getJButtonGenerateGuid(), null);\r
884 jContentPane.add(jLabelLicense, null);\r
885 jContentPane.add(jLabelCopyright, null);\r
886 jContentPane.add(jLabelDescription, null);\r
a13899c5 887 jContentPane.add(getJTextFieldSpecification(), null);\r
888 jContentPane.add(getJButtonOk(), null);\r
889 jContentPane.add(getJButtonCancel(), null);\r
890 jContentPane.add(getJScrollPaneLicense(), null);\r
891 jContentPane.add(getJScrollPaneDescription(), null);\r
892 jContentPane.add(jLabelAbstract, null);\r
893 jContentPane.add(getJTextFieldAbstract(), null);\r
894 jContentPane.add(jLabelModuleType, null);\r
895 jContentPane.add(getJComboBoxModuleType(), null);\r
896 jContentPane.add(jLabelURL, null);\r
897 jContentPane.add(getJTextFieldURL(), null);\r
739c6b04 898 jContentPane.add(jLabelOutputFileBasename, null);\r
899 jContentPane.add(getJTextFieldOutputFileBasename(), null);\r
900 jContentPane.add(jLabelBinaryModule, null);\r
739c6b04 901 jContentPane.add(jLabelArch, null);\r
902\r
a13899c5 903 jStarLabel1 = new StarLabel();\r
904 jStarLabel1.setLocation(new java.awt.Point(0, 10));\r
905 jStarLabel2 = new StarLabel();\r
906 jStarLabel2.setLocation(new java.awt.Point(0, 35));\r
907 jStarLabel4 = new StarLabel();\r
908 jStarLabel4.setLocation(new java.awt.Point(0, 60));\r
909 jStarLabel5 = new StarLabel();\r
910 jStarLabel5.setLocation(new java.awt.Point(0, 85));\r
911 jStarLabel6 = new StarLabel();\r
912 jStarLabel6.setLocation(new java.awt.Point(0, 135));\r
913 jStarLabel7 = new StarLabel();\r
914 jStarLabel7.setLocation(new java.awt.Point(0, 260));\r
915 jStarLabel8 = new StarLabel();\r
739c6b04 916 jStarLabel8.setLocation(new java.awt.Point(0, 305));\r
a13899c5 917 jStarLabel10 = new StarLabel();\r
918 jStarLabel10.setLocation(new java.awt.Point(0, 110));\r
919 jStarLabel12 = new StarLabel();\r
739c6b04 920 jStarLabel12.setLocation(new java.awt.Point(0, 455));\r
921 jStarLabel13 = new StarLabel();\r
922 jStarLabel13.setLocation(new java.awt.Point(0, 480));\r
923 jStarLabel14 = new StarLabel();\r
924 jStarLabel14.setLocation(new java.awt.Point(0, 505));\r
a13899c5 925\r
926 jContentPane.add(jStarLabel1, null);\r
927 jContentPane.add(jStarLabel2, null);\r
928 jContentPane.add(jStarLabel4, null);\r
929 jContentPane.add(jStarLabel5, null);\r
930 jContentPane.add(jStarLabel6, null);\r
931 jContentPane.add(jStarLabel7, null);\r
932 jContentPane.add(jStarLabel8, null);\r
933 jContentPane.add(jStarLabel10, null);\r
934 jContentPane.add(jStarLabel12, null);\r
739c6b04 935 jContentPane.add(jStarLabel13, null);\r
936 jContentPane.add(jStarLabel14, null);\r
739c6b04 937 jContentPane.add(getJScrollPaneCopyright(), null);\r
938\r
939 jContentPane.add(getJCheckBoxIa32(), null);\r
940 jContentPane.add(getJCheckBoxX64(), null);\r
941 jContentPane.add(getJCheckBoxIpf(), null);\r
942 jContentPane.add(getJCheckBoxEbc(), null);\r
943 jContentPane.add(getJCheckBoxArm(), null);\r
944 jContentPane.add(getJCheckBoxPpc(), null);\r
3b7a9058 945\r
946 jContentPane.add(getJCheckBoxPcd(), null);\r
947 jContentPane.add(getJComboBoxPcdIsDriver(), null);\r
948 jContentPane.add(getJCheckBoxFlashMap(), null);\r
b63cc1b6 949\r
950 ButtonGroup bg = new ButtonGroup();\r
951 jContentPane.add(getJRadioButtonBinaryModuleTrue(), null);\r
952 jContentPane.add(getJRadioButtonBinaryModuleFalse(), null);\r
953 bg.add(getJRadioButtonBinaryModuleTrue());\r
954 bg.add(getJRadioButtonBinaryModuleFalse());\r
a13899c5 955 }\r
956 return jContentPane;\r
957 }\r
958\r
959 /* (non-Javadoc)\r
960 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r
961 *\r
962 * Override actionPerformed to listen all actions\r
963 *\r
964 */\r
965 public void actionPerformed(ActionEvent arg0) {\r
966 if (arg0.getSource() == jButtonOk) {\r
967 if (this.check()) {\r
968 this.save();\r
969 } else {\r
970 return;\r
971 }\r
972 this.setEdited(true);\r
973 this.dispose();\r
974 }\r
3b7a9058 975\r
a13899c5 976 if (arg0.getSource() == jButtonCancel) {\r
977 this.setEdited(false);\r
978 }\r
3b7a9058 979\r
a13899c5 980 if (arg0.getSource() == jButtonGenerateGuid) {\r
981 jTextFieldGuid.setText(Tools.generateUuidString());\r
d1760183 982 jTextFieldGuid.requestFocus();\r
983 jButtonGenerateGuid.requestFocus();\r
a13899c5 984 }\r
3b7a9058 985\r
986 if (arg0.getSource() == this.jCheckBoxPcd) {\r
987 this.jComboBoxPcdIsDriver.setEnabled(this.jCheckBoxPcd.isSelected());\r
988 }\r
a13899c5 989 }\r
990\r
991 /**\r
992 Data validation for all fields\r
993 \r
994 @retval true - All datas are valid\r
995 @retval false - At least one data is invalid\r
996 \r
997 **/\r
998 public boolean check() {\r
999 //\r
1000 // Check if all required fields are not empty\r
1001 // and check if all data fields values are valid\r
1002 //\r
1003\r
1004 //\r
1005 // Check Base Name\r
1006 //\r
1007 if (isEmpty(this.jTextFieldBaseName.getText())) {\r
623db5ca 1008 Log.wrn("Update Msa Header", "Name must be entered!");\r
a13899c5 1009 //this.jTextFieldBaseName.requestFocus();\r
1010 return false;\r
1011 }\r
1012 if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {\r
623db5ca 1013 Log.wrn("Update Msa Header", "Incorrect data type for Name, it must start with an alpha character!");\r
a13899c5 1014 //this.jTextFieldBaseName.requestFocus();\r
1015 return false;\r
1016 }\r
1017\r
1018 //\r
1019 // Check Guid\r
1020 //\r
1021 if (isEmpty(this.jTextFieldGuid.getText())) {\r
623db5ca 1022 Log.wrn("Update Msa Header", "The Guid Value must be entered!");\r
a13899c5 1023 //this.jTextFieldGuid.requestFocus();\r
1024 return false;\r
1025 }\r
1026 if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {\r
623db5ca 1027 Log.wrn("Update Msa Header", "Incorrect data type for Guid, it must be registry format, 8-4-4-4-12");\r
a13899c5 1028 //this.jTextFieldGuid.requestFocus();\r
1029 return false;\r
1030 }\r
1031\r
1032 //\r
1033 // Check Version\r
1034 //\r
1035 if (isEmpty(this.jTextFieldVersion.getText())) {\r
623db5ca 1036 Log.wrn("Update Msa Header", "Version must be entered!");\r
a13899c5 1037 //this.jTextFieldVersion.requestFocus();\r
1038 return false;\r
1039 }\r
1040 if (!DataValidation.isVersion(this.jTextFieldVersion.getText())) {\r
623db5ca 1041 Log.wrn("Update Msa Header", "Incorrect data type for Version, it must start with a digit.");\r
a13899c5 1042 //this.jTextFieldVersion.requestFocus();\r
1043 return false;\r
1044 }\r
1045\r
1046 //\r
1047 // Check Abstact\r
1048 //\r
1049 if (isEmpty(this.jTextFieldAbstract.getText())) {\r
623db5ca 1050 Log.wrn("Update Msa Header", "Abstract must be entered!");\r
a13899c5 1051 //this.jTextFieldAbstract.requestFocus();\r
1052 return false;\r
1053 }\r
1054 if (!DataValidation.isAbstract(this.jTextFieldAbstract.getText())) {\r
3b7a9058 1055 Log.wrn("Update Msa Header",\r
1056 "Incorrect data type for Abstract, is should be a sentence describing the module.");\r
a13899c5 1057 //this.jTextFieldAbstract.requestFocus();\r
1058 return false;\r
1059 }\r
1060\r
1061 //\r
1062 // Check Description\r
1063 //\r
1064 if (isEmpty(this.jTextAreaDescription.getText())) {\r
623db5ca 1065 Log.wrn("Update Msa Header", "Description must be entered!");\r
a13899c5 1066 //this.jTextAreaDescription.requestFocus();\r
1067 return false;\r
1068 }\r
1069\r
1070 //\r
1071 // Check Copyright\r
1072 //\r
739c6b04 1073 if (isEmpty(this.jTextAreaCopyright.getText())) {\r
623db5ca 1074 Log.wrn("Update Msa Header", "Copyright must be entered!");\r
a13899c5 1075 //this.jTextFieldCopyright.requestFocus();\r
1076 return false;\r
1077 }\r
1078\r
1079 //\r
1080 // Check License\r
1081 //\r
1082 if (isEmpty(this.jTextAreaLicense.getText())) {\r
623db5ca 1083 Log.wrn("Update Msa Header", "License must be entered!");\r
a13899c5 1084 //this.jTextAreaLicense.requestFocus();\r
1085 return false;\r
1086 }\r
1087\r
1088 //\r
1089 // Check Specification\r
1090 //\r
1091 if (isEmpty(this.jTextFieldSpecification.getText())) {\r
623db5ca 1092 Log.wrn("Update Msa Header", "Specification must exist.");\r
a13899c5 1093 //this.jTextFieldSpecification.requestFocus();\r
1094 return false;\r
1095 }\r
1096 if (!DataValidation.isSpecification(this.jTextFieldSpecification.getText())) {\r
9d0ac02b 1097 // TODO Add code to check the specification number.\r
1098 // Future releases of Schema may require that we process these files\r
1099 // differently.\r
ed1665f2 1100 Log.wrn("Update Msa Header", "Incorrect data type for Specification");\r
a13899c5 1101 //this.jTextFieldSpecification.requestFocus();\r
1102 return false;\r
1103 }\r
1104\r
1105 return true;\r
1106 }\r
1107\r
1108 /**\r
1109 Save all components of Msa Header\r
1110 if exists msaHeader, set the value directly\r
1111 if not exists msaHeader, new an instance first\r
1112 \r
1113 **/\r
1114 public void save() {\r
1115 try {\r
55a2762d 1116 msaHeader.setSpecification(this.jTextFieldSpecification.getText());\r
a13899c5 1117 msa.setMsaHeader(msaHeader);\r
739c6b04 1118 msa.setModuleDefinitions(md);\r
a13899c5 1119 this.omt.setSaved(false);\r
1120 } catch (Exception e) {\r
ed1665f2 1121 Log.wrn("Save Module", e.getMessage());\r
a13899c5 1122 Log.err("Save Module", e.getMessage());\r
1123 }\r
1124 }\r
1125\r
1126 /**\r
1127 This method initializes Module type and Compontent type\r
1128 \r
1129 **/\r
1130 private void initFrame() {\r
1131 EnumerationData ed = new EnumerationData();\r
1132 Tools.generateComboBoxByVector(jComboBoxModuleType, ed.getVModuleType());\r
739c6b04 1133 this.setSelectedItems(ed.getVSupportedArchitectures());\r
a13899c5 1134 }\r
1135\r
1136 /**\r
1137 Get MsaHeaderDocument.MsaHeader\r
1138 \r
1139 @return MsaHeaderDocument.MsaHeader\r
1140 \r
1141 **/\r
1142 public MsaHeaderDocument.MsaHeader getMsaHeader() {\r
1143 return msaHeader;\r
1144 }\r
1145\r
1146 /**\r
1147 Set MsaHeaderDocument.MsaHeader\r
1148 \r
1149 @param msaHeader The input data of MsaHeaderDocument.MsaHeader\r
1150 \r
1151 **/\r
1152 public void setMsaHeader(MsaHeaderDocument.MsaHeader msaHeader) {\r
1153 this.msaHeader = msaHeader;\r
1154 }\r
1155\r
1156 /* (non-Javadoc)\r
1157 * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)\r
1158 * \r
1159 * Override componentResized to resize all components when frame's size is changed\r
1160 */\r
1161 public void componentResized(ComponentEvent arg0) {\r
1162 int intCurrentWidth = this.getJContentPane().getWidth();\r
1163 int intPreferredWidth = this.getJContentPane().getPreferredSize().width;\r
1164\r
8792f60f 1165 Tools.resizeComponentWidth(this.jTextFieldBaseName, intCurrentWidth, intPreferredWidth);\r
1166 Tools.resizeComponentWidth(this.jTextFieldGuid, intCurrentWidth, intPreferredWidth);\r
1167 Tools.resizeComponentWidth(this.jTextFieldVersion, intCurrentWidth, intPreferredWidth);\r
1168 Tools.resizeComponentWidth(this.jScrollPaneLicense, intCurrentWidth, intPreferredWidth);\r
1169 Tools.resizeComponentWidth(this.jTextFieldURL, intCurrentWidth, intPreferredWidth);\r
1170 Tools.resizeComponentWidth(this.jScrollPaneCopyright, intCurrentWidth, intPreferredWidth);\r
1171 Tools.resizeComponentWidth(this.jScrollPaneDescription, intCurrentWidth, intPreferredWidth);\r
b63cc1b6 1172 Tools.resizeComponentWidth(this.jTextFieldSpecification, intCurrentWidth, intPreferredWidth);\r
8792f60f 1173 Tools.resizeComponentWidth(this.jTextFieldAbstract, intCurrentWidth, intPreferredWidth);\r
b63cc1b6 1174 Tools.resizeComponentWidth(this.jComboBoxModuleType, intCurrentWidth, intPreferredWidth);\r
8792f60f 1175 Tools.resizeComponentWidth(this.jTextFieldOutputFileBasename, intCurrentWidth, intPreferredWidth);\r
b63cc1b6 1176 Tools.resizeComponentWidth(this.jComboBoxPcdIsDriver, intCurrentWidth, intPreferredWidth);\r
8792f60f 1177\r
1178 Tools.relocateComponentX(this.jButtonGenerateGuid, intCurrentWidth, intPreferredWidth,\r
b63cc1b6 1179 DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON);\r
a13899c5 1180 }\r
1181\r
1182 public void focusLost(FocusEvent arg0) {\r
1183 if (this.msaHeader == null) {\r
1184 msaHeader = MsaHeaderDocument.MsaHeader.Factory.newInstance();\r
1185 }\r
2003a22e 1186\r
a13899c5 1187 //\r
1188 // Check BaseName\r
1189 //\r
1190 if (arg0.getSource() == this.jTextFieldBaseName) {\r
1191 if (isEmpty(this.jTextFieldBaseName.getText())) {\r
623db5ca 1192 Log.wrn("Update Msa Header", "The Name must be entered!");\r
a13899c5 1193 //this.jTextFieldBaseName.requestFocus();\r
1194 return;\r
1195 }\r
1196 if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {\r
623db5ca 1197 Log.wrn("Update Msa Header", "Incorrect data type for Name, it must begin with an alpha character.");\r
a13899c5 1198 //this.jTextFieldBaseName.requestFocus();\r
1199 return;\r
1200 }\r
2003a22e 1201 if (!this.jTextFieldBaseName.getText().equals(msaHeader.getModuleName())) {\r
1202 this.msaHeader.setModuleName(this.jTextFieldBaseName.getText());\r
1203 } else {\r
1204 return;\r
1205 }\r
a13899c5 1206 }\r
1207\r
1208 //\r
1209 // Check Module Type\r
1210 //\r
1211 if (arg0.getSource() == this.jComboBoxModuleType) {\r
2003a22e 1212 if (!jComboBoxModuleType.getSelectedItem().toString().equals(msaHeader.getModuleType().toString())) {\r
1213 msaHeader.setModuleType(ModuleTypeDef.Enum.forString(jComboBoxModuleType.getSelectedItem().toString()));\r
1214 } else {\r
1215 return;\r
1216 }\r
a13899c5 1217 }\r
1218\r
1219 //\r
1220 // Check Guid\r
1221 //\r
1222 if (arg0.getSource() == this.jTextFieldGuid) {\r
1223 if (isEmpty(this.jTextFieldGuid.getText())) {\r
623db5ca 1224 Log.wrn("Update Msa Header", "Guid must be entered!");\r
a13899c5 1225 //this.jTextFieldGuid.requestFocus();\r
1226 return;\r
1227 }\r
1228 if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {\r
623db5ca 1229 Log.wrn("Update Msa Header", "Incorrect data type for Guid, it must be registry format. (8-4-4-4-12)");\r
a13899c5 1230 //this.jTextFieldGuid.requestFocus();\r
1231 return;\r
1232 }\r
2003a22e 1233 if (!this.jTextFieldGuid.getText().equals(msaHeader.getGuidValue())) {\r
1234 this.msaHeader.setGuidValue(this.jTextFieldGuid.getText());\r
1235 } else {\r
1236 return;\r
1237 }\r
a13899c5 1238 }\r
1239\r
1240 //\r
1241 // Check Version\r
1242 //\r
1243 if (arg0.getSource() == this.jTextFieldVersion) {\r
a13899c5 1244 if (isEmpty(this.jTextFieldVersion.getText())) {\r
623db5ca 1245 Log.wrn("Update Msa Header", "Version must be entered!");\r
a13899c5 1246 //this.jTextFieldVersion.requestFocus();\r
1247 return;\r
1248 }\r
1249 if (!DataValidation.isVersion(this.jTextFieldVersion.getText())) {\r
623db5ca 1250 Log.wrn("Update Msa Header", "Incorrect data type for Version, it must start with a digit.");\r
a13899c5 1251 //this.jTextFieldVersion.requestFocus();\r
1252 return;\r
1253 }\r
2003a22e 1254 if (!this.jTextFieldVersion.getText().equals(msaHeader.getVersion())) {\r
1255 this.msaHeader.setVersion(this.jTextFieldVersion.getText());\r
1256 } else {\r
1257 return;\r
1258 }\r
a13899c5 1259 }\r
1260\r
1261 //\r
1262 // Check Abstact\r
1263 //\r
1264 if (arg0.getSource() == this.jTextFieldAbstract) {\r
1265 if (isEmpty(this.jTextFieldAbstract.getText())) {\r
623db5ca 1266 Log.wrn("Update Msa Header", "Abstract must be entered!");\r
a13899c5 1267 //this.jTextFieldAbstract.requestFocus();\r
1268 return;\r
1269 }\r
1270 if (!DataValidation.isAbstract(this.jTextFieldAbstract.getText())) {\r
623db5ca 1271 Log.wrn("Update Msa Header", "Incorrect data type for Abstract, it must be sentence.");\r
a13899c5 1272 //this.jTextFieldAbstract.requestFocus();\r
1273 return;\r
1274 }\r
2003a22e 1275 if (!this.jTextFieldAbstract.getText().equals(msaHeader.getAbstract())) {\r
1276 this.msaHeader.setAbstract(this.jTextFieldAbstract.getText());\r
1277 } else {\r
1278 return;\r
1279 }\r
a13899c5 1280 }\r
1281\r
1282 //\r
1283 // Check Description\r
1284 //\r
1285 if (arg0.getSource() == this.jTextAreaDescription) {\r
1286 if (isEmpty(this.jTextAreaDescription.getText())) {\r
623db5ca 1287 Log.wrn("Update Msa Header", "Description must be entered!");\r
a13899c5 1288 //this.jTextAreaDescription.requestFocus();\r
1289 return;\r
1290 }\r
2003a22e 1291 if (!this.jTextAreaDescription.getText().equals(msaHeader.getDescription())) {\r
1292 this.msaHeader.setDescription(this.jTextAreaDescription.getText());\r
1293 } else {\r
1294 return;\r
1295 }\r
a13899c5 1296 }\r
1297\r
1298 //\r
1299 // Check Copyright\r
1300 //\r
739c6b04 1301 if (arg0.getSource() == this.jTextAreaCopyright) {\r
1302 if (isEmpty(this.jTextAreaCopyright.getText())) {\r
623db5ca 1303 Log.wrn("Update Msa Header", "Copyright must be entered!");\r
a13899c5 1304 //this.jTextFieldCopyright.requestFocus();\r
1305 return;\r
1306 }\r
739c6b04 1307 if (!this.jTextAreaCopyright.getText().equals(msaHeader.getCopyright())) {\r
1308 this.msaHeader.setCopyright(this.jTextAreaCopyright.getText());\r
2003a22e 1309 } else {\r
1310 return;\r
1311 }\r
a13899c5 1312 }\r
1313\r
1314 //\r
1315 // Check License\r
1316 //\r
1317 if (arg0.getSource() == this.jTextAreaLicense) {\r
1318 if (isEmpty(this.jTextAreaLicense.getText())) {\r
623db5ca 1319 Log.wrn("Update Msa Header", "License must be entered!");\r
a13899c5 1320 //this.jTextAreaLicense.requestFocus();\r
1321 return;\r
1322 }\r
1323 if (this.msaHeader.getLicense() != null) {\r
2003a22e 1324 if (!this.jTextAreaLicense.getText().equals(msaHeader.getLicense().getStringValue())) {\r
1325 this.msaHeader.getLicense().setStringValue(this.jTextAreaLicense.getText());\r
1326 } else {\r
1327 return;\r
1328 }\r
a13899c5 1329 } else {\r
1330 License mLicense = License.Factory.newInstance();\r
1331 mLicense.setStringValue(this.jTextAreaLicense.getText());\r
1332 this.msaHeader.setLicense(mLicense);\r
1333 }\r
1334 }\r
1335\r
1336 //\r
1337 // Check License URL\r
1338 //\r
1339 if (arg0.getSource() == this.jTextFieldURL) {\r
1340 if (!isEmpty(this.jTextFieldURL.getText())) {\r
1341 if (this.msaHeader.getLicense() == null) {\r
1342 License mLicense = License.Factory.newInstance();\r
1343 mLicense.setURL(this.jTextFieldURL.getText());\r
1344 this.msaHeader.setLicense(mLicense);\r
1345 } else {\r
2003a22e 1346 if (!this.jTextFieldURL.getText().equals(msaHeader.getLicense().getURL())) {\r
1347 this.msaHeader.getLicense().setURL(this.jTextFieldURL.getText());\r
1348 } else {\r
1349 return;\r
1350 }\r
a13899c5 1351 }\r
1352 }\r
1353 }\r
a929458e 1354\r
739c6b04 1355 //\r
1356 // Check Output File Basename\r
1357 //\r
1358 if (arg0.getSource() == this.jTextFieldOutputFileBasename) {\r
1359 if (isEmpty(this.jTextFieldOutputFileBasename.getText())) {\r
623db5ca 1360 Log.wrn("Update Msa Header", "Output File Basename must be entered!");\r
739c6b04 1361 // jTextFieldOutputFileBasename.removeFocusListener(this);\r
1362 // jTextFieldOutputFileBasename.requestFocus();\r
1363 // jTextFieldOutputFileBasename.addFocusListener(this);\r
1364 return;\r
1365 }\r
1366 if (!this.jTextFieldOutputFileBasename.getText().equals(md.getOutputFileBasename())) {\r
1367 this.md.setOutputFileBasename(this.jTextFieldOutputFileBasename.getText());\r
1368 } else {\r
1369 return;\r
1370 }\r
1371 }\r
1372\r
1373 //\r
1374 // Check Binary Module Type\r
1375 //\r
b63cc1b6 1376 if (arg0.getSource() == this.jRadioButtonBinaryModuleTrue) {\r
1377 if (jRadioButtonBinaryModuleTrue.isSelected()) {\r
739c6b04 1378 if (md.getBinaryModule()) {\r
1379 return;\r
1380 } else {\r
1381 md.setBinaryModule(true);\r
1382 }\r
b63cc1b6 1383 }\r
1384 }\r
1385\r
1386 //\r
1387 // Check Binary Module Type\r
1388 //\r
1389 if (arg0.getSource() == this.jRadioButtonBinaryModuleFalse) {\r
1390 if (jRadioButtonBinaryModuleFalse.isSelected()) {\r
739c6b04 1391 if (md.getBinaryModule()) {\r
1392 md.setBinaryModule(false);\r
1393 } else {\r
1394 return;\r
1395 }\r
1396 }\r
1397 }\r
1398\r
1399 //\r
1400 // Check Supported Arch\r
1401 //\r
1402 if (arg0.getSource() == this.jCheckBoxArm || arg0.getSource() == this.jCheckBoxEbc\r
1403 || arg0.getSource() == this.jCheckBoxIa32 || arg0.getSource() == this.jCheckBoxIpf\r
1404 || arg0.getSource() == this.jCheckBoxPpc || arg0.getSource() == this.jCheckBoxX64) {\r
1405 if (!this.getSelectedItemsString().equals(md.getSupportedArchitectures().toString())) {\r
1406 md.setSupportedArchitectures(this.getSelectedItemsVector());\r
1407 } else {\r
1408 return;\r
1409 }\r
1410 }\r
1411\r
3b7a9058 1412 //\r
1413 // Check Pcd is Driver\r
1414 //\r
d933fc5f 1415 if (arg0.getSource() == this.jCheckBoxPcd || arg0.getSource() == this.jComboBoxPcdIsDriver) {\r
3b7a9058 1416 if ((this.ex == null) && this.jCheckBoxPcd.isSelected()) {\r
1417 this.ex = ExternsDocument.Externs.Factory.newInstance();\r
1418 this.ex.setPcdIsDriver(PcdDriverTypes.Enum.forString(this.jComboBoxPcdIsDriver.getSelectedItem()\r
1419 .toString()));\r
1420 this.msa.setExterns(this.ex);\r
d933fc5f 1421 } else if ((this.ex != null) && (this.ex.getPcdIsDriver() == null) && this.jCheckBoxPcd.isSelected()) {\r
3b7a9058 1422 this.ex.setPcdIsDriver(PcdDriverTypes.Enum.forString(this.jComboBoxPcdIsDriver.getSelectedItem()\r
1423 .toString()));\r
1424 this.msa.setExterns(this.ex);\r
d933fc5f 1425 } else if ((this.ex != null) && (this.ex.getPcdIsDriver() != null)) {\r
3b7a9058 1426 if (this.jCheckBoxPcd.isSelected()\r
1427 && !this.jComboBoxPcdIsDriver.getSelectedItem().toString().equals(\r
1428 this.ex.getPcdIsDriver()\r
1429 .toString())) {\r
1430 this.ex.setPcdIsDriver(PcdDriverTypes.Enum.forString(this.jComboBoxPcdIsDriver.getSelectedItem()\r
1431 .toString()));\r
1432 this.msa.setExterns(this.ex);\r
1433 }\r
1434 if (!this.jCheckBoxPcd.isSelected()) {\r
1435 ExternsDocument.Externs newEx = ExternsDocument.Externs.Factory.newInstance();\r
1436 if (this.ex.getExternList() != null) {\r
1437 for (int index = 0; index < this.ex.getExternList().size(); index++) {\r
1438 newEx.addNewExtern();\r
1439 newEx.setExternArray(index, this.ex.getExternArray(index));\r
1440 }\r
1441 }\r
1442 if (this.ex.getSpecificationList() != null) {\r
1443 for (int index = 0; index < this.ex.getSpecificationList().size(); index++) {\r
1444 newEx.addNewSpecification();\r
1445 newEx.setSpecificationArray(index, this.ex.getSpecificationArray(index));\r
1446 }\r
1447 }\r
1448 if (this.ex.getTianoR8FlashMapH()) {\r
1449 newEx.setTianoR8FlashMapH(this.ex.getTianoR8FlashMapH());\r
1450 }\r
1451 this.ex = newEx;\r
1452 this.msa.setExterns(this.ex);\r
1453 }\r
1454 }\r
1455 }\r
1456\r
1457 //\r
1458 // Check Flash Map\r
1459 //\r
1460 if (arg0.getSource() == this.jCheckBoxFlashMap) {\r
1461 if ((this.ex == null) && this.jCheckBoxFlashMap.isSelected()) {\r
1462 this.ex = ExternsDocument.Externs.Factory.newInstance();\r
1463 this.ex.setTianoR8FlashMapH(this.jCheckBoxFlashMap.isSelected());\r
1464 this.msa.setExterns(this.ex);\r
d933fc5f 1465 } else if ((this.ex != null) && this.jCheckBoxFlashMap.isSelected()) {\r
3b7a9058 1466 this.ex.setTianoR8FlashMapH(this.jCheckBoxFlashMap.isSelected());\r
1467 this.msa.setExterns(this.ex);\r
d933fc5f 1468 } else if ((this.ex != null) && !this.jCheckBoxFlashMap.isSelected()) {\r
3b7a9058 1469 ExternsDocument.Externs newEx = ExternsDocument.Externs.Factory.newInstance();\r
1470 if (this.ex.getExternList() != null) {\r
1471 for (int index = 0; index < this.ex.getExternList().size(); index++) {\r
1472 newEx.addNewExtern();\r
1473 newEx.setExternArray(index, this.ex.getExternArray(index));\r
1474 }\r
1475 }\r
1476 if (this.ex.getSpecificationList() != null) {\r
1477 for (int index = 0; index < this.ex.getSpecificationList().size(); index++) {\r
1478 newEx.addNewSpecification();\r
1479 newEx.setSpecificationArray(index, this.ex.getSpecificationArray(index));\r
1480 }\r
1481 }\r
1482 if (this.ex.getPcdIsDriver() != null) {\r
1483 newEx.setPcdIsDriver(this.ex.getPcdIsDriver());\r
1484 }\r
1485 this.ex = newEx;\r
1486 this.msa.setExterns(this.ex);\r
1487 }\r
1488 }\r
1489\r
a13899c5 1490 this.save();\r
1491 }\r
739c6b04 1492\r
1493 private Vector<String> getSelectedItemsVector() {\r
1494 Vector<String> v = new Vector<String>();\r
1495 if (this.jCheckBoxIa32.isSelected()) {\r
1496 v.addElement(jCheckBoxIa32.getText());\r
1497 }\r
1498 if (this.jCheckBoxX64.isSelected()) {\r
1499 v.addElement(jCheckBoxX64.getText());\r
1500 }\r
1501 if (this.jCheckBoxIpf.isSelected()) {\r
1502 v.addElement(jCheckBoxIpf.getText());\r
1503 }\r
1504 if (this.jCheckBoxEbc.isSelected()) {\r
1505 v.addElement(jCheckBoxEbc.getText());\r
1506 }\r
1507 if (this.jCheckBoxArm.isSelected()) {\r
1508 v.addElement(jCheckBoxArm.getText());\r
1509 }\r
1510 if (this.jCheckBoxPpc.isSelected()) {\r
1511 v.addElement(jCheckBoxPpc.getText());\r
1512 }\r
1513 return v;\r
1514 }\r
1515\r
1516 private String getSelectedItemsString() {\r
1517 String s = "";\r
1518 if (this.jCheckBoxIa32.isSelected()) {\r
1519 s = s + jCheckBoxIa32.getText() + " ";\r
1520 }\r
1521 if (this.jCheckBoxX64.isSelected()) {\r
1522 s = s + jCheckBoxX64.getText() + " ";\r
1523 }\r
1524 if (this.jCheckBoxIpf.isSelected()) {\r
1525 s = s + jCheckBoxIpf.getText() + " ";\r
1526 }\r
1527 if (this.jCheckBoxEbc.isSelected()) {\r
1528 s = s + jCheckBoxEbc.getText() + " ";\r
1529 }\r
1530 if (this.jCheckBoxArm.isSelected()) {\r
1531 s = s + jCheckBoxArm.getText() + " ";\r
1532 }\r
1533 if (this.jCheckBoxPpc.isSelected()) {\r
1534 s = s + jCheckBoxPpc.getText() + " ";\r
1535 }\r
1536 return s.trim();\r
1537 }\r
1538\r
1539 private void setAllItemsSelected(boolean isSelected) {\r
1540 this.jCheckBoxIa32.setSelected(isSelected);\r
1541 this.jCheckBoxX64.setSelected(isSelected);\r
1542 this.jCheckBoxIpf.setSelected(isSelected);\r
1543 this.jCheckBoxEbc.setSelected(isSelected);\r
1544 this.jCheckBoxArm.setSelected(isSelected);\r
1545 this.jCheckBoxPpc.setSelected(isSelected);\r
1546 }\r
1547\r
1548 private void setSelectedItems(Vector<String> v) {\r
1549 setAllItemsSelected(false);\r
1550 if (v != null) {\r
1551 for (int index = 0; index < v.size(); index++) {\r
1552 if (v.get(index).equals(this.jCheckBoxIa32.getText())) {\r
1553 this.jCheckBoxIa32.setSelected(true);\r
1554 continue;\r
1555 }\r
1556 if (v.get(index).equals(this.jCheckBoxIpf.getText())) {\r
1557 this.jCheckBoxIpf.setSelected(true);\r
1558 continue;\r
1559 }\r
1560 if (v.get(index).equals(this.jCheckBoxX64.getText())) {\r
1561 this.jCheckBoxX64.setSelected(true);\r
1562 continue;\r
1563 }\r
1564 if (v.get(index).equals(this.jCheckBoxEbc.getText())) {\r
1565 this.jCheckBoxEbc.setSelected(true);\r
1566 continue;\r
1567 }\r
1568 if (v.get(index).equals(this.jCheckBoxArm.getText())) {\r
1569 this.jCheckBoxArm.setSelected(true);\r
1570 continue;\r
1571 }\r
1572 if (v.get(index).equals(this.jCheckBoxPpc.getText())) {\r
1573 this.jCheckBoxPpc.setSelected(true);\r
1574 continue;\r
1575 }\r
1576 }\r
1577 }\r
1578 }\r
3b7a9058 1579\r
1580 /**\r
1581 * This method initializes jCheckBoxPcd \r
1582 * \r
1583 * @return javax.swing.JCheckBox \r
1584 */\r
1585 private JCheckBox getJCheckBoxPcd() {\r
1586 if (jCheckBoxPcd == null) {\r
1587 jCheckBoxPcd = new JCheckBox();\r
0f6a6511 1588 jCheckBoxPcd.setBounds(new java.awt.Rectangle(labelCol, 530, labelWidth, 20));\r
3b7a9058 1589 jCheckBoxPcd.setText("Is this a PCD Driver?");\r
1590 jCheckBoxPcd.addFocusListener(this);\r
1591 jCheckBoxPcd.addActionListener(this);\r
1592 }\r
1593 return jCheckBoxPcd;\r
1594 }\r
1595\r
1596 /**\r
1597 * This method initializes jCheckBoxFlashMap \r
1598 * \r
1599 * @return javax.swing.JCheckBox \r
1600 */\r
1601 private JCheckBox getJCheckBoxFlashMap() {\r
1602 if (jCheckBoxFlashMap == null) {\r
1603 jCheckBoxFlashMap = new JCheckBox();\r
0f6a6511 1604 jCheckBoxFlashMap.setBounds(new java.awt.Rectangle(labelCol, 555, 480, 20));\r
8de0094c 1605 jCheckBoxFlashMap.setText("Does this module require a legacy FlashMap header file?");\r
3b7a9058 1606 jCheckBoxFlashMap.addFocusListener(this);\r
1607 }\r
1608 return jCheckBoxFlashMap;\r
1609 }\r
b63cc1b6 1610\r
1611 /**\r
1612 * This method initializes jRadioButtonBinaryModuleTrue \r
1613 * \r
1614 * @return javax.swing.JRadioButton \r
1615 */\r
1616 private JRadioButton getJRadioButtonBinaryModuleTrue() {\r
1617 if (jRadioButtonBinaryModuleTrue == null) {\r
1618 jRadioButtonBinaryModuleTrue = new JRadioButton();\r
1619 jRadioButtonBinaryModuleTrue.setBounds(new java.awt.Rectangle(valueCol, 480, 140, 20));\r
1620 jRadioButtonBinaryModuleTrue.setText("True");\r
1621 jRadioButtonBinaryModuleTrue.setSelected(true);\r
1622 jRadioButtonBinaryModuleTrue.addFocusListener(this);\r
1623 jRadioButtonBinaryModuleTrue.setToolTipText("<html>Modules are either source modules <br>"\r
1624 + "which can be compiled or binary <br>"\r
1625 + "modules which are linked. <br>"\r
1626 + "A module cannot contain both. <br>"\r
1627 + "The GUID numbers should be identical <br>"\r
1628 + "for a binary and source MSA, <br>"\r
1629 + "however the BINARY MSA should have <br>"\r
1630 + "a higher version number.</html>");\r
1631 }\r
1632 return jRadioButtonBinaryModuleTrue;\r
1633 }\r
1634\r
1635 /**\r
1636 * This method initializes jRadioButtonBinaryModuleFalse \r
1637 * \r
1638 * @return javax.swing.JRadioButton \r
1639 */\r
1640 private JRadioButton getJRadioButtonBinaryModuleFalse() {\r
1641 if (jRadioButtonBinaryModuleFalse == null) {\r
1642 jRadioButtonBinaryModuleFalse = new JRadioButton();\r
1643 jRadioButtonBinaryModuleFalse.setBounds(new java.awt.Rectangle(valueCol + 140, 480, 140, 20));\r
1644 jRadioButtonBinaryModuleFalse.setText("False");\r
1645 jRadioButtonBinaryModuleFalse.addFocusListener(this);\r
1646 jRadioButtonBinaryModuleFalse.setToolTipText("<html>Modules are either source modules <br>"\r
1647 + "which can be compiled or binary <br>"\r
1648 + "modules which are linked. <br>"\r
1649 + "A module cannot contain both. <br>"\r
1650 + "The GUID numbers should be identical <br>"\r
1651 + "for a binary and source MSA, <br>"\r
1652 + "however the BINARY MSA should have <br>"\r
1653 + "a higher version number.</html>");\r
1654 }\r
1655 return jRadioButtonBinaryModuleFalse;\r
1656 }\r
a13899c5 1657}\r