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 JTextField jTextField2
= null;
70 private JLabel jLabel3
= null;
71 private JTextField jTextField3
= null;
72 private JButton jButton4
= null;
73 private JButton jButton5
= null;
74 private JTextField jTextField4
= null;
75 private JScrollPane jScrollPane2
= null;
76 private JTable jTable2
= null;
77 private DefaultTableModel fileNameTableModel
= null;
78 private DefaultTableModel imageEntryPointTableModel
= null;
79 private DefaultTableModel outputDirectoryTableModel
= null;
80 private DefaultTableModel antTaskTableModel
= null;
81 private DefaultTableModel ffsAttributesTableModel
= null;
82 private DefaultTableModel optionsTableModel
= null;
83 private JPanel jPanel13
= null;
84 private JPanel jPanel14
= null;
85 private JPanel jPanel18
= null;
86 private JScrollPane jScrollPane4
= null;
87 private JLabel jLabel6
= null;
88 private JList jList
= null;
89 private JPanel jPanel15
= null;
90 private JPanel jPanel16
= null;
91 private JPanel jPanel17
= null;
92 private JLabel jLabel7
= null;
93 private JTextField jTextField6
= null;
94 private JButton jButton8
= null;
95 private JButton jButton9
= null;
96 private JCheckBox jCheckBox5
= null;
97 private JScrollPane jScrollPane5
= null;
98 private JTable jTable4
= null;
99 private JPanel jPanel19
= null;
100 private JPanel jPanel20
= null;
101 private JLabel jLabel9
= null;
102 private JTextField jTextField7
= null;
103 private JLabel jLabel10
= null;
104 private JComboBox jComboBox2
= null;
105 private JLabel jLabel11
= null;
106 private JLabel jLabel12
= null;
107 private JTextField jTextField8
= null;
108 private JScrollPane jScrollPane6
= null;
109 private JTable jTable5
= null;
110 private JButton jButton10
= null;
111 private JButton jButton11
= null;
112 private JPanel jPanel21
= null;
113 private JButton jButton12
= null;
114 private JButton jButton13
= null;
115 private JLabel jLabel8
= null;
116 private JTextField jTextField9
= null;
117 private JLabel jLabel13
= null;
118 private JTextField jTextField10
= null;
119 private JPanel jPanel22
= null;
120 private JCheckBox jCheckBox6
= null;
121 private JComboBox jComboBox4
= null;
122 private JCheckBox jCheckBox7
= null;
123 private JComboBox jComboBox5
= null;
124 private JCheckBox jCheckBox8
= null;
125 private JTextField jTextField11
= null;
126 private JButton jButton14
= null;
127 private JButton jButton15
= null;
128 private JButton jButton16
= null;
129 private DefaultListModel listModel
= new DefaultListModel();
130 private JScrollPane jScrollPane7
= null;
131 private JTree jTree
= null;
132 private JButton jButton17
= null;
133 private JButton jButton18
= null;
134 private FpdFileContents ffc
= null;
135 private JButton jButton19
= null;
136 private JCheckBox jCheckBox9
= null;
137 private JCheckBox jCheckBox10
= null;
138 private JCheckBox jCheckBox11
= null;
139 private JCheckBox jCheckBox12
= null;
140 private JCheckBox jCheckBox13
= null;
141 private JCheckBox jCheckBox14
= null;
142 private JLabel jLabel14
= null;
143 private JTextField jTextField12
= null;
144 private JTextField jTextField13
= null;
145 private JLabel jLabel15
= null;
146 private int selectedRow
= -1;
147 private JLabel jLabel
= null;
148 private JLabel jLabel1
= null;
150 * This method initializes jPanel
152 * @return javax.swing.JPanel
154 private JPanel
getJPanel() {
155 if (jPanel
== null) {
156 jPanel
= new JPanel();
162 * This method initializes jPanel1
164 * @return javax.swing.JPanel
166 private JPanel
getJPanel1() {
167 if (jPanel1
== null) {
168 jPanel1
= new JPanel();
174 * This method initializes jPanel2
176 * @return javax.swing.JPanel
178 private JPanel
getJPanel2() {
179 if (jPanel2
== null) {
180 jPanel2
= new JPanel();
186 * This method initializes jPanel3
188 * @return javax.swing.JPanel
190 private JPanel
getJPanel3() {
191 if (jPanel3
== null) {
192 jPanel3
= new JPanel();
198 * This method initializes jTabbedPane
200 * @return javax.swing.JTabbedPane
202 private JTabbedPane
getJTabbedPane() {
203 if (jTabbedPane
== null) {
204 jTabbedPane
= new JTabbedPane();
205 jTabbedPane
.addTab("FFS", null, getJPanel13(), null);
206 jTabbedPane
.addTab("Options", null, getJPanel20(), null);
207 jTabbedPane
.addTab("User Defined ANT Tasks", null, getJPanel8(), null);
214 * This method initializes jPanel8
216 * @return javax.swing.JPanel
218 private JPanel
getJPanel8() {
219 if (jPanel8
== null) {
220 jPanel8
= new JPanel();
221 jPanel8
.setLayout(new BorderLayout());
222 jPanel8
.add(getJPanel9(), java
.awt
.BorderLayout
.NORTH
);
223 jPanel8
.add(getJPanel10(), java
.awt
.BorderLayout
.SOUTH
);
224 jPanel8
.add(getJPanel11(), java
.awt
.BorderLayout
.CENTER
);
231 * This method initializes jPanel9
233 * @return javax.swing.JPanel
235 private JPanel
getJPanel9() {
236 if (jPanel9
== null) {
237 jLabel
= new JLabel();
238 jLabel
.setText("ANT Task File");
239 jLabel
.setPreferredSize(new java
.awt
.Dimension(80,20));
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(jLabel
, null);
247 jPanel9
.add(getJTextField2(), null);
248 jPanel9
.add(jLabel3
, null);
249 jPanel9
.add(getJTextField3(), null);
255 * This method initializes jPanel10
257 * @return javax.swing.JPanel
259 private JPanel
getJPanel10() {
260 if (jPanel10
== null) {
261 jPanel10
= new JPanel();
267 * This method initializes jPanel11
269 * @return javax.swing.JPanel
271 private JPanel
getJPanel11() {
272 if (jPanel11
== null) {
273 jLabel1
= new JLabel();
274 jLabel1
.setText("ANT Command Options");
275 jLabel1
.setPreferredSize(new java
.awt
.Dimension(131,20));
276 FlowLayout flowLayout3
= new FlowLayout();
277 flowLayout3
.setHgap(5);
278 flowLayout3
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
279 jPanel11
= new JPanel();
280 jPanel11
.setLayout(flowLayout3
);
281 jPanel11
.add(jLabel1
, null);
282 jPanel11
.add(getJTextField4(), null);
283 jPanel11
.add(getJButton4(), null);
284 jPanel11
.add(getJButton5(), null);
285 jPanel11
.add(getJScrollPane2(), null);
291 * This method initializes jTextField2
293 * @return javax.swing.JTextField
295 private JTextField
getJTextField2() {
296 if (jTextField2
== null) {
297 jTextField2
= new JTextField();
298 jTextField2
.setPreferredSize(new java
.awt
.Dimension(200,20));
304 * This method initializes jTextField3
306 * @return javax.swing.JTextField
308 private JTextField
getJTextField3() {
309 if (jTextField3
== null) {
310 jTextField3
= new JTextField();
311 jTextField3
.setPreferredSize(new java
.awt
.Dimension(100,20));
317 * This method initializes jButton4
319 * @return javax.swing.JButton
321 private JButton
getJButton4() {
322 if (jButton4
== null) {
323 jButton4
= new JButton();
324 jButton4
.setPreferredSize(new java
.awt
.Dimension(90,20));
325 jButton4
.setText("Add");
326 jButton4
.addActionListener(new ActionListener() {
327 public void actionPerformed(ActionEvent e
) {
328 Object
[] o
= {jTextField3
.getText(), null, null};
329 o
[1] = jTextField2
.getText();
330 o
[2] = jTextField4
.getText();
331 ffc
.genBuildOptionsUserDefAntTask(o
[0]+"", null, o
[2]+"");
332 antTaskTableModel
.addRow(o
);
341 * This method initializes jButton5
343 * @return javax.swing.JButton
345 private JButton
getJButton5() {
346 if (jButton5
== null) {
347 jButton5
= new JButton();
348 jButton5
.setPreferredSize(new java
.awt
.Dimension(90,20));
349 jButton5
.setText("Delete");
350 jButton5
.addActionListener(new ActionListener() {
351 public void actionPerformed(ActionEvent e
) {
352 if (selectedRow
>= 0) {
353 antTaskTableModel
.removeRow(selectedRow
);
354 ffc
.removeBuildOptionsUserDefAntTask(selectedRow
);
363 * This method initializes jTextField4
365 * @return javax.swing.JTextField
367 private JTextField
getJTextField4() {
368 if (jTextField4
== null) {
369 jTextField4
= new JTextField();
370 jTextField4
.setPreferredSize(new java
.awt
.Dimension(270,20));
371 jTextField4
.setEnabled(true);
377 * This method initializes jScrollPane2
379 * @return javax.swing.JScrollPane
381 private JScrollPane
getJScrollPane2() {
382 if (jScrollPane2
== null) {
383 jScrollPane2
= new JScrollPane();
384 jScrollPane2
.setPreferredSize(new java
.awt
.Dimension(600,100));
385 jScrollPane2
.setViewportView(getJTable2());
391 * This method initializes jTable2
393 * @return javax.swing.JTable
395 private JTable
getJTable2() {
396 if (jTable2
== null) {
397 antTaskTableModel
= new DefaultTableModel();
398 jTable2
= new JTable(antTaskTableModel
);
399 antTaskTableModel
.addColumn("ID");
400 antTaskTableModel
.addColumn("Filename");
401 antTaskTableModel
.addColumn("ANT Command Options");
403 jTable2
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
404 jTable2
.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
405 public void valueChanged(ListSelectionEvent e
) {
407 if (e
.getValueIsAdjusting()){
410 ListSelectionModel lsm
= (ListSelectionModel
)e
.getSource();
411 if (lsm
.isSelectionEmpty()) {
415 selectedRow
= lsm
.getMinSelectionIndex();
420 jTable2
.getModel().addTableModelListener(new TableModelListener() {
421 public void tableChanged(TableModelEvent arg0
) {
422 // TODO Auto-generated method stub
423 int row
= arg0
.getFirstRow();
424 TableModel m
= (TableModel
)arg0
.getSource();
425 if (arg0
.getType() == TableModelEvent
.UPDATE
){
426 //ToDo Data Validition check.
427 String id
= m
.getValueAt(row
, 0) + "";
428 String file
= m
.getValueAt(row
, 1) + "";
429 String execOrder
= m
.getValueAt(row
, 2) + "";
430 if (id
.length() == 0) {
433 if (file
.length() == 0 && execOrder
.length() == 0){
436 if (file
.length() == 0) {
439 if (execOrder
.length() == 0) {
442 ffc
.updateBuildOptionsUserDefAntTask(row
, id
, file
, execOrder
);
452 * This method initializes jPanel13
454 * @return javax.swing.JPanel
456 private JPanel
getJPanel13() {
457 if (jPanel13
== null) {
458 jPanel13
= new JPanel();
459 jPanel13
.setLayout(new BorderLayout());
460 jPanel13
.add(getJPanel14(), java
.awt
.BorderLayout
.WEST
);
461 jPanel13
.add(getJPanel18(), java
.awt
.BorderLayout
.CENTER
);
467 * This method initializes jPanel14
469 * @return javax.swing.JPanel
471 private JPanel
getJPanel14() {
472 if (jPanel14
== null) {
473 jLabel6
= new JLabel();
474 jLabel6
.setText("FFS Types");
475 jPanel14
= new JPanel();
476 jPanel14
.setPreferredSize(new java
.awt
.Dimension(120,300));
477 jPanel14
.add(jLabel6
, null);
478 jPanel14
.add(getJScrollPane4(), null);
484 * This method initializes jPanel18
486 * @return javax.swing.JPanel
488 private JPanel
getJPanel18() {
489 if (jPanel18
== null) {
490 jPanel18
= new JPanel();
491 jPanel18
.setLayout(new BorderLayout());
492 jPanel18
.add(getJPanel15(), java
.awt
.BorderLayout
.NORTH
);
493 jPanel18
.add(getJPanel16(), java
.awt
.BorderLayout
.SOUTH
);
494 jPanel18
.add(getJPanel17(), java
.awt
.BorderLayout
.EAST
);
495 jPanel18
.add(getJPanel19(), java
.awt
.BorderLayout
.CENTER
);
501 * This method initializes jScrollPane4
503 * @return javax.swing.JScrollPane
505 private JScrollPane
getJScrollPane4() {
506 if (jScrollPane4
== null) {
507 jScrollPane4
= new JScrollPane();
508 jScrollPane4
.setPreferredSize(new java
.awt
.Dimension(120,330));
509 jScrollPane4
.setViewportView(getJList());
515 * This method initializes jList
517 * @return javax.swing.JList
519 private JList
getJList() {
521 jList
= new JList(listModel
);
527 * This method initializes jPanel15
529 * @return javax.swing.JPanel
531 private JPanel
getJPanel15() {
532 if (jPanel15
== null) {
533 FlowLayout flowLayout5
= new FlowLayout();
534 flowLayout5
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
535 jLabel7
= new JLabel();
536 jLabel7
.setText("Type");
537 jPanel15
= new JPanel();
538 jPanel15
.setLayout(flowLayout5
);
539 jPanel15
.add(jLabel7
, null);
540 jPanel15
.add(getJTextField6(), null);
541 jPanel15
.add(getJButton8(), null);
542 jPanel15
.add(getJButton9(), null);
548 * This method initializes jPanel16
550 * @return javax.swing.JPanel
552 private JPanel
getJPanel16() {
553 if (jPanel16
== null) {
554 FlowLayout flowLayout6
= new FlowLayout();
555 flowLayout6
.setHgap(5);
556 flowLayout6
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
557 jPanel16
= new JPanel();
558 jPanel16
.setPreferredSize(new java
.awt
.Dimension(491,130));
559 jPanel16
.setLayout(flowLayout6
);
560 jPanel16
.add(getJCheckBox5(), null);
561 jPanel16
.add(getJButton17(), null);
562 jPanel16
.add(getJButton18(), null);
563 jPanel16
.add(getJScrollPane5(), null);
569 * This method initializes jPanel17
571 * @return javax.swing.JPanel
573 private JPanel
getJPanel17() {
574 if (jPanel17
== null) {
575 jPanel17
= new JPanel();
576 jPanel17
.add(getJScrollPane7(), null);
582 * This method initializes jTextField6
584 * @return javax.swing.JTextField
586 private JTextField
getJTextField6() {
587 if (jTextField6
== null) {
588 jTextField6
= new JTextField();
589 jTextField6
.setPreferredSize(new java
.awt
.Dimension(150,20));
595 * This method initializes jButton8
597 * @return javax.swing.JButton
599 private JButton
getJButton8() {
600 if (jButton8
== null) {
601 jButton8
= new JButton();
602 jButton8
.setPreferredSize(new java
.awt
.Dimension(70,20));
603 jButton8
.setText("Add");
604 jButton8
.addActionListener(new AbstractAction() {
605 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
606 if (jTextField6
.getText().length() > 0) {
607 listModel
.addElement(jTextField6
.getText());
616 * This method initializes jButton9
618 * @return javax.swing.JButton
620 private JButton
getJButton9() {
621 if (jButton9
== null) {
622 jButton9
= new JButton();
623 jButton9
.setPreferredSize(new java
.awt
.Dimension(70,20));
624 jButton9
.setText("Delete");
625 jButton9
.addActionListener(new AbstractAction() {
626 public void actionPerformed(ActionEvent arg0
){
627 listModel
.remove(jList
.getSelectedIndex());
635 * This method initializes jCheckBox5
637 * @return javax.swing.JCheckBox
639 private JCheckBox
getJCheckBox5() {
640 if (jCheckBox5
== null) {
641 jCheckBox5
= new JCheckBox();
642 jCheckBox5
.setText("Attributes");
643 jCheckBox5
.setPreferredSize(new java
.awt
.Dimension(81,20));
649 * This method initializes jScrollPane5
651 * @return javax.swing.JScrollPane
653 private JScrollPane
getJScrollPane5() {
654 if (jScrollPane5
== null) {
655 jScrollPane5
= new JScrollPane();
656 jScrollPane5
.setPreferredSize(new java
.awt
.Dimension(350,100));
657 jScrollPane5
.setViewportView(getJTable4());
663 * This method initializes jTable4
665 * @return javax.swing.JTable
667 private JTable
getJTable4() {
668 if (jTable4
== null) {
669 ffsAttributesTableModel
= new DefaultTableModel();
670 jTable4
= new JTable(ffsAttributesTableModel
);
671 jTable4
.setPreferredSize(new java
.awt
.Dimension(400,80));
672 ffsAttributesTableModel
.addColumn("Name");
673 ffsAttributesTableModel
.addColumn("Value");
679 * This method initializes jPanel19
681 * @return javax.swing.JPanel
683 private JPanel
getJPanel19() {
684 if (jPanel19
== null) {
685 jPanel19
= new JPanel();
686 jPanel19
.setLayout(new CardLayout());
687 jPanel19
.add(getJPanel21(), getJPanel21().getName());
688 jPanel19
.add(getJPanel22(), getJPanel22().getName());
694 * This method initializes jPanel20
696 * @return javax.swing.JPanel
698 private JPanel
getJPanel20() {
699 if (jPanel20
== null) {
700 jLabel15
= new JLabel();
701 jLabel15
.setText("Tag Name");
702 FlowLayout flowLayout9
= new FlowLayout();
703 flowLayout9
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
704 jLabel14
= new JLabel();
705 jLabel14
.setText("Build Targets");
706 jLabel12
= new JLabel();
707 jLabel12
.setText("Tool Command");
708 jLabel11
= new JLabel();
709 jLabel11
.setText("Supported Arch");
710 jLabel10
= new JLabel();
711 jLabel10
.setText("Tool Chain Family");
712 jLabel9
= new JLabel();
713 jLabel9
.setText("Option Contents");
714 jPanel20
= new JPanel();
715 jPanel20
.setLayout(flowLayout9
);
716 jPanel20
.add(jLabel14
, null);
717 jPanel20
.add(getJTextField12(), null);
718 jPanel20
.add(jLabel10
, null);
719 jPanel20
.add(getJComboBox2(), null);
720 jPanel20
.add(jLabel12
, null);
721 jPanel20
.add(getJTextField8(), null);
722 jPanel20
.add(jLabel11
, null);
723 jPanel20
.add(getJCheckBox9(), null);
724 jPanel20
.add(getJCheckBox10(), null);
725 jPanel20
.add(getJCheckBox11(), null);
726 jPanel20
.add(getJCheckBox12(), null);
727 jPanel20
.add(getJCheckBox13(), null);
728 jPanel20
.add(getJCheckBox14(), null);
729 jPanel20
.add(jLabel15
, null);
730 jPanel20
.add(getJTextField13(), null);
731 jPanel20
.add(jLabel9
, null);
732 jPanel20
.add(getJTextField7(), null);
733 jPanel20
.add(getJButton10(), null);
734 jPanel20
.add(getJButton11(), null);
735 jPanel20
.add(getJButton19(), null);
736 jPanel20
.add(getJScrollPane6(), null);
742 * This method initializes jTextField7
744 * @return javax.swing.JTextField
746 private JTextField
getJTextField7() {
747 if (jTextField7
== null) {
748 jTextField7
= new JTextField();
749 jTextField7
.setPreferredSize(new java
.awt
.Dimension(300,20));
755 * This method initializes jComboBox2
757 * @return javax.swing.JComboBox
759 private JComboBox
getJComboBox2() {
760 if (jComboBox2
== null) {
761 jComboBox2
= new JComboBox();
762 jComboBox2
.setPreferredSize(new java
.awt
.Dimension(80,20));
763 jComboBox2
.addItem("MSFT");
764 jComboBox2
.addItem("GCC");
765 jComboBox2
.addItem("CYGWIN");
766 jComboBox2
.addItem("INTEL");
767 jComboBox2
.setSelectedIndex(0);
773 * This method initializes jTextField8
775 * @return javax.swing.JTextField
777 private JTextField
getJTextField8() {
778 if (jTextField8
== null) {
779 jTextField8
= new JTextField();
780 jTextField8
.setPreferredSize(new java
.awt
.Dimension(110,20));
786 * This method initializes jScrollPane6
788 * @return javax.swing.JScrollPane
790 private JScrollPane
getJScrollPane6() {
791 if (jScrollPane6
== null) {
792 jScrollPane6
= new JScrollPane();
793 jScrollPane6
.setPreferredSize(new java
.awt
.Dimension(630,200));
794 jScrollPane6
.setViewportView(getJTable5());
800 * This method initializes jTable5
802 * @return javax.swing.JTable
804 private JTable
getJTable5() {
805 if (jTable5
== null) {
806 optionsTableModel
= new DefaultTableModel();
807 jTable5
= new JTable(optionsTableModel
);
808 optionsTableModel
.addColumn("BuildTargets");
809 optionsTableModel
.addColumn("ToolChainFamily");
810 optionsTableModel
.addColumn("SupportedArch");
811 optionsTableModel
.addColumn("ToolCommand");
812 optionsTableModel
.addColumn("TagName");
813 optionsTableModel
.addColumn("Contents");
815 TableColumn toolFamilyCol
= jTable5
.getColumnModel().getColumn(1);
816 JComboBox cb
= new JComboBox();
819 cb
.addItem("CYGWIN");
821 toolFamilyCol
.setCellEditor(new DefaultCellEditor(cb
));
823 jTable5
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
824 jTable5
.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
825 public void valueChanged(ListSelectionEvent e
) {
827 if (e
.getValueIsAdjusting()){
830 ListSelectionModel lsm
= (ListSelectionModel
)e
.getSource();
831 if (lsm
.isSelectionEmpty()) {
835 selectedRow
= lsm
.getMinSelectionIndex();
840 jTable5
.getModel().addTableModelListener(new TableModelListener() {
841 public void tableChanged(TableModelEvent arg0
) {
842 // TODO Auto-generated method stub
843 int row
= arg0
.getFirstRow();
844 TableModel m
= (TableModel
)arg0
.getSource();
845 if (arg0
.getType() == TableModelEvent
.UPDATE
){
846 //ToDo Data Validition check.
847 String targetName
= m
.getValueAt(row
, 0) + "";
848 String toolChain
= m
.getValueAt(row
, 1) + "";
849 String supArch
= m
.getValueAt(row
, 2) + "";
850 String toolCmd
= m
.getValueAt(row
, 3) + "";
851 String tagName
= m
.getValueAt(row
, 4) + "";
852 String contents
= m
.getValueAt(row
, 5) + "";
853 ffc
.updateBuildOptionsOpt(row
, targetName
, toolChain
, tagName
, toolCmd
, supArch
, contents
);
862 * This method initializes jButton10
864 * @return javax.swing.JButton
866 private JButton
getJButton10() {
867 if (jButton10
== null) {
868 jButton10
= new JButton();
869 jButton10
.setText("Add");
870 jButton10
.setPreferredSize(new java
.awt
.Dimension(70,20));
871 jButton10
.addActionListener(new AbstractAction() {
872 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
873 boolean[] boolArray
= {jCheckBox9
.isSelected(),jCheckBox10
.isSelected(),jCheckBox11
.isSelected(),
874 jCheckBox12
.isSelected(),jCheckBox13
.isSelected(),jCheckBox14
.isSelected()};
875 String s
= boolToList(boolArray
);
876 Object
[] o
= {jTextField12
.getText(), jComboBox2
.getSelectedItem(), s
,
877 jTextField8
.getText(), jTextField13
.getText(), jTextField7
.getText()};
878 optionsTableModel
.addRow(o
);
879 ffc
.genBuildOptionsOpt(jTextField12
.getText(), jComboBox2
.getSelectedItem()+"", jTextField13
.getText(), jTextField8
.getText(), s
, jTextField7
.getText());
886 private String
boolToList (boolean[] bool
) {
911 * This method initializes jButton11
913 * @return javax.swing.JButton
915 private JButton
getJButton11() {
916 if (jButton11
== null) {
917 jButton11
= new JButton();
918 jButton11
.setText("Delete");
919 jButton11
.setPreferredSize(new java
.awt
.Dimension(70,20));
920 jButton11
.addActionListener(new AbstractAction() {
921 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
922 if (selectedRow
>= 0) {
923 optionsTableModel
.removeRow(selectedRow
);
924 ffc
.removeBuildOptionsOpt(selectedRow
);
933 * This method initializes jPanel21
935 * @return javax.swing.JPanel
937 private JPanel
getJPanel21() {
938 if (jPanel21
== null) {
939 jLabel13
= new JLabel();
940 jLabel13
.setText("EncapsulationTag");
941 jLabel8
= new JLabel();
942 jLabel8
.setText("EncapsulationType");
943 jPanel21
= new JPanel();
944 jPanel21
.setName("jPanel21");
945 jPanel21
.add(jLabel8
, null);
946 jPanel21
.add(getJTextField9(), null);
947 jPanel21
.add(jLabel13
, null);
948 jPanel21
.add(getJTextField10(), null);
949 jPanel21
.add(getJButton12(), null);
950 jPanel21
.add(getJButton13(), null);
951 jPanel21
.add(getJButton16(), null);
957 * This method initializes jButton12
959 * @return javax.swing.JButton
961 private JButton
getJButton12() {
962 if (jButton12
== null) {
963 jButton12
= new JButton();
964 jButton12
.setText("Add Sections");
965 jButton12
.setPreferredSize(new java
.awt
.Dimension(109,20));
966 jButton12
.addActionListener(new AbstractAction(){
967 public void actionPerformed(ActionEvent arg0
){
975 * This method initializes jButton13
977 * @return javax.swing.JButton
979 private JButton
getJButton13() {
980 if (jButton13
== null) {
981 jButton13
= new JButton();
982 jButton13
.setText("Add Section");
983 jButton13
.setPreferredSize(new java
.awt
.Dimension(102,20));
984 jButton13
.addActionListener(new AbstractAction(){
985 public void actionPerformed(ActionEvent arg0
){
986 CardLayout cl
= (CardLayout
)jPanel19
.getLayout();
995 * This method initializes jTextField9
997 * @return javax.swing.JTextField
999 private JTextField
getJTextField9() {
1000 if (jTextField9
== null) {
1001 jTextField9
= new JTextField();
1002 jTextField9
.setPreferredSize(new java
.awt
.Dimension(250,20));
1008 * This method initializes jTextField10
1010 * @return javax.swing.JTextField
1012 private JTextField
getJTextField10() {
1013 if (jTextField10
== null) {
1014 jTextField10
= new JTextField();
1015 jTextField10
.setPreferredSize(new java
.awt
.Dimension(250,20));
1017 return jTextField10
;
1021 * This method initializes jPanel22
1023 * @return javax.swing.JPanel
1025 private JPanel
getJPanel22() {
1026 if (jPanel22
== null) {
1027 FlowLayout flowLayout7
= new FlowLayout();
1028 flowLayout7
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
1029 jPanel22
= new JPanel();
1030 jPanel22
.setLayout(flowLayout7
);
1031 jPanel22
.setName("jPanel22");
1032 jPanel22
.add(getJCheckBox6(), null);
1033 jPanel22
.add(getJComboBox4(), null);
1034 jPanel22
.add(getJCheckBox7(), null);
1035 jPanel22
.add(getJComboBox5(), null);
1036 jPanel22
.add(getJCheckBox8(), null);
1037 jPanel22
.add(getJTextField11(), null);
1038 jPanel22
.add(getJButton14(), null);
1039 jPanel22
.add(getJButton15(), null);
1045 * This method initializes jCheckBox6
1047 * @return javax.swing.JCheckBox
1049 private JCheckBox
getJCheckBox6() {
1050 if (jCheckBox6
== null) {
1051 jCheckBox6
= new JCheckBox();
1052 jCheckBox6
.setText("Section Type");
1053 jCheckBox6
.setPreferredSize(new java
.awt
.Dimension(98,20));
1059 * This method initializes jComboBox4
1061 * @return javax.swing.JComboBox
1063 private JComboBox
getJComboBox4() {
1064 if (jComboBox4
== null) {
1065 jComboBox4
= new JComboBox();
1066 jComboBox4
.setPreferredSize(new java
.awt
.Dimension(260,20));
1068 jComboBox4
.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");
1069 jComboBox4
.addItem("EFI_SECTION_VERSION");
1070 jComboBox4
.addItem("EFI_SECTION_USER_INTERFACE");
1071 jComboBox4
.addItem("EFI_SECTION_DXE_DEPEX");
1072 jComboBox4
.addItem("EFI_SECTION_PEI_DEPEX");
1073 jComboBox4
.addItem("EFI_SECTION_PE32");
1074 jComboBox4
.addItem("EFI_SECTION_PIC");
1075 jComboBox4
.addItem("EFI_SECTION_TE");
1076 jComboBox4
.addItem("EFI_SECTION_RAW");
1077 jComboBox4
.addItem("EFI_SECTION_COMPRESSION");
1078 jComboBox4
.addItem("EFI_SECTION_GUID_DEFINED");
1079 jComboBox4
.addItem("EFI_SECTION_COMPATIBILITY16");
1080 jComboBox4
.addItem("EFI_SECTION_FIRMWARE_VOLUME_IMAGE");
1081 jComboBox4
.setSelectedIndex(0);
1087 * This method initializes jCheckBox7
1089 * @return javax.swing.JCheckBox
1091 private JCheckBox
getJCheckBox7() {
1092 if (jCheckBox7
== null) {
1093 jCheckBox7
= new JCheckBox();
1094 jCheckBox7
.setPreferredSize(new java
.awt
.Dimension(120,20));
1095 jCheckBox7
.setText("Compressible");
1101 * This method initializes jComboBox5
1103 * @return javax.swing.JComboBox
1105 private JComboBox
getJComboBox5() {
1106 if (jComboBox5
== null) {
1107 jComboBox5
= new JComboBox();
1108 jComboBox5
.setPreferredSize(new java
.awt
.Dimension(80,20));
1110 jComboBox5
.addItem("false");
1111 jComboBox5
.addItem("true");
1112 jComboBox5
.setSelectedIndex(0);
1118 * This method initializes jCheckBox8
1120 * @return javax.swing.JCheckBox
1122 private JCheckBox
getJCheckBox8() {
1123 if (jCheckBox8
== null) {
1124 jCheckBox8
= new JCheckBox();
1125 jCheckBox8
.setText("Binding Order");
1126 jCheckBox8
.setPreferredSize(new java
.awt
.Dimension(103,20));
1132 * This method initializes jTextField11
1134 * @return javax.swing.JTextField
1136 private JTextField
getJTextField11() {
1137 if (jTextField11
== null) {
1138 jTextField11
= new JTextField();
1139 jTextField11
.setPreferredSize(new java
.awt
.Dimension(150,20));
1141 return jTextField11
;
1145 * This method initializes jButton14
1147 * @return javax.swing.JButton
1149 private JButton
getJButton14() {
1150 if (jButton14
== null) {
1151 jButton14
= new JButton();
1152 jButton14
.setText("Add");
1153 jButton14
.setPreferredSize(new java
.awt
.Dimension(70,20));
1154 jButton14
.addActionListener(new AbstractAction(){
1155 public void actionPerformed(ActionEvent arg0
){
1163 * This method initializes jButton15
1165 * @return javax.swing.JButton
1167 private JButton
getJButton15() {
1168 if (jButton15
== null) {
1169 jButton15
= new JButton();
1170 jButton15
.setPreferredSize(new java
.awt
.Dimension(70,20));
1171 jButton15
.setText("Delete");
1177 * This method initializes jButton16
1179 * @return javax.swing.JButton
1181 private JButton
getJButton16() {
1182 if (jButton16
== null) {
1183 jButton16
= new JButton();
1184 jButton16
.setText("Delete");
1185 jButton16
.setPreferredSize(new java
.awt
.Dimension(70,20));
1191 * This method initializes jScrollPane7
1193 * @return javax.swing.JScrollPane
1195 private JScrollPane
getJScrollPane7() {
1196 if (jScrollPane7
== null) {
1197 jScrollPane7
= new JScrollPane();
1198 jScrollPane7
.setPreferredSize(new java
.awt
.Dimension(110,200));
1199 jScrollPane7
.setViewportView(getJTree());
1201 return jScrollPane7
;
1205 * This method initializes jTree
1207 * @return javax.swing.JTree
1209 private JTree
getJTree() {
1210 if (jTree
== null) {
1211 jTree
= new JTree();
1217 * This method initializes jButton17
1219 * @return javax.swing.JButton
1221 private JButton
getJButton17() {
1222 if (jButton17
== null) {
1223 jButton17
= new JButton();
1224 jButton17
.setPreferredSize(new java
.awt
.Dimension(70,20));
1225 jButton17
.setText("Add");
1226 jButton17
.addActionListener(new AbstractAction() {
1227 public void actionPerformed(ActionEvent arg0
){
1228 Object
[] o
= {"", ""};
1229 ffsAttributesTableModel
.addRow(o
);
1237 * This method initializes jButton18
1239 * @return javax.swing.JButton
1241 private JButton
getJButton18() {
1242 if (jButton18
== null) {
1243 jButton18
= new JButton();
1244 jButton18
.setPreferredSize(new java
.awt
.Dimension(70,20));
1245 jButton18
.setText("Delete");
1246 jButton18
.addActionListener(new AbstractAction(){
1247 public void actionPerformed(ActionEvent arg0
){
1248 if (jTable4
.getSelectedRow() >= 0){
1249 ffsAttributesTableModel
.removeRow(jTable4
.getSelectedRow());
1258 * This method initializes jButton19
1260 * @return javax.swing.JButton
1262 private JButton
getJButton19() {
1263 if (jButton19
== null) {
1264 jButton19
= new JButton();
1265 jButton19
.setPreferredSize(new java
.awt
.Dimension(75,20));
1266 jButton19
.setEnabled(false);
1267 jButton19
.setText("Update");
1273 * This method initializes jCheckBox9
1275 * @return javax.swing.JCheckBox
1277 private JCheckBox
getJCheckBox9() {
1278 if (jCheckBox9
== null) {
1279 jCheckBox9
= new JCheckBox();
1280 jCheckBox9
.setPreferredSize(new java
.awt
.Dimension(50,20));
1281 jCheckBox9
.setText("IA32");
1287 * This method initializes jCheckBox10
1289 * @return javax.swing.JCheckBox
1291 private JCheckBox
getJCheckBox10() {
1292 if (jCheckBox10
== null) {
1293 jCheckBox10
= new JCheckBox();
1294 jCheckBox10
.setPreferredSize(new java
.awt
.Dimension(50,20));
1295 jCheckBox10
.setText("IPF");
1301 * This method initializes jCheckBox11
1303 * @return javax.swing.JCheckBox
1305 private JCheckBox
getJCheckBox11() {
1306 if (jCheckBox11
== null) {
1307 jCheckBox11
= new JCheckBox();
1308 jCheckBox11
.setText("X64");
1309 jCheckBox11
.setPreferredSize(new java
.awt
.Dimension(47,20));
1315 * This method initializes jCheckBox12
1317 * @return javax.swing.JCheckBox
1319 private JCheckBox
getJCheckBox12() {
1320 if (jCheckBox12
== null) {
1321 jCheckBox12
= new JCheckBox();
1322 jCheckBox12
.setPreferredSize(new java
.awt
.Dimension(50,20));
1323 jCheckBox12
.setText("EBC");
1329 * This method initializes jCheckBox13
1331 * @return javax.swing.JCheckBox
1333 private JCheckBox
getJCheckBox13() {
1334 if (jCheckBox13
== null) {
1335 jCheckBox13
= new JCheckBox();
1336 jCheckBox13
.setPreferredSize(new java
.awt
.Dimension(55,20));
1337 jCheckBox13
.setText("ARM");
1343 * This method initializes jCheckBox14
1345 * @return javax.swing.JCheckBox
1347 private JCheckBox
getJCheckBox14() {
1348 if (jCheckBox14
== null) {
1349 jCheckBox14
= new JCheckBox();
1350 jCheckBox14
.setPreferredSize(new java
.awt
.Dimension(50,20));
1351 jCheckBox14
.setText("PPC");
1357 * This method initializes jTextField12
1359 * @return javax.swing.JTextField
1361 private JTextField
getJTextField12() {
1362 if (jTextField12
== null) {
1363 jTextField12
= new JTextField();
1364 jTextField12
.setPreferredSize(new java
.awt
.Dimension(150,20));
1366 return jTextField12
;
1370 * This method initializes jTextField13
1372 * @return javax.swing.JTextField
1374 private JTextField
getJTextField13() {
1375 if (jTextField13
== null) {
1376 jTextField13
= new JTextField();
1377 jTextField13
.setPreferredSize(new java
.awt
.Dimension(140,20));
1379 return jTextField13
;
1385 public static void main(String
[] args
) {
1386 // TODO Auto-generated method stub
1387 new FpdBuildOptions().setVisible(true);
1391 * This is the default constructor
1393 public FpdBuildOptions() {
1396 this.setVisible(true);
1399 public FpdBuildOptions(PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
1401 ffc
= new FpdFileContents(fpd
);
1405 private void init(FpdFileContents ffc
) {
1410 private void initOptionTable() {
1411 if (ffc
.getBuildOptionsOptCount() == 0) {
1412 //ToDo get default options from *.txt file
1415 String
[][] saa
= new String
[ffc
.getBuildOptionsOptCount()][6];
1416 ffc
.getBuildOptionsOpts(saa
);
1417 for (int i
= 0; i
< saa
.length
; ++i
) {
1418 optionsTableModel
.addRow(saa
[i
]);
1422 private void initAntTaskTable() {
1423 if (ffc
.getBuildOptionsUserDefAntTaskCount() == 0) {
1426 String
[][] saa
= new String
[ffc
.getBuildOptionsUserDefAntTaskCount()][3];
1427 ffc
.getBuildOptionsUserDefAntTasks(saa
);
1428 for (int i
= 0; i
< saa
.length
; ++i
) {
1429 antTaskTableModel
.addRow(saa
[i
]);
1433 * This method initializes this
1437 private void initialize() {
1438 this.setSize(722, 439);
1439 this.setTitle("FPD Build Options");
1440 this.setContentPane(getJContentPane());
1444 * This method initializes jContentPane
1446 * @return javax.swing.JPanel
1448 private JPanel
getJContentPane() {
1449 if (jContentPane
== null) {
1450 jContentPane
= new JPanel();
1451 jContentPane
.setLayout(new BorderLayout());
1452 jContentPane
.add(getJPanel(), java
.awt
.BorderLayout
.SOUTH
);
1453 jContentPane
.add(getJPanel1(), java
.awt
.BorderLayout
.NORTH
);
1454 jContentPane
.add(getJPanel2(), java
.awt
.BorderLayout
.WEST
);
1455 jContentPane
.add(getJPanel3(), java
.awt
.BorderLayout
.EAST
);
1456 jContentPane
.add(getJTabbedPane(), java
.awt
.BorderLayout
.CENTER
);
1458 return jContentPane
;
1461 } // @jve:decl-index=0:visual-constraint="10,10"