3 The file is used to create, update Externs section of the 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.
15 package org
.tianocore
.frameworkwizard
.module
.ui
.dialog
;
17 import java
.awt
.event
.ActionEvent
;
18 import java
.awt
.event
.ItemEvent
;
19 import java
.awt
.event
.ItemListener
;
20 import java
.util
.Vector
;
22 import javax
.swing
.JButton
;
23 import javax
.swing
.JComboBox
;
24 import javax
.swing
.JLabel
;
25 import javax
.swing
.JPanel
;
26 import javax
.swing
.JScrollPane
;
27 import javax
.swing
.JTextField
;
29 import org
.tianocore
.frameworkwizard
.common
.DataType
;
30 import org
.tianocore
.frameworkwizard
.common
.DataValidation
;
31 import org
.tianocore
.frameworkwizard
.common
.EnumerationData
;
32 import org
.tianocore
.frameworkwizard
.common
.Log
;
33 import org
.tianocore
.frameworkwizard
.common
.Tools
;
34 import org
.tianocore
.frameworkwizard
.common
.ui
.ArchCheckBox
;
35 import org
.tianocore
.frameworkwizard
.common
.ui
.IDialog
;
36 import org
.tianocore
.frameworkwizard
.common
.ui
.IFrame
;
37 import org
.tianocore
.frameworkwizard
.common
.ui
.StarLabel
;
38 import org
.tianocore
.frameworkwizard
.module
.Identifications
.Externs
.ExternsIdentification
;
41 * The class is used to create, update Externs section of the MSA file
46 public class ExternsDlg
extends IDialog
implements ItemListener
{
49 /// Define class Serial Version UID
51 private static final long serialVersionUID
= -7382008402932047191L;
54 //Define class members
56 private JPanel jContentPane
= null;
58 private JLabel jLabelName
= null;
60 private JComboBox jComboBoxType
= null;
62 private JScrollPane jScrollPane
= null;
64 private JLabel jLabelSpecification
= null;
66 private JTextField jTextFieldSpecification
= null;
68 private JLabel jLabelFeatureFlag
= null;
70 private JLabel jLabelArch
= null;
72 private JTextField jTextFieldFeatureFlag
= null;
74 private ArchCheckBox jArchCheckBox
= null;
76 private JButton jButtonOk
= null;
78 private JButton jButtonCancel
= null;
80 private StarLabel jStarLabel1
= null;
82 private JPanel jPanelSpecification
= null;
84 private JPanel jPanelImage
= null;
86 private JPanel jPanelDriver
= null;
88 private JPanel jPanelLibrary
= null;
90 private JPanel jPanelCallBack
= null;
92 private JLabel jLabelModuleEntryPoint
= null;
94 private JTextField jTextFieldModuleEntryPoint
= null;
96 private JLabel jLabelModuleUnloadImage
= null;
98 private JTextField jTextFieldModuleUnloadImage
= null;
100 private JLabel jLabelDriverBinding
= null;
102 private JTextField jTextFieldDriverBinding
= null;
104 private JLabel jLabelComponentName
= null;
106 private JTextField jTextFieldComponentName
= null;
108 private JLabel jLabelDriverConfig
= null;
110 private JTextField jTextFieldDriverConfig
= null;
112 private JLabel jLabelDriverDiagnostic
= null;
114 private JTextField jTextFieldDriverDiagnostic
= null;
116 private JLabel jLabelConstructor
= null;
118 private JTextField jTextFieldConstructor
= null;
120 private JLabel jLabelDestructor
= null;
122 private JTextField jTextFieldDestructor
= null;
124 private JLabel jLabelVirtualAddressMap
= null;
126 private JTextField jTextFieldVirtualAddressMap
= null;
128 private JLabel jLabelExitBootServices
= null;
130 private JTextField jTextFieldExitBootServices
= null;
135 private ExternsIdentification id
= null;
137 private EnumerationData ed
= new EnumerationData();
140 This method initializes jComboBoxType
142 @return javax.swing.JComboBox jComboBoxType
145 private JComboBox
getJComboBoxType() {
146 if (jComboBoxType
== null) {
147 jComboBoxType
= new JComboBox();
148 jComboBoxType
.setBounds(new java
.awt
.Rectangle(168, 12, 320, 20));
149 jComboBoxType
.setPreferredSize(new java
.awt
.Dimension(320, 20));
150 jComboBoxType
.addItemListener(this);
152 return jComboBoxType
;
156 This method initializes jScrollPane
158 @return javax.swing.JScrollPane
160 private JScrollPane
getJScrollPane() {
161 if (jScrollPane
== null) {
162 jScrollPane
= new JScrollPane();
163 jScrollPane
.setViewportView(getJContentPane());
169 This method initializes jTextFieldC_Name
171 @return javax.swing.JTextField
174 private JTextField
getJTextFieldSpecification() {
175 if (jTextFieldSpecification
== null) {
176 jTextFieldSpecification
= new JTextField();
177 jTextFieldSpecification
.setPreferredSize(new java
.awt
.Dimension(320, 20));
178 jTextFieldSpecification
.setBounds(new java
.awt
.Rectangle(168, 0, 320, 20));
180 return jTextFieldSpecification
;
184 This method initializes jTextFieldFeatureFlag
186 @return javax.swing.JTextField
189 private JTextField
getJTextFieldFeatureFlag() {
190 if (jTextFieldFeatureFlag
== null) {
191 jTextFieldFeatureFlag
= new JTextField();
192 jTextFieldFeatureFlag
.setBounds(new java
.awt
.Rectangle(168, 87, 320, 20));
193 jTextFieldFeatureFlag
.setPreferredSize(new java
.awt
.Dimension(320, 20));
194 jTextFieldFeatureFlag
.setEnabled(false);
196 return jTextFieldFeatureFlag
;
200 This method initializes jButtonOk
202 @return javax.swing.JButton
205 private JButton
getJButtonOk() {
206 if (jButtonOk
== null) {
207 jButtonOk
= new JButton();
208 jButtonOk
.setBounds(new java
.awt
.Rectangle(300, 187, 90, 20));
209 jButtonOk
.setText("Ok");
210 jButtonOk
.addActionListener(this);
216 This method initializes jButtonCancel
218 @return javax.swing.JButton
221 private JButton
getJButtonCancel() {
222 if (jButtonCancel
== null) {
223 jButtonCancel
= new JButton();
224 jButtonCancel
.setBounds(new java
.awt
.Rectangle(400, 187, 90, 20));
225 jButtonCancel
.setText("Cancel");
226 jButtonCancel
.addActionListener(this);
228 return jButtonCancel
;
232 * This method initializes jPanelSpecification
234 * @return javax.swing.JPanel
236 private JPanel
getJPanelSpecification() {
237 if (jPanelSpecification
== null) {
238 jPanelSpecification
= new JPanel();
239 jPanelSpecification
.setBounds(new java
.awt
.Rectangle(0, 37, 505, 20));
240 jPanelSpecification
.setLayout(null);
242 jLabelSpecification
= new JLabel();
243 jLabelSpecification
.setBounds(new java
.awt
.Rectangle(12, 0, 140, 20));
244 jLabelSpecification
.setText("Specification Name");
246 jPanelSpecification
.add(jLabelSpecification
, null);
247 jPanelSpecification
.add(getJTextFieldSpecification(), null);
249 return jPanelSpecification
;
253 * This method initializes jPanelImage
255 * @return javax.swing.JPanel
257 private JPanel
getJPanelImage() {
258 if (jPanelImage
== null) {
259 jLabelModuleUnloadImage
= new JLabel();
260 jLabelModuleUnloadImage
.setBounds(new java
.awt
.Rectangle(12, 25, 140, 20));
261 jLabelModuleUnloadImage
.setText("Module Unload Image");
262 jLabelModuleEntryPoint
= new JLabel();
263 jLabelModuleEntryPoint
.setBounds(new java
.awt
.Rectangle(12, 0, 140, 20));
264 jLabelModuleEntryPoint
.setText("Module Entry Point");
265 jPanelImage
= new JPanel();
266 jPanelImage
.setBounds(new java
.awt
.Rectangle(0, 37, 505, 45));
267 jPanelImage
.setLayout(null);
268 jPanelImage
.add(jLabelModuleEntryPoint
, null);
269 jPanelImage
.add(getJTextFieldModuleEntryPoint(), null);
270 jPanelImage
.add(jLabelModuleUnloadImage
, null);
271 jPanelImage
.add(getJTextFieldModuleUnloadImage(), null);
277 * This method initializes jPanelDriver
279 * @return javax.swing.JPanel
281 private JPanel
getJPanelDriver() {
282 if (jPanelDriver
== null) {
283 jStarLabel1
= new StarLabel();
284 jStarLabel1
.setLocation(new java
.awt
.Point(0, 0));
285 jLabelDriverDiagnostic
= new JLabel();
286 jLabelDriverDiagnostic
.setBounds(new java
.awt
.Rectangle(12, 75, 140, 20));
287 jLabelDriverDiagnostic
.setText("Driver Diagnostic");
288 jLabelDriverConfig
= new JLabel();
289 jLabelDriverConfig
.setBounds(new java
.awt
.Rectangle(12, 50, 140, 20));
290 jLabelDriverConfig
.setText("Driver Config");
291 jLabelComponentName
= new JLabel();
292 jLabelComponentName
.setBounds(new java
.awt
.Rectangle(12, 25, 140, 20));
293 jLabelComponentName
.setText("Component Name");
294 jLabelDriverBinding
= new JLabel();
295 jLabelDriverBinding
.setBounds(new java
.awt
.Rectangle(12, 0, 140, 20));
296 jLabelDriverBinding
.setText("Driver Binding");
297 jPanelDriver
= new JPanel();
298 jPanelDriver
.setBounds(new java
.awt
.Rectangle(0, 37, 505, 95));
299 jPanelDriver
.setLayout(null);
300 jPanelDriver
.add(jStarLabel1
, null);
301 jPanelDriver
.add(jLabelDriverBinding
, null);
302 jPanelDriver
.add(getJTextFieldDriverBinding(), null);
303 jPanelDriver
.add(jLabelComponentName
, null);
304 jPanelDriver
.add(getJTextFieldComponentName(), null);
305 jPanelDriver
.add(jLabelDriverConfig
, null);
306 jPanelDriver
.add(getJTextFieldDriverConfig(), null);
307 jPanelDriver
.add(jLabelDriverDiagnostic
, null);
308 jPanelDriver
.add(getJTextFieldDriverDiagnostic(), null);
314 * This method initializes jPanelLibrary
316 * @return javax.swing.JPanel
318 private JPanel
getJPanelLibrary() {
319 if (jPanelLibrary
== null) {
320 jLabelDestructor
= new JLabel();
321 jLabelDestructor
.setBounds(new java
.awt
.Rectangle(12, 25, 140, 20));
322 jLabelDestructor
.setText("Destructor");
323 jLabelConstructor
= new JLabel();
324 jLabelConstructor
.setBounds(new java
.awt
.Rectangle(12, 0, 140, 20));
325 jLabelConstructor
.setText("Constructor");
326 jPanelLibrary
= new JPanel();
327 jPanelLibrary
.setBounds(new java
.awt
.Rectangle(0, 37, 505, 45));
328 jPanelLibrary
.setLayout(null);
329 jPanelLibrary
.add(jLabelConstructor
, null);
330 jPanelLibrary
.add(getJTextFieldConstructor(), null);
331 jPanelLibrary
.add(jLabelDestructor
, null);
332 jPanelLibrary
.add(getJTextFieldDestructor(), null);
334 return jPanelLibrary
;
338 * This method initializes jPanelCallBack
340 * @return javax.swing.JPanel
342 private JPanel
getJPanelCallBack() {
343 if (jPanelCallBack
== null) {
344 jLabelExitBootServices
= new JLabel();
345 jLabelExitBootServices
.setBounds(new java
.awt
.Rectangle(12, 25, 140, 20));
346 jLabelExitBootServices
.setText("Exit Boot Services");
347 jLabelVirtualAddressMap
= new JLabel();
348 jLabelVirtualAddressMap
.setBounds(new java
.awt
.Rectangle(12, 0, 140, 20));
349 jLabelVirtualAddressMap
.setText("Virtual Address Map");
350 jPanelCallBack
= new JPanel();
351 jPanelCallBack
.setBounds(new java
.awt
.Rectangle(0, 37, 505, 45));
352 jPanelCallBack
.setLayout(null);
353 jPanelCallBack
.add(jLabelVirtualAddressMap
, null);
354 jPanelCallBack
.add(getJTextFieldVirtualAddressMap(), null);
355 jPanelCallBack
.add(jLabelExitBootServices
, null);
356 jPanelCallBack
.add(getJTextFieldExitBootServices(), null);
358 return jPanelCallBack
;
362 * This method initializes jTextFieldModuleEntryPoint
364 * @return javax.swing.JTextField
366 private JTextField
getJTextFieldModuleEntryPoint() {
367 if (jTextFieldModuleEntryPoint
== null) {
368 jTextFieldModuleEntryPoint
= new JTextField();
369 jTextFieldModuleEntryPoint
.setBounds(new java
.awt
.Rectangle(168, 0, 320, 20));
371 return jTextFieldModuleEntryPoint
;
375 * This method initializes jTextFieldModuleUnloadImage
377 * @return javax.swing.JTextField
379 private JTextField
getJTextFieldModuleUnloadImage() {
380 if (jTextFieldModuleUnloadImage
== null) {
381 jTextFieldModuleUnloadImage
= new JTextField();
382 jTextFieldModuleUnloadImage
.setBounds(new java
.awt
.Rectangle(168, 25, 320, 20));
384 return jTextFieldModuleUnloadImage
;
388 * This method initializes jTextFieldDriverBinding
390 * @return javax.swing.JTextField
392 private JTextField
getJTextFieldDriverBinding() {
393 if (jTextFieldDriverBinding
== null) {
394 jTextFieldDriverBinding
= new JTextField();
395 jTextFieldDriverBinding
.setBounds(new java
.awt
.Rectangle(168, 0, 320, 20));
397 return jTextFieldDriverBinding
;
401 * This method initializes jTextFieldComponentName
403 * @return javax.swing.JTextField
405 private JTextField
getJTextFieldComponentName() {
406 if (jTextFieldComponentName
== null) {
407 jTextFieldComponentName
= new JTextField();
408 jTextFieldComponentName
.setBounds(new java
.awt
.Rectangle(168, 25, 320, 20));
410 return jTextFieldComponentName
;
414 * This method initializes jTextFieldDriverConfig
416 * @return javax.swing.JTextField
418 private JTextField
getJTextFieldDriverConfig() {
419 if (jTextFieldDriverConfig
== null) {
420 jTextFieldDriverConfig
= new JTextField();
421 jTextFieldDriverConfig
.setBounds(new java
.awt
.Rectangle(168, 50, 320, 20));
423 return jTextFieldDriverConfig
;
427 * This method initializes jTextFieldDriverDiagnostic
429 * @return javax.swing.JTextField
431 private JTextField
getJTextFieldDriverDiagnostic() {
432 if (jTextFieldDriverDiagnostic
== null) {
433 jTextFieldDriverDiagnostic
= new JTextField();
434 jTextFieldDriverDiagnostic
.setBounds(new java
.awt
.Rectangle(168, 75, 320, 20));
436 return jTextFieldDriverDiagnostic
;
440 * This method initializes jTextFieldConstructor
442 * @return javax.swing.JTextField
444 private JTextField
getJTextFieldConstructor() {
445 if (jTextFieldConstructor
== null) {
446 jTextFieldConstructor
= new JTextField();
447 jTextFieldConstructor
.setBounds(new java
.awt
.Rectangle(168, 0, 320, 20));
449 return jTextFieldConstructor
;
453 * This method initializes jTextFieldDestructor
455 * @return javax.swing.JTextField
457 private JTextField
getJTextFieldDestructor() {
458 if (jTextFieldDestructor
== null) {
459 jTextFieldDestructor
= new JTextField();
460 jTextFieldDestructor
.setBounds(new java
.awt
.Rectangle(168, 25, 320, 20));
462 return jTextFieldDestructor
;
466 * This method initializes jTextFieldVirtualAddressMap
468 * @return javax.swing.JTextField
470 private JTextField
getJTextFieldVirtualAddressMap() {
471 if (jTextFieldVirtualAddressMap
== null) {
472 jTextFieldVirtualAddressMap
= new JTextField();
473 jTextFieldVirtualAddressMap
.setBounds(new java
.awt
.Rectangle(168, 0, 320, 20));
475 return jTextFieldVirtualAddressMap
;
479 * This method initializes jTextFieldExitBootServices
481 * @return javax.swing.JTextField
483 private JTextField
getJTextFieldExitBootServices() {
484 if (jTextFieldExitBootServices
== null) {
485 jTextFieldExitBootServices
= new JTextField();
486 jTextFieldExitBootServices
.setBounds(new java
.awt
.Rectangle(168, 25, 320, 20));
488 return jTextFieldExitBootServices
;
491 public static void main(String
[] args
) {
496 This method initializes this
499 private void init() {
500 this.setSize(515, 250);
501 this.setContentPane(getJScrollPane());
502 this.setTitle("Externs");
508 This method initializes this
509 Fill values to all fields if these values are not empty
514 private void init(ExternsIdentification inExternsId
) {
516 this.id
= inExternsId
;
518 if (this.id
!= null) {
519 String type
= id
.getType();
521 // Filter the type to lock down the type
523 this.jComboBoxType
.removeAllItems();
524 this.jComboBoxType
.addItem(type
);
526 this.jTextFieldFeatureFlag
.setText(id
.getFeatureFlag());
527 this.jArchCheckBox
.setSelectedItems(id
.getSupArchList());
530 // Init specification
532 if (type
.equals(EnumerationData
.EXTERNS_SPECIFICATION
)) {
533 this.jTextFieldSpecification
.setText(id
.getName0());
539 if (type
.equals(EnumerationData
.EXTERNS_IMAGE
)) {
540 this.jTextFieldModuleEntryPoint
.setText(id
.getName0());
541 this.jTextFieldModuleUnloadImage
.setText(id
.getName1());
547 if (type
.equals(EnumerationData
.EXTERNS_LIBRARY
)) {
548 this.jTextFieldConstructor
.setText(id
.getName0());
549 this.jTextFieldDestructor
.setText(id
.getName1());
555 if (type
.equals(EnumerationData
.EXTERNS_DRIVER
)) {
556 this.jTextFieldDriverBinding
.setText(id
.getName0());
557 this.jTextFieldComponentName
.setText(id
.getName1());
558 this.jTextFieldDriverConfig
.setText(id
.getName2());
559 this.jTextFieldDriverDiagnostic
.setText(id
.getName3());
565 if (type
.equals(EnumerationData
.EXTERNS_CALL_BACK
)) {
566 this.jTextFieldVirtualAddressMap
.setText(id
.getName0());
567 this.jTextFieldExitBootServices
.setText(id
.getName1());
573 This is the override edit constructor
575 @param inBootModesIdentification
579 public ExternsDlg(ExternsIdentification inExternsIdentification
, IFrame iFrame
) {
581 init(inExternsIdentification
);
585 This method initializes jContentPane
587 @return javax.swing.JPanel jContentPane
590 private JPanel
getJContentPane() {
591 if (jContentPane
== null) {
592 jArchCheckBox
= new ArchCheckBox();
593 jArchCheckBox
.setBounds(new java
.awt
.Rectangle(168, 62, 320, 20));
594 jArchCheckBox
.setPreferredSize(new java
.awt
.Dimension(320, 20));
596 jLabelName
= new JLabel();
597 jLabelName
.setText("Choose Extern Type");
598 jLabelName
.setBounds(new java
.awt
.Rectangle(12, 12, 155, 20));
599 jLabelArch
= new JLabel();
600 jLabelArch
.setBounds(new java
.awt
.Rectangle(12, 62, 155, 20));
601 jLabelArch
.setText("Supported Architectures");
602 jLabelFeatureFlag
= new JLabel();
603 jLabelFeatureFlag
.setBounds(new java
.awt
.Rectangle(12, 87, 155, 20));
604 jLabelFeatureFlag
.setText("Feature Flag Expression");
605 jLabelFeatureFlag
.setEnabled(false);
607 jContentPane
= new JPanel();
608 jContentPane
.setLayout(null);
609 jContentPane
.setPreferredSize(new java
.awt
.Dimension(505, 200));
611 jContentPane
.add(jLabelName
, null);
612 jContentPane
.add(getJComboBoxType(), null);
613 jContentPane
.add(jLabelFeatureFlag
, null);
614 jContentPane
.add(jLabelArch
, null);
615 jContentPane
.add(getJTextFieldFeatureFlag(), null);
617 jContentPane
.add(jArchCheckBox
, null);
618 jContentPane
.add(getJButtonOk(), null);
619 jContentPane
.add(getJButtonCancel(), null);
621 jContentPane
.add(getJPanelSpecification(), null);
622 jContentPane
.add(getJPanelImage(), null);
623 jContentPane
.add(getJPanelDriver(), null);
624 jContentPane
.add(getJPanelLibrary(), null);
625 jContentPane
.add(getJPanelCallBack(), null);
631 This method initializes Usage type and Externs type
634 private void initFrame() {
635 Tools
.generateComboBoxByVector(this.jComboBoxType
, ed
.getVExternTypes());
636 this.jPanelSpecification
.setVisible(true);
637 this.jPanelImage
.setVisible(false);
638 this.jPanelLibrary
.setVisible(false);
639 this.jPanelDriver
.setVisible(false);
640 this.jPanelCallBack
.setVisible(false);
644 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
646 * Override actionPerformed to listen all actions
649 public void actionPerformed(ActionEvent arg0
) {
650 if (arg0
.getSource() == jButtonOk
) {
652 this.getCurrentExterns();
653 this.returnType
= DataType
.RETURN_TYPE_OK
;
654 this.setVisible(false);
658 if (arg0
.getSource() == jButtonCancel
) {
659 this.returnType
= DataType
.RETURN_TYPE_CANCEL
;
660 this.setVisible(false);
665 Data validation for all fields
667 @retval true - All datas are valid
668 @retval false - At least one data is invalid
671 public boolean checkAdd() {
673 // Check if all fields have correct data types
677 // Check specification
679 if (this.jComboBoxType
.getSelectedItem().toString().equals(EnumerationData
.EXTERNS_SPECIFICATION
)) {
680 if (isEmpty(this.jTextFieldSpecification
.getText())) {
681 Log
.wrn("Update Externs", "Please type specification's name");
684 if (!DataValidation
.isSentence(this.jTextFieldSpecification
.getText())) {
685 Log
.wrn("Update Externs", "Incorrect data type for Specification");
690 // No need to check feature flag, return true directly here.
698 if (this.jComboBoxType
.getSelectedItem().toString().equals(EnumerationData
.EXTERNS_IMAGE
)) {
699 if (isEmpty(this.jTextFieldModuleEntryPoint
.getText())
700 && isEmpty(this.jTextFieldModuleUnloadImage
.getText())) {
701 Log
.wrn("Update Externs", "At least one of ModuleEntryPoint or ModuleUnloadImage should have a value");
704 if (!isEmpty(this.jTextFieldModuleEntryPoint
.getText())) {
705 if (!DataValidation
.isC_NameType(this.jTextFieldModuleEntryPoint
.getText())) {
706 Log
.wrn("Update Externs", "Incorrect data type for Module Entry Point");
710 if (!isEmpty(this.jTextFieldModuleUnloadImage
.getText())) {
711 if (!DataValidation
.isC_NameType(this.jTextFieldModuleUnloadImage
.getText())) {
712 Log
.wrn("Update Externs", "Incorrect data type for Module Unload Image");
721 if (this.jComboBoxType
.getSelectedItem().toString().equals(EnumerationData
.EXTERNS_LIBRARY
)) {
722 if (isEmpty(this.jTextFieldConstructor
.getText()) && isEmpty(this.jTextFieldDestructor
.getText())) {
723 Log
.wrn("Update Externs", "At least one of Constructor or Destructor should have a value");
726 if (!isEmpty(this.jTextFieldConstructor
.getText())) {
727 if (!DataValidation
.isC_NameType(this.jTextFieldConstructor
.getText())) {
728 Log
.wrn("Update Externs", "Incorrect data type for Constructor");
732 if (!isEmpty(this.jTextFieldDestructor
.getText())) {
733 if (!DataValidation
.isC_NameType(this.jTextFieldDestructor
.getText())) {
734 Log
.wrn("Update Externs", "Incorrect data type for Destructor");
743 if (this.jComboBoxType
.getSelectedItem().toString().equals(EnumerationData
.EXTERNS_DRIVER
)) {
744 if (isEmpty(this.jTextFieldDriverBinding
.getText())) {
745 Log
.wrn("Update Externs", "DriverBinding must have a value");
748 if (!isEmpty(this.jTextFieldDriverBinding
.getText())) {
749 if (!DataValidation
.isC_NameType(this.jTextFieldDriverBinding
.getText())) {
750 Log
.wrn("Update Externs", "Incorrect data type for DriverBinding");
754 if (!isEmpty(this.jTextFieldComponentName
.getText())) {
755 if (!DataValidation
.isC_NameType(this.jTextFieldComponentName
.getText())) {
756 Log
.wrn("Update Externs", "Incorrect data type for ComponentName");
760 if (!isEmpty(this.jTextFieldDriverConfig
.getText())) {
761 if (!DataValidation
.isC_NameType(this.jTextFieldDriverConfig
.getText())) {
762 Log
.wrn("Update Externs", "Incorrect data type for DriverConfig");
766 if (!isEmpty(this.jTextFieldDriverDiagnostic
.getText())) {
767 if (!DataValidation
.isC_NameType(this.jTextFieldDriverDiagnostic
.getText())) {
768 Log
.wrn("Update Externs", "Incorrect data type for DriverDiagnostic");
777 if (this.jComboBoxType
.getSelectedItem().toString().equals(EnumerationData
.EXTERNS_CALL_BACK
)) {
778 if (isEmpty(this.jTextFieldVirtualAddressMap
.getText())
779 && isEmpty(this.jTextFieldExitBootServices
.getText())) {
780 Log
.wrn("Update Externs", "At least one of VirtualAddressMap or ExitBootServices should have a value");
783 if (!isEmpty(this.jTextFieldVirtualAddressMap
.getText())) {
784 if (!DataValidation
.isC_NameType(this.jTextFieldVirtualAddressMap
.getText())) {
785 Log
.wrn("Update Externs", "Incorrect data type for Virtual Address Map");
789 if (!isEmpty(this.jTextFieldExitBootServices
.getText())) {
790 if (!DataValidation
.isC_NameType(this.jTextFieldExitBootServices
.getText())) {
791 Log
.wrn("Update Externs", "Incorrect data type for Exit Boot Services");
800 if (!isEmpty(this.jTextFieldFeatureFlag
.getText())) {
801 if (!DataValidation
.isFeatureFlag(this.jTextFieldFeatureFlag
.getText())) {
802 Log
.wrn("Update Externs", "Incorrect data type for Feature Flag");
810 private ExternsIdentification
getCurrentExterns() {
816 String type
= this.jComboBoxType
.getSelectedItem().toString();
817 String featureFlag
= this.jTextFieldFeatureFlag
.getText();
818 Vector
<String
> arch
= this.jArchCheckBox
.getSelectedItemsVector();
820 if (type
.equals(EnumerationData
.EXTERNS_SPECIFICATION
)) {
821 arg0
= this.jTextFieldSpecification
.getText();
822 id
= new ExternsIdentification(arg0
, type
);
825 if (type
.equals(EnumerationData
.EXTERNS_IMAGE
)) {
826 arg0
= this.jTextFieldModuleEntryPoint
.getText();
827 arg1
= this.jTextFieldModuleUnloadImage
.getText();
828 id
= new ExternsIdentification(arg0
, arg1
, type
, featureFlag
, arch
);
831 if (type
.equals(EnumerationData
.EXTERNS_LIBRARY
)) {
832 arg0
= this.jTextFieldConstructor
.getText();
833 arg1
= this.jTextFieldDestructor
.getText();
834 id
= new ExternsIdentification(arg0
, arg1
, type
, featureFlag
, arch
);
837 if (type
.equals(EnumerationData
.EXTERNS_DRIVER
)) {
838 arg0
= this.jTextFieldDriverBinding
.getText();
839 arg1
= this.jTextFieldComponentName
.getText();
840 arg2
= this.jTextFieldDriverConfig
.getText();
841 arg3
= this.jTextFieldDriverDiagnostic
.getText();
842 id
= new ExternsIdentification(arg0
, arg1
, arg2
, arg3
, type
, featureFlag
, arch
);
845 if (type
.equals(EnumerationData
.EXTERNS_CALL_BACK
)) {
846 arg0
= this.jTextFieldVirtualAddressMap
.getText();
847 arg1
= this.jTextFieldExitBootServices
.getText();
848 id
= new ExternsIdentification(arg0
, arg1
, type
, featureFlag
, arch
);
855 * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
857 * Reflesh the frame when selected item changed
860 public void itemStateChanged(ItemEvent arg0
) {
861 if (arg0
.getSource() == jComboBoxType
&& arg0
.getStateChange() == ItemEvent
.SELECTED
) {
862 if (jComboBoxType
.getSelectedItem().toString().equals(EnumerationData
.EXTERNS_SPECIFICATION
)) {
863 this.jPanelSpecification
.setVisible(true);
864 this.jPanelImage
.setVisible(false);
865 this.jPanelLibrary
.setVisible(false);
866 this.jPanelDriver
.setVisible(false);
867 this.jPanelCallBack
.setVisible(false);
868 this.jLabelArch
.setEnabled(false);
869 this.jArchCheckBox
.setAllItemsEnabled(false);
870 this.jLabelArch
.setLocation(12, 62);
871 this.jArchCheckBox
.setLocation(168, 62);
872 this.jLabelFeatureFlag
.setLocation(12, 87);
873 this.jTextFieldFeatureFlag
.setLocation(168, 87);
874 } else if (jComboBoxType
.getSelectedItem().toString().equals(EnumerationData
.EXTERNS_IMAGE
)) {
875 this.jPanelSpecification
.setVisible(false);
876 this.jPanelImage
.setVisible(true);
877 this.jPanelLibrary
.setVisible(false);
878 this.jPanelDriver
.setVisible(false);
879 this.jPanelCallBack
.setVisible(false);
880 this.jLabelArch
.setEnabled(true);
881 this.jArchCheckBox
.setAllItemsEnabled(true);
882 this.jLabelArch
.setLocation(12, 87);
883 this.jArchCheckBox
.setLocation(168, 87);
884 this.jLabelFeatureFlag
.setLocation(12, 112);
885 this.jTextFieldFeatureFlag
.setLocation(168, 112);
886 } else if (jComboBoxType
.getSelectedItem().toString().equals(EnumerationData
.EXTERNS_LIBRARY
)) {
887 this.jPanelSpecification
.setVisible(false);
888 this.jPanelImage
.setVisible(false);
889 this.jPanelLibrary
.setVisible(true);
890 this.jPanelDriver
.setVisible(false);
891 this.jPanelCallBack
.setVisible(false);
892 this.jLabelArch
.setEnabled(true);
893 this.jArchCheckBox
.setAllItemsEnabled(true);
894 this.jLabelArch
.setLocation(12, 87);
895 this.jArchCheckBox
.setLocation(168, 87);
896 this.jLabelFeatureFlag
.setLocation(12, 112);
897 this.jTextFieldFeatureFlag
.setLocation(168, 112);
898 } else if (jComboBoxType
.getSelectedItem().toString().equals(EnumerationData
.EXTERNS_DRIVER
)) {
899 this.jPanelSpecification
.setVisible(false);
900 this.jPanelImage
.setVisible(false);
901 this.jPanelLibrary
.setVisible(false);
902 this.jPanelDriver
.setVisible(true);
903 this.jPanelCallBack
.setVisible(false);
904 this.jLabelArch
.setEnabled(true);
905 this.jArchCheckBox
.setAllItemsEnabled(true);
906 this.jLabelArch
.setLocation(12, 137);
907 this.jArchCheckBox
.setLocation(168, 137);
908 this.jLabelFeatureFlag
.setLocation(12, 162);
909 this.jTextFieldFeatureFlag
.setLocation(168, 162);
910 } else if (jComboBoxType
.getSelectedItem().toString().equals(EnumerationData
.EXTERNS_CALL_BACK
)) {
911 this.jPanelSpecification
.setVisible(false);
912 this.jPanelImage
.setVisible(false);
913 this.jPanelLibrary
.setVisible(false);
914 this.jPanelDriver
.setVisible(false);
915 this.jPanelCallBack
.setVisible(true);
916 this.jLabelArch
.setEnabled(true);
917 this.jArchCheckBox
.setAllItemsEnabled(true);
918 this.jLabelArch
.setLocation(12, 87);
919 this.jArchCheckBox
.setLocation(168, 87);
920 this.jLabelFeatureFlag
.setLocation(12, 112);
921 this.jTextFieldFeatureFlag
.setLocation(168, 112);
926 public ExternsIdentification
getId() {
930 public void setId(ExternsIdentification id
) {