3 The file is used to create, update MsaHeader of MSA file
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 package org
.tianocore
.frameworkwizard
.module
.ui
;
18 import java
.awt
.event
.ActionEvent
;
19 import java
.awt
.event
.ComponentEvent
;
20 import java
.awt
.event
.FocusEvent
;
21 import java
.util
.Vector
;
23 import javax
.swing
.ButtonGroup
;
24 import javax
.swing
.JButton
;
25 import javax
.swing
.JCheckBox
;
26 import javax
.swing
.JComboBox
;
27 import javax
.swing
.JLabel
;
28 import javax
.swing
.JPanel
;
29 import javax
.swing
.JScrollPane
;
30 import javax
.swing
.JTextArea
;
31 import javax
.swing
.JTextField
;
33 import org
.tianocore
.ExternsDocument
;
34 import org
.tianocore
.ModuleDefinitionsDocument
;
35 import org
.tianocore
.ModuleSurfaceAreaDocument
;
36 import org
.tianocore
.ModuleTypeDef
;
37 import org
.tianocore
.MsaHeaderDocument
;
38 import org
.tianocore
.PcdDriverTypes
;
39 import org
.tianocore
.LicenseDocument
.License
;
40 import org
.tianocore
.frameworkwizard
.common
.DataType
;
41 import org
.tianocore
.frameworkwizard
.common
.DataValidation
;
42 import org
.tianocore
.frameworkwizard
.common
.EnumerationData
;
43 import org
.tianocore
.frameworkwizard
.common
.Log
;
44 import org
.tianocore
.frameworkwizard
.common
.Tools
;
45 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningModuleType
;
46 import org
.tianocore
.frameworkwizard
.common
.ui
.IInternalFrame
;
47 import org
.tianocore
.frameworkwizard
.common
.ui
.StarLabel
;
48 import javax
.swing
.JRadioButton
;
51 The class is used to create, update MsaHeader of MSA file
52 It extends IInternalFrame
57 public class MsaHeader
extends IInternalFrame
{
60 /// Define class Serial Version UID
62 private static final long serialVersionUID
= -8152099582923006900L;
64 private int dialogWidth
= 500;
66 private int dialogHeight
= 630;
68 private final int labelWidth
= 155;
70 private int valueWidth
= 320;
72 private final int labelCol
= 12;
74 private final int valueCol
= 168;
76 //Define class members
78 private JPanel jContentPane
= null;
80 private JLabel jLabelBaseName
= null;
82 private JTextField jTextFieldBaseName
= null;
84 private JLabel jLabelGuid
= null;
86 private JTextField jTextFieldGuid
= null;
88 private JLabel jLabelVersion
= null;
90 private JTextField jTextFieldVersion
= null;
92 private JButton jButtonGenerateGuid
= null;
94 private JLabel jLabelLicense
= null;
96 private JTextArea jTextAreaLicense
= null;
98 private JLabel jLabelCopyright
= null;
100 private JLabel jLabelDescription
= null;
102 private JTextArea jTextAreaDescription
= null;
104 private JLabel jLabelSpecification
= null;
106 private JTextField jTextFieldSpecification
= null;
108 private JButton jButtonOk
= null;
110 private JButton jButtonCancel
= null;
112 private JScrollPane jScrollPaneLicense
= null;
114 private JScrollPane jScrollPaneDescription
= null;
116 private JLabel jLabelAbstract
= null;
118 private JTextField jTextFieldAbstract
= null;
120 private JLabel jLabelModuleType
= null;
122 private JComboBox jComboBoxModuleType
= null;
124 private JLabel jLabelArch
= null;
126 private JLabel jLabelBinaryModule
= null;
128 private JLabel jLabelOutputFileBasename
= null;
130 private JTextField jTextFieldOutputFileBasename
= null;
132 private JScrollPane jScrollPaneCopyright
= null;
134 private JTextArea jTextAreaCopyright
= null;
136 private JLabel jLabelURL
= null;
138 private JTextField jTextFieldURL
= null;
140 private JScrollPane jScrollPane
= null;
142 private StarLabel jStarLabel1
= null;
144 private StarLabel jStarLabel2
= null;
146 private StarLabel jStarLabel4
= null;
148 private StarLabel jStarLabel5
= null;
150 private StarLabel jStarLabel6
= null;
152 private StarLabel jStarLabel7
= null;
154 private StarLabel jStarLabel8
= null;
156 private StarLabel jStarLabel10
= null;
158 private StarLabel jStarLabel12
= null;
160 private StarLabel jStarLabel13
= null;
162 private StarLabel jStarLabel14
= null;
164 private JCheckBox jCheckBoxIa32
= null;
166 private JCheckBox jCheckBoxX64
= null;
168 private JCheckBox jCheckBoxIpf
= null;
170 private JCheckBox jCheckBoxEbc
= null;
172 private JCheckBox jCheckBoxArm
= null;
174 private JCheckBox jCheckBoxPpc
= null;
176 private JComboBox jComboBoxPcdIsDriver
= null;
178 private JCheckBox jCheckBoxPcd
= null;
180 private JCheckBox jCheckBoxFlashMap
= null;
185 private MsaHeaderDocument
.MsaHeader msaHeader
= null;
187 private ModuleDefinitionsDocument
.ModuleDefinitions md
= null;
189 private ModuleSurfaceAreaDocument
.ModuleSurfaceArea msa
= null;
191 private ExternsDocument
.Externs ex
= null;
193 private OpeningModuleType omt
= null;
195 private EnumerationData ed
= new EnumerationData();
197 private JRadioButton jRadioButtonBinaryModuleTrue
= null;
199 private JRadioButton jRadioButtonBinaryModuleFalse
= null;
202 * This method initializes jCheckBoxIa32
204 * @return javax.swing.JCheckBox
206 private JCheckBox
getJCheckBoxIa32() {
207 if (jCheckBoxIa32
== null) {
208 jCheckBoxIa32
= new JCheckBox();
209 jCheckBoxIa32
.setBounds(new java
.awt
.Rectangle(valueCol
, 505, 55, 20));
210 jCheckBoxIa32
.setText("IA32");
211 jCheckBoxIa32
.setToolTipText(DataType
.SUP_ARCH_LIST_HELP_TEXT
);
212 jCheckBoxIa32
.addFocusListener(this);
214 return jCheckBoxIa32
;
218 * This method initializes jCheckBoxX64
220 * @return javax.swing.JCheckBox
222 private JCheckBox
getJCheckBoxX64() {
223 if (jCheckBoxX64
== null) {
224 jCheckBoxX64
= new JCheckBox();
225 jCheckBoxX64
.setBounds(new java
.awt
.Rectangle(valueCol
+ 55, 505, 53, 20));
226 jCheckBoxX64
.setText("X64");
227 jCheckBoxX64
.setToolTipText(DataType
.SUP_ARCH_LIST_HELP_TEXT
);
228 jCheckBoxX64
.addFocusListener(this);
234 * This method initializes jCheckBoxIpf
236 * @return javax.swing.JCheckBox
238 private JCheckBox
getJCheckBoxIpf() {
239 if (jCheckBoxIpf
== null) {
240 jCheckBoxIpf
= new JCheckBox();
241 jCheckBoxIpf
.setBounds(new java
.awt
.Rectangle(valueCol
+ 110, 505, 52, 20));
242 jCheckBoxIpf
.setText("IPF");
243 jCheckBoxIpf
.setToolTipText(DataType
.SUP_ARCH_LIST_HELP_TEXT
);
244 jCheckBoxIpf
.addFocusListener(this);
250 * This method initializes jCheckBoxEbc
252 * @return javax.swing.JCheckBox
254 private JCheckBox
getJCheckBoxEbc() {
255 if (jCheckBoxEbc
== null) {
256 jCheckBoxEbc
= new JCheckBox();
257 jCheckBoxEbc
.setBounds(new java
.awt
.Rectangle(valueCol
+ 165, 505, 53, 20));
258 jCheckBoxEbc
.setText("EBC");
259 jCheckBoxEbc
.setToolTipText(DataType
.SUP_ARCH_LIST_HELP_TEXT
);
260 jCheckBoxEbc
.addFocusListener(this);
266 * This method initializes jCheckBoxArm
268 * @return javax.swing.JCheckBox
270 private JCheckBox
getJCheckBoxArm() {
271 if (jCheckBoxArm
== null) {
272 jCheckBoxArm
= new JCheckBox();
273 jCheckBoxArm
.setBounds(new java
.awt
.Rectangle(valueCol
+ 220, 505, 54, 20));
274 jCheckBoxArm
.setText("ARM");
275 jCheckBoxArm
.setToolTipText(DataType
.SUP_ARCH_LIST_HELP_TEXT
);
276 jCheckBoxArm
.addFocusListener(this);
282 * This method initializes jCheckBoxPpc
284 * @return javax.swing.JCheckBox
286 private JCheckBox
getJCheckBoxPpc() {
287 if (jCheckBoxPpc
== null) {
288 jCheckBoxPpc
= new JCheckBox();
289 jCheckBoxPpc
.setBounds(new java
.awt
.Rectangle(valueCol
+ 285, 505, 53, 20));
290 jCheckBoxPpc
.setText("PPC");
291 jCheckBoxPpc
.setToolTipText(DataType
.SUP_ARCH_LIST_HELP_TEXT
);
292 jCheckBoxPpc
.addFocusListener(this);
298 This method initializes jTextFieldBaseName
300 @return javax.swing.JTextField jTextFieldBaseName
303 private JTextField
getJTextFieldBaseName() {
304 if (jTextFieldBaseName
== null) {
305 jTextFieldBaseName
= new JTextField();
306 jTextFieldBaseName
.setBounds(new java
.awt
.Rectangle(valueCol
, 10, valueWidth
, 20));
307 jTextFieldBaseName
.setPreferredSize(new java
.awt
.Dimension(320, 20));
308 jTextFieldBaseName
.addFocusListener(this);
309 jTextFieldBaseName
.setToolTipText("A brief Identifier, such as USB I/O Library, of the module");
311 return jTextFieldBaseName
;
315 This method initializes jTextFieldGuid
317 @return javax.swing.JTextField jTextFieldGuid
320 private JTextField
getJTextFieldGuid() {
321 if (jTextFieldGuid
== null) {
322 jTextFieldGuid
= new JTextField();
323 jTextFieldGuid
.setPreferredSize(new java
.awt
.Dimension(250, 20));
324 jTextFieldGuid
.setLocation(new java
.awt
.Point(valueCol
, 60));
325 jTextFieldGuid
.setSize(new java
.awt
.Dimension(250, 20));
326 jTextFieldGuid
.addFocusListener(this);
327 jTextFieldGuid
.setToolTipText("Guaranteed Unique Identification Number, Registry Format (8-4-4-4-12)");
329 return jTextFieldGuid
;
333 This method initializes jTextFieldVersion
335 @return javax.swing.JTextField jTextFieldVersion
338 private JTextField
getJTextFieldVersion() {
339 if (jTextFieldVersion
== null) {
340 jTextFieldVersion
= new JTextField();
341 jTextFieldVersion
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, 20));
342 jTextFieldVersion
.setLocation(new java
.awt
.Point(valueCol
, 85));
343 jTextFieldVersion
.setSize(new java
.awt
.Dimension(valueWidth
, 20));
344 jTextFieldVersion
.addFocusListener(this);
345 jTextFieldVersion
.setToolTipText("A Version Number, 1.0, 1, 1.01, 1.0.1");
347 return jTextFieldVersion
;
351 This method initializes jButtonGenerateGuid
353 @return javax.swing.JButton jButtonGenerateGuid
356 private JButton
getJButtonGenerateGuid() {
357 if (jButtonGenerateGuid
== null) {
358 int genGuidCol
= valueCol
+ 285;
359 jButtonGenerateGuid
= new JButton();
360 jButtonGenerateGuid
.setPreferredSize(new java
.awt
.Dimension(65, 20));
361 jButtonGenerateGuid
.setSize(new java
.awt
.Dimension(65, 20));
362 jButtonGenerateGuid
.setLocation(new java
.awt
.Point(genGuidCol
, 60));
363 jButtonGenerateGuid
.setText("GEN");
364 jButtonGenerateGuid
.addActionListener(this);
366 return jButtonGenerateGuid
;
370 This method initializes jTextAreaLicense
372 @return javax.swing.JTextArea jTextAreaLicense
375 private JTextArea
getJTextAreaLicense() {
376 if (jTextAreaLicense
== null) {
377 jTextAreaLicense
= new JTextArea();
378 jTextAreaLicense
.setText("");
379 jTextAreaLicense
.setLineWrap(true);
380 jTextAreaLicense
.addFocusListener(this);
381 jTextAreaLicense
.setWrapStyleWord(true);
382 jTextAreaLicense
.setSelectionStart(0);
383 jTextAreaLicense
.setSelectionEnd(0);
384 jTextAreaLicense
.setToolTipText("The License for this Module.");
386 return jTextAreaLicense
;
390 This method initializes jTextAreaDescription
392 @return javax.swing.JTextArea jTextAreaDescription
395 private JTextArea
getJTextAreaDescription() {
396 if (jTextAreaDescription
== null) {
397 jTextAreaDescription
= new JTextArea();
398 jTextAreaDescription
.setLineWrap(true);
399 jTextAreaDescription
.addFocusListener(this);
400 jTextAreaDescription
.setToolTipText("A verbose description of the module.");
401 jTextAreaDescription
.setWrapStyleWord(true);
402 jTextAreaDescription
.setSelectionStart(0);
403 jTextAreaDescription
.setSelectionEnd(0);
405 return jTextAreaDescription
;
409 This method initializes jTextFieldSpecification
411 @return javax.swing.JTextField jTextFieldSpecification
414 private JTextField
getJTextFieldSpecification() {
415 if (jTextFieldSpecification
== null) {
416 int specWidth
= valueWidth
+ 50;
417 jTextFieldSpecification
= new JTextField();
419 jTextFieldSpecification
.setPreferredSize(new java
.awt
.Dimension(specWidth
, 20));
420 jTextFieldSpecification
.setText("FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052");
421 jTextFieldSpecification
.setBorder(null);
423 jTextFieldSpecification
.setSize(new java
.awt
.Dimension(specWidth
, 20));
424 jTextFieldSpecification
.setLocation(new java
.awt
.Point(labelCol
, dialogHeight
- 30));
425 jTextFieldSpecification
.setEditable(false);
426 jTextFieldSpecification
.addFocusListener(this);
428 return jTextFieldSpecification
;
432 This method initializes jButtonOk
434 @return javax.swing.JButton jButtonOk
437 private JButton
getJButtonOk() {
438 if (jButtonOk
== null) {
439 jButtonOk
= new JButton();
440 jButtonOk
.setText("OK");
441 jButtonOk
.setPreferredSize(new java
.awt
.Dimension(90, 20));
442 jButtonOk
.setBounds(new java
.awt
.Rectangle(390, 455, 90, 20));
443 jButtonOk
.addActionListener(this);
444 jButtonOk
.setVisible(false);
450 This method initializes jButtonCancel
452 @return javax.swing.JButton jButtonCancel
455 private JButton
getJButtonCancel() {
456 if (jButtonCancel
== null) {
457 jButtonCancel
= new JButton();
458 jButtonCancel
.setText("Cancel");
459 jButtonCancel
.setBounds(new java
.awt
.Rectangle(390, 445, 90, 20));
460 jButtonCancel
.addActionListener(this);
461 jButtonCancel
.setPreferredSize(new java
.awt
.Dimension(90, 20));
462 jButtonCancel
.setVisible(false);
464 return jButtonCancel
;
468 This method initializes jScrollPaneLicense
470 @return javax.swing.JScrollPane jScrollPaneLicense
473 private JScrollPane
getJScrollPaneLicense() {
474 if (jScrollPaneLicense
== null) {
475 jScrollPaneLicense
= new JScrollPane();
476 jScrollPaneLicense
.setHorizontalScrollBarPolicy(javax
.swing
.JScrollPane
.HORIZONTAL_SCROLLBAR_NEVER
);
477 jScrollPaneLicense
.setSize(new java
.awt
.Dimension(valueWidth
, 120));
478 jScrollPaneLicense
.setLocation(new java
.awt
.Point(valueCol
, 305));
479 jScrollPaneLicense
.setViewportView(getJTextAreaLicense());
480 jScrollPaneLicense
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, 120));
482 return jScrollPaneLicense
;
486 This method initializes jScrollPaneDescription
488 @return javax.swing.JScrollPane jScrollPaneDescription
491 private JScrollPane
getJScrollPaneDescription() {
492 if (jScrollPaneDescription
== null) {
493 jScrollPaneDescription
= new JScrollPane();
494 jScrollPaneDescription
.setHorizontalScrollBarPolicy(javax
.swing
.JScrollPane
.HORIZONTAL_SCROLLBAR_NEVER
);
495 jScrollPaneDescription
.setSize(new java
.awt
.Dimension(valueWidth
, 120));
496 jScrollPaneDescription
.setLocation(new java
.awt
.Point(valueCol
, 135));
497 jScrollPaneDescription
.setViewportView(getJTextAreaDescription());
498 jScrollPaneDescription
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, 120));
500 return jScrollPaneDescription
;
504 This method initializes jTextFieldAbstract
506 @return javax.swing.JTextField jTextFieldAbstract
509 private JTextField
getJTextFieldAbstract() {
510 if (jTextFieldAbstract
== null) {
511 jTextFieldAbstract
= new JTextField();
512 jTextFieldAbstract
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, 20));
513 jTextFieldAbstract
.setLocation(new java
.awt
.Point(valueCol
, 110));
514 jTextFieldAbstract
.setSize(new java
.awt
.Dimension(valueWidth
, 20));
515 jTextFieldAbstract
.addFocusListener(this);
516 jTextFieldAbstract
.setToolTipText("A one sentence description of this module.");
518 return jTextFieldAbstract
;
522 This method initializes jComboBoxModuleType
524 @return javax.swing.JComboBox jComboBoxModuleType
527 private JComboBox
getJComboBoxModuleType() {
528 if (jComboBoxModuleType
== null) {
529 jComboBoxModuleType
= new JComboBox();
530 jComboBoxModuleType
.setBounds(new java
.awt
.Rectangle(valueCol
, 35, valueWidth
, 20));
531 jComboBoxModuleType
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, 20));
532 jComboBoxModuleType
.addFocusListener(this);
534 return jComboBoxModuleType
;
538 This method initializes jTextFieldURL
540 @return javax.swing.JTextField
543 private JTextField
getJTextFieldURL() {
544 if (jTextFieldURL
== null) {
545 jTextFieldURL
= new JTextField();
546 jTextFieldURL
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, 20));
547 jTextFieldURL
.setLocation(new java
.awt
.Point(valueCol
, 430));
548 jTextFieldURL
.setSize(new java
.awt
.Dimension(valueWidth
, 20));
549 jTextFieldURL
.addFocusListener(this);
550 jTextFieldURL
.setToolTipText("A URL for the latest version of the license.");
552 return jTextFieldURL
;
556 This method initializes jScrollPane
558 @return javax.swing.JScrollPane
561 private JScrollPane
getJScrollPane() {
562 if (jScrollPane
== null) {
563 jScrollPane
= new JScrollPane();
564 jScrollPane
.setViewportView(getJContentPane());
570 This method initializes jScrollPaneCopyright
572 @return javax.swing.JScrollPane
575 private JScrollPane
getJScrollPaneCopyright() {
576 if (jScrollPaneCopyright
== null) {
577 jScrollPaneCopyright
= new JScrollPane();
578 jScrollPaneCopyright
.setBounds(new java
.awt
.Rectangle(valueCol
, 260, valueWidth
, 40));
579 jScrollPaneCopyright
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, 40));
580 jScrollPaneCopyright
.setViewportView(getJTextAreaCopyright());
581 jScrollPaneCopyright
.setSize(new java
.awt
.Dimension(valueWidth
, 40));
583 return jScrollPaneCopyright
;
587 This method initializes jTextAreaCopyright
589 @return javax.swing.JTextArea
592 private JTextArea
getJTextAreaCopyright() {
593 if (jTextAreaCopyright
== null) {
594 jTextAreaCopyright
= new JTextArea();
595 jTextAreaCopyright
.setLineWrap(true);
596 jTextAreaCopyright
.addFocusListener(this);
597 jTextAreaCopyright
.setWrapStyleWord(true);
598 jTextAreaCopyright
.setSelectionStart(0);
599 jTextAreaCopyright
.setSelectionEnd(0);
600 jTextAreaCopyright
.setBounds(new java
.awt
.Rectangle(0, 0, valueWidth
, 40));
601 jTextAreaCopyright
.setToolTipText("One or more copyright lines.");
603 return jTextAreaCopyright
;
607 * This method initializes jTextFieldOutputFileBasename
609 * @return javax.swing.JTextField
611 private JTextField
getJTextFieldOutputFileBasename() {
612 if (jTextFieldOutputFileBasename
== null) {
613 jTextFieldOutputFileBasename
= new JTextField();
614 jTextFieldOutputFileBasename
.setBounds(new java
.awt
.Rectangle(valueCol
, 455, valueWidth
, 20));
615 jTextFieldOutputFileBasename
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, 20));
616 jTextFieldOutputFileBasename
.addFocusListener(this);
617 jTextFieldOutputFileBasename
.setToolTipText("Enter a single word for generated output file names.");
619 return jTextFieldOutputFileBasename
;
623 * This method initializes jComboBoxPcdIsDriver
625 * @return javax.swing.JComboBox
627 private JComboBox
getJComboBoxPcdIsDriver() {
628 if (jComboBoxPcdIsDriver
== null) {
629 jComboBoxPcdIsDriver
= new JComboBox();
630 jComboBoxPcdIsDriver
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, 20));
631 jComboBoxPcdIsDriver
.setBounds(new java
.awt
.Rectangle(valueCol
, 530, valueWidth
, 20));
632 jComboBoxPcdIsDriver
.addItemListener(this);
633 jComboBoxPcdIsDriver
.addFocusListener(this);
634 jComboBoxPcdIsDriver
.setEnabled(false);
635 Tools
.generateComboBoxByVector(jComboBoxPcdIsDriver
, ed
.getVPcdDriverTypes());
636 jComboBoxPcdIsDriver
.setVisible(false);
638 return jComboBoxPcdIsDriver
;
642 This is the default constructor
648 this.setVisible(true);
652 This is the override edit constructor
654 @param inMsaHeader The input data of MsaHeaderDocument.MsaHeader
657 public MsaHeader(OpeningModuleType inMsa
) {
660 this.msa
= omt
.getXmlMsa();
663 // Set module definitions default value
665 if (msa
.getModuleDefinitions() == null) {
666 ModuleDefinitionsDocument
.ModuleDefinitions md
= ModuleDefinitionsDocument
.ModuleDefinitions
.Factory
668 md
.setOutputFileBasename(msa
.getMsaHeader().getModuleName());
669 md
.setBinaryModule(false);
670 md
.setSupportedArchitectures(ed
.getVSupportedArchitectures());
671 msa
.setModuleDefinitions(md
);
675 // Init items of Header, Definitions and Externs
677 init(msa
.getMsaHeader());
678 init(msa
.getModuleDefinitions());
679 init(msa
.getExterns());
681 this.setVisible(true);
682 this.setViewMode(false);
686 Disable all components when the mode is view
688 @param isView true - The view mode; false - The non-view mode
691 public void setViewMode(boolean isView
) {
693 this.jTextFieldBaseName
.setEnabled(!isView
);
694 this.jTextFieldGuid
.setEnabled(!isView
);
695 this.jTextFieldVersion
.setEnabled(!isView
);
696 this.jTextAreaLicense
.setEnabled(!isView
);
697 this.jTextAreaCopyright
.setEnabled(!isView
);
698 this.jTextAreaDescription
.setEnabled(!isView
);
699 this.jTextFieldSpecification
.setEnabled(!isView
);
700 this.jTextFieldAbstract
.setEnabled(!isView
);
701 this.jComboBoxModuleType
.setEnabled(!isView
);
702 this.jButtonCancel
.setEnabled(!isView
);
703 this.jButtonGenerateGuid
.setEnabled(!isView
);
704 this.jButtonOk
.setEnabled(!isView
);
709 This method initializes this
712 private void init() {
713 this.setSize(dialogWidth
, dialogHeight
);
714 this.setPreferredSize(new java
.awt
.Dimension(dialogWidth
, dialogHeight
));
715 this.setContentPane(getJScrollPane());
716 this.setTitle("Module Surface Area Header");
721 This method initializes this
722 Fill values to all fields if these values are not empty
724 @param inMsaHeader The input data of MsaHeaderDocument.MsaHeader
727 private void init(MsaHeaderDocument
.MsaHeader inMsaHeader
) {
729 if (inMsaHeader
!= null) {
730 setMsaHeader(inMsaHeader
);
731 if (this.msaHeader
.getModuleName() != null) {
732 this.jTextFieldBaseName
.setText(this.msaHeader
.getModuleName());
734 if (this.msaHeader
.getModuleType() != null) {
735 this.jComboBoxModuleType
.setSelectedItem(this.msaHeader
.getModuleType().toString());
737 if (this.msaHeader
.getGuidValue() != null) {
738 this.jTextFieldGuid
.setText(this.msaHeader
.getGuidValue());
740 if (this.msaHeader
.getVersion() != null) {
741 this.jTextFieldVersion
.setText(this.msaHeader
.getVersion());
743 if (this.msaHeader
.getAbstract() != null) {
744 this.jTextFieldAbstract
.setText(this.msaHeader
.getAbstract());
746 if (this.msaHeader
.getDescription() != null) {
747 this.jTextAreaDescription
.setText(this.msaHeader
.getDescription());
748 jTextAreaDescription
.setSelectionStart(0);
749 jTextAreaDescription
.setSelectionEnd(0);
751 if (this.msaHeader
.getCopyright() != null) {
752 this.jTextAreaCopyright
.setText(this.msaHeader
.getCopyright());
754 if (this.msaHeader
.getLicense() != null) {
755 this.jTextAreaLicense
.setText(this.msaHeader
.getLicense().getStringValue());
756 jTextAreaLicense
.setSelectionStart(0);
757 jTextAreaLicense
.setSelectionEnd(0);
759 if (this.msaHeader
.getLicense() != null && this.msaHeader
.getLicense().getURL() != null) {
760 this.jTextFieldURL
.setText(this.msaHeader
.getLicense().getURL());
762 if (this.msaHeader
.getSpecification() != null) {
763 this.jTextFieldSpecification
.setText(this.msaHeader
.getSpecification());
769 This method initializes this
770 Fill values to all fields if these values are not empty
772 @param inMsaHeader The input data of MsaHeaderDocument.MsaHeader
775 private void init(ModuleDefinitionsDocument
.ModuleDefinitions inMd
) {
778 if (md
.getSupportedArchitectures() != null) {
779 this.setSelectedItems(Tools
.convertListToVector(md
.getSupportedArchitectures()));
781 if (md
.getBinaryModule()) {
782 this.jRadioButtonBinaryModuleTrue
.setSelected(true);
784 this.jRadioButtonBinaryModuleFalse
.setSelected(true);
786 if (md
.getOutputFileBasename() != null) {
787 this.jTextFieldOutputFileBasename
.setText(md
.getOutputFileBasename());
793 This method initializes this
794 Fill values to all fields if these values are not empty
796 @param inEx The input data of ExternsDocument.Externs
799 private void init(ExternsDocument
.Externs inEx
) {
802 if (ex
.getPcdIsDriver() != null) {
803 this.jCheckBoxPcd
.setSelected(true);
804 this.jComboBoxPcdIsDriver
.setEnabled(true);
805 this.jComboBoxPcdIsDriver
.setSelectedItem(ex
.getPcdIsDriver());
806 // TODO: If the module type is DXE_DRIVER, set PCD_DXE_DRIVER
807 // If the module type is PEIM, set PCD_PEI_DRIVER
808 // If the module type is anything else, unset this!
810 this.jCheckBoxFlashMap
.setSelected(ex
.getTianoR8FlashMapH());
815 This method initializes jContentPane
817 @return javax.swing.JPanel jContentPane
820 private JPanel
getJContentPane() {
821 if (jContentPane
== null) {
823 jLabelURL
= new JLabel();
824 jLabelURL
.setText("License URL");
825 jLabelURL
.setLocation(new java
.awt
.Point(labelCol
, 430));
826 jLabelURL
.setSize(new java
.awt
.Dimension(labelWidth
, 20));
827 jLabelBaseName
= new JLabel();
828 jLabelBaseName
.setText("Module Name");
829 jLabelBaseName
.setBounds(new java
.awt
.Rectangle(labelCol
, 10, labelWidth
, 20));
830 jLabelModuleType
= new JLabel();
831 jLabelModuleType
.setBounds(new java
.awt
.Rectangle(labelCol
, 35, labelWidth
, 20));
832 jLabelModuleType
.setText("Module Type");
833 jLabelGuid
= new JLabel();
834 jLabelGuid
.setText("Guid Value");
835 jLabelGuid
.setLocation(new java
.awt
.Point(labelCol
, 60));
836 jLabelGuid
.setSize(new java
.awt
.Dimension(labelWidth
, 20));
837 jLabelVersion
= new JLabel();
838 jLabelVersion
.setText("Version");
839 jLabelVersion
.setLocation(new java
.awt
.Point(labelCol
, 85));
840 jLabelVersion
.setSize(new java
.awt
.Dimension(labelWidth
, 20));
841 jLabelAbstract
= new JLabel();
842 jLabelAbstract
.setText("Abstract");
843 jLabelAbstract
.setLocation(new java
.awt
.Point(labelCol
, 110));
844 jLabelAbstract
.setSize(new java
.awt
.Dimension(labelWidth
, 20));
845 jLabelDescription
= new JLabel();
846 jLabelDescription
.setText("Description");
847 jLabelDescription
.setLocation(new java
.awt
.Point(labelCol
, 135));
848 jLabelDescription
.setSize(new java
.awt
.Dimension(labelWidth
, 20));
849 jLabelCopyright
= new JLabel();
850 jLabelCopyright
.setText("Copyright");
851 jLabelCopyright
.setLocation(new java
.awt
.Point(labelCol
, 260));
852 jLabelCopyright
.setSize(new java
.awt
.Dimension(labelWidth
, 20));
853 jLabelLicense
= new JLabel();
854 jLabelLicense
.setText("License");
855 jLabelLicense
.setLocation(new java
.awt
.Point(labelCol
, 305));
856 jLabelLicense
.setSize(new java
.awt
.Dimension(labelWidth
, 20));
857 jLabelOutputFileBasename
= new JLabel();
858 jLabelOutputFileBasename
.setBounds(new java
.awt
.Rectangle(labelCol
, 455, labelWidth
, 20));
859 jLabelOutputFileBasename
.setText("Output File Basename");
860 jLabelBinaryModule
= new JLabel();
861 jLabelBinaryModule
.setBounds(new java
.awt
.Rectangle(labelCol
, 480, labelWidth
, 20));
862 jLabelBinaryModule
.setText("Binary Module");
863 jLabelArch
= new JLabel();
864 jLabelArch
.setBounds(new java
.awt
.Rectangle(labelCol
, 505, labelWidth
, 20));
865 jLabelArch
.setText("Supported Architectures");
866 jLabelSpecification
= new JLabel();
867 jLabelSpecification
.setText("Specification");
868 jLabelSpecification
.setLocation(new java
.awt
.Point(labelCol
, 530));
869 jLabelSpecification
.setSize(new java
.awt
.Dimension(labelWidth
, 20));
871 jContentPane
= new JPanel();
872 jContentPane
.setLayout(null);
873 jContentPane
.setPreferredSize(new java
.awt
.Dimension(dialogWidth
- 10, dialogHeight
- 10));
875 jContentPane
.addFocusListener(this);
877 jContentPane
.add(jLabelBaseName
, null);
878 jContentPane
.add(getJTextFieldBaseName(), null);
879 jContentPane
.add(jLabelGuid
, null);
880 jContentPane
.add(getJTextFieldGuid(), null);
881 jContentPane
.add(jLabelVersion
, null);
882 jContentPane
.add(getJTextFieldVersion(), null);
883 jContentPane
.add(getJButtonGenerateGuid(), null);
884 jContentPane
.add(jLabelLicense
, null);
885 jContentPane
.add(jLabelCopyright
, null);
886 jContentPane
.add(jLabelDescription
, null);
887 jContentPane
.add(getJTextFieldSpecification(), null);
888 jContentPane
.add(getJButtonOk(), null);
889 jContentPane
.add(getJButtonCancel(), null);
890 jContentPane
.add(getJScrollPaneLicense(), null);
891 jContentPane
.add(getJScrollPaneDescription(), null);
892 jContentPane
.add(jLabelAbstract
, null);
893 jContentPane
.add(getJTextFieldAbstract(), null);
894 jContentPane
.add(jLabelModuleType
, null);
895 jContentPane
.add(getJComboBoxModuleType(), null);
896 jContentPane
.add(jLabelURL
, null);
897 jContentPane
.add(getJTextFieldURL(), null);
898 jContentPane
.add(jLabelOutputFileBasename
, null);
899 jContentPane
.add(getJTextFieldOutputFileBasename(), null);
900 jContentPane
.add(jLabelBinaryModule
, null);
901 jContentPane
.add(jLabelArch
, null);
903 jStarLabel1
= new StarLabel();
904 jStarLabel1
.setLocation(new java
.awt
.Point(0, 10));
905 jStarLabel2
= new StarLabel();
906 jStarLabel2
.setLocation(new java
.awt
.Point(0, 35));
907 jStarLabel4
= new StarLabel();
908 jStarLabel4
.setLocation(new java
.awt
.Point(0, 60));
909 jStarLabel5
= new StarLabel();
910 jStarLabel5
.setLocation(new java
.awt
.Point(0, 85));
911 jStarLabel6
= new StarLabel();
912 jStarLabel6
.setLocation(new java
.awt
.Point(0, 135));
913 jStarLabel7
= new StarLabel();
914 jStarLabel7
.setLocation(new java
.awt
.Point(0, 260));
915 jStarLabel8
= new StarLabel();
916 jStarLabel8
.setLocation(new java
.awt
.Point(0, 305));
917 jStarLabel10
= new StarLabel();
918 jStarLabel10
.setLocation(new java
.awt
.Point(0, 110));
919 jStarLabel12
= new StarLabel();
920 jStarLabel12
.setLocation(new java
.awt
.Point(0, 455));
921 jStarLabel13
= new StarLabel();
922 jStarLabel13
.setLocation(new java
.awt
.Point(0, 480));
923 jStarLabel14
= new StarLabel();
924 jStarLabel14
.setLocation(new java
.awt
.Point(0, 505));
926 jContentPane
.add(jStarLabel1
, null);
927 jContentPane
.add(jStarLabel2
, null);
928 jContentPane
.add(jStarLabel4
, null);
929 jContentPane
.add(jStarLabel5
, null);
930 jContentPane
.add(jStarLabel6
, null);
931 jContentPane
.add(jStarLabel7
, null);
932 jContentPane
.add(jStarLabel8
, null);
933 jContentPane
.add(jStarLabel10
, null);
934 jContentPane
.add(jStarLabel12
, null);
935 jContentPane
.add(jStarLabel13
, null);
936 jContentPane
.add(jStarLabel14
, null);
937 jContentPane
.add(getJScrollPaneCopyright(), null);
939 jContentPane
.add(getJCheckBoxIa32(), null);
940 jContentPane
.add(getJCheckBoxX64(), null);
941 jContentPane
.add(getJCheckBoxIpf(), null);
942 jContentPane
.add(getJCheckBoxEbc(), null);
943 jContentPane
.add(getJCheckBoxArm(), null);
944 jContentPane
.add(getJCheckBoxPpc(), null);
946 jContentPane
.add(getJCheckBoxPcd(), null);
947 jContentPane
.add(getJComboBoxPcdIsDriver(), null);
948 jContentPane
.add(getJCheckBoxFlashMap(), null);
950 ButtonGroup bg
= new ButtonGroup();
951 jContentPane
.add(getJRadioButtonBinaryModuleTrue(), null);
952 jContentPane
.add(getJRadioButtonBinaryModuleFalse(), null);
953 bg
.add(getJRadioButtonBinaryModuleTrue());
954 bg
.add(getJRadioButtonBinaryModuleFalse());
960 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
962 * Override actionPerformed to listen all actions
965 public void actionPerformed(ActionEvent arg0
) {
966 if (arg0
.getSource() == jButtonOk
) {
972 this.setEdited(true);
976 if (arg0
.getSource() == jButtonCancel
) {
977 this.setEdited(false);
980 if (arg0
.getSource() == jButtonGenerateGuid
) {
981 jTextFieldGuid
.setText(Tools
.generateUuidString());
982 jTextFieldGuid
.requestFocus();
983 jButtonGenerateGuid
.requestFocus();
986 if (arg0
.getSource() == this.jCheckBoxPcd
) {
987 this.jComboBoxPcdIsDriver
.setEnabled(this.jCheckBoxPcd
.isSelected());
992 Data validation for all fields
994 @retval true - All datas are valid
995 @retval false - At least one data is invalid
998 public boolean check() {
1000 // Check if all required fields are not empty
1001 // and check if all data fields values are valid
1007 if (isEmpty(this.jTextFieldBaseName
.getText())) {
1008 Log
.wrn("Update Msa Header", "Name must be entered!");
1009 //this.jTextFieldBaseName.requestFocus();
1012 if (!DataValidation
.isBaseName(this.jTextFieldBaseName
.getText())) {
1013 Log
.wrn("Update Msa Header", "Incorrect data type for Name, it must start with an alpha character!");
1014 //this.jTextFieldBaseName.requestFocus();
1021 if (isEmpty(this.jTextFieldGuid
.getText())) {
1022 Log
.wrn("Update Msa Header", "The Guid Value must be entered!");
1023 //this.jTextFieldGuid.requestFocus();
1026 if (!DataValidation
.isGuid((this.jTextFieldGuid
).getText())) {
1027 Log
.wrn("Update Msa Header", "Incorrect data type for Guid, it must be registry format, 8-4-4-4-12");
1028 //this.jTextFieldGuid.requestFocus();
1035 if (isEmpty(this.jTextFieldVersion
.getText())) {
1036 Log
.wrn("Update Msa Header", "Version must be entered!");
1037 //this.jTextFieldVersion.requestFocus();
1040 if (!DataValidation
.isVersion(this.jTextFieldVersion
.getText())) {
1041 Log
.wrn("Update Msa Header", "Incorrect data type for Version, it must start with a digit.");
1042 //this.jTextFieldVersion.requestFocus();
1049 if (isEmpty(this.jTextFieldAbstract
.getText())) {
1050 Log
.wrn("Update Msa Header", "Abstract must be entered!");
1051 //this.jTextFieldAbstract.requestFocus();
1054 if (!DataValidation
.isAbstract(this.jTextFieldAbstract
.getText())) {
1055 Log
.wrn("Update Msa Header",
1056 "Incorrect data type for Abstract, is should be a sentence describing the module.");
1057 //this.jTextFieldAbstract.requestFocus();
1062 // Check Description
1064 if (isEmpty(this.jTextAreaDescription
.getText())) {
1065 Log
.wrn("Update Msa Header", "Description must be entered!");
1066 //this.jTextAreaDescription.requestFocus();
1073 if (isEmpty(this.jTextAreaCopyright
.getText())) {
1074 Log
.wrn("Update Msa Header", "Copyright must be entered!");
1075 //this.jTextFieldCopyright.requestFocus();
1082 if (isEmpty(this.jTextAreaLicense
.getText())) {
1083 Log
.wrn("Update Msa Header", "License must be entered!");
1084 //this.jTextAreaLicense.requestFocus();
1089 // Check Specification
1091 if (isEmpty(this.jTextFieldSpecification
.getText())) {
1092 Log
.wrn("Update Msa Header", "Specification must exist.");
1093 //this.jTextFieldSpecification.requestFocus();
1096 if (!DataValidation
.isSpecification(this.jTextFieldSpecification
.getText())) {
1097 // TODO Add code to check the specification number.
1098 // Future releases of Schema may require that we process these files
1100 Log
.wrn("Update Msa Header", "Incorrect data type for Specification");
1101 //this.jTextFieldSpecification.requestFocus();
1109 Save all components of Msa Header
1110 if exists msaHeader, set the value directly
1111 if not exists msaHeader, new an instance first
1114 public void save() {
1116 msaHeader
.setSpecification(this.jTextFieldSpecification
.getText());
1117 msa
.setMsaHeader(msaHeader
);
1118 msa
.setModuleDefinitions(md
);
1119 this.omt
.setSaved(false);
1120 } catch (Exception e
) {
1121 Log
.wrn("Save Module", e
.getMessage());
1122 Log
.err("Save Module", e
.getMessage());
1127 This method initializes Module type and Compontent type
1130 private void initFrame() {
1131 EnumerationData ed
= new EnumerationData();
1132 Tools
.generateComboBoxByVector(jComboBoxModuleType
, ed
.getVModuleType());
1133 this.setSelectedItems(ed
.getVSupportedArchitectures());
1137 Get MsaHeaderDocument.MsaHeader
1139 @return MsaHeaderDocument.MsaHeader
1142 public MsaHeaderDocument
.MsaHeader
getMsaHeader() {
1147 Set MsaHeaderDocument.MsaHeader
1149 @param msaHeader The input data of MsaHeaderDocument.MsaHeader
1152 public void setMsaHeader(MsaHeaderDocument
.MsaHeader msaHeader
) {
1153 this.msaHeader
= msaHeader
;
1157 * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
1159 * Override componentResized to resize all components when frame's size is changed
1161 public void componentResized(ComponentEvent arg0
) {
1162 int intCurrentWidth
= this.getJContentPane().getWidth();
1163 int intPreferredWidth
= this.getJContentPane().getPreferredSize().width
;
1165 Tools
.resizeComponentWidth(this.jTextFieldBaseName
, intCurrentWidth
, intPreferredWidth
);
1166 Tools
.resizeComponentWidth(this.jTextFieldGuid
, intCurrentWidth
, intPreferredWidth
);
1167 Tools
.resizeComponentWidth(this.jTextFieldVersion
, intCurrentWidth
, intPreferredWidth
);
1168 Tools
.resizeComponentWidth(this.jScrollPaneLicense
, intCurrentWidth
, intPreferredWidth
);
1169 Tools
.resizeComponentWidth(this.jTextFieldURL
, intCurrentWidth
, intPreferredWidth
);
1170 Tools
.resizeComponentWidth(this.jScrollPaneCopyright
, intCurrentWidth
, intPreferredWidth
);
1171 Tools
.resizeComponentWidth(this.jScrollPaneDescription
, intCurrentWidth
, intPreferredWidth
);
1172 Tools
.resizeComponentWidth(this.jTextFieldSpecification
, intCurrentWidth
, intPreferredWidth
);
1173 Tools
.resizeComponentWidth(this.jTextFieldAbstract
, intCurrentWidth
, intPreferredWidth
);
1174 Tools
.resizeComponentWidth(this.jComboBoxModuleType
, intCurrentWidth
, intPreferredWidth
);
1175 Tools
.resizeComponentWidth(this.jTextFieldOutputFileBasename
, intCurrentWidth
, intPreferredWidth
);
1176 Tools
.resizeComponentWidth(this.jComboBoxPcdIsDriver
, intCurrentWidth
, intPreferredWidth
);
1178 Tools
.relocateComponentX(this.jButtonGenerateGuid
, intCurrentWidth
, intPreferredWidth
,
1179 DataType
.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON
);
1182 public void focusLost(FocusEvent arg0
) {
1183 if (this.msaHeader
== null) {
1184 msaHeader
= MsaHeaderDocument
.MsaHeader
.Factory
.newInstance();
1190 if (arg0
.getSource() == this.jTextFieldBaseName
) {
1191 if (isEmpty(this.jTextFieldBaseName
.getText())) {
1192 Log
.wrn("Update Msa Header", "The Name must be entered!");
1193 //this.jTextFieldBaseName.requestFocus();
1196 if (!DataValidation
.isBaseName(this.jTextFieldBaseName
.getText())) {
1197 Log
.wrn("Update Msa Header", "Incorrect data type for Name, it must begin with an alpha character.");
1198 //this.jTextFieldBaseName.requestFocus();
1201 if (!this.jTextFieldBaseName
.getText().equals(msaHeader
.getModuleName())) {
1202 this.msaHeader
.setModuleName(this.jTextFieldBaseName
.getText());
1209 // Check Module Type
1211 if (arg0
.getSource() == this.jComboBoxModuleType
) {
1212 if (!jComboBoxModuleType
.getSelectedItem().toString().equals(msaHeader
.getModuleType().toString())) {
1213 msaHeader
.setModuleType(ModuleTypeDef
.Enum
.forString(jComboBoxModuleType
.getSelectedItem().toString()));
1222 if (arg0
.getSource() == this.jTextFieldGuid
) {
1223 if (isEmpty(this.jTextFieldGuid
.getText())) {
1224 Log
.wrn("Update Msa Header", "Guid must be entered!");
1225 //this.jTextFieldGuid.requestFocus();
1228 if (!DataValidation
.isGuid((this.jTextFieldGuid
).getText())) {
1229 Log
.wrn("Update Msa Header", "Incorrect data type for Guid, it must be registry format. (8-4-4-4-12)");
1230 //this.jTextFieldGuid.requestFocus();
1233 if (!this.jTextFieldGuid
.getText().equals(msaHeader
.getGuidValue())) {
1234 this.msaHeader
.setGuidValue(this.jTextFieldGuid
.getText());
1243 if (arg0
.getSource() == this.jTextFieldVersion
) {
1244 if (isEmpty(this.jTextFieldVersion
.getText())) {
1245 Log
.wrn("Update Msa Header", "Version must be entered!");
1246 //this.jTextFieldVersion.requestFocus();
1249 if (!DataValidation
.isVersion(this.jTextFieldVersion
.getText())) {
1250 Log
.wrn("Update Msa Header", "Incorrect data type for Version, it must start with a digit.");
1251 //this.jTextFieldVersion.requestFocus();
1254 if (!this.jTextFieldVersion
.getText().equals(msaHeader
.getVersion())) {
1255 this.msaHeader
.setVersion(this.jTextFieldVersion
.getText());
1264 if (arg0
.getSource() == this.jTextFieldAbstract
) {
1265 if (isEmpty(this.jTextFieldAbstract
.getText())) {
1266 Log
.wrn("Update Msa Header", "Abstract must be entered!");
1267 //this.jTextFieldAbstract.requestFocus();
1270 if (!DataValidation
.isAbstract(this.jTextFieldAbstract
.getText())) {
1271 Log
.wrn("Update Msa Header", "Incorrect data type for Abstract, it must be sentence.");
1272 //this.jTextFieldAbstract.requestFocus();
1275 if (!this.jTextFieldAbstract
.getText().equals(msaHeader
.getAbstract())) {
1276 this.msaHeader
.setAbstract(this.jTextFieldAbstract
.getText());
1283 // Check Description
1285 if (arg0
.getSource() == this.jTextAreaDescription
) {
1286 if (isEmpty(this.jTextAreaDescription
.getText())) {
1287 Log
.wrn("Update Msa Header", "Description must be entered!");
1288 //this.jTextAreaDescription.requestFocus();
1291 if (!this.jTextAreaDescription
.getText().equals(msaHeader
.getDescription())) {
1292 this.msaHeader
.setDescription(this.jTextAreaDescription
.getText());
1301 if (arg0
.getSource() == this.jTextAreaCopyright
) {
1302 if (isEmpty(this.jTextAreaCopyright
.getText())) {
1303 Log
.wrn("Update Msa Header", "Copyright must be entered!");
1304 //this.jTextFieldCopyright.requestFocus();
1307 if (!this.jTextAreaCopyright
.getText().equals(msaHeader
.getCopyright())) {
1308 this.msaHeader
.setCopyright(this.jTextAreaCopyright
.getText());
1317 if (arg0
.getSource() == this.jTextAreaLicense
) {
1318 if (isEmpty(this.jTextAreaLicense
.getText())) {
1319 Log
.wrn("Update Msa Header", "License must be entered!");
1320 //this.jTextAreaLicense.requestFocus();
1323 if (this.msaHeader
.getLicense() != null) {
1324 if (!this.jTextAreaLicense
.getText().equals(msaHeader
.getLicense().getStringValue())) {
1325 this.msaHeader
.getLicense().setStringValue(this.jTextAreaLicense
.getText());
1330 License mLicense
= License
.Factory
.newInstance();
1331 mLicense
.setStringValue(this.jTextAreaLicense
.getText());
1332 this.msaHeader
.setLicense(mLicense
);
1337 // Check License URL
1339 if (arg0
.getSource() == this.jTextFieldURL
) {
1340 if (!isEmpty(this.jTextFieldURL
.getText())) {
1341 if (this.msaHeader
.getLicense() == null) {
1342 License mLicense
= License
.Factory
.newInstance();
1343 mLicense
.setURL(this.jTextFieldURL
.getText());
1344 this.msaHeader
.setLicense(mLicense
);
1346 if (!this.jTextFieldURL
.getText().equals(msaHeader
.getLicense().getURL())) {
1347 this.msaHeader
.getLicense().setURL(this.jTextFieldURL
.getText());
1356 // Check Output File Basename
1358 if (arg0
.getSource() == this.jTextFieldOutputFileBasename
) {
1359 if (isEmpty(this.jTextFieldOutputFileBasename
.getText())) {
1360 Log
.wrn("Update Msa Header", "Output File Basename must be entered!");
1361 // jTextFieldOutputFileBasename.removeFocusListener(this);
1362 // jTextFieldOutputFileBasename.requestFocus();
1363 // jTextFieldOutputFileBasename.addFocusListener(this);
1366 if (!this.jTextFieldOutputFileBasename
.getText().equals(md
.getOutputFileBasename())) {
1367 this.md
.setOutputFileBasename(this.jTextFieldOutputFileBasename
.getText());
1374 // Check Binary Module Type
1376 if (arg0
.getSource() == this.jRadioButtonBinaryModuleTrue
) {
1377 if (jRadioButtonBinaryModuleTrue
.isSelected()) {
1378 if (md
.getBinaryModule()) {
1381 md
.setBinaryModule(true);
1387 // Check Binary Module Type
1389 if (arg0
.getSource() == this.jRadioButtonBinaryModuleFalse
) {
1390 if (jRadioButtonBinaryModuleFalse
.isSelected()) {
1391 if (md
.getBinaryModule()) {
1392 md
.setBinaryModule(false);
1400 // Check Supported Arch
1402 if (arg0
.getSource() == this.jCheckBoxArm
|| arg0
.getSource() == this.jCheckBoxEbc
1403 || arg0
.getSource() == this.jCheckBoxIa32
|| arg0
.getSource() == this.jCheckBoxIpf
1404 || arg0
.getSource() == this.jCheckBoxPpc
|| arg0
.getSource() == this.jCheckBoxX64
) {
1405 if (!this.getSelectedItemsString().equals(md
.getSupportedArchitectures().toString())) {
1406 md
.setSupportedArchitectures(this.getSelectedItemsVector());
1413 // Check Pcd is Driver
1415 if (arg0
.getSource() == this.jCheckBoxPcd
|| arg0
.getSource() == this.jComboBoxPcdIsDriver
) {
1416 if ((this.ex
== null) && this.jCheckBoxPcd
.isSelected()) {
1417 this.ex
= ExternsDocument
.Externs
.Factory
.newInstance();
1418 this.ex
.setPcdIsDriver(PcdDriverTypes
.Enum
.forString(this.jComboBoxPcdIsDriver
.getSelectedItem()
1420 this.msa
.setExterns(this.ex
);
1421 } else if ((this.ex
!= null) && (this.ex
.getPcdIsDriver() == null) && this.jCheckBoxPcd
.isSelected()) {
1422 this.ex
.setPcdIsDriver(PcdDriverTypes
.Enum
.forString(this.jComboBoxPcdIsDriver
.getSelectedItem()
1424 this.msa
.setExterns(this.ex
);
1425 } else if ((this.ex
!= null) && (this.ex
.getPcdIsDriver() != null)) {
1426 if (this.jCheckBoxPcd
.isSelected()
1427 && !this.jComboBoxPcdIsDriver
.getSelectedItem().toString().equals(
1428 this.ex
.getPcdIsDriver()
1430 this.ex
.setPcdIsDriver(PcdDriverTypes
.Enum
.forString(this.jComboBoxPcdIsDriver
.getSelectedItem()
1432 this.msa
.setExterns(this.ex
);
1434 if (!this.jCheckBoxPcd
.isSelected()) {
1435 ExternsDocument
.Externs newEx
= ExternsDocument
.Externs
.Factory
.newInstance();
1436 if (this.ex
.getExternList() != null) {
1437 for (int index
= 0; index
< this.ex
.getExternList().size(); index
++) {
1438 newEx
.addNewExtern();
1439 newEx
.setExternArray(index
, this.ex
.getExternArray(index
));
1442 if (this.ex
.getSpecificationList() != null) {
1443 for (int index
= 0; index
< this.ex
.getSpecificationList().size(); index
++) {
1444 newEx
.addNewSpecification();
1445 newEx
.setSpecificationArray(index
, this.ex
.getSpecificationArray(index
));
1448 if (this.ex
.getTianoR8FlashMapH()) {
1449 newEx
.setTianoR8FlashMapH(this.ex
.getTianoR8FlashMapH());
1452 this.msa
.setExterns(this.ex
);
1460 if (arg0
.getSource() == this.jCheckBoxFlashMap
) {
1461 if ((this.ex
== null) && this.jCheckBoxFlashMap
.isSelected()) {
1462 this.ex
= ExternsDocument
.Externs
.Factory
.newInstance();
1463 this.ex
.setTianoR8FlashMapH(this.jCheckBoxFlashMap
.isSelected());
1464 this.msa
.setExterns(this.ex
);
1465 } else if ((this.ex
!= null) && this.jCheckBoxFlashMap
.isSelected()) {
1466 this.ex
.setTianoR8FlashMapH(this.jCheckBoxFlashMap
.isSelected());
1467 this.msa
.setExterns(this.ex
);
1468 } else if ((this.ex
!= null) && !this.jCheckBoxFlashMap
.isSelected()) {
1469 ExternsDocument
.Externs newEx
= ExternsDocument
.Externs
.Factory
.newInstance();
1470 if (this.ex
.getExternList() != null) {
1471 for (int index
= 0; index
< this.ex
.getExternList().size(); index
++) {
1472 newEx
.addNewExtern();
1473 newEx
.setExternArray(index
, this.ex
.getExternArray(index
));
1476 if (this.ex
.getSpecificationList() != null) {
1477 for (int index
= 0; index
< this.ex
.getSpecificationList().size(); index
++) {
1478 newEx
.addNewSpecification();
1479 newEx
.setSpecificationArray(index
, this.ex
.getSpecificationArray(index
));
1482 if (this.ex
.getPcdIsDriver() != null) {
1483 newEx
.setPcdIsDriver(this.ex
.getPcdIsDriver());
1486 this.msa
.setExterns(this.ex
);
1493 private Vector
<String
> getSelectedItemsVector() {
1494 Vector
<String
> v
= new Vector
<String
>();
1495 if (this.jCheckBoxIa32
.isSelected()) {
1496 v
.addElement(jCheckBoxIa32
.getText());
1498 if (this.jCheckBoxX64
.isSelected()) {
1499 v
.addElement(jCheckBoxX64
.getText());
1501 if (this.jCheckBoxIpf
.isSelected()) {
1502 v
.addElement(jCheckBoxIpf
.getText());
1504 if (this.jCheckBoxEbc
.isSelected()) {
1505 v
.addElement(jCheckBoxEbc
.getText());
1507 if (this.jCheckBoxArm
.isSelected()) {
1508 v
.addElement(jCheckBoxArm
.getText());
1510 if (this.jCheckBoxPpc
.isSelected()) {
1511 v
.addElement(jCheckBoxPpc
.getText());
1516 private String
getSelectedItemsString() {
1518 if (this.jCheckBoxIa32
.isSelected()) {
1519 s
= s
+ jCheckBoxIa32
.getText() + " ";
1521 if (this.jCheckBoxX64
.isSelected()) {
1522 s
= s
+ jCheckBoxX64
.getText() + " ";
1524 if (this.jCheckBoxIpf
.isSelected()) {
1525 s
= s
+ jCheckBoxIpf
.getText() + " ";
1527 if (this.jCheckBoxEbc
.isSelected()) {
1528 s
= s
+ jCheckBoxEbc
.getText() + " ";
1530 if (this.jCheckBoxArm
.isSelected()) {
1531 s
= s
+ jCheckBoxArm
.getText() + " ";
1533 if (this.jCheckBoxPpc
.isSelected()) {
1534 s
= s
+ jCheckBoxPpc
.getText() + " ";
1539 private void setAllItemsSelected(boolean isSelected
) {
1540 this.jCheckBoxIa32
.setSelected(isSelected
);
1541 this.jCheckBoxX64
.setSelected(isSelected
);
1542 this.jCheckBoxIpf
.setSelected(isSelected
);
1543 this.jCheckBoxEbc
.setSelected(isSelected
);
1544 this.jCheckBoxArm
.setSelected(isSelected
);
1545 this.jCheckBoxPpc
.setSelected(isSelected
);
1548 private void setSelectedItems(Vector
<String
> v
) {
1549 setAllItemsSelected(false);
1551 for (int index
= 0; index
< v
.size(); index
++) {
1552 if (v
.get(index
).equals(this.jCheckBoxIa32
.getText())) {
1553 this.jCheckBoxIa32
.setSelected(true);
1556 if (v
.get(index
).equals(this.jCheckBoxIpf
.getText())) {
1557 this.jCheckBoxIpf
.setSelected(true);
1560 if (v
.get(index
).equals(this.jCheckBoxX64
.getText())) {
1561 this.jCheckBoxX64
.setSelected(true);
1564 if (v
.get(index
).equals(this.jCheckBoxEbc
.getText())) {
1565 this.jCheckBoxEbc
.setSelected(true);
1568 if (v
.get(index
).equals(this.jCheckBoxArm
.getText())) {
1569 this.jCheckBoxArm
.setSelected(true);
1572 if (v
.get(index
).equals(this.jCheckBoxPpc
.getText())) {
1573 this.jCheckBoxPpc
.setSelected(true);
1581 * This method initializes jCheckBoxPcd
1583 * @return javax.swing.JCheckBox
1585 private JCheckBox
getJCheckBoxPcd() {
1586 if (jCheckBoxPcd
== null) {
1587 jCheckBoxPcd
= new JCheckBox();
1588 jCheckBoxPcd
.setBounds(new java
.awt
.Rectangle(labelCol
, 530, labelWidth
, 20));
1589 jCheckBoxPcd
.setText("Is this a PCD Driver?");
1590 jCheckBoxPcd
.addFocusListener(this);
1591 jCheckBoxPcd
.addActionListener(this);
1593 return jCheckBoxPcd
;
1597 * This method initializes jCheckBoxFlashMap
1599 * @return javax.swing.JCheckBox
1601 private JCheckBox
getJCheckBoxFlashMap() {
1602 if (jCheckBoxFlashMap
== null) {
1603 jCheckBoxFlashMap
= new JCheckBox();
1604 jCheckBoxFlashMap
.setBounds(new java
.awt
.Rectangle(labelCol
, 555, 480, 20));
1605 jCheckBoxFlashMap
.setText("Are you using a legacy FlashMap header file?");
1606 jCheckBoxFlashMap
.addFocusListener(this);
1608 return jCheckBoxFlashMap
;
1612 * This method initializes jRadioButtonBinaryModuleTrue
1614 * @return javax.swing.JRadioButton
1616 private JRadioButton
getJRadioButtonBinaryModuleTrue() {
1617 if (jRadioButtonBinaryModuleTrue
== null) {
1618 jRadioButtonBinaryModuleTrue
= new JRadioButton();
1619 jRadioButtonBinaryModuleTrue
.setBounds(new java
.awt
.Rectangle(valueCol
, 480, 140, 20));
1620 jRadioButtonBinaryModuleTrue
.setText("True");
1621 jRadioButtonBinaryModuleTrue
.setSelected(true);
1622 jRadioButtonBinaryModuleTrue
.addFocusListener(this);
1623 jRadioButtonBinaryModuleTrue
.setToolTipText("<html>Modules are either source modules <br>"
1624 + "which can be compiled or binary <br>"
1625 + "modules which are linked. <br>"
1626 + "A module cannot contain both. <br>"
1627 + "The GUID numbers should be identical <br>"
1628 + "for a binary and source MSA, <br>"
1629 + "however the BINARY MSA should have <br>"
1630 + "a higher version number.</html>");
1632 return jRadioButtonBinaryModuleTrue
;
1636 * This method initializes jRadioButtonBinaryModuleFalse
1638 * @return javax.swing.JRadioButton
1640 private JRadioButton
getJRadioButtonBinaryModuleFalse() {
1641 if (jRadioButtonBinaryModuleFalse
== null) {
1642 jRadioButtonBinaryModuleFalse
= new JRadioButton();
1643 jRadioButtonBinaryModuleFalse
.setBounds(new java
.awt
.Rectangle(valueCol
+ 140, 480, 140, 20));
1644 jRadioButtonBinaryModuleFalse
.setText("False");
1645 jRadioButtonBinaryModuleFalse
.addFocusListener(this);
1646 jRadioButtonBinaryModuleFalse
.setToolTipText("<html>Modules are either source modules <br>"
1647 + "which can be compiled or binary <br>"
1648 + "modules which are linked. <br>"
1649 + "A module cannot contain both. <br>"
1650 + "The GUID numbers should be identical <br>"
1651 + "for a binary and source MSA, <br>"
1652 + "however the BINARY MSA should have <br>"
1653 + "a higher version number.</html>");
1655 return jRadioButtonBinaryModuleFalse
;