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
.JButton
;
24 import javax
.swing
.JCheckBox
;
25 import javax
.swing
.JComboBox
;
26 import javax
.swing
.JLabel
;
27 import javax
.swing
.JPanel
;
28 import javax
.swing
.JScrollPane
;
29 import javax
.swing
.JTextArea
;
30 import javax
.swing
.JTextField
;
32 import org
.tianocore
.ExternsDocument
;
33 import org
.tianocore
.ModuleDefinitionsDocument
;
34 import org
.tianocore
.ModuleSurfaceAreaDocument
;
35 import org
.tianocore
.ModuleTypeDef
;
36 import org
.tianocore
.MsaHeaderDocument
;
37 import org
.tianocore
.PcdDriverTypes
;
38 import org
.tianocore
.LicenseDocument
.License
;
39 import org
.tianocore
.frameworkwizard
.common
.DataType
;
40 import org
.tianocore
.frameworkwizard
.common
.DataValidation
;
41 import org
.tianocore
.frameworkwizard
.common
.EnumerationData
;
42 import org
.tianocore
.frameworkwizard
.common
.Log
;
43 import org
.tianocore
.frameworkwizard
.common
.Tools
;
44 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningModuleType
;
45 import org
.tianocore
.frameworkwizard
.common
.ui
.IInternalFrame
;
46 import org
.tianocore
.frameworkwizard
.common
.ui
.StarLabel
;
49 The class is used to create, update MsaHeader of MSA file
50 It extends IInternalFrame
55 public class MsaHeader
extends IInternalFrame
{
58 /// Define class Serial Version UID
60 private static final long serialVersionUID
= -8152099582923006900L;
62 private int dialogWidth
= 500;
64 private int dialogHeight
= 630;
67 //Define class members
69 private JPanel jContentPane
= null;
71 private JLabel jLabelBaseName
= null;
73 private JTextField jTextFieldBaseName
= null;
75 private JLabel jLabelGuid
= null;
77 private JTextField jTextFieldGuid
= null;
79 private JLabel jLabelVersion
= null;
81 private JTextField jTextFieldVersion
= null;
83 private JButton jButtonGenerateGuid
= null;
85 private JLabel jLabelLicense
= null;
87 private JTextArea jTextAreaLicense
= null;
89 private JLabel jLabelCopyright
= null;
91 private JLabel jLabelDescription
= null;
93 private JTextArea jTextAreaDescription
= null;
95 private JLabel jLabelSpecification
= null;
97 private JTextField jTextFieldSpecification
= null;
99 private JButton jButtonOk
= null;
101 private JButton jButtonCancel
= null;
103 private JScrollPane jScrollPaneLicense
= null;
105 private JScrollPane jScrollPaneDescription
= null;
107 private JLabel jLabelAbstract
= null;
109 private JTextField jTextFieldAbstract
= null;
111 private JLabel jLabelModuleType
= null;
113 private JComboBox jComboBoxModuleType
= null;
115 private JLabel jLabelArch
= null;
117 private JLabel jLabelBinaryModule
= null;
119 private JComboBox jComboBoxBinaryModule
= null;
121 private JLabel jLabelOutputFileBasename
= null;
123 private JTextField jTextFieldOutputFileBasename
= null;
125 private JScrollPane jScrollPaneCopyright
= null;
127 private JTextArea jTextAreaCopyright
= null;
129 private JLabel jLabelURL
= null;
131 private JTextField jTextFieldURL
= null;
133 private JScrollPane jScrollPane
= null;
135 private StarLabel jStarLabel1
= null;
137 private StarLabel jStarLabel2
= null;
139 private StarLabel jStarLabel4
= null;
141 private StarLabel jStarLabel5
= null;
143 private StarLabel jStarLabel6
= null;
145 private StarLabel jStarLabel7
= null;
147 private StarLabel jStarLabel8
= null;
149 private StarLabel jStarLabel10
= null;
151 private StarLabel jStarLabel12
= null;
153 private StarLabel jStarLabel13
= null;
155 private StarLabel jStarLabel14
= null;
157 private JCheckBox jCheckBoxIa32
= null;
159 private JCheckBox jCheckBoxX64
= null;
161 private JCheckBox jCheckBoxIpf
= null;
163 private JCheckBox jCheckBoxEbc
= null;
165 private JCheckBox jCheckBoxArm
= null;
167 private JCheckBox jCheckBoxPpc
= null;
169 private JComboBox jComboBoxPcdIsDriver
= null;
171 private JCheckBox jCheckBoxPcd
= null;
173 private JCheckBox jCheckBoxFlashMap
= null;
178 private MsaHeaderDocument
.MsaHeader msaHeader
= null;
180 private ModuleDefinitionsDocument
.ModuleDefinitions md
= null;
182 private ModuleSurfaceAreaDocument
.ModuleSurfaceArea msa
= null;
184 private ExternsDocument
.Externs ex
= null;
186 private OpeningModuleType omt
= null;
188 private EnumerationData ed
= new EnumerationData();
191 * This method initializes jCheckBoxIa32
193 * @return javax.swing.JCheckBox
195 private JCheckBox
getJCheckBoxIa32() {
196 if (jCheckBoxIa32
== null) {
197 jCheckBoxIa32
= new JCheckBox();
198 jCheckBoxIa32
.setBounds(new java
.awt
.Rectangle(160, 505, 55, 20));
199 jCheckBoxIa32
.setText("IA32");
200 jCheckBoxIa32
.setToolTipText(DataType
.SUP_ARCH_LIST_HELP_TEXT
);
201 jCheckBoxIa32
.addFocusListener(this);
203 return jCheckBoxIa32
;
207 * This method initializes jCheckBoxX64
209 * @return javax.swing.JCheckBox
211 private JCheckBox
getJCheckBoxX64() {
212 if (jCheckBoxX64
== null) {
213 jCheckBoxX64
= new JCheckBox();
214 jCheckBoxX64
.setBounds(new java
.awt
.Rectangle(215, 505, 53, 20));
215 jCheckBoxX64
.setText("X64");
216 jCheckBoxX64
.setToolTipText(DataType
.SUP_ARCH_LIST_HELP_TEXT
);
217 jCheckBoxX64
.addFocusListener(this);
223 * This method initializes jCheckBoxIpf
225 * @return javax.swing.JCheckBox
227 private JCheckBox
getJCheckBoxIpf() {
228 if (jCheckBoxIpf
== null) {
229 jCheckBoxIpf
= new JCheckBox();
230 jCheckBoxIpf
.setBounds(new java
.awt
.Rectangle(270, 505, 52, 20));
231 jCheckBoxIpf
.setText("IPF");
232 jCheckBoxIpf
.setToolTipText(DataType
.SUP_ARCH_LIST_HELP_TEXT
);
233 jCheckBoxIpf
.addFocusListener(this);
239 * This method initializes jCheckBoxEbc
241 * @return javax.swing.JCheckBox
243 private JCheckBox
getJCheckBoxEbc() {
244 if (jCheckBoxEbc
== null) {
245 jCheckBoxEbc
= new JCheckBox();
246 jCheckBoxEbc
.setBounds(new java
.awt
.Rectangle(325, 505, 53, 20));
247 jCheckBoxEbc
.setText("EBC");
248 jCheckBoxEbc
.setToolTipText(DataType
.SUP_ARCH_LIST_HELP_TEXT
);
249 jCheckBoxEbc
.addFocusListener(this);
255 * This method initializes jCheckBoxArm
257 * @return javax.swing.JCheckBox
259 private JCheckBox
getJCheckBoxArm() {
260 if (jCheckBoxArm
== null) {
261 jCheckBoxArm
= new JCheckBox();
262 jCheckBoxArm
.setBounds(new java
.awt
.Rectangle(380, 505, 54, 20));
263 jCheckBoxArm
.setText("ARM");
264 jCheckBoxArm
.setToolTipText(DataType
.SUP_ARCH_LIST_HELP_TEXT
);
265 jCheckBoxArm
.addFocusListener(this);
271 * This method initializes jCheckBoxPpc
273 * @return javax.swing.JCheckBox
275 private JCheckBox
getJCheckBoxPpc() {
276 if (jCheckBoxPpc
== null) {
277 jCheckBoxPpc
= new JCheckBox();
278 jCheckBoxPpc
.setBounds(new java
.awt
.Rectangle(435, 505, 53, 20));
279 jCheckBoxPpc
.setText("PPC");
280 jCheckBoxPpc
.setToolTipText(DataType
.SUP_ARCH_LIST_HELP_TEXT
);
281 jCheckBoxPpc
.addFocusListener(this);
287 This method initializes jTextFieldBaseName
289 @return javax.swing.JTextField jTextFieldBaseName
292 private JTextField
getJTextFieldBaseName() {
293 if (jTextFieldBaseName
== null) {
294 jTextFieldBaseName
= new JTextField();
295 jTextFieldBaseName
.setBounds(new java
.awt
.Rectangle(160, 10, 320, 20));
296 jTextFieldBaseName
.setPreferredSize(new java
.awt
.Dimension(320, 20));
297 jTextFieldBaseName
.addFocusListener(this);
298 jTextFieldBaseName
.setToolTipText("A brief Identifier, such as USB I/O Library, of the module");
300 return jTextFieldBaseName
;
304 This method initializes jTextFieldGuid
306 @return javax.swing.JTextField jTextFieldGuid
309 private JTextField
getJTextFieldGuid() {
310 if (jTextFieldGuid
== null) {
311 jTextFieldGuid
= new JTextField();
312 jTextFieldGuid
.setPreferredSize(new java
.awt
.Dimension(250, 20));
313 jTextFieldGuid
.setLocation(new java
.awt
.Point(160, 60));
314 jTextFieldGuid
.setSize(new java
.awt
.Dimension(250, 20));
315 jTextFieldGuid
.addFocusListener(this);
316 jTextFieldGuid
.setToolTipText("Guaranteed Unique Identification Number, Registry Format (8-4-4-4-12)");
318 return jTextFieldGuid
;
322 This method initializes jTextFieldVersion
324 @return javax.swing.JTextField jTextFieldVersion
327 private JTextField
getJTextFieldVersion() {
328 if (jTextFieldVersion
== null) {
329 jTextFieldVersion
= new JTextField();
330 jTextFieldVersion
.setPreferredSize(new java
.awt
.Dimension(320, 20));
331 jTextFieldVersion
.setLocation(new java
.awt
.Point(160, 85));
332 jTextFieldVersion
.setSize(new java
.awt
.Dimension(320, 20));
333 jTextFieldVersion
.addFocusListener(this);
334 jTextFieldVersion
.setToolTipText("A Version Number, 1.0, 1, 1.01, 1.0.1");
336 return jTextFieldVersion
;
340 This method initializes jButtonGenerateGuid
342 @return javax.swing.JButton jButtonGenerateGuid
345 private JButton
getJButtonGenerateGuid() {
346 if (jButtonGenerateGuid
== null) {
347 jButtonGenerateGuid
= new JButton();
348 jButtonGenerateGuid
.setPreferredSize(new java
.awt
.Dimension(65, 20));
349 jButtonGenerateGuid
.setSize(new java
.awt
.Dimension(65, 20));
350 jButtonGenerateGuid
.setLocation(new java
.awt
.Point(415, 60));
351 jButtonGenerateGuid
.setText("GEN");
352 jButtonGenerateGuid
.addActionListener(this);
354 return jButtonGenerateGuid
;
358 This method initializes jTextAreaLicense
360 @return javax.swing.JTextArea jTextAreaLicense
363 private JTextArea
getJTextAreaLicense() {
364 if (jTextAreaLicense
== null) {
365 jTextAreaLicense
= new JTextArea();
366 jTextAreaLicense
.setText("");
367 jTextAreaLicense
.setLineWrap(true);
368 jTextAreaLicense
.addFocusListener(this);
369 jTextAreaLicense
.setWrapStyleWord(true);
370 jTextAreaLicense
.setSelectionStart(0);
371 jTextAreaLicense
.setSelectionEnd(0);
372 jTextAreaLicense
.setToolTipText("The License for this Module.");
374 return jTextAreaLicense
;
378 This method initializes jTextAreaDescription
380 @return javax.swing.JTextArea jTextAreaDescription
383 private JTextArea
getJTextAreaDescription() {
384 if (jTextAreaDescription
== null) {
385 jTextAreaDescription
= new JTextArea();
386 jTextAreaDescription
.setLineWrap(true);
387 jTextAreaDescription
.addFocusListener(this);
388 jTextAreaDescription
.setToolTipText("A verbose description of the module.");
389 jTextAreaDescription
.setWrapStyleWord(true);
390 jTextAreaDescription
.setSelectionStart(0);
391 jTextAreaDescription
.setSelectionEnd(0);
393 return jTextAreaDescription
;
397 This method initializes jTextFieldSpecification
399 @return javax.swing.JTextField jTextFieldSpecification
402 private JTextField
getJTextFieldSpecification() {
403 if (jTextFieldSpecification
== null) {
404 jTextFieldSpecification
= new JTextField();
406 jTextFieldSpecification
.setPreferredSize(new java
.awt
.Dimension(320, 20));
407 jTextFieldSpecification
.setText("FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052");
408 jTextFieldSpecification
.setBorder(null);
410 jTextFieldSpecification
.setSize(new java
.awt
.Dimension(320, 20));
411 jTextFieldSpecification
.setLocation(new java
.awt
.Point(2, dialogHeight
- 30));
412 jTextFieldSpecification
.setEditable(false);
413 jTextFieldSpecification
.addFocusListener(this);
415 return jTextFieldSpecification
;
419 This method initializes jButtonOk
421 @return javax.swing.JButton jButtonOk
424 private JButton
getJButtonOk() {
425 if (jButtonOk
== null) {
426 jButtonOk
= new JButton();
427 jButtonOk
.setText("OK");
428 jButtonOk
.setPreferredSize(new java
.awt
.Dimension(90, 20));
429 jButtonOk
.setBounds(new java
.awt
.Rectangle(390, 455, 90, 20));
430 jButtonOk
.addActionListener(this);
431 jButtonOk
.setVisible(false);
437 This method initializes jButtonCancel
439 @return javax.swing.JButton jButtonCancel
442 private JButton
getJButtonCancel() {
443 if (jButtonCancel
== null) {
444 jButtonCancel
= new JButton();
445 jButtonCancel
.setText("Cancel");
446 jButtonCancel
.setBounds(new java
.awt
.Rectangle(390, 445, 90, 20));
447 jButtonCancel
.addActionListener(this);
448 jButtonCancel
.setPreferredSize(new java
.awt
.Dimension(90, 20));
449 jButtonCancel
.setVisible(false);
451 return jButtonCancel
;
455 This method initializes jScrollPaneLicense
457 @return javax.swing.JScrollPane jScrollPaneLicense
460 private JScrollPane
getJScrollPaneLicense() {
461 if (jScrollPaneLicense
== null) {
462 jScrollPaneLicense
= new JScrollPane();
463 jScrollPaneLicense
.setHorizontalScrollBarPolicy(javax
.swing
.JScrollPane
.HORIZONTAL_SCROLLBAR_NEVER
);
464 jScrollPaneLicense
.setSize(new java
.awt
.Dimension(320, 120));
465 jScrollPaneLicense
.setLocation(new java
.awt
.Point(160, 305));
466 jScrollPaneLicense
.setViewportView(getJTextAreaLicense());
467 jScrollPaneLicense
.setPreferredSize(new java
.awt
.Dimension(320, 120));
469 return jScrollPaneLicense
;
473 This method initializes jScrollPaneDescription
475 @return javax.swing.JScrollPane jScrollPaneDescription
478 private JScrollPane
getJScrollPaneDescription() {
479 if (jScrollPaneDescription
== null) {
480 jScrollPaneDescription
= new JScrollPane();
481 jScrollPaneDescription
.setHorizontalScrollBarPolicy(javax
.swing
.JScrollPane
.HORIZONTAL_SCROLLBAR_NEVER
);
482 jScrollPaneDescription
.setSize(new java
.awt
.Dimension(320, 120));
483 jScrollPaneDescription
.setLocation(new java
.awt
.Point(160, 135));
484 jScrollPaneDescription
.setViewportView(getJTextAreaDescription());
485 jScrollPaneDescription
.setPreferredSize(new java
.awt
.Dimension(320, 120));
487 return jScrollPaneDescription
;
491 This method initializes jTextFieldAbstract
493 @return javax.swing.JTextField jTextFieldAbstract
496 private JTextField
getJTextFieldAbstract() {
497 if (jTextFieldAbstract
== null) {
498 jTextFieldAbstract
= new JTextField();
499 jTextFieldAbstract
.setPreferredSize(new java
.awt
.Dimension(320, 20));
500 jTextFieldAbstract
.setLocation(new java
.awt
.Point(160, 110));
501 jTextFieldAbstract
.setSize(new java
.awt
.Dimension(320, 20));
502 jTextFieldAbstract
.addFocusListener(this);
503 jTextFieldAbstract
.setToolTipText("A one sentence description of this module.");
505 return jTextFieldAbstract
;
509 This method initializes jComboBoxModuleType
511 @return javax.swing.JComboBox jComboBoxModuleType
514 private JComboBox
getJComboBoxModuleType() {
515 if (jComboBoxModuleType
== null) {
516 jComboBoxModuleType
= new JComboBox();
517 jComboBoxModuleType
.setBounds(new java
.awt
.Rectangle(160, 35, 320, 20));
518 jComboBoxModuleType
.setPreferredSize(new java
.awt
.Dimension(320, 20));
519 jComboBoxModuleType
.addFocusListener(this);
521 return jComboBoxModuleType
;
525 This method initializes jTextFieldURL
527 @return javax.swing.JTextField
530 private JTextField
getJTextFieldURL() {
531 if (jTextFieldURL
== null) {
532 jTextFieldURL
= new JTextField();
533 jTextFieldURL
.setPreferredSize(new java
.awt
.Dimension(320, 20));
534 jTextFieldURL
.setLocation(new java
.awt
.Point(160, 430));
535 jTextFieldURL
.setSize(new java
.awt
.Dimension(320, 20));
536 jTextFieldURL
.addFocusListener(this);
537 jTextFieldURL
.setToolTipText("A URL for the latest version of the license.");
539 return jTextFieldURL
;
543 This method initializes jScrollPane
545 @return javax.swing.JScrollPane
548 private JScrollPane
getJScrollPane() {
549 if (jScrollPane
== null) {
550 jScrollPane
= new JScrollPane();
551 jScrollPane
.setViewportView(getJContentPane());
557 This method initializes jScrollPaneCopyright
559 @return javax.swing.JScrollPane
562 private JScrollPane
getJScrollPaneCopyright() {
563 if (jScrollPaneCopyright
== null) {
564 jScrollPaneCopyright
= new JScrollPane();
565 jScrollPaneCopyright
.setBounds(new java
.awt
.Rectangle(160, 260, 320, 40));
566 jScrollPaneCopyright
.setPreferredSize(new java
.awt
.Dimension(320, 40));
567 jScrollPaneCopyright
.setViewportView(getJTextAreaCopyright());
568 jScrollPaneCopyright
.setSize(new java
.awt
.Dimension(320, 40));
570 return jScrollPaneCopyright
;
574 This method initializes jTextAreaCopyright
576 @return javax.swing.JTextArea
579 private JTextArea
getJTextAreaCopyright() {
580 if (jTextAreaCopyright
== null) {
581 jTextAreaCopyright
= new JTextArea();
582 jTextAreaCopyright
.setLineWrap(true);
583 jTextAreaCopyright
.addFocusListener(this);
584 jTextAreaCopyright
.setWrapStyleWord(true);
585 jTextAreaCopyright
.setSelectionStart(0);
586 jTextAreaCopyright
.setSelectionEnd(0);
587 jTextAreaCopyright
.setBounds(new java
.awt
.Rectangle(0, 0, 320, 40));
588 jTextAreaCopyright
.setToolTipText("One or more copyright lines.");
590 return jTextAreaCopyright
;
594 * This method initializes jComboBoxBinaryModule
596 * @return javax.swing.JComboBox
598 private JComboBox
getJComboBoxBinaryModule() {
599 if (jComboBoxBinaryModule
== null) {
600 jComboBoxBinaryModule
= new JComboBox();
601 jComboBoxBinaryModule
.setBounds(new java
.awt
.Rectangle(160, 480, 320, 20));
602 jComboBoxBinaryModule
.setPreferredSize(new java
.awt
.Dimension(320, 20));
603 jComboBoxBinaryModule
.addFocusListener(this);
604 jComboBoxBinaryModule
.setToolTipText("<html>Modules are either source modules <br>"
605 + "which can be compiled or binary <br>"
606 + "modules which are linked. <br>"
607 + "A module cannot contain both. <br>"
608 + "The GUID numbers should be identical <br>"
609 + "for a binary and source MSA, <br>"
610 + "however the BINARY MSA should have <br>"
611 + "a higher version number.</html>");
613 return jComboBoxBinaryModule
;
617 * This method initializes jTextFieldOutputFileBasename
619 * @return javax.swing.JTextField
621 private JTextField
getJTextFieldOutputFileBasename() {
622 if (jTextFieldOutputFileBasename
== null) {
623 jTextFieldOutputFileBasename
= new JTextField();
624 jTextFieldOutputFileBasename
.setBounds(new java
.awt
.Rectangle(160, 455, 320, 20));
625 jTextFieldOutputFileBasename
.setPreferredSize(new java
.awt
.Dimension(320, 20));
626 jTextFieldOutputFileBasename
.addFocusListener(this);
627 jTextFieldOutputFileBasename
.setToolTipText("Enter a single word for generated output file names.");
629 return jTextFieldOutputFileBasename
;
633 * This method initializes jComboBoxPcdIsDriver
635 * @return javax.swing.JComboBox
637 private JComboBox
getJComboBoxPcdIsDriver() {
638 if (jComboBoxPcdIsDriver
== null) {
639 jComboBoxPcdIsDriver
= new JComboBox();
640 jComboBoxPcdIsDriver
.setPreferredSize(new java
.awt
.Dimension(320, 20));
641 jComboBoxPcdIsDriver
.setBounds(new java
.awt
.Rectangle(160, 530, 320, 20));
642 jComboBoxPcdIsDriver
.addItemListener(this);
643 jComboBoxPcdIsDriver
.setEnabled(false);
644 Tools
.generateComboBoxByVector(jComboBoxPcdIsDriver
, ed
.getVPcdDriverTypes());
646 return jComboBoxPcdIsDriver
;
650 This is the default constructor
656 this.setVisible(true);
660 This is the override edit constructor
662 @param inMsaHeader The input data of MsaHeaderDocument.MsaHeader
665 public MsaHeader(OpeningModuleType inMsa
) {
668 this.msa
= omt
.getXmlMsa();
671 // Set module definitions default value
673 if (msa
.getModuleDefinitions() == null) {
674 ModuleDefinitionsDocument
.ModuleDefinitions md
= ModuleDefinitionsDocument
.ModuleDefinitions
.Factory
676 md
.setOutputFileBasename(msa
.getMsaHeader().getModuleName());
677 md
.setBinaryModule(false);
678 md
.setSupportedArchitectures(ed
.getVSupportedArchitectures());
679 msa
.setModuleDefinitions(md
);
683 // Init items of Header, Definitions and Externs
685 init(msa
.getMsaHeader());
686 init(msa
.getModuleDefinitions());
687 init(msa
.getExterns());
689 this.setVisible(true);
690 this.setViewMode(false);
694 Disable all components when the mode is view
696 @param isView true - The view mode; false - The non-view mode
699 public void setViewMode(boolean isView
) {
701 this.jTextFieldBaseName
.setEnabled(!isView
);
702 this.jTextFieldGuid
.setEnabled(!isView
);
703 this.jTextFieldVersion
.setEnabled(!isView
);
704 this.jTextAreaLicense
.setEnabled(!isView
);
705 this.jTextAreaCopyright
.setEnabled(!isView
);
706 this.jTextAreaDescription
.setEnabled(!isView
);
707 this.jTextFieldSpecification
.setEnabled(!isView
);
708 this.jTextFieldAbstract
.setEnabled(!isView
);
709 this.jComboBoxModuleType
.setEnabled(!isView
);
710 this.jButtonCancel
.setEnabled(!isView
);
711 this.jButtonGenerateGuid
.setEnabled(!isView
);
712 this.jButtonOk
.setEnabled(!isView
);
717 This method initializes this
720 private void init() {
721 this.setSize(dialogWidth
, dialogHeight
);
722 this.setPreferredSize(new java
.awt
.Dimension(dialogWidth
, dialogHeight
));
723 this.setContentPane(getJScrollPane());
724 this.setTitle("Module Surface Area Header");
729 This method initializes this
730 Fill values to all fields if these values are not empty
732 @param inMsaHeader The input data of MsaHeaderDocument.MsaHeader
735 private void init(MsaHeaderDocument
.MsaHeader inMsaHeader
) {
737 if (inMsaHeader
!= null) {
738 setMsaHeader(inMsaHeader
);
739 if (this.msaHeader
.getModuleName() != null) {
740 this.jTextFieldBaseName
.setText(this.msaHeader
.getModuleName());
742 if (this.msaHeader
.getModuleType() != null) {
743 this.jComboBoxModuleType
.setSelectedItem(this.msaHeader
.getModuleType().toString());
745 if (this.msaHeader
.getGuidValue() != null) {
746 this.jTextFieldGuid
.setText(this.msaHeader
.getGuidValue());
748 if (this.msaHeader
.getVersion() != null) {
749 this.jTextFieldVersion
.setText(this.msaHeader
.getVersion());
751 if (this.msaHeader
.getAbstract() != null) {
752 this.jTextFieldAbstract
.setText(this.msaHeader
.getAbstract());
754 if (this.msaHeader
.getDescription() != null) {
755 this.jTextAreaDescription
.setText(this.msaHeader
.getDescription());
756 jTextAreaDescription
.setSelectionStart(0);
757 jTextAreaDescription
.setSelectionEnd(0);
759 if (this.msaHeader
.getCopyright() != null) {
760 this.jTextAreaCopyright
.setText(this.msaHeader
.getCopyright());
762 if (this.msaHeader
.getLicense() != null) {
763 this.jTextAreaLicense
.setText(this.msaHeader
.getLicense().getStringValue());
764 jTextAreaLicense
.setSelectionStart(0);
765 jTextAreaLicense
.setSelectionEnd(0);
767 if (this.msaHeader
.getLicense() != null && this.msaHeader
.getLicense().getURL() != null) {
768 this.jTextFieldURL
.setText(this.msaHeader
.getLicense().getURL());
770 if (this.msaHeader
.getSpecification() != null) {
771 this.jTextFieldSpecification
.setText(this.msaHeader
.getSpecification());
777 This method initializes this
778 Fill values to all fields if these values are not empty
780 @param inMsaHeader The input data of MsaHeaderDocument.MsaHeader
783 private void init(ModuleDefinitionsDocument
.ModuleDefinitions inMd
) {
786 if (md
.getSupportedArchitectures() != null) {
787 this.setSelectedItems(Tools
.convertListToVector(md
.getSupportedArchitectures()));
789 if (md
.getBinaryModule()) {
790 this.jComboBoxBinaryModule
.setSelectedIndex(1);
792 this.jComboBoxBinaryModule
.setSelectedIndex(0);
794 if (md
.getOutputFileBasename() != null) {
795 this.jTextFieldOutputFileBasename
.setText(md
.getOutputFileBasename());
801 This method initializes this
802 Fill values to all fields if these values are not empty
804 @param inEx The input data of ExternsDocument.Externs
807 private void init(ExternsDocument
.Externs inEx
) {
810 if (ex
.getPcdIsDriver() != null) {
811 this.jCheckBoxPcd
.setSelected(true);
812 this.jComboBoxPcdIsDriver
.setEnabled(true);
813 this.jComboBoxPcdIsDriver
.setSelectedItem(ex
.getPcdIsDriver());
815 this.jCheckBoxFlashMap
.setSelected(ex
.getTianoR8FlashMapH());
820 This method initializes jContentPane
822 @return javax.swing.JPanel jContentPane
825 private JPanel
getJContentPane() {
826 if (jContentPane
== null) {
828 jLabelURL
= new JLabel();
829 jLabelURL
.setText("License URL");
830 jLabelURL
.setLocation(new java
.awt
.Point(15, 430));
831 jLabelURL
.setSize(new java
.awt
.Dimension(140, 20));
832 jLabelBaseName
= new JLabel();
833 jLabelBaseName
.setText("Module Name");
834 jLabelBaseName
.setBounds(new java
.awt
.Rectangle(15, 10, 140, 20));
835 jLabelModuleType
= new JLabel();
836 jLabelModuleType
.setBounds(new java
.awt
.Rectangle(15, 35, 140, 20));
837 jLabelModuleType
.setText("Module Type");
838 jLabelGuid
= new JLabel();
839 jLabelGuid
.setText("Guid Value");
840 jLabelGuid
.setLocation(new java
.awt
.Point(15, 60));
841 jLabelGuid
.setSize(new java
.awt
.Dimension(140, 20));
842 jLabelVersion
= new JLabel();
843 jLabelVersion
.setText("Version");
844 jLabelVersion
.setLocation(new java
.awt
.Point(15, 85));
845 jLabelVersion
.setSize(new java
.awt
.Dimension(140, 20));
846 jLabelAbstract
= new JLabel();
847 jLabelAbstract
.setText("Abstract");
848 jLabelAbstract
.setLocation(new java
.awt
.Point(15, 110));
849 jLabelAbstract
.setSize(new java
.awt
.Dimension(140, 20));
850 jLabelDescription
= new JLabel();
851 jLabelDescription
.setText("Description");
852 jLabelDescription
.setLocation(new java
.awt
.Point(15, 135));
853 jLabelDescription
.setSize(new java
.awt
.Dimension(140, 20));
854 jLabelCopyright
= new JLabel();
855 jLabelCopyright
.setText("Copyright");
856 jLabelCopyright
.setLocation(new java
.awt
.Point(15, 260));
857 jLabelCopyright
.setSize(new java
.awt
.Dimension(140, 20));
858 jLabelLicense
= new JLabel();
859 jLabelLicense
.setText("License");
860 jLabelLicense
.setLocation(new java
.awt
.Point(15, 305));
861 jLabelLicense
.setSize(new java
.awt
.Dimension(140, 20));
862 jLabelOutputFileBasename
= new JLabel();
863 jLabelOutputFileBasename
.setBounds(new java
.awt
.Rectangle(15, 455, 140, 20));
864 jLabelOutputFileBasename
.setText("Output File Basename");
865 jLabelBinaryModule
= new JLabel();
866 jLabelBinaryModule
.setBounds(new java
.awt
.Rectangle(15, 480, 140, 20));
867 jLabelBinaryModule
.setText("Binary Module");
868 jLabelArch
= new JLabel();
869 jLabelArch
.setBounds(new java
.awt
.Rectangle(15, 505, 140, 20));
870 jLabelArch
.setText("Supported Architectures");
871 jLabelSpecification
= new JLabel();
872 jLabelSpecification
.setText("Specification");
873 jLabelSpecification
.setLocation(new java
.awt
.Point(14, 530));
874 jLabelSpecification
.setSize(new java
.awt
.Dimension(140, 20));
876 jContentPane
= new JPanel();
877 jContentPane
.setLayout(null);
878 jContentPane
.setPreferredSize(new java
.awt
.Dimension(dialogWidth
- 10, dialogHeight
- 10));
880 jContentPane
.addFocusListener(this);
882 jContentPane
.add(jLabelBaseName
, null);
883 jContentPane
.add(getJTextFieldBaseName(), null);
884 jContentPane
.add(jLabelGuid
, null);
885 jContentPane
.add(getJTextFieldGuid(), null);
886 jContentPane
.add(jLabelVersion
, null);
887 jContentPane
.add(getJTextFieldVersion(), null);
888 jContentPane
.add(getJButtonGenerateGuid(), null);
889 jContentPane
.add(jLabelLicense
, null);
890 jContentPane
.add(jLabelCopyright
, null);
891 jContentPane
.add(jLabelDescription
, null);
892 // jContentPane.add(jLabelSpecification, null);
893 jContentPane
.add(getJTextFieldSpecification(), null);
894 jContentPane
.add(getJButtonOk(), null);
895 jContentPane
.add(getJButtonCancel(), null);
896 jContentPane
.add(getJScrollPaneLicense(), null);
897 jContentPane
.add(getJScrollPaneDescription(), null);
898 jContentPane
.add(jLabelAbstract
, null);
899 jContentPane
.add(getJTextFieldAbstract(), null);
900 jContentPane
.add(jLabelModuleType
, null);
901 jContentPane
.add(getJComboBoxModuleType(), null);
902 jContentPane
.add(jLabelURL
, null);
903 jContentPane
.add(getJTextFieldURL(), null);
904 jContentPane
.add(jLabelOutputFileBasename
, null);
905 jContentPane
.add(getJTextFieldOutputFileBasename(), null);
906 jContentPane
.add(jLabelBinaryModule
, null);
907 jContentPane
.add(getJComboBoxBinaryModule(), null);
908 jContentPane
.add(jLabelArch
, null);
910 jStarLabel1
= new StarLabel();
911 jStarLabel1
.setLocation(new java
.awt
.Point(0, 10));
912 jStarLabel2
= new StarLabel();
913 jStarLabel2
.setLocation(new java
.awt
.Point(0, 35));
914 jStarLabel4
= new StarLabel();
915 jStarLabel4
.setLocation(new java
.awt
.Point(0, 60));
916 jStarLabel5
= new StarLabel();
917 jStarLabel5
.setLocation(new java
.awt
.Point(0, 85));
918 jStarLabel6
= new StarLabel();
919 jStarLabel6
.setLocation(new java
.awt
.Point(0, 135));
920 jStarLabel7
= new StarLabel();
921 jStarLabel7
.setLocation(new java
.awt
.Point(0, 260));
922 jStarLabel8
= new StarLabel();
923 jStarLabel8
.setLocation(new java
.awt
.Point(0, 305));
924 jStarLabel10
= new StarLabel();
925 jStarLabel10
.setLocation(new java
.awt
.Point(0, 110));
926 jStarLabel12
= new StarLabel();
927 jStarLabel12
.setLocation(new java
.awt
.Point(0, 455));
928 jStarLabel13
= new StarLabel();
929 jStarLabel13
.setLocation(new java
.awt
.Point(0, 480));
930 jStarLabel14
= new StarLabel();
931 jStarLabel14
.setLocation(new java
.awt
.Point(0, 505));
932 // jStarLabel15 = new StarLabel();
933 // jStarLabel15.setLocation(new java.awt.Point(0, 530));
935 jContentPane
.add(jStarLabel1
, null);
936 jContentPane
.add(jStarLabel2
, null);
937 jContentPane
.add(jStarLabel4
, null);
938 jContentPane
.add(jStarLabel5
, null);
939 jContentPane
.add(jStarLabel6
, null);
940 jContentPane
.add(jStarLabel7
, null);
941 jContentPane
.add(jStarLabel8
, null);
942 jContentPane
.add(jStarLabel10
, null);
943 jContentPane
.add(jStarLabel12
, null);
944 jContentPane
.add(jStarLabel13
, null);
945 jContentPane
.add(jStarLabel14
, null);
946 // jContentPane.add(jStarLabel15, null);
947 jContentPane
.add(getJScrollPaneCopyright(), null);
949 jContentPane
.add(getJCheckBoxIa32(), null);
950 jContentPane
.add(getJCheckBoxX64(), null);
951 jContentPane
.add(getJCheckBoxIpf(), null);
952 jContentPane
.add(getJCheckBoxEbc(), null);
953 jContentPane
.add(getJCheckBoxArm(), null);
954 jContentPane
.add(getJCheckBoxPpc(), null);
956 jContentPane
.add(getJCheckBoxPcd(), null);
957 jContentPane
.add(getJComboBoxPcdIsDriver(), null);
958 jContentPane
.add(getJCheckBoxFlashMap(), null);
964 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
966 * Override actionPerformed to listen all actions
969 public void actionPerformed(ActionEvent arg0
) {
970 if (arg0
.getSource() == jButtonOk
) {
976 this.setEdited(true);
980 if (arg0
.getSource() == jButtonCancel
) {
981 this.setEdited(false);
984 if (arg0
.getSource() == jButtonGenerateGuid
) {
985 jTextFieldGuid
.setText(Tools
.generateUuidString());
986 jTextFieldGuid
.requestFocus();
987 jButtonGenerateGuid
.requestFocus();
990 if (arg0
.getSource() == this.jCheckBoxPcd
) {
991 this.jComboBoxPcdIsDriver
.setEnabled(this.jCheckBoxPcd
.isSelected());
996 Data validation for all fields
998 @retval true - All datas are valid
999 @retval false - At least one data is invalid
1002 public boolean check() {
1004 // Check if all required fields are not empty
1005 // and check if all data fields values are valid
1011 if (isEmpty(this.jTextFieldBaseName
.getText())) {
1012 Log
.wrn("Update Msa Header", "Name must be entered!");
1013 //this.jTextFieldBaseName.requestFocus();
1016 if (!DataValidation
.isBaseName(this.jTextFieldBaseName
.getText())) {
1017 Log
.wrn("Update Msa Header", "Incorrect data type for Name, it must start with an alpha character!");
1018 //this.jTextFieldBaseName.requestFocus();
1025 if (isEmpty(this.jTextFieldGuid
.getText())) {
1026 Log
.wrn("Update Msa Header", "The Guid Value must be entered!");
1027 //this.jTextFieldGuid.requestFocus();
1030 if (!DataValidation
.isGuid((this.jTextFieldGuid
).getText())) {
1031 Log
.wrn("Update Msa Header", "Incorrect data type for Guid, it must be registry format, 8-4-4-4-12");
1032 //this.jTextFieldGuid.requestFocus();
1039 if (isEmpty(this.jTextFieldVersion
.getText())) {
1040 Log
.wrn("Update Msa Header", "Version must be entered!");
1041 //this.jTextFieldVersion.requestFocus();
1044 if (!DataValidation
.isVersion(this.jTextFieldVersion
.getText())) {
1045 Log
.wrn("Update Msa Header", "Incorrect data type for Version, it must start with a digit.");
1046 //this.jTextFieldVersion.requestFocus();
1053 if (isEmpty(this.jTextFieldAbstract
.getText())) {
1054 Log
.wrn("Update Msa Header", "Abstract must be entered!");
1055 //this.jTextFieldAbstract.requestFocus();
1058 if (!DataValidation
.isAbstract(this.jTextFieldAbstract
.getText())) {
1059 Log
.wrn("Update Msa Header",
1060 "Incorrect data type for Abstract, is should be a sentence describing the module.");
1061 //this.jTextFieldAbstract.requestFocus();
1066 // Check Description
1068 if (isEmpty(this.jTextAreaDescription
.getText())) {
1069 Log
.wrn("Update Msa Header", "Description must be entered!");
1070 //this.jTextAreaDescription.requestFocus();
1077 if (isEmpty(this.jTextAreaCopyright
.getText())) {
1078 Log
.wrn("Update Msa Header", "Copyright must be entered!");
1079 //this.jTextFieldCopyright.requestFocus();
1086 if (isEmpty(this.jTextAreaLicense
.getText())) {
1087 Log
.wrn("Update Msa Header", "License must be entered!");
1088 //this.jTextAreaLicense.requestFocus();
1093 // Check Specification
1095 if (isEmpty(this.jTextFieldSpecification
.getText())) {
1096 Log
.wrn("Update Msa Header", "Specification must exist.");
1097 //this.jTextFieldSpecification.requestFocus();
1100 if (!DataValidation
.isSpecification(this.jTextFieldSpecification
.getText())) {
1101 // TODO Add code to check the specification number.
1102 // Future releases of Schema may require that we process these files
1104 Log
.wrn("Update Msa Header", "Incorrect data type for Specification");
1105 //this.jTextFieldSpecification.requestFocus();
1113 Save all components of Msa Header
1114 if exists msaHeader, set the value directly
1115 if not exists msaHeader, new an instance first
1118 public void save() {
1120 msaHeader
.setSpecification(this.jTextFieldSpecification
.getText());
1121 msa
.setMsaHeader(msaHeader
);
1122 msa
.setModuleDefinitions(md
);
1123 this.omt
.setSaved(false);
1124 } catch (Exception e
) {
1125 Log
.wrn("Save Module", e
.getMessage());
1126 Log
.err("Save Module", e
.getMessage());
1131 This method initializes Module type and Compontent type
1134 private void initFrame() {
1135 EnumerationData ed
= new EnumerationData();
1136 Tools
.generateComboBoxByVector(jComboBoxModuleType
, ed
.getVModuleType());
1137 Tools
.generateComboBoxByVector(jComboBoxBinaryModule
, ed
.getVBoolean());
1138 this.setSelectedItems(ed
.getVSupportedArchitectures());
1142 Get MsaHeaderDocument.MsaHeader
1144 @return MsaHeaderDocument.MsaHeader
1147 public MsaHeaderDocument
.MsaHeader
getMsaHeader() {
1152 Set MsaHeaderDocument.MsaHeader
1154 @param msaHeader The input data of MsaHeaderDocument.MsaHeader
1157 public void setMsaHeader(MsaHeaderDocument
.MsaHeader msaHeader
) {
1158 this.msaHeader
= msaHeader
;
1162 * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
1164 * Override componentResized to resize all components when frame's size is changed
1166 public void componentResized(ComponentEvent arg0
) {
1167 int intCurrentWidth
= this.getJContentPane().getWidth();
1168 int intPreferredWidth
= this.getJContentPane().getPreferredSize().width
;
1170 Tools
.resizeComponentWidth(this.jTextFieldBaseName
, intCurrentWidth
, intPreferredWidth
);
1171 Tools
.resizeComponentWidth(this.jTextFieldGuid
, intCurrentWidth
, intPreferredWidth
);
1172 Tools
.resizeComponentWidth(this.jTextFieldVersion
, intCurrentWidth
, intPreferredWidth
);
1173 Tools
.resizeComponentWidth(this.jScrollPaneLicense
, intCurrentWidth
, intPreferredWidth
);
1174 Tools
.resizeComponentWidth(this.jTextFieldURL
, intCurrentWidth
, intPreferredWidth
);
1175 Tools
.resizeComponentWidth(this.jScrollPaneCopyright
, intCurrentWidth
, intPreferredWidth
);
1176 Tools
.resizeComponentWidth(this.jScrollPaneDescription
, intCurrentWidth
, intPreferredWidth
);
1177 Tools
.resizeComponentWidth(this.jTextFieldSpecification
, intCurrentWidth
, intPreferredWidth
);
1178 Tools
.resizeComponentWidth(this.jTextFieldAbstract
, intCurrentWidth
, intPreferredWidth
);
1179 Tools
.resizeComponentWidth(this.jComboBoxModuleType
, intCurrentWidth
, intPreferredWidth
);
1180 Tools
.resizeComponentWidth(this.jComboBoxBinaryModule
, intCurrentWidth
, intPreferredWidth
);
1181 Tools
.resizeComponentWidth(this.jTextFieldOutputFileBasename
, intCurrentWidth
, intPreferredWidth
);
1182 Tools
.resizeComponentWidth(this.jComboBoxPcdIsDriver
, intCurrentWidth
, intPreferredWidth
);
1184 Tools
.relocateComponentX(this.jButtonGenerateGuid
, intCurrentWidth
, intPreferredWidth
,
1185 DataType
.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON
);
1188 public void focusLost(FocusEvent arg0
) {
1189 if (this.msaHeader
== null) {
1190 msaHeader
= MsaHeaderDocument
.MsaHeader
.Factory
.newInstance();
1196 if (arg0
.getSource() == this.jTextFieldBaseName
) {
1197 if (isEmpty(this.jTextFieldBaseName
.getText())) {
1198 Log
.wrn("Update Msa Header", "The Name must be entered!");
1199 //this.jTextFieldBaseName.requestFocus();
1202 if (!DataValidation
.isBaseName(this.jTextFieldBaseName
.getText())) {
1203 Log
.wrn("Update Msa Header", "Incorrect data type for Name, it must begin with an alpha character.");
1204 //this.jTextFieldBaseName.requestFocus();
1207 if (!this.jTextFieldBaseName
.getText().equals(msaHeader
.getModuleName())) {
1208 this.msaHeader
.setModuleName(this.jTextFieldBaseName
.getText());
1215 // Check Module Type
1217 if (arg0
.getSource() == this.jComboBoxModuleType
) {
1218 if (!jComboBoxModuleType
.getSelectedItem().toString().equals(msaHeader
.getModuleType().toString())) {
1219 msaHeader
.setModuleType(ModuleTypeDef
.Enum
.forString(jComboBoxModuleType
.getSelectedItem().toString()));
1228 if (arg0
.getSource() == this.jTextFieldGuid
) {
1229 if (isEmpty(this.jTextFieldGuid
.getText())) {
1230 Log
.wrn("Update Msa Header", "Guid must be entered!");
1231 //this.jTextFieldGuid.requestFocus();
1234 if (!DataValidation
.isGuid((this.jTextFieldGuid
).getText())) {
1235 Log
.wrn("Update Msa Header", "Incorrect data type for Guid, it must be registry format. (8-4-4-4-12)");
1236 //this.jTextFieldGuid.requestFocus();
1239 if (!this.jTextFieldGuid
.getText().equals(msaHeader
.getGuidValue())) {
1240 this.msaHeader
.setGuidValue(this.jTextFieldGuid
.getText());
1249 if (arg0
.getSource() == this.jTextFieldVersion
) {
1250 if (isEmpty(this.jTextFieldVersion
.getText())) {
1251 Log
.wrn("Update Msa Header", "Version must be entered!");
1252 //this.jTextFieldVersion.requestFocus();
1255 if (!DataValidation
.isVersion(this.jTextFieldVersion
.getText())) {
1256 Log
.wrn("Update Msa Header", "Incorrect data type for Version, it must start with a digit.");
1257 //this.jTextFieldVersion.requestFocus();
1260 if (!this.jTextFieldVersion
.getText().equals(msaHeader
.getVersion())) {
1261 this.msaHeader
.setVersion(this.jTextFieldVersion
.getText());
1270 if (arg0
.getSource() == this.jTextFieldAbstract
) {
1271 if (isEmpty(this.jTextFieldAbstract
.getText())) {
1272 Log
.wrn("Update Msa Header", "Abstract must be entered!");
1273 //this.jTextFieldAbstract.requestFocus();
1276 if (!DataValidation
.isAbstract(this.jTextFieldAbstract
.getText())) {
1277 Log
.wrn("Update Msa Header", "Incorrect data type for Abstract, it must be sentence.");
1278 //this.jTextFieldAbstract.requestFocus();
1281 if (!this.jTextFieldAbstract
.getText().equals(msaHeader
.getAbstract())) {
1282 this.msaHeader
.setAbstract(this.jTextFieldAbstract
.getText());
1289 // Check Description
1291 if (arg0
.getSource() == this.jTextAreaDescription
) {
1292 if (isEmpty(this.jTextAreaDescription
.getText())) {
1293 Log
.wrn("Update Msa Header", "Description must be entered!");
1294 //this.jTextAreaDescription.requestFocus();
1297 if (!this.jTextAreaDescription
.getText().equals(msaHeader
.getDescription())) {
1298 this.msaHeader
.setDescription(this.jTextAreaDescription
.getText());
1307 if (arg0
.getSource() == this.jTextAreaCopyright
) {
1308 if (isEmpty(this.jTextAreaCopyright
.getText())) {
1309 Log
.wrn("Update Msa Header", "Copyright must be entered!");
1310 //this.jTextFieldCopyright.requestFocus();
1313 if (!this.jTextAreaCopyright
.getText().equals(msaHeader
.getCopyright())) {
1314 this.msaHeader
.setCopyright(this.jTextAreaCopyright
.getText());
1323 if (arg0
.getSource() == this.jTextAreaLicense
) {
1324 if (isEmpty(this.jTextAreaLicense
.getText())) {
1325 Log
.wrn("Update Msa Header", "License must be entered!");
1326 //this.jTextAreaLicense.requestFocus();
1329 if (this.msaHeader
.getLicense() != null) {
1330 if (!this.jTextAreaLicense
.getText().equals(msaHeader
.getLicense().getStringValue())) {
1331 this.msaHeader
.getLicense().setStringValue(this.jTextAreaLicense
.getText());
1336 License mLicense
= License
.Factory
.newInstance();
1337 mLicense
.setStringValue(this.jTextAreaLicense
.getText());
1338 this.msaHeader
.setLicense(mLicense
);
1343 // Check License URL
1345 if (arg0
.getSource() == this.jTextFieldURL
) {
1346 if (!isEmpty(this.jTextFieldURL
.getText())) {
1347 if (this.msaHeader
.getLicense() == null) {
1348 License mLicense
= License
.Factory
.newInstance();
1349 mLicense
.setURL(this.jTextFieldURL
.getText());
1350 this.msaHeader
.setLicense(mLicense
);
1352 if (!this.jTextFieldURL
.getText().equals(msaHeader
.getLicense().getURL())) {
1353 this.msaHeader
.getLicense().setURL(this.jTextFieldURL
.getText());
1362 // Check Output File Basename
1364 if (arg0
.getSource() == this.jTextFieldOutputFileBasename
) {
1365 if (isEmpty(this.jTextFieldOutputFileBasename
.getText())) {
1366 Log
.wrn("Update Msa Header", "Output File Basename must be entered!");
1367 // jTextFieldOutputFileBasename.removeFocusListener(this);
1368 // jTextFieldOutputFileBasename.requestFocus();
1369 // jTextFieldOutputFileBasename.addFocusListener(this);
1372 if (!this.jTextFieldOutputFileBasename
.getText().equals(md
.getOutputFileBasename())) {
1373 this.md
.setOutputFileBasename(this.jTextFieldOutputFileBasename
.getText());
1380 // Check Binary Module Type
1382 if (arg0
.getSource() == this.jComboBoxBinaryModule
) {
1383 if (jComboBoxBinaryModule
.getSelectedItem().toString().equals(DataType
.TRUE
)) {
1384 if (md
.getBinaryModule()) {
1387 md
.setBinaryModule(true);
1389 } else if (jComboBoxBinaryModule
.getSelectedItem().toString().equals(DataType
.FALSE
)) {
1390 if (md
.getBinaryModule()) {
1391 md
.setBinaryModule(false);
1399 // Check Supported Arch
1401 if (arg0
.getSource() == this.jCheckBoxArm
|| arg0
.getSource() == this.jCheckBoxEbc
1402 || arg0
.getSource() == this.jCheckBoxIa32
|| arg0
.getSource() == this.jCheckBoxIpf
1403 || arg0
.getSource() == this.jCheckBoxPpc
|| arg0
.getSource() == this.jCheckBoxX64
) {
1404 if (!this.getSelectedItemsString().equals(md
.getSupportedArchitectures().toString())) {
1405 md
.setSupportedArchitectures(this.getSelectedItemsVector());
1412 // Check Pcd is Driver
1414 if (arg0
.getSource() == this.jCheckBoxPcd
) {
1415 if ((this.ex
== null) && this.jCheckBoxPcd
.isSelected()) {
1416 this.ex
= ExternsDocument
.Externs
.Factory
.newInstance();
1417 this.ex
.setPcdIsDriver(PcdDriverTypes
.Enum
.forString(this.jComboBoxPcdIsDriver
.getSelectedItem()
1419 this.msa
.setExterns(this.ex
);
1422 if ((this.ex
!= null) && (this.ex
.getPcdIsDriver() == null) && this.jCheckBoxPcd
.isSelected()) {
1423 this.ex
.setPcdIsDriver(PcdDriverTypes
.Enum
.forString(this.jComboBoxPcdIsDriver
.getSelectedItem()
1425 this.msa
.setExterns(this.ex
);
1428 if ((this.ex
!= null) && (this.ex
.getPcdIsDriver() != null)) {
1429 if (this.jCheckBoxPcd
.isSelected()
1430 && !this.jComboBoxPcdIsDriver
.getSelectedItem().toString().equals(
1431 this.ex
.getPcdIsDriver()
1433 this.ex
.setPcdIsDriver(PcdDriverTypes
.Enum
.forString(this.jComboBoxPcdIsDriver
.getSelectedItem()
1435 this.msa
.setExterns(this.ex
);
1437 if (!this.jCheckBoxPcd
.isSelected()) {
1438 ExternsDocument
.Externs newEx
= ExternsDocument
.Externs
.Factory
.newInstance();
1439 if (this.ex
.getExternList() != null) {
1440 for (int index
= 0; index
< this.ex
.getExternList().size(); index
++) {
1441 newEx
.addNewExtern();
1442 newEx
.setExternArray(index
, this.ex
.getExternArray(index
));
1445 if (this.ex
.getSpecificationList() != null) {
1446 for (int index
= 0; index
< this.ex
.getSpecificationList().size(); index
++) {
1447 newEx
.addNewSpecification();
1448 newEx
.setSpecificationArray(index
, this.ex
.getSpecificationArray(index
));
1451 if (this.ex
.getTianoR8FlashMapH()) {
1452 newEx
.setTianoR8FlashMapH(this.ex
.getTianoR8FlashMapH());
1455 this.msa
.setExterns(this.ex
);
1463 if (arg0
.getSource() == this.jCheckBoxFlashMap
) {
1464 if ((this.ex
== null) && this.jCheckBoxFlashMap
.isSelected()) {
1465 this.ex
= ExternsDocument
.Externs
.Factory
.newInstance();
1466 this.ex
.setTianoR8FlashMapH(this.jCheckBoxFlashMap
.isSelected());
1467 this.msa
.setExterns(this.ex
);
1470 if ((this.ex
!= null) && this.jCheckBoxFlashMap
.isSelected()) {
1471 this.ex
.setTianoR8FlashMapH(this.jCheckBoxFlashMap
.isSelected());
1472 this.msa
.setExterns(this.ex
);
1475 if ((this.ex
!= null) && !this.jCheckBoxFlashMap
.isSelected()) {
1476 ExternsDocument
.Externs newEx
= ExternsDocument
.Externs
.Factory
.newInstance();
1477 if (this.ex
.getExternList() != null) {
1478 for (int index
= 0; index
< this.ex
.getExternList().size(); index
++) {
1479 newEx
.addNewExtern();
1480 newEx
.setExternArray(index
, this.ex
.getExternArray(index
));
1483 if (this.ex
.getSpecificationList() != null) {
1484 for (int index
= 0; index
< this.ex
.getSpecificationList().size(); index
++) {
1485 newEx
.addNewSpecification();
1486 newEx
.setSpecificationArray(index
, this.ex
.getSpecificationArray(index
));
1489 if (this.ex
.getPcdIsDriver() != null) {
1490 newEx
.setPcdIsDriver(this.ex
.getPcdIsDriver());
1493 this.msa
.setExterns(this.ex
);
1500 private Vector
<String
> getSelectedItemsVector() {
1501 Vector
<String
> v
= new Vector
<String
>();
1502 if (this.jCheckBoxIa32
.isSelected()) {
1503 v
.addElement(jCheckBoxIa32
.getText());
1505 if (this.jCheckBoxX64
.isSelected()) {
1506 v
.addElement(jCheckBoxX64
.getText());
1508 if (this.jCheckBoxIpf
.isSelected()) {
1509 v
.addElement(jCheckBoxIpf
.getText());
1511 if (this.jCheckBoxEbc
.isSelected()) {
1512 v
.addElement(jCheckBoxEbc
.getText());
1514 if (this.jCheckBoxArm
.isSelected()) {
1515 v
.addElement(jCheckBoxArm
.getText());
1517 if (this.jCheckBoxPpc
.isSelected()) {
1518 v
.addElement(jCheckBoxPpc
.getText());
1523 private String
getSelectedItemsString() {
1525 if (this.jCheckBoxIa32
.isSelected()) {
1526 s
= s
+ jCheckBoxIa32
.getText() + " ";
1528 if (this.jCheckBoxX64
.isSelected()) {
1529 s
= s
+ jCheckBoxX64
.getText() + " ";
1531 if (this.jCheckBoxIpf
.isSelected()) {
1532 s
= s
+ jCheckBoxIpf
.getText() + " ";
1534 if (this.jCheckBoxEbc
.isSelected()) {
1535 s
= s
+ jCheckBoxEbc
.getText() + " ";
1537 if (this.jCheckBoxArm
.isSelected()) {
1538 s
= s
+ jCheckBoxArm
.getText() + " ";
1540 if (this.jCheckBoxPpc
.isSelected()) {
1541 s
= s
+ jCheckBoxPpc
.getText() + " ";
1546 private void setAllItemsSelected(boolean isSelected
) {
1547 this.jCheckBoxIa32
.setSelected(isSelected
);
1548 this.jCheckBoxX64
.setSelected(isSelected
);
1549 this.jCheckBoxIpf
.setSelected(isSelected
);
1550 this.jCheckBoxEbc
.setSelected(isSelected
);
1551 this.jCheckBoxArm
.setSelected(isSelected
);
1552 this.jCheckBoxPpc
.setSelected(isSelected
);
1555 private void setSelectedItems(Vector
<String
> v
) {
1556 setAllItemsSelected(false);
1558 for (int index
= 0; index
< v
.size(); index
++) {
1559 if (v
.get(index
).equals(this.jCheckBoxIa32
.getText())) {
1560 this.jCheckBoxIa32
.setSelected(true);
1563 if (v
.get(index
).equals(this.jCheckBoxIpf
.getText())) {
1564 this.jCheckBoxIpf
.setSelected(true);
1567 if (v
.get(index
).equals(this.jCheckBoxX64
.getText())) {
1568 this.jCheckBoxX64
.setSelected(true);
1571 if (v
.get(index
).equals(this.jCheckBoxEbc
.getText())) {
1572 this.jCheckBoxEbc
.setSelected(true);
1575 if (v
.get(index
).equals(this.jCheckBoxArm
.getText())) {
1576 this.jCheckBoxArm
.setSelected(true);
1579 if (v
.get(index
).equals(this.jCheckBoxPpc
.getText())) {
1580 this.jCheckBoxPpc
.setSelected(true);
1588 * This method initializes jCheckBoxPcd
1590 * @return javax.swing.JCheckBox
1592 private JCheckBox
getJCheckBoxPcd() {
1593 if (jCheckBoxPcd
== null) {
1594 jCheckBoxPcd
= new JCheckBox();
1595 jCheckBoxPcd
.setBounds(new java
.awt
.Rectangle(0, 530, 140, 20));
1596 jCheckBoxPcd
.setText("Is this a PCD Driver?");
1597 jCheckBoxPcd
.addFocusListener(this);
1598 jCheckBoxPcd
.addActionListener(this);
1600 return jCheckBoxPcd
;
1604 * This method initializes jCheckBoxFlashMap
1606 * @return javax.swing.JCheckBox
1608 private JCheckBox
getJCheckBoxFlashMap() {
1609 if (jCheckBoxFlashMap
== null) {
1610 jCheckBoxFlashMap
= new JCheckBox();
1611 jCheckBoxFlashMap
.setBounds(new java
.awt
.Rectangle(0, 555, 480, 20));
1612 jCheckBoxFlashMap
.setText("Are you using a legacy FlashMap header file?");
1613 jCheckBoxFlashMap
.addFocusListener(this);
1615 return jCheckBoxFlashMap
;