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
;
19 import javax
.swing
.JPanel
;
20 import javax
.swing
.JTabbedPane
;
21 import javax
.swing
.JCheckBox
;
22 import javax
.swing
.JLabel
;
23 import java
.awt
.FlowLayout
;
24 import javax
.swing
.AbstractAction
;
25 import java
.awt
.event
.ActionEvent
;
26 import java
.awt
.event
.ActionListener
;
28 import javax
.swing
.DefaultCellEditor
;
29 import javax
.swing
.JFileChooser
;
30 import javax
.swing
.JFrame
;
31 import javax
.swing
.JOptionPane
;
32 import javax
.swing
.JTextField
;
33 import javax
.swing
.JButton
;
34 import javax
.swing
.JScrollPane
;
35 import javax
.swing
.JTable
;
36 import javax
.swing
.JComboBox
;
37 import javax
.swing
.ListSelectionModel
;
38 import javax
.swing
.event
.InternalFrameAdapter
;
39 import javax
.swing
.event
.InternalFrameEvent
;
40 import javax
.swing
.event
.ListSelectionEvent
;
41 import javax
.swing
.event
.ListSelectionListener
;
42 import javax
.swing
.event
.TableModelEvent
;
43 import javax
.swing
.event
.TableModelListener
;
44 import javax
.swing
.table
.DefaultTableModel
;
45 import javax
.swing
.table
.TableModel
;
47 import org
.tianocore
.PlatformSurfaceAreaDocument
;
48 import org
.tianocore
.frameworkwizard
.common
.DataValidation
;
49 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningPlatformType
;
50 import org
.tianocore
.frameworkwizard
.common
.ui
.IInternalFrame
;
53 import java
.util
.ArrayList
;
54 import java
.util
.Iterator
;
55 import java
.util
.LinkedHashMap
;
57 import java
.util
.Vector
;
58 import java
.awt
.Dimension
;
59 import javax
.swing
.JSplitPane
;
61 public class FpdBuildOptions
extends IInternalFrame
{
63 private final int oneRowHeight
= 20;
65 private final int twoRowHeight
= 40;
67 private final int sepHeight
= 6;
69 private final int sepWidth
= 10;
71 private final int buttonWidth
= 90;
73 private final int rowOne
= 12;
75 private final int dialogWidth
= 600;
77 private final int rowTwo
= rowOne
+ oneRowHeight
+ sepHeight
;
79 private final int rowThree
= rowTwo
+ oneRowHeight
+ sepHeight
;
81 private final int rowFour
= rowThree
+ oneRowHeight
+ sepHeight
;
83 private final int rowFive
= rowFour
+ oneRowHeight
+ sepHeight
;
85 private final int rowSix
= rowFive
+ oneRowHeight
+ sepHeight
;
87 private final int rowSeven
= rowSix
+ oneRowHeight
+ sepHeight
;
89 private final int buttonRow
= rowSeven
+ oneRowHeight
+ sepHeight
+ sepHeight
;
91 private final int dialogHeight
= buttonRow
+ twoRowHeight
+ twoRowHeight
;
93 private final int lastButtonXLoc
= dialogWidth
- buttonWidth
- sepWidth
;
95 private final int next2LastButtonLoc
= lastButtonXLoc
- buttonWidth
- sepWidth
;
97 private final int firstButtonLoc
= next2LastButtonLoc
- buttonWidth
- sepWidth
;
99 private final int labelColumn
= 12;
101 private final int fieldColumn
= 168;
103 private final int labelWidth
= 155;
105 private final int fieldWidth
= 320;
107 private static final long serialVersionUID
= 1L;
111 private JPanel jContentPane
= null;
113 // private JPanel jPanelContentSouth = null;
115 // private JPanel jPanelContentNorth = null;
117 // private JPanel jPanelContentWest = null;
119 // private JPanel jPanelContentEast = null;
121 private JTabbedPane jTabbedPane
= null;
123 private JPanel jPanelUserDef
= null;
125 private JPanel jPanelUserDefNorth
= null;
127 private JPanel jPanelUserDefCenter
= null;
129 private JTextField jTextFieldAntTaskFile
= null;
131 private JLabel jLabelAntTaskId
= null;
133 private JTextField jTextFieldAntTaskId
= null;
135 private JButton jButtonAntTaskAdd
= null;
137 private JButton jButtonAntTaskDel
= null;
139 private JTextField jTextFieldAntCmdOpts
= null;
141 private JScrollPane jScrollPaneAntTasks
= null;
143 private JTable jTableAntTasks
= null;
145 private DefaultTableModel ffsTableModel
= null;
147 private DefaultTableModel sectionsTableModel
= null;
149 private DefaultTableModel sectionTableModel
= null;
151 private DefaultTableModel subsectionsTableModel
= null;
153 private DefaultTableModel antTaskTableModel
= null;
155 private DefaultTableModel ffsAttributesTableModel
= null;
157 private DefaultTableModel optionsTableModel
= null;
159 private JPanel jPanelFfsTab
= null;
161 private JPanel jPanelFfsTabCenter
= null;
163 private JPanel jPanelFfsTabCenterN
= null;
165 private JPanel jPanelFfsTabCenterS
= null;
167 private JLabel jLabelFfsKey
= null;
169 private JTextField jTextFieldFfsKey
= null;
171 private JButton jButtonFfsAdd
= null;
173 private JButton jButtonFfsDel
= null;
175 private JScrollPane jScrollPaneFfsAttribs
= null;
177 private JTable jTableFfsAttribs
= null;
179 private JPanel jPanelOptionsTab
= null;
181 private JLabel jLabelOptionContents
= null;
183 private JTextField jTextFieldOptionContents
= null;
185 private JLabel jLabelToolChainFamily
= null;
187 private JLabel jLabelSupArch
= null;
189 private JLabel jLabelToolCmd
= null;
191 private JTextField jTextFieldToolCmd
= null;
193 private JScrollPane jScrollPaneOptions
= null;
195 private JTable jTableOptions
= null;
197 private JLabel jTitle
= null;
199 private JButton jButtonOptionsAdd
= null;
201 private JButton jButtonOptionsDel
= null;
203 private JButton jButtonFfsAttribNew
= null;
205 private JButton jButtonFfsAttribRemove
= null;
207 private FpdFileContents ffc
= null;
209 private OpeningPlatformType docConsole
= null;
211 private JPanel jArchitectureSelections
= null;
213 private JCheckBox jCheckBoxIA32
= null;
215 private JCheckBox jCheckBoxIpf
= null;
217 private JCheckBox jCheckBoxX64
= null;
219 private JCheckBox jCheckBoxEBC
= null;
221 private JCheckBox jCheckBoxARM
= null;
223 private JCheckBox jCheckBoxPPC
= null;
225 private JLabel jLabelBuildTargets
= null;
227 private JTextField jTextFieldBuildTargets
= null;
229 private JTextField jTextFieldTagName
= null;
231 private JLabel jLabelTagName
= null;
233 private int selectedRow
= -1;
235 private JLabel jLabelAntTaskFile
= null;
237 private JLabel jLabelAntCmdOpts
= null;
239 private JScrollPane jScrollPaneFfs
= null;
241 private JTable jTableFfs
= null;
243 private JLabel jLabelFfsSection
= null;
245 private JScrollPane jScrollPaneFfsSection
= null;
247 private JTable jTableFfsSection
= null;
249 private JLabel jLabelFfsSubSections
= null;
251 private JScrollPane jScrollPaneFfsSubSection
= null;
253 private JTable jTableFfsSubSection
= null;
255 private JLabel jLabelEncapType
= null;
257 private JTextField jTextFieldEncapType
= null;
259 private JPanel jPanelFfsAttribButtonGroup
= null;
261 private JLabel jLabelFfsAttribs
= null;
263 private JButton jButtonFfsSectionNew
= null;
265 private JButton jButtonFfsSectionRemove
= null;
267 private JButton jButtonFfsSubSectionNew
= null;
269 private JButton jButtonFfsSubSectionRemove
= null;
271 private JLabel jLabelFfsSections
= null;
273 private JButton jButtonFfsSectionsNew
= null;
275 private JButton jButtonFfsSectionsRemove
= null;
277 private JScrollPane jScrollPaneFfsSections
= null;
279 private JTable jTableFfsSections
= null;
281 private JButton jButtonAntTaskFileBrowse
= null;
283 private JTextField jTextFieldToolChainFamily
= null;
285 private JSplitPane jSplitPaneFfsC
= null;
287 private JPanel jPanelFfsCTop
= null;
289 private JSplitPane jSplitPaneFfsCBottom
= null;
291 private JPanel jPanelFfsCBottomTop
= null;
293 private JPanel jPanelFfsCBottomBottom
= null;
295 private JPanel jPanelSectionN
= null;
297 private JPanel jPanelSectionC
= null;
299 private JPanel jPanelSectionsN
= null;
301 private JPanel jPanelSectionsC
= null;
303 private JPanel jPanelSubSectionN
= null;
305 private JPanel jPanelSubSectionC
= null;
307 private JPanel jPanelOptionsContainer
= null;
309 private JPanel jPanelUserDefCenterN
= null;
311 private JPanel jPanelUserDefCenterC
= null;
314 * This method initializes jPanel
316 * @return javax.swing.JPanel
317 private JPanel getJPanelContentSouth() {
318 if (jPanelContentSouth == null) {
319 jPanelContentSouth = new JPanel();
321 return jPanelContentSouth;
326 * This method initializes jPanel1
328 * @return javax.swing.JPanel
329 private JPanel getJPanelContentNorth() {
330 if (jPanelContentNorth == null) {
331 jPanelContentNorth = new JPanel();
333 return jPanelContentNorth;
338 * This method initializes jPanel2
340 * @return javax.swing.JPanel
341 private JPanel getJPanelContentWest() {
342 if (jPanelContentWest == null) {
343 jPanelContentWest = new JPanel();
345 return jPanelContentWest;
350 * This method initializes jPanel3
352 * @return javax.swing.JPanel
353 private JPanel getJPanelContentEast() {
354 if (jPanelContentEast == null) {
355 jPanelContentEast = new JPanel();
357 return jPanelContentEast;
362 * This method initializes jTabbedPane
364 * @return javax.swing.JTabbedPane
366 private JTabbedPane
getJTabbedPane() {
367 if (jTabbedPane
== null) {
368 jTabbedPane
= new JTabbedPane();
369 jTabbedPane
.addTab("Flash Filesystem Options", null, getJPanelFfsTab(), null);
370 jTabbedPane
.addTab("Tool Arguments", null, getJPanelOptionsTab(), null);
371 jTabbedPane
.addTab("User Defined ANT Tasks", null, getJPanelUserDef(), null);
377 * This method initializes this
381 private void initialize() {
382 this.setSize(722, 577);
383 this.setTitle("Platform Build Options");
384 this.setContentPane(getJContentPane());
388 * This method initializes jContentPane
390 * @return javax.swing.JPanel
392 private JPanel
getJContentPane() {
393 if (jContentPane
== null) {
394 jContentPane
= new JPanel();
395 jContentPane
.setLayout(new BorderLayout());
396 // jContentPane.add(getJPanelContentSouth(), java.awt.BorderLayout.SOUTH);
397 // jContentPane.add(getJPanelContentNorth(), java.awt.BorderLayout.NORTH);
398 // jContentPane.add(getJPanelContentWest(), java.awt.BorderLayout.WEST);
399 // jContentPane.add(getJPanelContentEast(), java.awt.BorderLayout.EAST);
400 jContentPane
.add(getJTabbedPane(), java
.awt
.BorderLayout
.CENTER
);
408 public static void main(String
[] args
) {
409 // TODO Auto-generated method stub
410 new FpdBuildOptions().setVisible(true);
414 * This is the default constructor
416 public FpdBuildOptions() {
419 this.setVisible(true);
422 public FpdBuildOptions(PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
424 ffc
= new FpdFileContents(fpd
);
428 public FpdBuildOptions(OpeningPlatformType opt
) {
429 this(opt
.getXmlFpd());
433 private void init(FpdFileContents ffc
) {
437 this.addInternalFrameListener(new InternalFrameAdapter() {
438 public void internalFrameDeactivated(InternalFrameEvent e
) {
439 if (jTableFfs
.isEditing()) {
440 jTableFfs
.getCellEditor().stopCellEditing();
442 if (jTableFfsSection
.isEditing()) {
443 jTableFfsSection
.getCellEditor().stopCellEditing();
445 if (jTableAntTasks
.isEditing()) {
446 jTableAntTasks
.getCellEditor().stopCellEditing();
448 if (jTableFfsSubSection
.isEditing()) {
449 jTableFfsSubSection
.getCellEditor().stopCellEditing();
451 if (jTableFfsAttribs
.isEditing()) {
452 jTableFfsAttribs
.getCellEditor().stopCellEditing();
454 if (jTableOptions
.isEditing()) {
455 jTableOptions
.getCellEditor().stopCellEditing();
462 * This method initializes jPanel13
464 * @return javax.swing.JPanel
466 private JPanel
getJPanelFfsTab() {
467 if (jPanelFfsTab
== null) {
468 jPanelFfsTab
= new JPanel();
469 jPanelFfsTab
.setLayout(new BorderLayout());
470 jPanelFfsTab
.add(getJPanelFfsTabCenter(), java
.awt
.BorderLayout
.CENTER
);
471 jPanelFfsTab
.add(getJScrollPaneFfs(), java
.awt
.BorderLayout
.WEST
);
477 * This method initializes jPanel18
479 * @return javax.swing.JPanel
481 private JPanel
getJPanelFfsTabCenter() {
482 if (jPanelFfsTabCenter
== null) {
483 jPanelFfsTabCenter
= new JPanel();
484 jPanelFfsTabCenter
.setLayout(new BorderLayout());
485 jPanelFfsTabCenter
.add(getJPanelFfsTabCenterN(), java
.awt
.BorderLayout
.NORTH
);
486 jPanelFfsTabCenter
.add(getJPanelFfsTabCenterS(), java
.awt
.BorderLayout
.SOUTH
);
487 jPanelFfsTabCenter
.add(getJSplitPaneFfsC(), java
.awt
.BorderLayout
.CENTER
);
489 return jPanelFfsTabCenter
;
493 * This method initializes jPanel15
495 * @return javax.swing.JPanel
497 private JPanel
getJPanelFfsTabCenterN() {
498 if (jPanelFfsTabCenterN
== null) {
499 jLabelEncapType
= new JLabel();
500 jLabelEncapType
.setText("Encapsulation Type");
501 FlowLayout flowLayout5
= new FlowLayout();
502 flowLayout5
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
503 jLabelFfsKey
= new JLabel();
504 jLabelFfsKey
.setText("FFS Key");
505 jPanelFfsTabCenterN
= new JPanel();
506 jPanelFfsTabCenterN
.setLayout(flowLayout5
);
507 jPanelFfsTabCenterN
.add(jLabelFfsKey
, null);
508 jPanelFfsTabCenterN
.add(getJTextFieldFfsKey(), null);
509 jPanelFfsTabCenterN
.add(jLabelEncapType
, null);
510 jPanelFfsTabCenterN
.add(getJTextFieldEncapType(), null);
511 jPanelFfsTabCenterN
.add(getJButtonFfsAdd(), null);
512 jPanelFfsTabCenterN
.add(getJButtonFfsDel(), null);
514 return jPanelFfsTabCenterN
;
518 * This method initializes jPanel16
520 * @return javax.swing.JPanel
522 private JPanel
getJPanelFfsTabCenterS() {
523 if (jPanelFfsTabCenterS
== null) {
524 jLabelFfsAttribs
= new JLabel();
525 jLabelFfsAttribs
.setText("Attributes");
526 FlowLayout flowLayout6
= new FlowLayout();
527 flowLayout6
.setHgap(5);
528 flowLayout6
.setVgap(20);
529 flowLayout6
.setAlignment(java
.awt
.FlowLayout
.CENTER
);
530 jPanelFfsTabCenterS
= new JPanel();
531 jPanelFfsTabCenterS
.setPreferredSize(new java
.awt
.Dimension(491, 130));
532 jPanelFfsTabCenterS
.setLayout(flowLayout6
);
533 jPanelFfsTabCenterS
.add(jLabelFfsAttribs
, null);
534 jPanelFfsTabCenterS
.add(getJScrollPaneFfsAttribs(), null);
535 jPanelFfsTabCenterS
.add(getJPanelFfsAttribButtonGroup(), null);
537 return jPanelFfsTabCenterS
;
541 * This method initializes jTextField6
543 * @return javax.swing.JTextField
545 private JTextField
getJTextFieldFfsKey() {
546 if (jTextFieldFfsKey
== null) {
547 jTextFieldFfsKey
= new JTextField();
548 jTextFieldFfsKey
.setPreferredSize(new java
.awt
.Dimension(100, 20));
549 jTextFieldFfsKey
.setEditable(true);
550 jTextFieldFfsKey
.addFocusListener(new java
.awt
.event
.FocusAdapter() {
551 public void focusLost(java
.awt
.event
.FocusEvent e
) {
552 if (jTableFfs
.getSelectedRow() < 0) {
555 // ffc.updateBuildOptionsFfsKey(jTable.getSelectedRow(), jTextField6.getText());
559 return jTextFieldFfsKey
;
563 * This method initializes jButton8
565 * @return javax.swing.JButton
567 private JButton
getJButtonFfsAdd() {
568 if (jButtonFfsAdd
== null) {
569 jButtonFfsAdd
= new JButton();
570 jButtonFfsAdd
.setPreferredSize(new java
.awt
.Dimension(70, 20));
571 jButtonFfsAdd
.setText("Add");
572 jButtonFfsAdd
.addActionListener(new AbstractAction() {
576 private static final long serialVersionUID
= -2923720717273384221L;
578 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
579 if (jTextFieldFfsKey
.getText().length() > 0) {
580 String
[] row
= { jTextFieldFfsKey
.getText() };
581 ffsTableModel
.addRow(row
);
582 docConsole
.setSaved(false);
583 ffc
.genBuildOptionsFfs(jTextFieldFfsKey
.getText(), jTextFieldEncapType
.getText());
588 return jButtonFfsAdd
;
592 * This method initializes jButton9
594 * @return javax.swing.JButton
596 private JButton
getJButtonFfsDel() {
597 if (jButtonFfsDel
== null) {
598 jButtonFfsDel
= new JButton();
599 jButtonFfsDel
.setPreferredSize(new java
.awt
.Dimension(70, 20));
600 jButtonFfsDel
.setText("Delete");
601 jButtonFfsDel
.addActionListener(new AbstractAction() {
605 private static final long serialVersionUID
= -4002678939178194476L;
607 public void actionPerformed(ActionEvent arg0
) {
608 if (jTableFfs
.getSelectedRow() < 0) {
611 docConsole
.setSaved(false);
612 ffc
.removeBuildOptionsFfs(jTableFfs
.getSelectedRow());
613 ffsTableModel
.removeRow(jTableFfs
.getSelectedRow());
617 return jButtonFfsDel
;
621 * This method initializes jScrollPane5
623 * @return javax.swing.JScrollPane
625 private JScrollPane
getJScrollPaneFfsAttribs() {
626 if (jScrollPaneFfsAttribs
== null) {
627 jScrollPaneFfsAttribs
= new JScrollPane();
628 jScrollPaneFfsAttribs
.setPreferredSize(new java
.awt
.Dimension(350, 100));
629 jScrollPaneFfsAttribs
.setViewportView(getJTableFfsAttribs());
631 return jScrollPaneFfsAttribs
;
635 * This method initializes jTable4
637 * @return javax.swing.JTable
639 private JTable
getJTableFfsAttribs() {
640 if (jTableFfsAttribs
== null) {
641 ffsAttributesTableModel
= new DefaultTableModel();
642 jTableFfsAttribs
= new JTable(ffsAttributesTableModel
);
643 jTableFfsAttribs
.setPreferredSize(new java
.awt
.Dimension(400, 80));
644 jTableFfsAttribs
.setRowHeight(20);
645 ffsAttributesTableModel
.addColumn("Name");
646 ffsAttributesTableModel
.addColumn("Value");
648 jTableFfsAttribs
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
649 jTableFfsAttribs
.getModel().addTableModelListener(new TableModelListener() {
650 public void tableChanged(TableModelEvent arg0
) {
651 // TODO Auto-generated method stub
652 int row
= arg0
.getFirstRow();
653 TableModel m
= (TableModel
) arg0
.getSource();
654 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
655 //ToDo Data Validition check.
656 String name
= m
.getValueAt(row
, 0) + "";
657 String value
= m
.getValueAt(row
, 1) + "";
659 if (name
.length() == 0) {
662 if (value
.length() == 0) {
665 docConsole
.setSaved(false);
666 ffc
.updateBuildOptionsFfsAttribute(jTableFfs
.getSelectedRow(), row
, name
, value
);
671 return jTableFfsAttribs
;
674 private void initFfsTable() {
675 int ffsCount
= ffc
.getBuildOptionsFfsCount();
679 String
[][] saa
= new String
[ffsCount
][1];
680 ffc
.getBuildOptionsFfsKey(saa
);
681 for (int i
= 0; i
< saa
.length
; ++i
) {
682 ffsTableModel
.addRow(saa
[i
]);
687 * This method initializes jButton17
689 * @return javax.swing.JButton
691 private JButton
getJButtonFfsAttribNew() {
692 if (jButtonFfsAttribNew
== null) {
693 jButtonFfsAttribNew
= new JButton();
694 jButtonFfsAttribNew
.setPreferredSize(new java
.awt
.Dimension(80, 20));
695 jButtonFfsAttribNew
.setText("New");
696 jButtonFfsAttribNew
.addActionListener(new AbstractAction() {
700 private static final long serialVersionUID
= 1L;
702 public void actionPerformed(ActionEvent arg0
) {
703 if (jTableFfs
.getSelectedRow() < 0) {
706 Object
[] o
= { "", "" };
707 ffsAttributesTableModel
.addRow(o
);
708 docConsole
.setSaved(false);
709 ffc
.genBuildOptionsFfsAttribute(jTableFfs
.getSelectedRow(), "", "");
713 return jButtonFfsAttribNew
;
717 * This method initializes jButton18
719 * @return javax.swing.JButton
721 private JButton
getJButtonFfsAttribRemove() {
722 if (jButtonFfsAttribRemove
== null) {
723 jButtonFfsAttribRemove
= new JButton();
724 jButtonFfsAttribRemove
.setPreferredSize(new java
.awt
.Dimension(80, 20));
725 jButtonFfsAttribRemove
.setText("Remove");
726 jButtonFfsAttribRemove
.addActionListener(new AbstractAction() {
730 private static final long serialVersionUID
= 1L;
732 public void actionPerformed(ActionEvent arg0
) {
733 if (jTableFfs
.getSelectedRow() < 0) {
736 if (jTableFfsAttribs
.getSelectedRow() >= 0) {
737 docConsole
.setSaved(false);
738 ffsAttributesTableModel
.removeRow(jTableFfsAttribs
.getSelectedRow());
739 ffc
.removeBuildOptionsFfsAttribute(jTableFfs
.getSelectedRow(),
740 jTableFfsAttribs
.getSelectedRow());
745 return jButtonFfsAttribRemove
;
749 * This method initializes jScrollPane
751 * @return javax.swing.JScrollPane
753 private JScrollPane
getJScrollPaneFfs() {
754 if (jScrollPaneFfs
== null) {
755 jScrollPaneFfs
= new JScrollPane();
756 jScrollPaneFfs
.setPreferredSize(new java
.awt
.Dimension(150, 419));
757 jScrollPaneFfs
.setViewportView(getJTableFfs());
759 return jScrollPaneFfs
;
763 * This method initializes jTable
765 * @return javax.swing.JTable
767 private JTable
getJTableFfs() {
768 if (jTableFfs
== null) {
769 ffsTableModel
= new DefaultTableModel();
770 ffsTableModel
.addColumn("FFS Type");
771 jTableFfs
= new JTable(ffsTableModel
);
772 jTableFfs
.setShowGrid(false);
773 jTableFfs
.setRowHeight(20);
775 jTableFfs
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
776 jTableFfs
.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
777 public void valueChanged(ListSelectionEvent e
) {
779 if (e
.getValueIsAdjusting()) {
782 ListSelectionModel lsm
= (ListSelectionModel
) e
.getSource();
783 if (lsm
.isSelectionEmpty()) {
786 int row
= lsm
.getMinSelectionIndex();
787 sectionTableModel
.setRowCount(0);
788 sectionsTableModel
.setRowCount(0);
789 subsectionsTableModel
.setRowCount(0);
790 ffsAttributesTableModel
.setRowCount(0);
791 String
[] sArray
= { "", "" };
792 LinkedHashMap
<String
, String
> lhm
= new LinkedHashMap
<String
, String
>();
793 ArrayList
<String
> alSections
= new ArrayList
<String
>();
794 ArrayList
<String
> alSection
= new ArrayList
<String
>();
795 ffc
.getBuildOptionsFfs(row
, sArray
, lhm
, alSections
, alSection
);
796 jTextFieldFfsKey
.setText(sArray
[0]);
797 jTextFieldEncapType
.setText(sArray
[1]);
798 for (int i
= 0; i
< alSection
.size(); ++i
) {
799 String
[] sectionRow
= { alSection
.get(i
) };
800 sectionTableModel
.addRow(sectionRow
);
802 for (int j
= 0; j
< alSections
.size(); ++j
) {
803 String
[] sectionsRow
= { alSections
.get(j
) };
804 sectionsTableModel
.addRow(sectionsRow
);
806 if (lhm
.size() <= 0) {
809 Set
<String
> keySet
= lhm
.keySet();
810 Iterator
<String
> is
= keySet
.iterator();
811 while (is
.hasNext()) {
812 String key
= is
.next();
813 String
[] attribRow
= { key
, lhm
.get(key
) };
814 ffsAttributesTableModel
.addRow(attribRow
);
820 jTableFfs
.getModel().addTableModelListener(new TableModelListener() {
821 public void tableChanged(TableModelEvent arg0
) {
822 // TODO Auto-generated method stub
823 int row
= arg0
.getFirstRow();
824 TableModel m
= (TableModel
) arg0
.getSource();
825 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
826 //ToDo Data Validition check.
827 String id
= m
.getValueAt(row
, 0) + "";
829 if (id
.length() == 0) {
832 docConsole
.setSaved(false);
833 ffc
.updateBuildOptionsFfsKey(row
, id
);
842 * This method initializes jScrollPane1
844 * @return javax.swing.JScrollPane
846 private JScrollPane
getJScrollPaneFfsSection() {
847 if (jScrollPaneFfsSection
== null) {
848 jScrollPaneFfsSection
= new JScrollPane();
849 // jScrollPaneFfsSection.setPreferredSize(new java.awt.Dimension(500, 80));
850 jScrollPaneFfsSection
.setViewportView(getJTableFfsSection());
852 return jScrollPaneFfsSection
;
856 * This method initializes jTable1
858 * @return javax.swing.JTable
860 private JTable
getJTableFfsSection() {
861 if (jTableFfsSection
== null) {
862 sectionTableModel
= new DefaultTableModel();
863 sectionTableModel
.addColumn("SectionType");
865 jTableFfsSection
= new JTable(sectionTableModel
);
866 jTableFfsSection
.setRowHeight(20);
867 JComboBox cb
= new JComboBox();
868 cb
.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");
869 cb
.addItem("EFI_SECTION_VERSION");
870 cb
.addItem("EFI_SECTION_USER_INTERFACE");
871 cb
.addItem("EFI_SECTION_DXE_DEPEX");
872 cb
.addItem("EFI_SECTION_PEI_DEPEX");
873 cb
.addItem("EFI_SECTION_PE32");
874 cb
.addItem("EFI_SECTION_PIC");
875 cb
.addItem("EFI_SECTION_TE");
876 cb
.addItem("EFI_SECTION_RAW");
877 cb
.addItem("EFI_SECTION_COMPRESSION");
878 cb
.addItem("EFI_SECTION_GUID_DEFINED");
879 cb
.addItem("EFI_SECTION_COMPATIBILITY16");
880 cb
.addItem("EFI_SECTION_FIRMWARE_VOLUME_IMAGE");
881 jTableFfsSection
.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(cb
));
883 jTableFfsSection
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
885 jTableFfsSection
.getModel().addTableModelListener(new TableModelListener() {
886 public void tableChanged(TableModelEvent arg0
) {
887 // TODO Auto-generated method stub
888 if (jTableFfs
.getSelectedRow() < 0) {
891 int row
= arg0
.getFirstRow();
892 TableModel m
= (TableModel
) arg0
.getSource();
893 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
894 //ToDo Data Validition check.
895 String type
= m
.getValueAt(row
, 0) + "";
896 docConsole
.setSaved(false);
897 ffc
.updateBuildOptionsFfsSectionsSection(jTableFfs
.getSelectedRow(), row
, type
);
902 return jTableFfsSection
;
906 * This method initializes jScrollPane3
908 * @return javax.swing.JScrollPane
910 private JScrollPane
getJScrollPaneFfsSubSection() {
911 if (jScrollPaneFfsSubSection
== null) {
912 jScrollPaneFfsSubSection
= new JScrollPane();
913 // jScrollPaneFfsSubSection.setPreferredSize(new java.awt.Dimension(500, 90));
914 jScrollPaneFfsSubSection
.setViewportView(getJTableFfsSubSection());
916 return jScrollPaneFfsSubSection
;
920 * This method initializes jTable3
922 * @return javax.swing.JTable
924 private JTable
getJTableFfsSubSection() {
925 if (jTableFfsSubSection
== null) {
926 subsectionsTableModel
= new DefaultTableModel();
927 subsectionsTableModel
.addColumn("SectionType");
928 jTableFfsSubSection
= new JTable(subsectionsTableModel
);
929 jTableFfsSubSection
.setRowHeight(20);
930 JComboBox cb
= new JComboBox();
931 cb
.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");
932 cb
.addItem("EFI_SECTION_VERSION");
933 cb
.addItem("EFI_SECTION_USER_INTERFACE");
934 cb
.addItem("EFI_SECTION_DXE_DEPEX");
935 cb
.addItem("EFI_SECTION_PEI_DEPEX");
936 cb
.addItem("EFI_SECTION_PE32");
937 cb
.addItem("EFI_SECTION_PIC");
938 cb
.addItem("EFI_SECTION_TE");
939 cb
.addItem("EFI_SECTION_RAW");
940 cb
.addItem("EFI_SECTION_COMPRESSION");
941 cb
.addItem("EFI_SECTION_GUID_DEFINED");
942 cb
.addItem("EFI_SECTION_COMPATIBILITY16");
943 cb
.addItem("EFI_SECTION_FIRMWARE_VOLUME_IMAGE");
944 jTableFfsSubSection
.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(cb
));
945 jTableFfsSubSection
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
947 jTableFfsSubSection
.getModel().addTableModelListener(new TableModelListener() {
948 public void tableChanged(TableModelEvent arg0
) {
949 // TODO Auto-generated method stub
950 if (jTableFfs
.getSelectedRow() < 0 || jTableFfsSections
.getSelectedRow() < 0) {
953 int row
= arg0
.getFirstRow();
954 TableModel m
= (TableModel
) arg0
.getSource();
955 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
956 //ToDo Data Validition check.
957 String type
= m
.getValueAt(row
, 0) + "";
958 docConsole
.setSaved(false);
959 ffc
.updateBuildOptionsFfsSectionsSectionsSection(jTableFfs
.getSelectedRow(),
960 jTableFfsSections
.getSelectedRow(), row
, type
);
965 return jTableFfsSubSection
;
969 * This method initializes jTextField
971 * @return javax.swing.JTextField
973 private JTextField
getJTextFieldEncapType() {
974 if (jTextFieldEncapType
== null) {
975 jTextFieldEncapType
= new JTextField();
976 jTextFieldEncapType
.setPreferredSize(new java
.awt
.Dimension(100, 20));
977 jTextFieldEncapType
.addFocusListener(new java
.awt
.event
.FocusAdapter() {
978 public void focusLost(java
.awt
.event
.FocusEvent e
) {
979 if (jTableFfs
.getSelectedRow() < 0) {
982 ffc
.updateBuildOptionsFfsSectionsType(jTableFfs
.getSelectedRow(), jTextFieldEncapType
.getText());
986 return jTextFieldEncapType
;
990 * This method initializes jPanel4
992 * @return javax.swing.JPanel
994 private JPanel
getJPanelFfsAttribButtonGroup() {
995 if (jPanelFfsAttribButtonGroup
== null) {
996 jPanelFfsAttribButtonGroup
= new JPanel();
997 jPanelFfsAttribButtonGroup
.setPreferredSize(new java
.awt
.Dimension(100, 100));
998 jPanelFfsAttribButtonGroup
.add(getJButtonFfsAttribNew(), null);
999 jPanelFfsAttribButtonGroup
.add(getJButtonFfsAttribRemove(), null);
1001 return jPanelFfsAttribButtonGroup
;
1005 * This method initializes jButton
1007 * @return javax.swing.JButton
1009 private JButton
getJButtonFfsSectionNew() {
1010 if (jButtonFfsSectionNew
== null) {
1011 jButtonFfsSectionNew
= new JButton();
1012 jButtonFfsSectionNew
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1013 jButtonFfsSectionNew
.setText("New");
1014 jButtonFfsSectionNew
.addActionListener(new java
.awt
.event
.ActionListener() {
1015 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1016 if (jTableFfs
.getSelectedRow() < 0) {
1019 docConsole
.setSaved(false);
1020 String
[] row
= { "EFI_SECTION_RAW" };
1021 sectionTableModel
.addRow(row
);
1022 ffc
.genBuildOptionsFfsSectionsSection(jTableFfs
.getSelectedRow(), row
[0]);
1026 return jButtonFfsSectionNew
;
1030 * This method initializes jButton1
1032 * @return javax.swing.JButton
1034 private JButton
getJButtonFfsSectionRemove() {
1035 if (jButtonFfsSectionRemove
== null) {
1036 jButtonFfsSectionRemove
= new JButton();
1037 jButtonFfsSectionRemove
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1038 jButtonFfsSectionRemove
.setText("Remove");
1040 jButtonFfsSectionRemove
.addActionListener(new java
.awt
.event
.ActionListener() {
1041 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1042 if (jTableFfs
.getSelectedRow() < 0 || jTableFfsSection
.getSelectedRow() < 0) {
1045 docConsole
.setSaved(false);
1046 sectionTableModel
.removeRow(jTableFfsSection
.getSelectedRow());
1047 ffc
.removeBuildOptionsFfsSectionsSection(jTableFfs
.getSelectedRow(),
1048 jTableFfsSection
.getSelectedRow());
1052 return jButtonFfsSectionRemove
;
1056 * This method initializes jButton2
1058 * @return javax.swing.JButton
1060 private JButton
getJButtonFfsSubSectionNew() {
1061 if (jButtonFfsSubSectionNew
== null) {
1062 jButtonFfsSubSectionNew
= new JButton();
1063 jButtonFfsSubSectionNew
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1064 jButtonFfsSubSectionNew
.setText("New");
1065 jButtonFfsSubSectionNew
.addActionListener(new java
.awt
.event
.ActionListener() {
1066 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1067 if (jTableFfs
.getSelectedRow() < 0 || jTableFfsSections
.getSelectedRow() < 0) {
1070 docConsole
.setSaved(false);
1071 String
[] row
= { "EFI_SECTION_RAW" };
1072 subsectionsTableModel
.addRow(row
);
1073 ffc
.genBuildOptionsFfsSectionsSectionsSection(jTableFfs
.getSelectedRow(),
1074 jTableFfsSections
.getSelectedRow(), row
[0]);
1079 return jButtonFfsSubSectionNew
;
1083 * This method initializes jButton3
1085 * @return javax.swing.JButton
1087 private JButton
getJButtonFfsSubSectionRemove() {
1088 if (jButtonFfsSubSectionRemove
== null) {
1089 jButtonFfsSubSectionRemove
= new JButton();
1090 jButtonFfsSubSectionRemove
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1091 jButtonFfsSubSectionRemove
.setText("Remove");
1092 jButtonFfsSubSectionRemove
.addActionListener(new java
.awt
.event
.ActionListener() {
1093 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1094 if (jTableFfs
.getSelectedRow() < 0 || jTableFfsSections
.getSelectedRow() < 0
1095 || jTableFfsSubSection
.getSelectedRow() < 0) {
1098 docConsole
.setSaved(false);
1099 subsectionsTableModel
.removeRow(jTableFfsSubSection
.getSelectedRow());
1100 ffc
.removeBuildOptionsFfsSectionsSectionsSection(jTableFfs
.getSelectedRow(),
1101 jTableFfsSections
.getSelectedRow(),
1102 jTableFfsSubSection
.getSelectedRow());
1106 return jButtonFfsSubSectionRemove
;
1110 * This method initializes jButton6
1112 * @return javax.swing.JButton
1114 private JButton
getJButtonFfsSectionsNew() {
1115 if (jButtonFfsSectionsNew
== null) {
1116 jButtonFfsSectionsNew
= new JButton();
1117 jButtonFfsSectionsNew
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1118 jButtonFfsSectionsNew
.setText("New");
1119 jButtonFfsSectionsNew
.addActionListener(new java
.awt
.event
.ActionListener() {
1120 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1121 if (jTableFfs
.getSelectedRow() < 0) {
1124 docConsole
.setSaved(false);
1125 String
[] row
= { "" };
1126 sectionsTableModel
.addRow(row
);
1127 ffc
.genBuildOptionsFfsSectionsSections(jTableFfs
.getSelectedRow(), "");
1131 return jButtonFfsSectionsNew
;
1135 * This method initializes jButton7
1137 * @return javax.swing.JButton
1139 private JButton
getJButtonFfsSectionsRemove() {
1140 if (jButtonFfsSectionsRemove
== null) {
1141 jButtonFfsSectionsRemove
= new JButton();
1142 jButtonFfsSectionsRemove
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1143 jButtonFfsSectionsRemove
.setText("Remove");
1144 jButtonFfsSectionsRemove
.addActionListener(new java
.awt
.event
.ActionListener() {
1145 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1146 if (jTableFfs
.getSelectedRow() < 0 || jTableFfsSections
.getSelectedRow() < 0) {
1149 docConsole
.setSaved(false);
1150 sectionsTableModel
.removeRow(jTableFfsSections
.getSelectedRow());
1151 ffc
.removeBuildOptionsFfsSectionsSections(jTableFfs
.getSelectedRow(),
1152 jTableFfsSections
.getSelectedRow());
1156 return jButtonFfsSectionsRemove
;
1159 private JScrollPane
getJScrollPaneFfsSections() {
1160 if (jScrollPaneFfsSections
== null) {
1161 jScrollPaneFfsSections
= new JScrollPane();
1162 // jScrollPaneFfsSections.setPreferredSize(new java.awt.Dimension(500, 80));
1163 jScrollPaneFfsSections
.setViewportView(getJTableFfsSections());
1165 return jScrollPaneFfsSections
;
1169 * This method initializes jTable6
1171 * @return javax.swing.JTable
1173 private JTable
getJTableFfsSections() {
1174 if (jTableFfsSections
== null) {
1175 sectionsTableModel
= new DefaultTableModel();
1176 sectionsTableModel
.addColumn("EncapsulationType");
1177 jTableFfsSections
= new JTable(sectionsTableModel
);
1178 jTableFfsSections
.setRowHeight(20);
1179 jTableFfsSections
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
1180 jTableFfsSections
.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
1181 public void valueChanged(ListSelectionEvent e
) {
1182 if (e
.getValueIsAdjusting()) {
1185 ListSelectionModel lsm
= (ListSelectionModel
) e
.getSource();
1186 if (lsm
.isSelectionEmpty()) {
1189 int sectionsRow
= lsm
.getMinSelectionIndex();
1190 if (jTableFfs
.getSelectedRow() < 0) {
1193 subsectionsTableModel
.setRowCount(0);
1194 ArrayList
<String
> al
= new ArrayList
<String
>();
1195 ffc
.getBuildOptionsFfsSectionsSectionsSection(jTableFfs
.getSelectedRow(), sectionsRow
, al
);
1196 for (int i
= 0; i
< al
.size(); ++i
) {
1197 String
[] subsectionRow
= { al
.get(i
) };
1198 subsectionsTableModel
.addRow(subsectionRow
);
1204 jTableFfsSections
.getModel().addTableModelListener(new TableModelListener() {
1205 public void tableChanged(TableModelEvent arg0
) {
1206 // TODO Auto-generated method stub
1207 int row
= arg0
.getFirstRow();
1208 TableModel m
= (TableModel
) arg0
.getSource();
1209 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
1210 //ToDo Data Validition check.
1211 String encapType
= m
.getValueAt(row
, 0) + "";
1212 docConsole
.setSaved(false);
1213 ffc
.updateBuildOptionsFfsSectionsSections(jTableFfs
.getSelectedRow(), row
, encapType
);
1218 return jTableFfsSections
;
1222 * This method initializes jSplitPaneFfsC
1224 * @return javax.swing.JSplitPane
1226 private JSplitPane
getJSplitPaneFfsC() {
1227 if (jSplitPaneFfsC
== null) {
1228 jSplitPaneFfsC
= new JSplitPane();
1229 jSplitPaneFfsC
.setOrientation(javax
.swing
.JSplitPane
.VERTICAL_SPLIT
);
1230 jSplitPaneFfsC
.setDividerLocation(130);
1231 jSplitPaneFfsC
.setTopComponent(getJPanelFfsCTop());
1232 jSplitPaneFfsC
.setBottomComponent(getJSplitPaneFfsCBottom());
1233 jSplitPaneFfsC
.setDividerSize(5);
1235 return jSplitPaneFfsC
;
1239 * This method initializes jPanelFfsCTop
1241 * @return javax.swing.JPanel
1243 private JPanel
getJPanelFfsCTop() {
1244 if (jPanelFfsCTop
== null) {
1245 jPanelFfsCTop
= new JPanel();
1246 jPanelFfsCTop
.setLayout(new BorderLayout());
1247 jPanelFfsCTop
.add(getJPanelSectionN(), java
.awt
.BorderLayout
.NORTH
);
1248 jPanelFfsCTop
.add(getJPanelSectionC(), java
.awt
.BorderLayout
.CENTER
);
1250 return jPanelFfsCTop
;
1254 * This method initializes jSplitPaneFfsCBottom
1256 * @return javax.swing.JSplitPane
1258 private JSplitPane
getJSplitPaneFfsCBottom() {
1259 if (jSplitPaneFfsCBottom
== null) {
1260 jSplitPaneFfsCBottom
= new JSplitPane();
1261 jSplitPaneFfsCBottom
.setDividerSize(5);
1262 jSplitPaneFfsCBottom
.setDividerLocation(130);
1263 jSplitPaneFfsCBottom
.setTopComponent(getJPanelFfsCBottomTop());
1264 jSplitPaneFfsCBottom
.setBottomComponent(getJPanelFfsCBottomBottom());
1265 jSplitPaneFfsCBottom
.setOrientation(javax
.swing
.JSplitPane
.VERTICAL_SPLIT
);
1267 return jSplitPaneFfsCBottom
;
1271 * This method initializes jPanelFfsCBottomTop
1273 * @return javax.swing.JPanel
1275 private JPanel
getJPanelFfsCBottomTop() {
1276 if (jPanelFfsCBottomTop
== null) {
1277 jPanelFfsCBottomTop
= new JPanel();
1278 jPanelFfsCBottomTop
.setLayout(new BorderLayout());
1279 jPanelFfsCBottomTop
.add(getJPanelSectionsN(), java
.awt
.BorderLayout
.NORTH
);
1280 jPanelFfsCBottomTop
.add(getJPanelSectionsC(), java
.awt
.BorderLayout
.CENTER
);
1282 return jPanelFfsCBottomTop
;
1286 * This method initializes jPanelFfsCBottomBottom
1288 * @return javax.swing.JPanel
1290 private JPanel
getJPanelFfsCBottomBottom() {
1291 if (jPanelFfsCBottomBottom
== null) {
1292 jPanelFfsCBottomBottom
= new JPanel();
1293 jPanelFfsCBottomBottom
.setLayout(new BorderLayout());
1294 jPanelFfsCBottomBottom
.add(getJPanelSubSectionN(), java
.awt
.BorderLayout
.NORTH
);
1295 jPanelFfsCBottomBottom
.add(getJPanelSubSectionC(), java
.awt
.BorderLayout
.CENTER
);
1297 return jPanelFfsCBottomBottom
;
1301 * This method initializes jPanelSectionN
1303 * @return javax.swing.JPanel
1305 private JPanel
getJPanelSectionN() {
1306 if (jPanelSectionN
== null) {
1307 jPanelSectionN
= new JPanel();
1308 jLabelFfsSection
= new JLabel();
1309 jLabelFfsSection
.setText("Section");
1310 jPanelSectionN
.add(jLabelFfsSection
, null);
1311 jPanelSectionN
.add(getJButtonFfsSectionNew(), null);
1312 jPanelSectionN
.add(getJButtonFfsSectionRemove(), null);
1314 return jPanelSectionN
;
1318 * This method initializes jPanelSectionC
1320 * @return javax.swing.JPanel
1322 private JPanel
getJPanelSectionC() {
1323 if (jPanelSectionC
== null) {
1324 jPanelSectionC
= new JPanel();
1325 jPanelSectionC
.add(getJScrollPaneFfsSection(), null);
1327 return jPanelSectionC
;
1331 * This method initializes jPanelSectionsN
1333 * @return javax.swing.JPanel
1335 private JPanel
getJPanelSectionsN() {
1336 if (jPanelSectionsN
== null) {
1337 jPanelSectionsN
= new JPanel();
1338 jLabelFfsSections
= new JLabel();
1339 jLabelFfsSections
.setText("Sections");
1340 jPanelSectionsN
.add(jLabelFfsSections
, null);
1341 jPanelSectionsN
.add(getJButtonFfsSectionsNew(), null);
1342 jPanelSectionsN
.add(getJButtonFfsSectionsRemove(), null);
1344 return jPanelSectionsN
;
1348 * This method initializes jPanelSectionsC
1350 * @return javax.swing.JPanel
1352 private JPanel
getJPanelSectionsC() {
1353 if (jPanelSectionsC
== null) {
1354 jPanelSectionsC
= new JPanel();
1355 jPanelSectionsC
.add(getJScrollPaneFfsSections(), null);
1357 return jPanelSectionsC
;
1361 * This method initializes jPanelSubSectionN
1363 * @return javax.swing.JPanel
1365 private JPanel
getJPanelSubSectionN() {
1366 if (jPanelSubSectionN
== null) {
1367 jPanelSubSectionN
= new JPanel();
1368 jLabelFfsSubSections
= new JLabel();
1369 jLabelFfsSubSections
.setText("Sub-Sections");
1370 jPanelSubSectionN
.add(jLabelFfsSubSections
, null);
1371 jPanelSubSectionN
.add(getJButtonFfsSubSectionNew(), null);
1372 jPanelSubSectionN
.add(getJButtonFfsSubSectionRemove(), null);
1374 return jPanelSubSectionN
;
1378 * This method initializes jPanelSubSectionC
1380 * @return javax.swing.JPanel
1382 private JPanel
getJPanelSubSectionC() {
1383 if (jPanelSubSectionC
== null) {
1384 jPanelSubSectionC
= new JPanel();
1385 jPanelSubSectionC
.add(getJScrollPaneFfsSubSection(), null);
1387 return jPanelSubSectionC
;
1391 * The following section contains all Build Options content
1395 * This method initializes jPanelOptionsTab
1397 * This is the main Options screen
1399 * @return javax.swing.JPanel jPanelOptionsTab
1401 private JPanel
getJPanelOptionsTab() {
1402 if (jPanelOptionsTab
== null) {
1403 // This container holds the Options Tab content
1405 // FlowLayout flowLayout9 = new FlowLayout();
1406 // flowLayout9.setAlignment(java.awt.FlowLayout.LEFT);
1408 jPanelOptionsTab
= new JPanel();
1409 jPanelOptionsTab
.setBounds(new java
.awt
.Rectangle(0, 0, dialogWidth
* 2, dialogHeight
* 3));
1410 jPanelOptionsTab
.setPreferredSize(new java
.awt
.Dimension(dialogWidth
+ 10, (dialogHeight
* 3) + 10));
1411 jPanelOptionsTab
.setAutoscrolls(true);
1412 jPanelOptionsTab
.setLocation(0, 0);
1413 jPanelOptionsTab
.setLayout(null);
1414 jPanelOptionsTab
.add(getJPanelOptionsContainer(), null);
1415 jPanelOptionsTab
.add(getJScrollPaneOptions(), null);
1418 return jPanelOptionsTab
;
1422 * This method initializes jPanelOptionsContainer
1424 * @return javax.swing.JPanel
1426 private JPanel
getJPanelOptionsContainer() {
1427 if (jPanelOptionsContainer
== null) {
1428 jLabelTagName
= new JLabel();
1429 jLabelTagName
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowOne
, labelWidth
, oneRowHeight
));
1430 jLabelTagName
.setLocation(new java
.awt
.Point(labelColumn
, rowOne
));
1431 jLabelTagName
.setText("Tag Name");
1432 jLabelBuildTargets
= new JLabel();
1433 jLabelBuildTargets
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowTwo
, labelWidth
, oneRowHeight
));
1434 jLabelBuildTargets
.setLocation(new java
.awt
.Point(labelColumn
, rowTwo
));
1435 jLabelBuildTargets
.setText("Build Targets");
1436 jLabelToolCmd
= new JLabel();
1437 jLabelToolCmd
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowThree
, labelWidth
, oneRowHeight
));
1438 jLabelToolCmd
.setLocation(new java
.awt
.Point(labelColumn
, rowThree
));
1439 jLabelToolCmd
.setText("Tool Command");
1440 jLabelSupArch
= new JLabel();
1441 jLabelSupArch
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowFour
, labelWidth
, oneRowHeight
));
1442 jLabelSupArch
.setLocation(new java
.awt
.Point(labelColumn
, rowFour
));
1443 jLabelSupArch
.setText("Supported Architectures");
1444 jLabelToolChainFamily
= new JLabel();
1445 jLabelToolChainFamily
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowFive
, labelWidth
, oneRowHeight
));
1446 jLabelToolChainFamily
.setLocation(new java
.awt
.Point(labelColumn
, rowFive
));
1447 jLabelToolChainFamily
.setText("Tool Chain Family");
1449 jLabelOptionContents
= new JLabel();
1450 jLabelOptionContents
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowSix
, labelWidth
, oneRowHeight
));
1451 jLabelOptionContents
.setLocation(new java
.awt
.Point(labelColumn
, rowSix
));
1452 jLabelOptionContents
.setText("Option Contents");
1454 jPanelOptionsContainer
= new JPanel();
1456 jPanelOptionsContainer
.setLayout(null);
1458 jPanelOptionsContainer
.setLocation(new java
.awt
.Point(2, 2));
1459 jPanelOptionsContainer
.setBounds(new java
.awt
.Rectangle(2, 2, dialogWidth
* 2, dialogHeight
));
1460 jPanelOptionsContainer
.setPreferredSize(new java
.awt
.Dimension(dialogWidth
, dialogHeight
));
1462 jPanelOptionsContainer
1463 .setBorder(javax.swing.BorderFactory
1464 .createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
1466 jPanelOptionsContainer
.add(jLabelTagName
, null);
1467 jPanelOptionsContainer
.add(getJTextFieldTagName(), null);
1469 jPanelOptionsContainer
.add(jLabelBuildTargets
, null);
1470 jPanelOptionsContainer
.add(getJTextFieldBuildTargets(), null);
1472 jPanelOptionsContainer
.add(jLabelToolChainFamily
, null);
1473 jPanelOptionsContainer
.add(getJTextFieldToolChainFamily(), null);
1475 jPanelOptionsContainer
.add(jLabelToolCmd
, null);
1476 jPanelOptionsContainer
.add(getJTextFieldToolCmd(), null);
1478 jPanelOptionsContainer
.add(jLabelSupArch
, null);
1479 jPanelOptionsContainer
.add(getArchitectureSelections(), null);
1481 jPanelOptionsContainer
.add(jLabelOptionContents
, null);
1482 jPanelOptionsContainer
.add(getJTextFieldOptionContents(), null);
1484 jPanelOptionsContainer
.add(getJButtonOptionsAdd(), null);
1485 jPanelOptionsContainer
.add(getJButtonOptionsDel(), null);
1487 return jPanelOptionsContainer
;
1491 * This method initializes jTextFieldOptionTagName Row 1
1493 * @return javax.swing.JTextField
1495 private JTextField
getJTextFieldTagName() {
1496 if (jTextFieldTagName
== null) {
1497 jTextFieldTagName
= new JTextField();
1498 jTextFieldTagName
.setBounds(new java
.awt
.Rectangle(fieldColumn
, rowOne
, fieldWidth
, oneRowHeight
));
1499 jTextFieldTagName
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1500 jTextFieldTagName
.setLocation(new java
.awt
.Point(fieldColumn
, rowOne
));
1502 return jTextFieldTagName
;
1506 * This method initializes jTextFieldBuildTargets Row 2
1508 * @return javax.swing.JTextField jTextFieldBuildTargets
1510 private JTextField
getJTextFieldBuildTargets() {
1511 if (jTextFieldBuildTargets
== null) {
1512 jTextFieldBuildTargets
= new JTextField();
1513 jTextFieldBuildTargets
.setBounds(new java
.awt
.Rectangle(fieldColumn
, rowTwo
, fieldWidth
, oneRowHeight
));
1514 jTextFieldBuildTargets
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1515 jTextFieldBuildTargets
.setLocation(new java
.awt
.Point(fieldColumn
, rowTwo
));
1517 return jTextFieldBuildTargets
;
1521 * This method initializes jTextFieldToolCmd Row 3
1523 * This should be a dropdown box of command codes from tools_def.txt
1525 * @return javax.swing.JTextField jTextFieldToolCmd
1527 private JTextField
getJTextFieldToolCmd() {
1528 if (jTextFieldToolCmd
== null) {
1529 jTextFieldToolCmd
= new JTextField();
1530 jTextFieldToolCmd
.setBounds(new java
.awt
.Rectangle(fieldColumn
, rowThree
, fieldWidth
, oneRowHeight
));
1531 jTextFieldToolCmd
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1532 jTextFieldToolCmd
.setLocation(new java
.awt
.Point(fieldColumn
, rowThree
));
1534 return jTextFieldToolCmd
;
1538 * This method initializes jArchitectureSelections Row 4
1540 * @return jArchitectureSelections
1542 private JPanel
getArchitectureSelections() {
1543 if (jArchitectureSelections
== null) {
1544 jArchitectureSelections
= new JPanel();
1545 jArchitectureSelections
.setLayout(null);
1546 jArchitectureSelections
.add(getJCheckBoxIA32(), null);
1547 jArchitectureSelections
.add(getJCheckBoxX64(), null);
1548 jArchitectureSelections
.add(getJCheckBoxIpf(), null);
1549 jArchitectureSelections
.add(getJCheckBoxEBC(), null);
1550 jArchitectureSelections
.add(getJCheckBoxARM(), null);
1551 jArchitectureSelections
.add(getJCheckBoxPPC(), null);
1552 jArchitectureSelections
.setBounds(new java
.awt
.Rectangle(fieldColumn
, rowFour
, fieldWidth
, oneRowHeight
));
1553 jArchitectureSelections
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1554 jArchitectureSelections
.setLocation(new java
.awt
.Point(fieldColumn
, rowFour
));
1556 return jArchitectureSelections
;
1560 * This method initializes jCheckBoxIA32
1562 * @return javax.swing.JCheckBox jCheckBoxIA32
1564 private JCheckBox
getJCheckBoxIA32() {
1565 if (jCheckBoxIA32
== null) {
1566 jCheckBoxIA32
= new JCheckBox();
1567 jCheckBoxIA32
.setBounds(new java
.awt
.Rectangle(0, 0, 55, 20));
1568 jCheckBoxIA32
.setText("IA32");
1570 return jCheckBoxIA32
;
1574 * This method initializes jCheckBoxX64
1576 * @return javax.swing.JCheckBox jCheckBoxX64
1578 private JCheckBox
getJCheckBoxX64() {
1579 if (jCheckBoxX64
== null) {
1580 jCheckBoxX64
= new JCheckBox();
1581 jCheckBoxX64
.setText("X64");
1582 jCheckBoxX64
.setBounds(new java
.awt
.Rectangle(55, 0, 53, 20));
1584 return jCheckBoxX64
;
1588 * This method initializes jCheckBoxIpf
1590 * @return javax.swing.JCheckBox jCheckBoxIpf
1592 private JCheckBox
getJCheckBoxIpf() {
1593 if (jCheckBoxIpf
== null) {
1594 jCheckBoxIpf
= new JCheckBox();
1595 jCheckBoxIpf
.setBounds(new java
.awt
.Rectangle(108, 0, 52, 20));
1596 jCheckBoxIpf
.setText("IPF");
1598 return jCheckBoxIpf
;
1603 * This method initializes jCheckBoxEBC
1605 * @return javax.swing.JCheckBox jCheckBoxEBC
1607 private JCheckBox
getJCheckBoxEBC() {
1608 if (jCheckBoxEBC
== null) {
1609 jCheckBoxEBC
= new JCheckBox();
1610 jCheckBoxEBC
.setBounds(new java
.awt
.Rectangle(160, 0, 53, 20));
1611 jCheckBoxEBC
.setText("EBC");
1613 return jCheckBoxEBC
;
1617 * This method initializes jCheckBoxARM
1619 * @return javax.swing.JCheckBox jCheckBoxARM
1621 private JCheckBox
getJCheckBoxARM() {
1622 if (jCheckBoxARM
== null) {
1623 jCheckBoxARM
= new JCheckBox();
1624 jCheckBoxARM
.setBounds(new java
.awt
.Rectangle(213, 0, 54, 20));
1625 jCheckBoxARM
.setText("ARM");
1627 return jCheckBoxARM
;
1631 * This method initializes jCheckBoxPPC
1633 * @return javax.swing.JCheckBox jCheckBoxPPC
1635 private JCheckBox
getJCheckBoxPPC() {
1636 if (jCheckBoxPPC
== null) {
1637 jCheckBoxPPC
= new JCheckBox();
1638 jCheckBoxPPC
.setBounds(new java
.awt
.Rectangle(267, 0, 53, 20));
1639 jCheckBoxPPC
.setText("PPC");
1641 return jCheckBoxPPC
;
1645 * This method initializes jTextFieldToolChainFamily Row 5
1647 * This should be a drop down for MSFT, INTEL, GCC or USER_DEFINED
1649 * @return javax.swing.JTextField
1651 private JTextField
getJTextFieldToolChainFamily() {
1652 if (jTextFieldToolChainFamily
== null) {
1653 jTextFieldToolChainFamily
= new JTextField();
1654 jTextFieldToolChainFamily
.setBounds(new java
.awt
.Rectangle(fieldColumn
, rowFive
, fieldWidth
, oneRowHeight
));
1655 jTextFieldToolChainFamily
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1656 jTextFieldToolChainFamily
.setLocation(new java
.awt
.Point(fieldColumn
, rowFive
));
1658 return jTextFieldToolChainFamily
;
1662 * This method initializes jTextFieldOptionContents Row 6
1664 * This is where we should put the checkbox & entry data for the command arguments
1666 * @return javax.swing.JTextField
1668 private JTextField
getJTextFieldOptionContents() {
1669 if (jTextFieldOptionContents
== null) {
1670 jTextFieldOptionContents
= new JTextField();
1671 jTextFieldOptionContents
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1672 jTextFieldOptionContents
.setBounds(fieldColumn
, rowSix
, fieldWidth
, oneRowHeight
);
1673 jTextFieldOptionContents
.setLocation(new java
.awt
.Point(fieldColumn
, rowSix
));
1675 return jTextFieldOptionContents
;
1679 * This method initializes jButtonOptionsAdd
1681 * Add entry from the top screen to the table
1683 * @return javax.swing.JButton jButtonOptionsAdd
1685 private JButton
getJButtonOptionsAdd() {
1686 if (jButtonOptionsAdd
== null) {
1687 jButtonOptionsAdd
= new JButton();
1688 jButtonOptionsAdd
.setText("Add");
1690 jButtonOptionsAdd
.setPreferredSize(new java
.awt
.Dimension(buttonWidth
, oneRowHeight
));
1691 jButtonOptionsAdd
.setBounds(new java
.awt
.Rectangle(firstButtonLoc
, buttonRow
, buttonWidth
, oneRowHeight
));
1692 jButtonOptionsAdd
.setLocation(new java
.awt
.Point(firstButtonLoc
, buttonRow
));
1693 jButtonOptionsAdd
.addActionListener(new AbstractAction() {
1697 private static final long serialVersionUID
= 1L;
1699 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1700 boolean[] boolArray
= { jCheckBoxIA32
.isSelected(), jCheckBoxIpf
.isSelected(),
1701 jCheckBoxX64
.isSelected(), jCheckBoxEBC
.isSelected(),
1702 jCheckBoxARM
.isSelected(), jCheckBoxPPC
.isSelected() };
1703 String s
= boolToList(boolArray
);
1704 Object
[] o
= { jTextFieldBuildTargets
.getText(), jTextFieldToolChainFamily
.getText(), s
,
1705 jTextFieldToolCmd
.getText(), jTextFieldTagName
.getText(),
1706 jTextFieldOptionContents
.getText() };
1707 optionsTableModel
.addRow(o
);
1708 docConsole
.setSaved(false);
1709 ffc
.genBuildOptionsOpt(stringToVector(jTextFieldBuildTargets
.getText()),
1710 jTextFieldToolChainFamily
.getText(), jTextFieldTagName
.getText(),
1711 jTextFieldToolCmd
.getText(), stringToVector(s
),
1712 jTextFieldOptionContents
.getText());
1716 return jButtonOptionsAdd
;
1720 * This method initializes jButtonOptionsDel
1722 * Remove a line from the table below
1724 * @return javax.swing.JButton jButtonOptionsDel
1726 private JButton
getJButtonOptionsDel() {
1727 if (jButtonOptionsDel
== null) {
1728 jButtonOptionsDel
= new JButton();
1729 jButtonOptionsDel
.setText("Delete");
1730 jButtonOptionsDel
.setPreferredSize(new java
.awt
.Dimension(buttonWidth
, oneRowHeight
));
1731 jButtonOptionsDel
.setBounds(new java
.awt
.Rectangle(next2LastButtonLoc
, buttonRow
, buttonWidth
, oneRowHeight
));
1732 jButtonOptionsDel
.setLocation(new java
.awt
.Point(next2LastButtonLoc
, buttonRow
));
1733 jButtonOptionsDel
.addActionListener(new AbstractAction() {
1737 private static final long serialVersionUID
= 1L;
1739 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1740 if (selectedRow
>= 0) {
1741 optionsTableModel
.removeRow(selectedRow
);
1742 docConsole
.setSaved(false);
1743 ffc
.removeBuildOptionsOpt(selectedRow
);
1748 return jButtonOptionsDel
;
1752 * This method initializes jScrollPaneOptions
1753 * Contains the Table and is located below the data entry section
1754 * @return javax.swing.JScrollPane jScrollPaneOptoins
1756 private JScrollPane
getJScrollPaneOptions() {
1757 if (jScrollPaneOptions
== null) {
1758 jScrollPaneOptions
= new JScrollPane();
1759 jScrollPaneOptions
.setPreferredSize(new java
.awt
.Dimension(dialogWidth
, dialogHeight
* 2));
1760 jScrollPaneOptions
.setBounds(new java
.awt
.Rectangle(2, (dialogHeight
* 2) + 2, dialogWidth
* 2, dialogHeight
* 2));
1761 jScrollPaneOptions
.setLocation(new java
.awt
.Point(2, dialogHeight
+ 2));
1763 jScrollPaneOptions
.setViewportView(getJTableOptions());
1765 return jScrollPaneOptions
;
1769 * This method initializes jTableOptions
1771 * @return javax.swing.JTable jTableOptions
1773 private JTable
getJTableOptions() {
1774 if (jTableOptions
== null) {
1775 jTitle
= new JLabel();
1776 jTitle
.setText("Current Option Configuration Lines");
1777 jTitle
.setBounds(2, 2, labelWidth
, oneRowHeight
);
1779 optionsTableModel
= new DefaultTableModel();
1780 jTableOptions
= new JTable(optionsTableModel
);
1781 jTableOptions
.setRowHeight(20);
1782 optionsTableModel
.addColumn("Build Targets");
1783 optionsTableModel
.addColumn("Tool Chain Family");
1784 optionsTableModel
.addColumn("Supported Architectures");
1785 optionsTableModel
.addColumn("Tool Command Code");
1786 optionsTableModel
.addColumn("TagName");
1787 optionsTableModel
.addColumn("Contents");
1789 javax
.swing
.table
.TableColumn toolFamilyCol
= jTableOptions
.getColumnModel().getColumn(1);
1790 JComboBox cb
= new JComboBox();
1793 cb
.addItem("CYGWIN");
1794 cb
.addItem("INTEL");
1795 cb
.addItem("USER_DEFINED");
1796 toolFamilyCol
.setCellEditor(new DefaultCellEditor(cb
));
1797 Vector
<String
> vArch
= new Vector
<String
>();
1804 jTableOptions
.getColumnModel().getColumn(2).setCellEditor(new ListEditor(vArch
));
1805 jTableOptions
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
1806 jTableOptions
.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
1807 public void valueChanged(ListSelectionEvent e
) {
1809 if (e
.getValueIsAdjusting()) {
1812 ListSelectionModel lsm
= (ListSelectionModel
) e
.getSource();
1813 if (lsm
.isSelectionEmpty()) {
1816 selectedRow
= lsm
.getMinSelectionIndex();
1821 jTableOptions
.getModel().addTableModelListener(new TableModelListener() {
1822 public void tableChanged(TableModelEvent arg0
) {
1823 // TODO Auto-generated method stub
1824 int row
= arg0
.getFirstRow();
1825 TableModel m
= (TableModel
) arg0
.getSource();
1826 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
1827 //ToDo Data Validition check.
1828 String targets
= m
.getValueAt(row
, 0) + "";
1829 Vector
<Object
> targetName
= new Vector
<Object
>();
1830 String
[] sArray
= targets
.split("( )+");
1831 for (int i
= 0; i
< sArray
.length
; ++i
) {
1832 targetName
.add(sArray
[i
]);
1834 String toolChain
= m
.getValueAt(row
, 1) + "";
1835 String archs
= m
.getValueAt(row
, 2) + "";
1836 Vector
<Object
> supArch
= null;
1837 if (archs
.length() > 0) {
1838 supArch
= new Vector
<Object
>();
1839 String
[] sArray1
= archs
.split("( )+");
1840 for (int i
= 0; i
< sArray1
.length
; ++i
) {
1841 supArch
.add(sArray1
[i
]);
1845 String toolCmd
= m
.getValueAt(row
, 3) + "";
1846 String tagName
= m
.getValueAt(row
, 4) + "";
1847 String contents
= m
.getValueAt(row
, 5) + "";
1848 docConsole
.setSaved(false);
1849 ffc
.updateBuildOptionsOpt(row
, targetName
, toolChain
, tagName
, toolCmd
, supArch
, contents
);
1854 return jTableOptions
;
1857 private Vector
<Object
> stringToVector(String s
) {
1858 String
[] sArray
= s
.split(" ");
1859 Vector
<Object
> v
= null;
1860 if (s
.length() > 0) {
1861 v
= new Vector
<Object
>();
1862 for (int i
= 0; i
< sArray
.length
; ++i
) {
1869 private String
boolToList(boolean[] bool
) {
1895 private void initOptionTable() {
1896 if (ffc
.getBuildOptionsOptCount() == 0) {
1897 //ToDo get default options from *.txt file
1900 String
[][] saa
= new String
[ffc
.getBuildOptionsOptCount()][6];
1901 ffc
.getBuildOptionsOpts(saa
);
1902 for (int i
= 0; i
< saa
.length
; ++i
) {
1903 optionsTableModel
.addRow(saa
[i
]);
1909 * Everything below should pertain to the ANT Task Tab
1913 * This method initializes jButton12
1915 * @return javax.swing.JButton
1917 private JButton
getJButtonAntTaskFileBrowse() {
1918 if (jButtonAntTaskFileBrowse
== null) {
1919 jButtonAntTaskFileBrowse
= new JButton();
1920 jButtonAntTaskFileBrowse
.setPreferredSize(new Dimension(buttonWidth
, oneRowHeight
));
1921 jButtonAntTaskFileBrowse
.setText("Browse");
1922 jButtonAntTaskFileBrowse
.addActionListener(new AbstractAction() {
1923 private static final long serialVersionUID
= 1L;
1925 public void actionPerformed(ActionEvent arg0
) {
1927 // Select files from current workspace
1929 String dirPrefix
= System
.getenv("WORKSPACE");
1930 JFileChooser chooser
= new JFileChooser(dirPrefix
);
1931 File theFile
= null;
1932 String headerDest
= null;
1934 chooser
.setMultiSelectionEnabled(false);
1935 chooser
.setFileSelectionMode(JFileChooser
.FILES_ONLY
);
1936 int retval
= chooser
.showOpenDialog(frame
);
1937 if (retval
== JFileChooser
.APPROVE_OPTION
) {
1939 theFile
= chooser
.getSelectedFile();
1940 String file
= theFile
.getPath();
1941 if (!file
.startsWith(dirPrefix
)) {
1942 JOptionPane
.showMessageDialog(frame
, "You can only select files in current package!");
1949 headerDest
= theFile
.getPath();
1950 jTextFieldAntTaskFile
.setText(headerDest
.substring(dirPrefix
.length()).replace('\\', '/'));
1956 return jButtonAntTaskFileBrowse
;
1960 * This method initializes jPanelUserDefCenterN
1962 * @return javax.swing.JPanel
1964 private JPanel
getJPanelUserDefCenterN() {
1965 if (jPanelUserDefCenterN
== null) {
1966 jPanelUserDefCenterN
= new JPanel();
1967 jPanelUserDefCenterN
.add(jLabelAntCmdOpts
, null);
1968 jPanelUserDefCenterN
.add(getJTextFieldAntCmdOpts(), null);
1969 jPanelUserDefCenterN
.add(getJButtonAntTaskAdd(), null);
1970 jPanelUserDefCenterN
.add(getJButtonAntTaskDel(), null);
1972 return jPanelUserDefCenterN
;
1976 * This method initializes jPanelUserDefCenterC
1978 * @return javax.swing.JPanel
1980 private JPanel
getJPanelUserDefCenterC() {
1981 if (jPanelUserDefCenterC
== null) {
1982 jPanelUserDefCenterC
= new JPanel();
1983 jPanelUserDefCenterC
.add(getJScrollPaneAntTasks(), null);
1985 return jPanelUserDefCenterC
;
1989 * This method initializes jPanel8
1991 * @return javax.swing.JPanel
1993 private JPanel
getJPanelUserDef() {
1994 if (jPanelUserDef
== null) {
1995 jPanelUserDef
= new JPanel();
1996 jPanelUserDef
.setLayout(new BorderLayout());
1997 jPanelUserDef
.add(getJPanelUserDefNorth(), java
.awt
.BorderLayout
.NORTH
);
1998 jPanelUserDef
.add(getJPanelUserDefCenter(), java
.awt
.BorderLayout
.CENTER
);
2001 return jPanelUserDef
;
2005 * This method initializes jPanel9
2007 * @return javax.swing.JPanel
2009 private JPanel
getJPanelUserDefNorth() {
2010 if (jPanelUserDefNorth
== null) {
2011 jLabelAntTaskFile
= new JLabel();
2012 jLabelAntTaskFile
.setText("ANT Task File");
2013 jLabelAntTaskFile
.setPreferredSize(new java
.awt
.Dimension(80, 20));
2014 FlowLayout flowLayout8
= new FlowLayout();
2015 flowLayout8
.setAlignment(java
.awt
.FlowLayout
.CENTER
);
2016 jLabelAntTaskId
= new JLabel();
2017 jLabelAntTaskId
.setText("ID");
2018 jPanelUserDefNorth
= new JPanel();
2019 jPanelUserDefNorth
.setLayout(flowLayout8
);
2020 jPanelUserDefNorth
.add(jLabelAntTaskFile
, null);
2021 jPanelUserDefNorth
.add(getJTextFieldAntTaskFile(), null);
2022 jPanelUserDefNorth
.add(getJButtonAntTaskFileBrowse(), null);
2023 jPanelUserDefNorth
.add(jLabelAntTaskId
, null);
2024 jPanelUserDefNorth
.add(getJTextFieldAntTaskId(), null);
2026 return jPanelUserDefNorth
;
2030 * This method initializes jPanel11
2032 * @return javax.swing.JPanel
2034 private JPanel
getJPanelUserDefCenter() {
2035 if (jPanelUserDefCenter
== null) {
2036 jLabelAntCmdOpts
= new JLabel();
2037 jLabelAntCmdOpts
.setText("ANT Command Options");
2038 jLabelAntCmdOpts
.setPreferredSize(new java
.awt
.Dimension(131, 20));
2039 jPanelUserDefCenter
= new JPanel();
2040 jPanelUserDefCenter
.setLayout(new BorderLayout());
2042 jPanelUserDefCenter
.add(getJPanelUserDefCenterN(), java
.awt
.BorderLayout
.NORTH
);
2043 jPanelUserDefCenter
.add(getJPanelUserDefCenterC(), java
.awt
.BorderLayout
.CENTER
);
2045 return jPanelUserDefCenter
;
2049 * This method initializes jTextField2
2051 * @return javax.swing.JTextField
2053 private JTextField
getJTextFieldAntTaskFile() {
2054 if (jTextFieldAntTaskFile
== null) {
2055 jTextFieldAntTaskFile
= new JTextField();
2056 jTextFieldAntTaskFile
.setPreferredSize(new java
.awt
.Dimension(200, 20));
2058 return jTextFieldAntTaskFile
;
2062 * This method initializes jTextField3
2064 * @return javax.swing.JTextField
2066 private JTextField
getJTextFieldAntTaskId() {
2067 if (jTextFieldAntTaskId
== null) {
2068 jTextFieldAntTaskId
= new JTextField();
2069 jTextFieldAntTaskId
.setPreferredSize(new java
.awt
.Dimension(100, 20));
2071 return jTextFieldAntTaskId
;
2075 * This method initializes jButton4
2077 * @return javax.swing.JButton
2079 private JButton
getJButtonAntTaskAdd() {
2080 if (jButtonAntTaskAdd
== null) {
2081 jButtonAntTaskAdd
= new JButton();
2082 jButtonAntTaskAdd
.setPreferredSize(new java
.awt
.Dimension(90, 20));
2083 jButtonAntTaskAdd
.setText("Add");
2084 jButtonAntTaskAdd
.addActionListener(new ActionListener() {
2085 public void actionPerformed(ActionEvent e
) {
2086 if (!DataValidation
.isInt(jTextFieldAntTaskId
.getText())
2087 || jTextFieldAntTaskId
.getText().length() != 8) {
2088 JOptionPane
.showMessageDialog(frame
, "ID must be an 8-digit integer.");
2091 Object
[] o
= { jTextFieldAntTaskId
.getText(), null, null };
2092 o
[1] = jTextFieldAntTaskFile
.getText();
2093 o
[2] = jTextFieldAntCmdOpts
.getText();
2094 ffc
.genBuildOptionsUserDefAntTask(o
[0] + "", o
[1] + "", o
[2] + "");
2095 antTaskTableModel
.addRow(o
);
2096 docConsole
.setSaved(false);
2100 return jButtonAntTaskAdd
;
2104 * This method initializes jButton5
2106 * @return javax.swing.JButton
2108 private JButton
getJButtonAntTaskDel() {
2109 if (jButtonAntTaskDel
== null) {
2110 jButtonAntTaskDel
= new JButton();
2111 jButtonAntTaskDel
.setPreferredSize(new java
.awt
.Dimension(90, 20));
2112 jButtonAntTaskDel
.setText("Delete");
2113 jButtonAntTaskDel
.addActionListener(new ActionListener() {
2114 public void actionPerformed(ActionEvent e
) {
2115 if (selectedRow
>= 0) {
2116 docConsole
.setSaved(false);
2117 antTaskTableModel
.removeRow(selectedRow
);
2118 ffc
.removeBuildOptionsUserDefAntTask(selectedRow
);
2123 return jButtonAntTaskDel
;
2127 * This method initializes jTextField4
2129 * @return javax.swing.JTextField
2131 private JTextField
getJTextFieldAntCmdOpts() {
2132 if (jTextFieldAntCmdOpts
== null) {
2133 jTextFieldAntCmdOpts
= new JTextField();
2134 jTextFieldAntCmdOpts
.setPreferredSize(new java
.awt
.Dimension(270, 20));
2135 jTextFieldAntCmdOpts
.setEnabled(true);
2137 return jTextFieldAntCmdOpts
;
2141 * This method initializes jScrollPane2
2143 * @return javax.swing.JScrollPane
2145 private JScrollPane
getJScrollPaneAntTasks() {
2146 if (jScrollPaneAntTasks
== null) {
2147 jScrollPaneAntTasks
= new JScrollPane();
2148 jScrollPaneAntTasks
.setPreferredSize(new java
.awt
.Dimension(600, 400));
2149 jScrollPaneAntTasks
.setViewportView(getJTableAntTasks());
2151 return jScrollPaneAntTasks
;
2155 * This method initializes jTable2
2157 * @return javax.swing.JTable
2159 private JTable
getJTableAntTasks() {
2160 if (jTableAntTasks
== null) {
2161 antTaskTableModel
= new DefaultTableModel();
2162 jTableAntTasks
= new JTable(antTaskTableModel
);
2163 jTableAntTasks
.setRowHeight(20);
2164 antTaskTableModel
.addColumn("ID");
2165 antTaskTableModel
.addColumn("Filename");
2166 antTaskTableModel
.addColumn("ANT Command Options");
2168 jTableAntTasks
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
2169 jTableAntTasks
.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
2170 public void valueChanged(ListSelectionEvent e
) {
2172 if (e
.getValueIsAdjusting()) {
2175 ListSelectionModel lsm
= (ListSelectionModel
) e
.getSource();
2176 if (lsm
.isSelectionEmpty()) {
2179 selectedRow
= lsm
.getMinSelectionIndex();
2184 jTableAntTasks
.getModel().addTableModelListener(new TableModelListener() {
2185 public void tableChanged(TableModelEvent arg0
) {
2186 // TODO Auto-generated method stub
2187 int row
= arg0
.getFirstRow();
2188 TableModel m
= (TableModel
) arg0
.getSource();
2189 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
2190 //ToDo Data Validition check.
2191 String id
= m
.getValueAt(row
, 0) + "";
2192 String file
= m
.getValueAt(row
, 1) + "";
2193 String execOrder
= m
.getValueAt(row
, 2) + "";
2194 if (id
.length() == 0) {
2197 if (file
.length() == 0 && execOrder
.length() == 0) {
2200 if (file
.length() == 0) {
2203 if (execOrder
.length() == 0) {
2206 ffc
.updateBuildOptionsUserDefAntTask(row
, id
, file
, execOrder
);
2212 return jTableAntTasks
;
2215 private void initAntTaskTable() {
2216 if (ffc
.getBuildOptionsUserDefAntTaskCount() == 0) {
2219 String
[][] saa
= new String
[ffc
.getBuildOptionsUserDefAntTaskCount()][3];
2220 ffc
.getBuildOptionsUserDefAntTasks(saa
);
2221 for (int i
= 0; i
< saa
.length
; ++i
) {
2222 antTaskTableModel
.addRow(saa
[i
]);
2226 } // @jve:decl-index=0:visual-constraint="10,10"