3 The file is used to create, update BuildOptions of Fpd 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
.platform
.ui
;
17 import java
.awt
.BorderLayout
;
18 import java
.awt
.Dimension
;
20 import javax
.swing
.JPanel
;
21 import javax
.swing
.JDialog
;
22 import javax
.swing
.JTabbedPane
;
23 import javax
.swing
.JCheckBox
;
24 import javax
.swing
.JLabel
;
25 import java
.awt
.FlowLayout
;
26 import javax
.swing
.AbstractAction
;
27 import java
.awt
.event
.ActionEvent
;
28 import java
.awt
.event
.ActionListener
;
29 import java
.awt
.event
.ItemEvent
;
30 import java
.awt
.event
.ItemListener
;
32 import javax
.swing
.ButtonGroup
;
33 import javax
.swing
.DefaultCellEditor
;
34 import javax
.swing
.DefaultListModel
;
35 import javax
.swing
.JTextField
;
36 import javax
.swing
.JButton
;
37 import javax
.swing
.JScrollPane
;
38 import javax
.swing
.JTable
;
39 import javax
.swing
.JComboBox
;
40 import javax
.swing
.JRadioButton
;
41 import javax
.swing
.ListSelectionModel
;
42 import javax
.swing
.event
.ListSelectionEvent
;
43 import javax
.swing
.event
.ListSelectionListener
;
44 import javax
.swing
.event
.TableModelEvent
;
45 import javax
.swing
.event
.TableModelListener
;
46 import javax
.swing
.table
.DefaultTableModel
;
47 import javax
.swing
.table
.TableColumn
;
48 import javax
.swing
.table
.TableModel
;
49 import javax
.swing
.JList
;
51 import org
.tianocore
.PlatformSurfaceAreaDocument
;
52 import org
.tianocore
.frameworkwizard
.common
.ui
.IInternalFrame
;
53 import java
.awt
.CardLayout
;
54 import javax
.swing
.JTree
;
56 public class FpdBuildOptions
extends IInternalFrame
{
58 private static final long serialVersionUID
= 1L;
59 private JPanel jContentPane
= null;
60 private JPanel jPanel
= null;
61 private JPanel jPanel1
= null;
62 private JPanel jPanel2
= null;
63 private JPanel jPanel3
= null;
64 private JTabbedPane jTabbedPane
= null;
65 private JPanel jPanel8
= null;
66 private JPanel jPanel9
= null;
67 private JPanel jPanel10
= null;
68 private JPanel jPanel11
= null;
69 private JRadioButton jRadioButton
= null;
70 private JTextField jTextField2
= null;
71 private JLabel jLabel3
= null;
72 private JTextField jTextField3
= null;
73 private JButton jButton4
= null;
74 private JButton jButton5
= null;
75 private JRadioButton jRadioButton1
= null;
76 private JLabel jLabel4
= null;
77 private JTextField jTextField4
= null;
78 private JScrollPane jScrollPane2
= null;
79 private JTable jTable2
= null;
80 private DefaultTableModel fileNameTableModel
= null;
81 private DefaultTableModel imageEntryPointTableModel
= null;
82 private DefaultTableModel outputDirectoryTableModel
= null;
83 private DefaultTableModel antTaskTableModel
= null;
84 private DefaultTableModel ffsAttributesTableModel
= null;
85 private DefaultTableModel optionsTableModel
= null;
86 private JPanel jPanel13
= null;
87 private JPanel jPanel14
= null;
88 private JPanel jPanel18
= null;
89 private JScrollPane jScrollPane4
= null;
90 private JLabel jLabel6
= null;
91 private JList jList
= null;
92 private JPanel jPanel15
= null;
93 private JPanel jPanel16
= null;
94 private JPanel jPanel17
= null;
95 private JLabel jLabel7
= null;
96 private JTextField jTextField6
= null;
97 private JButton jButton8
= null;
98 private JButton jButton9
= null;
99 private JCheckBox jCheckBox5
= null;
100 private JScrollPane jScrollPane5
= null;
101 private JTable jTable4
= null;
102 private JPanel jPanel19
= null;
103 private JPanel jPanel20
= null;
104 private JLabel jLabel9
= null;
105 private JTextField jTextField7
= null;
106 private JLabel jLabel10
= null;
107 private JComboBox jComboBox2
= null;
108 private JLabel jLabel11
= null;
109 private JLabel jLabel12
= null;
110 private JTextField jTextField8
= null;
111 private JScrollPane jScrollPane6
= null;
112 private JTable jTable5
= null;
113 private JButton jButton10
= null;
114 private JButton jButton11
= null;
115 private JPanel jPanel21
= null;
116 private JButton jButton12
= null;
117 private JButton jButton13
= null;
118 private JLabel jLabel8
= null;
119 private JTextField jTextField9
= null;
120 private JLabel jLabel13
= null;
121 private JTextField jTextField10
= null;
122 private JPanel jPanel22
= null;
123 private JCheckBox jCheckBox6
= null;
124 private JComboBox jComboBox4
= null;
125 private JCheckBox jCheckBox7
= null;
126 private JComboBox jComboBox5
= null;
127 private JCheckBox jCheckBox8
= null;
128 private JTextField jTextField11
= null;
129 private JButton jButton14
= null;
130 private JButton jButton15
= null;
131 private JButton jButton16
= null;
132 private DefaultListModel listModel
= new DefaultListModel();
133 private JScrollPane jScrollPane7
= null;
134 private JTree jTree
= null;
135 private JButton jButton17
= null;
136 private JButton jButton18
= null;
137 private FpdFileContents ffc
= null;
138 private JButton jButton19
= null;
139 private JCheckBox jCheckBox9
= null;
140 private JCheckBox jCheckBox10
= null;
141 private JCheckBox jCheckBox11
= null;
142 private JCheckBox jCheckBox12
= null;
143 private JCheckBox jCheckBox13
= null;
144 private JCheckBox jCheckBox14
= null;
145 private JLabel jLabel14
= null;
146 private JTextField jTextField12
= null;
147 private JTextField jTextField13
= null;
148 private JLabel jLabel15
= null;
149 private int selectedRow
= -1;
151 * This method initializes jPanel
153 * @return javax.swing.JPanel
155 private JPanel
getJPanel() {
156 if (jPanel
== null) {
157 jPanel
= new JPanel();
163 * This method initializes jPanel1
165 * @return javax.swing.JPanel
167 private JPanel
getJPanel1() {
168 if (jPanel1
== null) {
169 jPanel1
= new JPanel();
175 * This method initializes jPanel2
177 * @return javax.swing.JPanel
179 private JPanel
getJPanel2() {
180 if (jPanel2
== null) {
181 jPanel2
= new JPanel();
187 * This method initializes jPanel3
189 * @return javax.swing.JPanel
191 private JPanel
getJPanel3() {
192 if (jPanel3
== null) {
193 jPanel3
= new JPanel();
199 * This method initializes jTabbedPane
201 * @return javax.swing.JTabbedPane
203 private JTabbedPane
getJTabbedPane() {
204 if (jTabbedPane
== null) {
205 jTabbedPane
= new JTabbedPane();
206 jTabbedPane
.addTab("FFS", null, getJPanel13(), null);
207 jTabbedPane
.addTab("Options", null, getJPanel20(), null);
208 jTabbedPane
.addTab("User Defined ANT Tasks", null, getJPanel8(), null);
215 * This method initializes jPanel8
217 * @return javax.swing.JPanel
219 private JPanel
getJPanel8() {
220 if (jPanel8
== null) {
221 jPanel8
= new JPanel();
222 jPanel8
.setLayout(new BorderLayout());
223 jPanel8
.add(getJPanel9(), java
.awt
.BorderLayout
.NORTH
);
224 jPanel8
.add(getJPanel10(), java
.awt
.BorderLayout
.SOUTH
);
225 jPanel8
.add(getJPanel11(), java
.awt
.BorderLayout
.CENTER
);
226 ButtonGroup bg
= new ButtonGroup();
227 bg
.add(jRadioButton
);
228 bg
.add(jRadioButton1
);
234 * This method initializes jPanel9
236 * @return javax.swing.JPanel
238 private JPanel
getJPanel9() {
239 if (jPanel9
== null) {
240 FlowLayout flowLayout8
= new FlowLayout();
241 flowLayout8
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
242 jLabel3
= new JLabel();
243 jLabel3
.setText("ID");
244 jPanel9
= new JPanel();
245 jPanel9
.setLayout(flowLayout8
);
246 jPanel9
.add(getJRadioButton(), null);
247 jPanel9
.add(getJTextField2(), null);
248 jPanel9
.add(jLabel3
, null);
249 jPanel9
.add(getJTextField3(), null);
250 jPanel9
.add(getJButton4(), null);
251 jPanel9
.add(getJButton5(), null);
257 * This method initializes jPanel10
259 * @return javax.swing.JPanel
261 private JPanel
getJPanel10() {
262 if (jPanel10
== null) {
263 jPanel10
= new JPanel();
269 * This method initializes jPanel11
271 * @return javax.swing.JPanel
273 private JPanel
getJPanel11() {
274 if (jPanel11
== null) {
275 FlowLayout flowLayout3
= new FlowLayout();
276 flowLayout3
.setHgap(5);
277 flowLayout3
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
278 jLabel4
= new JLabel();
279 jLabel4
.setText("Execution Order");
280 jLabel4
.setEnabled(false);
281 jLabel4
.setPreferredSize(new java
.awt
.Dimension(100,16));
282 jPanel11
= new JPanel();
283 jPanel11
.setLayout(flowLayout3
);
284 jPanel11
.add(getJRadioButton1(), null);
285 jPanel11
.add(jLabel4
, null);
286 jPanel11
.add(getJTextField4(), null);
287 jPanel11
.add(getJScrollPane2(), null);
293 * This method initializes jRadioButton
295 * @return javax.swing.JRadioButton
297 private JRadioButton
getJRadioButton() {
298 if (jRadioButton
== null) {
299 jRadioButton
= new JRadioButton();
300 jRadioButton
.setText("ANT tasks File");
301 jRadioButton
.setSelected(true);
302 jRadioButton
.addItemListener(new ItemListener() {
303 public void itemStateChanged(ItemEvent arg0
) {
304 boolean selected
= jRadioButton
.isSelected();
305 jTextField2
.setEnabled(selected
);
313 * This method initializes jTextField2
315 * @return javax.swing.JTextField
317 private JTextField
getJTextField2() {
318 if (jTextField2
== null) {
319 jTextField2
= new JTextField();
320 jTextField2
.setPreferredSize(new java
.awt
.Dimension(200,20));
326 * This method initializes jTextField3
328 * @return javax.swing.JTextField
330 private JTextField
getJTextField3() {
331 if (jTextField3
== null) {
332 jTextField3
= new JTextField();
333 jTextField3
.setPreferredSize(new java
.awt
.Dimension(100,20));
339 * This method initializes jButton4
341 * @return javax.swing.JButton
343 private JButton
getJButton4() {
344 if (jButton4
== null) {
345 jButton4
= new JButton();
346 jButton4
.setPreferredSize(new java
.awt
.Dimension(70,20));
347 jButton4
.setText("Add");
348 jButton4
.addActionListener(new ActionListener() {
349 public void actionPerformed(ActionEvent e
) {
350 Object
[] o
= {jTextField3
.getText(), null, null};
351 if (jRadioButton
.isSelected()) {
352 o
[1] = jTextField2
.getText();
353 ffc
.genBuildOptionsUserDefAntTask(o
[0]+"", o
[1]+"", null);
355 if (jRadioButton1
.isSelected()) {
356 o
[2] = jTextField4
.getText();
357 ffc
.genBuildOptionsUserDefAntTask(o
[0]+"", null, o
[2]+"");
359 antTaskTableModel
.addRow(o
);
368 * This method initializes jButton5
370 * @return javax.swing.JButton
372 private JButton
getJButton5() {
373 if (jButton5
== null) {
374 jButton5
= new JButton();
375 jButton5
.setPreferredSize(new java
.awt
.Dimension(70,20));
376 jButton5
.setText("Delete");
377 jButton5
.addActionListener(new ActionListener() {
378 public void actionPerformed(ActionEvent e
) {
379 if (selectedRow
>= 0) {
380 antTaskTableModel
.removeRow(selectedRow
);
381 ffc
.removeBuildOptionsUserDefAntTask(selectedRow
);
390 * This method initializes jRadioButton1
392 * @return javax.swing.JRadioButton
394 private JRadioButton
getJRadioButton1() {
395 if (jRadioButton1
== null) {
396 jRadioButton1
= new JRadioButton();
397 jRadioButton1
.setText("ANT Command");
398 jRadioButton1
.setPreferredSize(new java
.awt
.Dimension(180,24));
399 jRadioButton1
.addItemListener(new ItemListener() {
400 public void itemStateChanged(ItemEvent arg0
) {
401 boolean selected
= jRadioButton1
.isSelected();
402 jLabel4
.setEnabled(selected
);
403 jTextField4
.setEnabled(selected
);
407 return jRadioButton1
;
411 * This method initializes jTextField4
413 * @return javax.swing.JTextField
415 private JTextField
getJTextField4() {
416 if (jTextField4
== null) {
417 jTextField4
= new JTextField();
418 jTextField4
.setPreferredSize(new java
.awt
.Dimension(100,20));
419 jTextField4
.setEnabled(false);
425 * This method initializes jScrollPane2
427 * @return javax.swing.JScrollPane
429 private JScrollPane
getJScrollPane2() {
430 if (jScrollPane2
== null) {
431 jScrollPane2
= new JScrollPane();
432 jScrollPane2
.setPreferredSize(new java
.awt
.Dimension(600,100));
433 jScrollPane2
.setViewportView(getJTable2());
439 * This method initializes jTable2
441 * @return javax.swing.JTable
443 private JTable
getJTable2() {
444 if (jTable2
== null) {
445 antTaskTableModel
= new DefaultTableModel();
446 jTable2
= new JTable(antTaskTableModel
);
447 antTaskTableModel
.addColumn("ID");
448 antTaskTableModel
.addColumn("Filename");
449 antTaskTableModel
.addColumn("ExecutionOrder");
451 jTable2
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
452 jTable2
.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
453 public void valueChanged(ListSelectionEvent e
) {
455 if (e
.getValueIsAdjusting()){
458 ListSelectionModel lsm
= (ListSelectionModel
)e
.getSource();
459 if (lsm
.isSelectionEmpty()) {
463 selectedRow
= lsm
.getMinSelectionIndex();
468 jTable2
.getModel().addTableModelListener(new TableModelListener() {
469 public void tableChanged(TableModelEvent arg0
) {
470 // TODO Auto-generated method stub
471 int row
= arg0
.getFirstRow();
472 TableModel m
= (TableModel
)arg0
.getSource();
473 if (arg0
.getType() == TableModelEvent
.UPDATE
){
474 //ToDo Data Validition check.
475 String id
= m
.getValueAt(row
, 0) + "";
476 String file
= m
.getValueAt(row
, 1) + "";
477 String execOrder
= m
.getValueAt(row
, 2) + "";
478 if (id
.length() == 0) {
481 if (file
.length() == 0 && execOrder
.length() == 0){
484 if (file
.length() == 0) {
487 if (execOrder
.length() == 0) {
490 ffc
.updateBuildOptionsUserDefAntTask(row
, id
, file
, execOrder
);
500 * This method initializes jPanel13
502 * @return javax.swing.JPanel
504 private JPanel
getJPanel13() {
505 if (jPanel13
== null) {
506 jPanel13
= new JPanel();
507 jPanel13
.setLayout(new BorderLayout());
508 jPanel13
.add(getJPanel14(), java
.awt
.BorderLayout
.WEST
);
509 jPanel13
.add(getJPanel18(), java
.awt
.BorderLayout
.CENTER
);
515 * This method initializes jPanel14
517 * @return javax.swing.JPanel
519 private JPanel
getJPanel14() {
520 if (jPanel14
== null) {
521 jLabel6
= new JLabel();
522 jLabel6
.setText("FFS Types");
523 jPanel14
= new JPanel();
524 jPanel14
.setPreferredSize(new java
.awt
.Dimension(120,300));
525 jPanel14
.add(jLabel6
, null);
526 jPanel14
.add(getJScrollPane4(), null);
532 * This method initializes jPanel18
534 * @return javax.swing.JPanel
536 private JPanel
getJPanel18() {
537 if (jPanel18
== null) {
538 jPanel18
= new JPanel();
539 jPanel18
.setLayout(new BorderLayout());
540 jPanel18
.add(getJPanel15(), java
.awt
.BorderLayout
.NORTH
);
541 jPanel18
.add(getJPanel16(), java
.awt
.BorderLayout
.SOUTH
);
542 jPanel18
.add(getJPanel17(), java
.awt
.BorderLayout
.EAST
);
543 jPanel18
.add(getJPanel19(), java
.awt
.BorderLayout
.CENTER
);
549 * This method initializes jScrollPane4
551 * @return javax.swing.JScrollPane
553 private JScrollPane
getJScrollPane4() {
554 if (jScrollPane4
== null) {
555 jScrollPane4
= new JScrollPane();
556 jScrollPane4
.setPreferredSize(new java
.awt
.Dimension(120,330));
557 jScrollPane4
.setViewportView(getJList());
563 * This method initializes jList
565 * @return javax.swing.JList
567 private JList
getJList() {
569 jList
= new JList(listModel
);
575 * This method initializes jPanel15
577 * @return javax.swing.JPanel
579 private JPanel
getJPanel15() {
580 if (jPanel15
== null) {
581 FlowLayout flowLayout5
= new FlowLayout();
582 flowLayout5
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
583 jLabel7
= new JLabel();
584 jLabel7
.setText("Type");
585 jPanel15
= new JPanel();
586 jPanel15
.setLayout(flowLayout5
);
587 jPanel15
.add(jLabel7
, null);
588 jPanel15
.add(getJTextField6(), null);
589 jPanel15
.add(getJButton8(), null);
590 jPanel15
.add(getJButton9(), null);
596 * This method initializes jPanel16
598 * @return javax.swing.JPanel
600 private JPanel
getJPanel16() {
601 if (jPanel16
== null) {
602 FlowLayout flowLayout6
= new FlowLayout();
603 flowLayout6
.setHgap(5);
604 flowLayout6
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
605 jPanel16
= new JPanel();
606 jPanel16
.setPreferredSize(new java
.awt
.Dimension(491,130));
607 jPanel16
.setLayout(flowLayout6
);
608 jPanel16
.add(getJCheckBox5(), null);
609 jPanel16
.add(getJButton17(), null);
610 jPanel16
.add(getJButton18(), null);
611 jPanel16
.add(getJScrollPane5(), null);
617 * This method initializes jPanel17
619 * @return javax.swing.JPanel
621 private JPanel
getJPanel17() {
622 if (jPanel17
== null) {
623 jPanel17
= new JPanel();
624 jPanel17
.add(getJScrollPane7(), null);
630 * This method initializes jTextField6
632 * @return javax.swing.JTextField
634 private JTextField
getJTextField6() {
635 if (jTextField6
== null) {
636 jTextField6
= new JTextField();
637 jTextField6
.setPreferredSize(new java
.awt
.Dimension(150,20));
643 * This method initializes jButton8
645 * @return javax.swing.JButton
647 private JButton
getJButton8() {
648 if (jButton8
== null) {
649 jButton8
= new JButton();
650 jButton8
.setPreferredSize(new java
.awt
.Dimension(70,20));
651 jButton8
.setText("Add");
652 jButton8
.addActionListener(new AbstractAction() {
653 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
654 if (jTextField6
.getText().length() > 0) {
655 listModel
.addElement(jTextField6
.getText());
664 * This method initializes jButton9
666 * @return javax.swing.JButton
668 private JButton
getJButton9() {
669 if (jButton9
== null) {
670 jButton9
= new JButton();
671 jButton9
.setPreferredSize(new java
.awt
.Dimension(70,20));
672 jButton9
.setText("Delete");
673 jButton9
.addActionListener(new AbstractAction() {
674 public void actionPerformed(ActionEvent arg0
){
675 listModel
.remove(jList
.getSelectedIndex());
683 * This method initializes jCheckBox5
685 * @return javax.swing.JCheckBox
687 private JCheckBox
getJCheckBox5() {
688 if (jCheckBox5
== null) {
689 jCheckBox5
= new JCheckBox();
690 jCheckBox5
.setText("Attributes");
691 jCheckBox5
.setPreferredSize(new java
.awt
.Dimension(81,20));
697 * This method initializes jScrollPane5
699 * @return javax.swing.JScrollPane
701 private JScrollPane
getJScrollPane5() {
702 if (jScrollPane5
== null) {
703 jScrollPane5
= new JScrollPane();
704 jScrollPane5
.setPreferredSize(new java
.awt
.Dimension(350,100));
705 jScrollPane5
.setViewportView(getJTable4());
711 * This method initializes jTable4
713 * @return javax.swing.JTable
715 private JTable
getJTable4() {
716 if (jTable4
== null) {
717 ffsAttributesTableModel
= new DefaultTableModel();
718 jTable4
= new JTable(ffsAttributesTableModel
);
719 jTable4
.setPreferredSize(new java
.awt
.Dimension(400,80));
720 ffsAttributesTableModel
.addColumn("Name");
721 ffsAttributesTableModel
.addColumn("Value");
727 * This method initializes jPanel19
729 * @return javax.swing.JPanel
731 private JPanel
getJPanel19() {
732 if (jPanel19
== null) {
733 jPanel19
= new JPanel();
734 jPanel19
.setLayout(new CardLayout());
735 jPanel19
.add(getJPanel21(), getJPanel21().getName());
736 jPanel19
.add(getJPanel22(), getJPanel22().getName());
742 * This method initializes jPanel20
744 * @return javax.swing.JPanel
746 private JPanel
getJPanel20() {
747 if (jPanel20
== null) {
748 jLabel15
= new JLabel();
749 jLabel15
.setText("Tag Name");
750 FlowLayout flowLayout9
= new FlowLayout();
751 flowLayout9
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
752 jLabel14
= new JLabel();
753 jLabel14
.setText("Build Targets");
754 jLabel12
= new JLabel();
755 jLabel12
.setText("Tool Command");
756 jLabel11
= new JLabel();
757 jLabel11
.setText("Supported Arch");
758 jLabel10
= new JLabel();
759 jLabel10
.setText("Tool Chain Family");
760 jLabel9
= new JLabel();
761 jLabel9
.setText("Option Contents");
762 jPanel20
= new JPanel();
763 jPanel20
.setLayout(flowLayout9
);
764 jPanel20
.add(jLabel14
, null);
765 jPanel20
.add(getJTextField12(), null);
766 jPanel20
.add(jLabel10
, null);
767 jPanel20
.add(getJComboBox2(), null);
768 jPanel20
.add(jLabel12
, null);
769 jPanel20
.add(getJTextField8(), null);
770 jPanel20
.add(jLabel11
, null);
771 jPanel20
.add(getJCheckBox9(), null);
772 jPanel20
.add(getJCheckBox10(), null);
773 jPanel20
.add(getJCheckBox11(), null);
774 jPanel20
.add(getJCheckBox12(), null);
775 jPanel20
.add(getJCheckBox13(), null);
776 jPanel20
.add(getJCheckBox14(), null);
777 jPanel20
.add(jLabel15
, null);
778 jPanel20
.add(getJTextField13(), null);
779 jPanel20
.add(jLabel9
, null);
780 jPanel20
.add(getJTextField7(), null);
781 jPanel20
.add(getJButton10(), null);
782 jPanel20
.add(getJButton11(), null);
783 jPanel20
.add(getJButton19(), null);
784 jPanel20
.add(getJScrollPane6(), null);
790 * This method initializes jTextField7
792 * @return javax.swing.JTextField
794 private JTextField
getJTextField7() {
795 if (jTextField7
== null) {
796 jTextField7
= new JTextField();
797 jTextField7
.setPreferredSize(new java
.awt
.Dimension(300,20));
803 * This method initializes jComboBox2
805 * @return javax.swing.JComboBox
807 private JComboBox
getJComboBox2() {
808 if (jComboBox2
== null) {
809 jComboBox2
= new JComboBox();
810 jComboBox2
.setPreferredSize(new java
.awt
.Dimension(80,20));
811 jComboBox2
.addItem("MSFT");
812 jComboBox2
.addItem("GCC");
813 jComboBox2
.addItem("CYGWIN");
814 jComboBox2
.addItem("INTEL");
815 jComboBox2
.setSelectedIndex(0);
821 * This method initializes jTextField8
823 * @return javax.swing.JTextField
825 private JTextField
getJTextField8() {
826 if (jTextField8
== null) {
827 jTextField8
= new JTextField();
828 jTextField8
.setPreferredSize(new java
.awt
.Dimension(110,20));
834 * This method initializes jScrollPane6
836 * @return javax.swing.JScrollPane
838 private JScrollPane
getJScrollPane6() {
839 if (jScrollPane6
== null) {
840 jScrollPane6
= new JScrollPane();
841 jScrollPane6
.setPreferredSize(new java
.awt
.Dimension(630,200));
842 jScrollPane6
.setViewportView(getJTable5());
848 * This method initializes jTable5
850 * @return javax.swing.JTable
852 private JTable
getJTable5() {
853 if (jTable5
== null) {
854 optionsTableModel
= new DefaultTableModel();
855 jTable5
= new JTable(optionsTableModel
);
856 optionsTableModel
.addColumn("BuildTargets");
857 optionsTableModel
.addColumn("ToolChainFamily");
858 optionsTableModel
.addColumn("SupportedArch");
859 optionsTableModel
.addColumn("ToolCommand");
860 optionsTableModel
.addColumn("TagName");
861 optionsTableModel
.addColumn("Contents");
863 TableColumn toolFamilyCol
= jTable5
.getColumnModel().getColumn(1);
864 JComboBox cb
= new JComboBox();
867 cb
.addItem("CYGWIN");
869 toolFamilyCol
.setCellEditor(new DefaultCellEditor(cb
));
871 jTable5
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
872 jTable5
.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
873 public void valueChanged(ListSelectionEvent e
) {
875 if (e
.getValueIsAdjusting()){
878 ListSelectionModel lsm
= (ListSelectionModel
)e
.getSource();
879 if (lsm
.isSelectionEmpty()) {
883 selectedRow
= lsm
.getMinSelectionIndex();
888 jTable5
.getModel().addTableModelListener(new TableModelListener() {
889 public void tableChanged(TableModelEvent arg0
) {
890 // TODO Auto-generated method stub
891 int row
= arg0
.getFirstRow();
892 TableModel m
= (TableModel
)arg0
.getSource();
893 if (arg0
.getType() == TableModelEvent
.UPDATE
){
894 //ToDo Data Validition check.
895 String targetName
= m
.getValueAt(row
, 0) + "";
896 String toolChain
= m
.getValueAt(row
, 1) + "";
897 String supArch
= m
.getValueAt(row
, 2) + "";
898 String toolCmd
= m
.getValueAt(row
, 3) + "";
899 String tagName
= m
.getValueAt(row
, 4) + "";
900 String contents
= m
.getValueAt(row
, 5) + "";
901 ffc
.updateBuildOptionsOpt(row
, targetName
, toolChain
, tagName
, toolCmd
, supArch
, contents
);
910 * This method initializes jButton10
912 * @return javax.swing.JButton
914 private JButton
getJButton10() {
915 if (jButton10
== null) {
916 jButton10
= new JButton();
917 jButton10
.setText("Add");
918 jButton10
.setPreferredSize(new java
.awt
.Dimension(70,20));
919 jButton10
.addActionListener(new AbstractAction() {
920 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
921 boolean[] boolArray
= {jCheckBox9
.isSelected(),jCheckBox10
.isSelected(),jCheckBox11
.isSelected(),
922 jCheckBox12
.isSelected(),jCheckBox13
.isSelected(),jCheckBox14
.isSelected()};
923 String s
= boolToList(boolArray
);
924 Object
[] o
= {jTextField12
.getText(), jComboBox2
.getSelectedItem(), s
,
925 jTextField8
.getText(), jTextField13
.getText(), jTextField7
.getText()};
926 optionsTableModel
.addRow(o
);
927 ffc
.genBuildOptionsOpt(jTextField12
.getText(), jComboBox2
.getSelectedItem()+"", jTextField13
.getText(), jTextField8
.getText(), s
, jTextField7
.getText());
934 private String
boolToList (boolean[] bool
) {
959 * This method initializes jButton11
961 * @return javax.swing.JButton
963 private JButton
getJButton11() {
964 if (jButton11
== null) {
965 jButton11
= new JButton();
966 jButton11
.setText("Delete");
967 jButton11
.setPreferredSize(new java
.awt
.Dimension(70,20));
968 jButton11
.addActionListener(new AbstractAction() {
969 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
970 if (selectedRow
>= 0) {
971 optionsTableModel
.removeRow(selectedRow
);
972 ffc
.removeBuildOptionsOpt(selectedRow
);
981 * This method initializes jPanel21
983 * @return javax.swing.JPanel
985 private JPanel
getJPanel21() {
986 if (jPanel21
== null) {
987 jLabel13
= new JLabel();
988 jLabel13
.setText("EncapsulationTag");
989 jLabel8
= new JLabel();
990 jLabel8
.setText("EncapsulationType");
991 jPanel21
= new JPanel();
992 jPanel21
.setName("jPanel21");
993 jPanel21
.add(jLabel8
, null);
994 jPanel21
.add(getJTextField9(), null);
995 jPanel21
.add(jLabel13
, null);
996 jPanel21
.add(getJTextField10(), null);
997 jPanel21
.add(getJButton12(), null);
998 jPanel21
.add(getJButton13(), null);
999 jPanel21
.add(getJButton16(), null);
1005 * This method initializes jButton12
1007 * @return javax.swing.JButton
1009 private JButton
getJButton12() {
1010 if (jButton12
== null) {
1011 jButton12
= new JButton();
1012 jButton12
.setText("Add Sections");
1013 jButton12
.setPreferredSize(new java
.awt
.Dimension(109,20));
1014 jButton12
.addActionListener(new AbstractAction(){
1015 public void actionPerformed(ActionEvent arg0
){
1023 * This method initializes jButton13
1025 * @return javax.swing.JButton
1027 private JButton
getJButton13() {
1028 if (jButton13
== null) {
1029 jButton13
= new JButton();
1030 jButton13
.setText("Add Section");
1031 jButton13
.setPreferredSize(new java
.awt
.Dimension(102,20));
1032 jButton13
.addActionListener(new AbstractAction(){
1033 public void actionPerformed(ActionEvent arg0
){
1034 CardLayout cl
= (CardLayout
)jPanel19
.getLayout();
1043 * This method initializes jTextField9
1045 * @return javax.swing.JTextField
1047 private JTextField
getJTextField9() {
1048 if (jTextField9
== null) {
1049 jTextField9
= new JTextField();
1050 jTextField9
.setPreferredSize(new java
.awt
.Dimension(250,20));
1056 * This method initializes jTextField10
1058 * @return javax.swing.JTextField
1060 private JTextField
getJTextField10() {
1061 if (jTextField10
== null) {
1062 jTextField10
= new JTextField();
1063 jTextField10
.setPreferredSize(new java
.awt
.Dimension(250,20));
1065 return jTextField10
;
1069 * This method initializes jPanel22
1071 * @return javax.swing.JPanel
1073 private JPanel
getJPanel22() {
1074 if (jPanel22
== null) {
1075 FlowLayout flowLayout7
= new FlowLayout();
1076 flowLayout7
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
1077 jPanel22
= new JPanel();
1078 jPanel22
.setLayout(flowLayout7
);
1079 jPanel22
.setName("jPanel22");
1080 jPanel22
.add(getJCheckBox6(), null);
1081 jPanel22
.add(getJComboBox4(), null);
1082 jPanel22
.add(getJCheckBox7(), null);
1083 jPanel22
.add(getJComboBox5(), null);
1084 jPanel22
.add(getJCheckBox8(), null);
1085 jPanel22
.add(getJTextField11(), null);
1086 jPanel22
.add(getJButton14(), null);
1087 jPanel22
.add(getJButton15(), null);
1093 * This method initializes jCheckBox6
1095 * @return javax.swing.JCheckBox
1097 private JCheckBox
getJCheckBox6() {
1098 if (jCheckBox6
== null) {
1099 jCheckBox6
= new JCheckBox();
1100 jCheckBox6
.setText("Section Type");
1101 jCheckBox6
.setPreferredSize(new java
.awt
.Dimension(98,20));
1107 * This method initializes jComboBox4
1109 * @return javax.swing.JComboBox
1111 private JComboBox
getJComboBox4() {
1112 if (jComboBox4
== null) {
1113 jComboBox4
= new JComboBox();
1114 jComboBox4
.setPreferredSize(new java
.awt
.Dimension(260,20));
1116 jComboBox4
.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");
1117 jComboBox4
.addItem("EFI_SECTION_VERSION");
1118 jComboBox4
.addItem("EFI_SECTION_USER_INTERFACE");
1119 jComboBox4
.addItem("EFI_SECTION_DXE_DEPEX");
1120 jComboBox4
.addItem("EFI_SECTION_PEI_DEPEX");
1121 jComboBox4
.addItem("EFI_SECTION_PE32");
1122 jComboBox4
.addItem("EFI_SECTION_PIC");
1123 jComboBox4
.addItem("EFI_SECTION_TE");
1124 jComboBox4
.addItem("EFI_SECTION_RAW");
1125 jComboBox4
.addItem("EFI_SECTION_COMPRESSION");
1126 jComboBox4
.addItem("EFI_SECTION_GUID_DEFINED");
1127 jComboBox4
.addItem("EFI_SECTION_COMPATIBILITY16");
1128 jComboBox4
.addItem("EFI_SECTION_FIRMWARE_VOLUME_IMAGE");
1129 jComboBox4
.setSelectedIndex(0);
1135 * This method initializes jCheckBox7
1137 * @return javax.swing.JCheckBox
1139 private JCheckBox
getJCheckBox7() {
1140 if (jCheckBox7
== null) {
1141 jCheckBox7
= new JCheckBox();
1142 jCheckBox7
.setPreferredSize(new java
.awt
.Dimension(120,20));
1143 jCheckBox7
.setText("Compressible");
1149 * This method initializes jComboBox5
1151 * @return javax.swing.JComboBox
1153 private JComboBox
getJComboBox5() {
1154 if (jComboBox5
== null) {
1155 jComboBox5
= new JComboBox();
1156 jComboBox5
.setPreferredSize(new java
.awt
.Dimension(80,20));
1158 jComboBox5
.addItem("false");
1159 jComboBox5
.addItem("true");
1160 jComboBox5
.setSelectedIndex(0);
1166 * This method initializes jCheckBox8
1168 * @return javax.swing.JCheckBox
1170 private JCheckBox
getJCheckBox8() {
1171 if (jCheckBox8
== null) {
1172 jCheckBox8
= new JCheckBox();
1173 jCheckBox8
.setText("Binding Order");
1174 jCheckBox8
.setPreferredSize(new java
.awt
.Dimension(103,20));
1180 * This method initializes jTextField11
1182 * @return javax.swing.JTextField
1184 private JTextField
getJTextField11() {
1185 if (jTextField11
== null) {
1186 jTextField11
= new JTextField();
1187 jTextField11
.setPreferredSize(new java
.awt
.Dimension(150,20));
1189 return jTextField11
;
1193 * This method initializes jButton14
1195 * @return javax.swing.JButton
1197 private JButton
getJButton14() {
1198 if (jButton14
== null) {
1199 jButton14
= new JButton();
1200 jButton14
.setText("Add");
1201 jButton14
.setPreferredSize(new java
.awt
.Dimension(70,20));
1202 jButton14
.addActionListener(new AbstractAction(){
1203 public void actionPerformed(ActionEvent arg0
){
1211 * This method initializes jButton15
1213 * @return javax.swing.JButton
1215 private JButton
getJButton15() {
1216 if (jButton15
== null) {
1217 jButton15
= new JButton();
1218 jButton15
.setPreferredSize(new java
.awt
.Dimension(70,20));
1219 jButton15
.setText("Delete");
1225 * This method initializes jButton16
1227 * @return javax.swing.JButton
1229 private JButton
getJButton16() {
1230 if (jButton16
== null) {
1231 jButton16
= new JButton();
1232 jButton16
.setText("Delete");
1233 jButton16
.setPreferredSize(new java
.awt
.Dimension(70,20));
1239 * This method initializes jScrollPane7
1241 * @return javax.swing.JScrollPane
1243 private JScrollPane
getJScrollPane7() {
1244 if (jScrollPane7
== null) {
1245 jScrollPane7
= new JScrollPane();
1246 jScrollPane7
.setPreferredSize(new java
.awt
.Dimension(110,200));
1247 jScrollPane7
.setViewportView(getJTree());
1249 return jScrollPane7
;
1253 * This method initializes jTree
1255 * @return javax.swing.JTree
1257 private JTree
getJTree() {
1258 if (jTree
== null) {
1259 jTree
= new JTree();
1265 * This method initializes jButton17
1267 * @return javax.swing.JButton
1269 private JButton
getJButton17() {
1270 if (jButton17
== null) {
1271 jButton17
= new JButton();
1272 jButton17
.setPreferredSize(new java
.awt
.Dimension(70,20));
1273 jButton17
.setText("Add");
1274 jButton17
.addActionListener(new AbstractAction() {
1275 public void actionPerformed(ActionEvent arg0
){
1276 Object
[] o
= {"", ""};
1277 ffsAttributesTableModel
.addRow(o
);
1285 * This method initializes jButton18
1287 * @return javax.swing.JButton
1289 private JButton
getJButton18() {
1290 if (jButton18
== null) {
1291 jButton18
= new JButton();
1292 jButton18
.setPreferredSize(new java
.awt
.Dimension(70,20));
1293 jButton18
.setText("Delete");
1294 jButton18
.addActionListener(new AbstractAction(){
1295 public void actionPerformed(ActionEvent arg0
){
1296 if (jTable4
.getSelectedRow() >= 0){
1297 ffsAttributesTableModel
.removeRow(jTable4
.getSelectedRow());
1306 * This method initializes jButton19
1308 * @return javax.swing.JButton
1310 private JButton
getJButton19() {
1311 if (jButton19
== null) {
1312 jButton19
= new JButton();
1313 jButton19
.setPreferredSize(new java
.awt
.Dimension(75,20));
1314 jButton19
.setEnabled(false);
1315 jButton19
.setText("Update");
1321 * This method initializes jCheckBox9
1323 * @return javax.swing.JCheckBox
1325 private JCheckBox
getJCheckBox9() {
1326 if (jCheckBox9
== null) {
1327 jCheckBox9
= new JCheckBox();
1328 jCheckBox9
.setPreferredSize(new java
.awt
.Dimension(50,20));
1329 jCheckBox9
.setText("IA32");
1335 * This method initializes jCheckBox10
1337 * @return javax.swing.JCheckBox
1339 private JCheckBox
getJCheckBox10() {
1340 if (jCheckBox10
== null) {
1341 jCheckBox10
= new JCheckBox();
1342 jCheckBox10
.setPreferredSize(new java
.awt
.Dimension(50,20));
1343 jCheckBox10
.setText("IPF");
1349 * This method initializes jCheckBox11
1351 * @return javax.swing.JCheckBox
1353 private JCheckBox
getJCheckBox11() {
1354 if (jCheckBox11
== null) {
1355 jCheckBox11
= new JCheckBox();
1356 jCheckBox11
.setText("X64");
1357 jCheckBox11
.setPreferredSize(new java
.awt
.Dimension(47,20));
1363 * This method initializes jCheckBox12
1365 * @return javax.swing.JCheckBox
1367 private JCheckBox
getJCheckBox12() {
1368 if (jCheckBox12
== null) {
1369 jCheckBox12
= new JCheckBox();
1370 jCheckBox12
.setPreferredSize(new java
.awt
.Dimension(50,20));
1371 jCheckBox12
.setText("EBC");
1377 * This method initializes jCheckBox13
1379 * @return javax.swing.JCheckBox
1381 private JCheckBox
getJCheckBox13() {
1382 if (jCheckBox13
== null) {
1383 jCheckBox13
= new JCheckBox();
1384 jCheckBox13
.setPreferredSize(new java
.awt
.Dimension(55,20));
1385 jCheckBox13
.setText("ARM");
1391 * This method initializes jCheckBox14
1393 * @return javax.swing.JCheckBox
1395 private JCheckBox
getJCheckBox14() {
1396 if (jCheckBox14
== null) {
1397 jCheckBox14
= new JCheckBox();
1398 jCheckBox14
.setPreferredSize(new java
.awt
.Dimension(50,20));
1399 jCheckBox14
.setText("PPC");
1405 * This method initializes jTextField12
1407 * @return javax.swing.JTextField
1409 private JTextField
getJTextField12() {
1410 if (jTextField12
== null) {
1411 jTextField12
= new JTextField();
1412 jTextField12
.setPreferredSize(new java
.awt
.Dimension(150,20));
1414 return jTextField12
;
1418 * This method initializes jTextField13
1420 * @return javax.swing.JTextField
1422 private JTextField
getJTextField13() {
1423 if (jTextField13
== null) {
1424 jTextField13
= new JTextField();
1425 jTextField13
.setPreferredSize(new java
.awt
.Dimension(140,20));
1427 return jTextField13
;
1433 public static void main(String
[] args
) {
1434 // TODO Auto-generated method stub
1435 new FpdBuildOptions().setVisible(true);
1439 * This is the default constructor
1441 public FpdBuildOptions() {
1444 this.setVisible(true);
1447 public FpdBuildOptions(PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
1449 ffc
= new FpdFileContents(fpd
);
1453 private void init(FpdFileContents ffc
) {
1458 private void initOptionTable() {
1459 if (ffc
.getBuildOptionsOptCount() == 0) {
1460 //ToDo get default options from *.txt file
1463 String
[][] saa
= new String
[ffc
.getBuildOptionsOptCount()][6];
1464 ffc
.getBuildOptionsOpts(saa
);
1465 for (int i
= 0; i
< saa
.length
; ++i
) {
1466 optionsTableModel
.addRow(saa
[i
]);
1470 private void initAntTaskTable() {
1471 if (ffc
.getBuildOptionsUserDefAntTaskCount() == 0) {
1474 String
[][] saa
= new String
[ffc
.getBuildOptionsUserDefAntTaskCount()][3];
1475 ffc
.getBuildOptionsUserDefAntTasks(saa
);
1476 for (int i
= 0; i
< saa
.length
; ++i
) {
1477 antTaskTableModel
.addRow(saa
[i
]);
1481 * This method initializes this
1485 private void initialize() {
1486 this.setSize(722, 439);
1487 this.setTitle("FPD Build Options");
1488 this.setContentPane(getJContentPane());
1492 * This method initializes jContentPane
1494 * @return javax.swing.JPanel
1496 private JPanel
getJContentPane() {
1497 if (jContentPane
== null) {
1498 jContentPane
= new JPanel();
1499 jContentPane
.setLayout(new BorderLayout());
1500 jContentPane
.add(getJPanel(), java
.awt
.BorderLayout
.SOUTH
);
1501 jContentPane
.add(getJPanel1(), java
.awt
.BorderLayout
.NORTH
);
1502 jContentPane
.add(getJPanel2(), java
.awt
.BorderLayout
.WEST
);
1503 jContentPane
.add(getJPanel3(), java
.awt
.BorderLayout
.EAST
);
1504 jContentPane
.add(getJTabbedPane(), java
.awt
.BorderLayout
.CENTER
);
1506 return jContentPane
;
1509 } // @jve:decl-index=0:visual-constraint="10,10"