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 jPanelSectionsN
= null;
299 private JPanel jPanelSubSectionN
= null;
301 private JPanel jPanelOptionsContainer
= null;
303 private JPanel jPanelUserDefCenterN
= null;
306 * This method initializes jPanel
308 * @return javax.swing.JPanel
309 private JPanel getJPanelContentSouth() {
310 if (jPanelContentSouth == null) {
311 jPanelContentSouth = new JPanel();
313 return jPanelContentSouth;
318 * This method initializes jPanel1
320 * @return javax.swing.JPanel
321 private JPanel getJPanelContentNorth() {
322 if (jPanelContentNorth == null) {
323 jPanelContentNorth = new JPanel();
325 return jPanelContentNorth;
330 * This method initializes jPanel2
332 * @return javax.swing.JPanel
333 private JPanel getJPanelContentWest() {
334 if (jPanelContentWest == null) {
335 jPanelContentWest = new JPanel();
337 return jPanelContentWest;
342 * This method initializes jPanel3
344 * @return javax.swing.JPanel
345 private JPanel getJPanelContentEast() {
346 if (jPanelContentEast == null) {
347 jPanelContentEast = new JPanel();
349 return jPanelContentEast;
354 * This method initializes jTabbedPane
356 * @return javax.swing.JTabbedPane
358 private JTabbedPane
getJTabbedPane() {
359 if (jTabbedPane
== null) {
360 jTabbedPane
= new JTabbedPane();
361 jTabbedPane
.addTab("Flash Filesystem Options", null, getJPanelFfsTab(), null);
362 jTabbedPane
.addTab("Tool Arguments", null, getJPanelOptionsTab(), null);
363 jTabbedPane
.addTab("User Defined ANT Tasks", null, getJPanelUserDef(), null);
369 * This method initializes this
373 private void initialize() {
374 this.setSize(722, 577);
375 this.setTitle("Platform Build Options");
376 this.setContentPane(getJContentPane());
380 * This method initializes jContentPane
382 * @return javax.swing.JPanel
384 private JPanel
getJContentPane() {
385 if (jContentPane
== null) {
386 jContentPane
= new JPanel();
387 jContentPane
.setLayout(new BorderLayout());
388 // jContentPane.add(getJPanelContentSouth(), java.awt.BorderLayout.SOUTH);
389 // jContentPane.add(getJPanelContentNorth(), java.awt.BorderLayout.NORTH);
390 // jContentPane.add(getJPanelContentWest(), java.awt.BorderLayout.WEST);
391 // jContentPane.add(getJPanelContentEast(), java.awt.BorderLayout.EAST);
392 jContentPane
.add(getJTabbedPane(), java
.awt
.BorderLayout
.CENTER
);
400 public static void main(String
[] args
) {
401 // TODO Auto-generated method stub
402 new FpdBuildOptions().setVisible(true);
406 * This is the default constructor
408 public FpdBuildOptions() {
411 this.setVisible(true);
414 public FpdBuildOptions(PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
416 ffc
= new FpdFileContents(fpd
);
420 public FpdBuildOptions(OpeningPlatformType opt
) {
421 this(opt
.getXmlFpd());
425 private void init(FpdFileContents ffc
) {
429 this.addInternalFrameListener(new InternalFrameAdapter() {
430 public void internalFrameDeactivated(InternalFrameEvent e
) {
431 if (jTableFfs
.isEditing()) {
432 jTableFfs
.getCellEditor().stopCellEditing();
434 if (jTableFfsSection
.isEditing()) {
435 jTableFfsSection
.getCellEditor().stopCellEditing();
437 if (jTableAntTasks
.isEditing()) {
438 jTableAntTasks
.getCellEditor().stopCellEditing();
440 if (jTableFfsSubSection
.isEditing()) {
441 jTableFfsSubSection
.getCellEditor().stopCellEditing();
443 if (jTableFfsAttribs
.isEditing()) {
444 jTableFfsAttribs
.getCellEditor().stopCellEditing();
446 if (jTableOptions
.isEditing()) {
447 jTableOptions
.getCellEditor().stopCellEditing();
454 * This method initializes jPanel13
456 * @return javax.swing.JPanel
458 private JPanel
getJPanelFfsTab() {
459 if (jPanelFfsTab
== null) {
460 jPanelFfsTab
= new JPanel();
461 jPanelFfsTab
.setLayout(new BorderLayout());
462 jPanelFfsTab
.add(getJPanelFfsTabCenter(), java
.awt
.BorderLayout
.CENTER
);
463 jPanelFfsTab
.add(getJScrollPaneFfs(), java
.awt
.BorderLayout
.WEST
);
469 * This method initializes jPanel18
471 * @return javax.swing.JPanel
473 private JPanel
getJPanelFfsTabCenter() {
474 if (jPanelFfsTabCenter
== null) {
475 jPanelFfsTabCenter
= new JPanel();
476 jPanelFfsTabCenter
.setLayout(new BorderLayout());
477 jPanelFfsTabCenter
.add(getJPanelFfsTabCenterN(), java
.awt
.BorderLayout
.NORTH
);
478 jPanelFfsTabCenter
.add(getJPanelFfsTabCenterS(), java
.awt
.BorderLayout
.SOUTH
);
479 jPanelFfsTabCenter
.add(getJSplitPaneFfsC(), java
.awt
.BorderLayout
.CENTER
);
481 return jPanelFfsTabCenter
;
485 * This method initializes jPanel15
487 * @return javax.swing.JPanel
489 private JPanel
getJPanelFfsTabCenterN() {
490 if (jPanelFfsTabCenterN
== null) {
491 jLabelEncapType
= new JLabel();
492 jLabelEncapType
.setText("Encapsulation Type");
493 FlowLayout flowLayout5
= new FlowLayout();
494 flowLayout5
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
495 jLabelFfsKey
= new JLabel();
496 jLabelFfsKey
.setText("FFS Key");
497 jPanelFfsTabCenterN
= new JPanel();
498 jPanelFfsTabCenterN
.setLayout(flowLayout5
);
499 jPanelFfsTabCenterN
.add(jLabelFfsKey
, null);
500 jPanelFfsTabCenterN
.add(getJTextFieldFfsKey(), null);
501 jPanelFfsTabCenterN
.add(jLabelEncapType
, null);
502 jPanelFfsTabCenterN
.add(getJTextFieldEncapType(), null);
503 jPanelFfsTabCenterN
.add(getJButtonFfsAdd(), null);
504 jPanelFfsTabCenterN
.add(getJButtonFfsDel(), null);
506 return jPanelFfsTabCenterN
;
510 * This method initializes jPanel16
512 * @return javax.swing.JPanel
514 private JPanel
getJPanelFfsTabCenterS() {
515 if (jPanelFfsTabCenterS
== null) {
516 jLabelFfsAttribs
= new JLabel();
517 jLabelFfsAttribs
.setText("Attributes");
518 FlowLayout flowLayout6
= new FlowLayout();
519 flowLayout6
.setHgap(5);
520 flowLayout6
.setVgap(20);
521 flowLayout6
.setAlignment(java
.awt
.FlowLayout
.CENTER
);
522 jPanelFfsTabCenterS
= new JPanel();
523 jPanelFfsTabCenterS
.setPreferredSize(new java
.awt
.Dimension(491, 130));
524 jPanelFfsTabCenterS
.setLayout(flowLayout6
);
525 jPanelFfsTabCenterS
.add(jLabelFfsAttribs
, null);
526 jPanelFfsTabCenterS
.add(getJScrollPaneFfsAttribs(), null);
527 jPanelFfsTabCenterS
.add(getJPanelFfsAttribButtonGroup(), null);
529 return jPanelFfsTabCenterS
;
533 * This method initializes jTextField6
535 * @return javax.swing.JTextField
537 private JTextField
getJTextFieldFfsKey() {
538 if (jTextFieldFfsKey
== null) {
539 jTextFieldFfsKey
= new JTextField();
540 jTextFieldFfsKey
.setPreferredSize(new java
.awt
.Dimension(100, 20));
541 jTextFieldFfsKey
.setEditable(true);
542 jTextFieldFfsKey
.addFocusListener(new java
.awt
.event
.FocusAdapter() {
543 public void focusLost(java
.awt
.event
.FocusEvent e
) {
544 if (jTableFfs
.getSelectedRow() < 0) {
547 // ffc.updateBuildOptionsFfsKey(jTable.getSelectedRow(), jTextField6.getText());
551 return jTextFieldFfsKey
;
555 * This method initializes jButton8
557 * @return javax.swing.JButton
559 private JButton
getJButtonFfsAdd() {
560 if (jButtonFfsAdd
== null) {
561 jButtonFfsAdd
= new JButton();
562 jButtonFfsAdd
.setPreferredSize(new java
.awt
.Dimension(70, 20));
563 jButtonFfsAdd
.setText("Add");
564 jButtonFfsAdd
.addActionListener(new AbstractAction() {
568 private static final long serialVersionUID
= -2923720717273384221L;
570 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
571 if (jTextFieldFfsKey
.getText().length() > 0) {
572 String
[] row
= { jTextFieldFfsKey
.getText() };
573 ffsTableModel
.addRow(row
);
574 docConsole
.setSaved(false);
575 ffc
.genBuildOptionsFfs(jTextFieldFfsKey
.getText(), jTextFieldEncapType
.getText());
580 return jButtonFfsAdd
;
584 * This method initializes jButton9
586 * @return javax.swing.JButton
588 private JButton
getJButtonFfsDel() {
589 if (jButtonFfsDel
== null) {
590 jButtonFfsDel
= new JButton();
591 jButtonFfsDel
.setPreferredSize(new java
.awt
.Dimension(70, 20));
592 jButtonFfsDel
.setText("Delete");
593 jButtonFfsDel
.addActionListener(new AbstractAction() {
597 private static final long serialVersionUID
= -4002678939178194476L;
599 public void actionPerformed(ActionEvent arg0
) {
600 if (jTableFfs
.getSelectedRow() < 0) {
603 docConsole
.setSaved(false);
604 ffc
.removeBuildOptionsFfs(jTableFfs
.getSelectedRow());
605 ffsTableModel
.removeRow(jTableFfs
.getSelectedRow());
609 return jButtonFfsDel
;
613 * This method initializes jScrollPane5
615 * @return javax.swing.JScrollPane
617 private JScrollPane
getJScrollPaneFfsAttribs() {
618 if (jScrollPaneFfsAttribs
== null) {
619 jScrollPaneFfsAttribs
= new JScrollPane();
620 jScrollPaneFfsAttribs
.setPreferredSize(new java
.awt
.Dimension(350, 100));
621 jScrollPaneFfsAttribs
.setViewportView(getJTableFfsAttribs());
623 return jScrollPaneFfsAttribs
;
627 * This method initializes jTable4
629 * @return javax.swing.JTable
631 private JTable
getJTableFfsAttribs() {
632 if (jTableFfsAttribs
== null) {
633 ffsAttributesTableModel
= new DefaultTableModel();
634 jTableFfsAttribs
= new JTable(ffsAttributesTableModel
);
635 jTableFfsAttribs
.setPreferredSize(new java
.awt
.Dimension(400, 80));
636 jTableFfsAttribs
.setRowHeight(20);
637 ffsAttributesTableModel
.addColumn("Name");
638 ffsAttributesTableModel
.addColumn("Value");
640 jTableFfsAttribs
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
641 jTableFfsAttribs
.getModel().addTableModelListener(new TableModelListener() {
642 public void tableChanged(TableModelEvent arg0
) {
643 // TODO Auto-generated method stub
644 int row
= arg0
.getFirstRow();
645 TableModel m
= (TableModel
) arg0
.getSource();
646 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
647 //ToDo Data Validition check.
648 String name
= m
.getValueAt(row
, 0) + "";
649 String value
= m
.getValueAt(row
, 1) + "";
651 if (name
.length() == 0) {
654 if (value
.length() == 0) {
657 docConsole
.setSaved(false);
658 ffc
.updateBuildOptionsFfsAttribute(jTableFfs
.getSelectedRow(), row
, name
, value
);
663 return jTableFfsAttribs
;
666 private void initFfsTable() {
667 int ffsCount
= ffc
.getBuildOptionsFfsCount();
671 String
[][] saa
= new String
[ffsCount
][1];
672 ffc
.getBuildOptionsFfsKey(saa
);
673 for (int i
= 0; i
< saa
.length
; ++i
) {
674 ffsTableModel
.addRow(saa
[i
]);
679 * This method initializes jButton17
681 * @return javax.swing.JButton
683 private JButton
getJButtonFfsAttribNew() {
684 if (jButtonFfsAttribNew
== null) {
685 jButtonFfsAttribNew
= new JButton();
686 jButtonFfsAttribNew
.setPreferredSize(new java
.awt
.Dimension(80, 20));
687 jButtonFfsAttribNew
.setText("New");
688 jButtonFfsAttribNew
.addActionListener(new AbstractAction() {
692 private static final long serialVersionUID
= 1L;
694 public void actionPerformed(ActionEvent arg0
) {
695 if (jTableFfs
.getSelectedRow() < 0) {
698 Object
[] o
= { "", "" };
699 ffsAttributesTableModel
.addRow(o
);
700 docConsole
.setSaved(false);
701 ffc
.genBuildOptionsFfsAttribute(jTableFfs
.getSelectedRow(), "", "");
705 return jButtonFfsAttribNew
;
709 * This method initializes jButton18
711 * @return javax.swing.JButton
713 private JButton
getJButtonFfsAttribRemove() {
714 if (jButtonFfsAttribRemove
== null) {
715 jButtonFfsAttribRemove
= new JButton();
716 jButtonFfsAttribRemove
.setPreferredSize(new java
.awt
.Dimension(80, 20));
717 jButtonFfsAttribRemove
.setText("Remove");
718 jButtonFfsAttribRemove
.addActionListener(new AbstractAction() {
722 private static final long serialVersionUID
= 1L;
724 public void actionPerformed(ActionEvent arg0
) {
725 if (jTableFfs
.getSelectedRow() < 0) {
728 if (jTableFfsAttribs
.getSelectedRow() >= 0) {
729 docConsole
.setSaved(false);
730 ffsAttributesTableModel
.removeRow(jTableFfsAttribs
.getSelectedRow());
731 ffc
.removeBuildOptionsFfsAttribute(jTableFfs
.getSelectedRow(),
732 jTableFfsAttribs
.getSelectedRow());
737 return jButtonFfsAttribRemove
;
741 * This method initializes jScrollPane
743 * @return javax.swing.JScrollPane
745 private JScrollPane
getJScrollPaneFfs() {
746 if (jScrollPaneFfs
== null) {
747 jScrollPaneFfs
= new JScrollPane();
748 jScrollPaneFfs
.setPreferredSize(new java
.awt
.Dimension(150, 419));
749 jScrollPaneFfs
.setViewportView(getJTableFfs());
751 return jScrollPaneFfs
;
755 * This method initializes jTable
757 * @return javax.swing.JTable
759 private JTable
getJTableFfs() {
760 if (jTableFfs
== null) {
761 ffsTableModel
= new DefaultTableModel();
762 ffsTableModel
.addColumn("FFS Type");
763 jTableFfs
= new JTable(ffsTableModel
);
764 jTableFfs
.setShowGrid(false);
765 jTableFfs
.setRowHeight(20);
767 jTableFfs
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
768 jTableFfs
.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
769 public void valueChanged(ListSelectionEvent e
) {
771 if (e
.getValueIsAdjusting()) {
774 ListSelectionModel lsm
= (ListSelectionModel
) e
.getSource();
775 if (lsm
.isSelectionEmpty()) {
778 int row
= lsm
.getMinSelectionIndex();
779 sectionTableModel
.setRowCount(0);
780 sectionsTableModel
.setRowCount(0);
781 subsectionsTableModel
.setRowCount(0);
782 ffsAttributesTableModel
.setRowCount(0);
783 String
[] sArray
= { "", "" };
784 LinkedHashMap
<String
, String
> lhm
= new LinkedHashMap
<String
, String
>();
785 ArrayList
<String
> alSections
= new ArrayList
<String
>();
786 ArrayList
<String
> alSection
= new ArrayList
<String
>();
787 ffc
.getBuildOptionsFfs(row
, sArray
, lhm
, alSections
, alSection
);
788 jTextFieldFfsKey
.setText(sArray
[0]);
789 jTextFieldEncapType
.setText(sArray
[1]);
790 for (int i
= 0; i
< alSection
.size(); ++i
) {
791 String
[] sectionRow
= { alSection
.get(i
) };
792 sectionTableModel
.addRow(sectionRow
);
794 for (int j
= 0; j
< alSections
.size(); ++j
) {
795 String
[] sectionsRow
= { alSections
.get(j
) };
796 sectionsTableModel
.addRow(sectionsRow
);
798 if (lhm
.size() <= 0) {
801 Set
<String
> keySet
= lhm
.keySet();
802 Iterator
<String
> is
= keySet
.iterator();
803 while (is
.hasNext()) {
804 String key
= is
.next();
805 String
[] attribRow
= { key
, lhm
.get(key
) };
806 ffsAttributesTableModel
.addRow(attribRow
);
812 jTableFfs
.getModel().addTableModelListener(new TableModelListener() {
813 public void tableChanged(TableModelEvent arg0
) {
814 // TODO Auto-generated method stub
815 int row
= arg0
.getFirstRow();
816 TableModel m
= (TableModel
) arg0
.getSource();
817 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
818 //ToDo Data Validition check.
819 String id
= m
.getValueAt(row
, 0) + "";
821 if (id
.length() == 0) {
824 docConsole
.setSaved(false);
825 ffc
.updateBuildOptionsFfsKey(row
, id
);
834 * This method initializes jScrollPane1
836 * @return javax.swing.JScrollPane
838 private JScrollPane
getJScrollPaneFfsSection() {
839 if (jScrollPaneFfsSection
== null) {
840 jScrollPaneFfsSection
= new JScrollPane();
841 // jScrollPaneFfsSection.setPreferredSize(new java.awt.Dimension(500, 80));
842 jScrollPaneFfsSection
.setViewportView(getJTableFfsSection());
844 return jScrollPaneFfsSection
;
848 * This method initializes jTable1
850 * @return javax.swing.JTable
852 private JTable
getJTableFfsSection() {
853 if (jTableFfsSection
== null) {
854 sectionTableModel
= new DefaultTableModel();
855 sectionTableModel
.addColumn("SectionType");
857 jTableFfsSection
= new JTable(sectionTableModel
);
858 jTableFfsSection
.setRowHeight(20);
859 JComboBox cb
= new JComboBox();
860 cb
.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");
861 cb
.addItem("EFI_SECTION_VERSION");
862 cb
.addItem("EFI_SECTION_USER_INTERFACE");
863 cb
.addItem("EFI_SECTION_DXE_DEPEX");
864 cb
.addItem("EFI_SECTION_PEI_DEPEX");
865 cb
.addItem("EFI_SECTION_PE32");
866 cb
.addItem("EFI_SECTION_PIC");
867 cb
.addItem("EFI_SECTION_TE");
868 cb
.addItem("EFI_SECTION_RAW");
869 cb
.addItem("EFI_SECTION_COMPRESSION");
870 cb
.addItem("EFI_SECTION_GUID_DEFINED");
871 cb
.addItem("EFI_SECTION_COMPATIBILITY16");
872 cb
.addItem("EFI_SECTION_FIRMWARE_VOLUME_IMAGE");
873 jTableFfsSection
.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(cb
));
875 jTableFfsSection
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
877 jTableFfsSection
.getModel().addTableModelListener(new TableModelListener() {
878 public void tableChanged(TableModelEvent arg0
) {
879 // TODO Auto-generated method stub
880 if (jTableFfs
.getSelectedRow() < 0) {
883 int row
= arg0
.getFirstRow();
884 TableModel m
= (TableModel
) arg0
.getSource();
885 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
886 //ToDo Data Validition check.
887 String type
= m
.getValueAt(row
, 0) + "";
888 docConsole
.setSaved(false);
889 ffc
.updateBuildOptionsFfsSectionsSection(jTableFfs
.getSelectedRow(), row
, type
);
894 return jTableFfsSection
;
898 * This method initializes jScrollPane3
900 * @return javax.swing.JScrollPane
902 private JScrollPane
getJScrollPaneFfsSubSection() {
903 if (jScrollPaneFfsSubSection
== null) {
904 jScrollPaneFfsSubSection
= new JScrollPane();
905 // jScrollPaneFfsSubSection.setPreferredSize(new java.awt.Dimension(500, 90));
906 jScrollPaneFfsSubSection
.setViewportView(getJTableFfsSubSection());
908 return jScrollPaneFfsSubSection
;
912 * This method initializes jTable3
914 * @return javax.swing.JTable
916 private JTable
getJTableFfsSubSection() {
917 if (jTableFfsSubSection
== null) {
918 subsectionsTableModel
= new DefaultTableModel();
919 subsectionsTableModel
.addColumn("SectionType");
920 jTableFfsSubSection
= new JTable(subsectionsTableModel
);
921 jTableFfsSubSection
.setRowHeight(20);
922 JComboBox cb
= new JComboBox();
923 cb
.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");
924 cb
.addItem("EFI_SECTION_VERSION");
925 cb
.addItem("EFI_SECTION_USER_INTERFACE");
926 cb
.addItem("EFI_SECTION_DXE_DEPEX");
927 cb
.addItem("EFI_SECTION_PEI_DEPEX");
928 cb
.addItem("EFI_SECTION_PE32");
929 cb
.addItem("EFI_SECTION_PIC");
930 cb
.addItem("EFI_SECTION_TE");
931 cb
.addItem("EFI_SECTION_RAW");
932 cb
.addItem("EFI_SECTION_COMPRESSION");
933 cb
.addItem("EFI_SECTION_GUID_DEFINED");
934 cb
.addItem("EFI_SECTION_COMPATIBILITY16");
935 cb
.addItem("EFI_SECTION_FIRMWARE_VOLUME_IMAGE");
936 jTableFfsSubSection
.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(cb
));
937 jTableFfsSubSection
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
939 jTableFfsSubSection
.getModel().addTableModelListener(new TableModelListener() {
940 public void tableChanged(TableModelEvent arg0
) {
941 // TODO Auto-generated method stub
942 if (jTableFfs
.getSelectedRow() < 0 || jTableFfsSections
.getSelectedRow() < 0) {
945 int row
= arg0
.getFirstRow();
946 TableModel m
= (TableModel
) arg0
.getSource();
947 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
948 //ToDo Data Validition check.
949 String type
= m
.getValueAt(row
, 0) + "";
950 docConsole
.setSaved(false);
951 ffc
.updateBuildOptionsFfsSectionsSectionsSection(jTableFfs
.getSelectedRow(),
952 jTableFfsSections
.getSelectedRow(), row
, type
);
957 return jTableFfsSubSection
;
961 * This method initializes jTextField
963 * @return javax.swing.JTextField
965 private JTextField
getJTextFieldEncapType() {
966 if (jTextFieldEncapType
== null) {
967 jTextFieldEncapType
= new JTextField();
968 jTextFieldEncapType
.setPreferredSize(new java
.awt
.Dimension(100, 20));
969 jTextFieldEncapType
.addFocusListener(new java
.awt
.event
.FocusAdapter() {
970 public void focusLost(java
.awt
.event
.FocusEvent e
) {
971 if (jTableFfs
.getSelectedRow() < 0) {
974 ffc
.updateBuildOptionsFfsSectionsType(jTableFfs
.getSelectedRow(), jTextFieldEncapType
.getText());
978 return jTextFieldEncapType
;
982 * This method initializes jPanel4
984 * @return javax.swing.JPanel
986 private JPanel
getJPanelFfsAttribButtonGroup() {
987 if (jPanelFfsAttribButtonGroup
== null) {
988 jPanelFfsAttribButtonGroup
= new JPanel();
989 jPanelFfsAttribButtonGroup
.setPreferredSize(new java
.awt
.Dimension(100, 100));
990 jPanelFfsAttribButtonGroup
.add(getJButtonFfsAttribNew(), null);
991 jPanelFfsAttribButtonGroup
.add(getJButtonFfsAttribRemove(), null);
993 return jPanelFfsAttribButtonGroup
;
997 * This method initializes jButton
999 * @return javax.swing.JButton
1001 private JButton
getJButtonFfsSectionNew() {
1002 if (jButtonFfsSectionNew
== null) {
1003 jButtonFfsSectionNew
= new JButton();
1004 jButtonFfsSectionNew
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1005 jButtonFfsSectionNew
.setText("New");
1006 jButtonFfsSectionNew
.addActionListener(new java
.awt
.event
.ActionListener() {
1007 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1008 if (jTableFfs
.getSelectedRow() < 0) {
1011 docConsole
.setSaved(false);
1012 String
[] row
= { "EFI_SECTION_RAW" };
1013 sectionTableModel
.addRow(row
);
1014 ffc
.genBuildOptionsFfsSectionsSection(jTableFfs
.getSelectedRow(), row
[0]);
1018 return jButtonFfsSectionNew
;
1022 * This method initializes jButton1
1024 * @return javax.swing.JButton
1026 private JButton
getJButtonFfsSectionRemove() {
1027 if (jButtonFfsSectionRemove
== null) {
1028 jButtonFfsSectionRemove
= new JButton();
1029 jButtonFfsSectionRemove
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1030 jButtonFfsSectionRemove
.setText("Remove");
1032 jButtonFfsSectionRemove
.addActionListener(new java
.awt
.event
.ActionListener() {
1033 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1034 if (jTableFfs
.getSelectedRow() < 0 || jTableFfsSection
.getSelectedRow() < 0) {
1037 docConsole
.setSaved(false);
1038 sectionTableModel
.removeRow(jTableFfsSection
.getSelectedRow());
1039 ffc
.removeBuildOptionsFfsSectionsSection(jTableFfs
.getSelectedRow(),
1040 jTableFfsSection
.getSelectedRow());
1044 return jButtonFfsSectionRemove
;
1048 * This method initializes jButton2
1050 * @return javax.swing.JButton
1052 private JButton
getJButtonFfsSubSectionNew() {
1053 if (jButtonFfsSubSectionNew
== null) {
1054 jButtonFfsSubSectionNew
= new JButton();
1055 jButtonFfsSubSectionNew
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1056 jButtonFfsSubSectionNew
.setText("New");
1057 jButtonFfsSubSectionNew
.addActionListener(new java
.awt
.event
.ActionListener() {
1058 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1059 if (jTableFfs
.getSelectedRow() < 0 || jTableFfsSections
.getSelectedRow() < 0) {
1062 docConsole
.setSaved(false);
1063 String
[] row
= { "EFI_SECTION_RAW" };
1064 subsectionsTableModel
.addRow(row
);
1065 ffc
.genBuildOptionsFfsSectionsSectionsSection(jTableFfs
.getSelectedRow(),
1066 jTableFfsSections
.getSelectedRow(), row
[0]);
1071 return jButtonFfsSubSectionNew
;
1075 * This method initializes jButton3
1077 * @return javax.swing.JButton
1079 private JButton
getJButtonFfsSubSectionRemove() {
1080 if (jButtonFfsSubSectionRemove
== null) {
1081 jButtonFfsSubSectionRemove
= new JButton();
1082 jButtonFfsSubSectionRemove
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1083 jButtonFfsSubSectionRemove
.setText("Remove");
1084 jButtonFfsSubSectionRemove
.addActionListener(new java
.awt
.event
.ActionListener() {
1085 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1086 if (jTableFfs
.getSelectedRow() < 0 || jTableFfsSections
.getSelectedRow() < 0
1087 || jTableFfsSubSection
.getSelectedRow() < 0) {
1090 docConsole
.setSaved(false);
1091 subsectionsTableModel
.removeRow(jTableFfsSubSection
.getSelectedRow());
1092 ffc
.removeBuildOptionsFfsSectionsSectionsSection(jTableFfs
.getSelectedRow(),
1093 jTableFfsSections
.getSelectedRow(),
1094 jTableFfsSubSection
.getSelectedRow());
1098 return jButtonFfsSubSectionRemove
;
1102 * This method initializes jButton6
1104 * @return javax.swing.JButton
1106 private JButton
getJButtonFfsSectionsNew() {
1107 if (jButtonFfsSectionsNew
== null) {
1108 jButtonFfsSectionsNew
= new JButton();
1109 jButtonFfsSectionsNew
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1110 jButtonFfsSectionsNew
.setText("New");
1111 jButtonFfsSectionsNew
.addActionListener(new java
.awt
.event
.ActionListener() {
1112 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1113 if (jTableFfs
.getSelectedRow() < 0) {
1116 docConsole
.setSaved(false);
1117 String
[] row
= { "" };
1118 sectionsTableModel
.addRow(row
);
1119 ffc
.genBuildOptionsFfsSectionsSections(jTableFfs
.getSelectedRow(), "");
1123 return jButtonFfsSectionsNew
;
1127 * This method initializes jButton7
1129 * @return javax.swing.JButton
1131 private JButton
getJButtonFfsSectionsRemove() {
1132 if (jButtonFfsSectionsRemove
== null) {
1133 jButtonFfsSectionsRemove
= new JButton();
1134 jButtonFfsSectionsRemove
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1135 jButtonFfsSectionsRemove
.setText("Remove");
1136 jButtonFfsSectionsRemove
.addActionListener(new java
.awt
.event
.ActionListener() {
1137 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1138 if (jTableFfs
.getSelectedRow() < 0 || jTableFfsSections
.getSelectedRow() < 0) {
1141 docConsole
.setSaved(false);
1142 sectionsTableModel
.removeRow(jTableFfsSections
.getSelectedRow());
1143 ffc
.removeBuildOptionsFfsSectionsSections(jTableFfs
.getSelectedRow(),
1144 jTableFfsSections
.getSelectedRow());
1148 return jButtonFfsSectionsRemove
;
1151 private JScrollPane
getJScrollPaneFfsSections() {
1152 if (jScrollPaneFfsSections
== null) {
1153 jScrollPaneFfsSections
= new JScrollPane();
1154 // jScrollPaneFfsSections.setPreferredSize(new java.awt.Dimension(500, 80));
1155 jScrollPaneFfsSections
.setViewportView(getJTableFfsSections());
1157 return jScrollPaneFfsSections
;
1161 * This method initializes jTable6
1163 * @return javax.swing.JTable
1165 private JTable
getJTableFfsSections() {
1166 if (jTableFfsSections
== null) {
1167 sectionsTableModel
= new DefaultTableModel();
1168 sectionsTableModel
.addColumn("EncapsulationType");
1169 jTableFfsSections
= new JTable(sectionsTableModel
);
1170 jTableFfsSections
.setRowHeight(20);
1171 jTableFfsSections
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
1172 jTableFfsSections
.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
1173 public void valueChanged(ListSelectionEvent e
) {
1174 if (e
.getValueIsAdjusting()) {
1177 ListSelectionModel lsm
= (ListSelectionModel
) e
.getSource();
1178 if (lsm
.isSelectionEmpty()) {
1181 int sectionsRow
= lsm
.getMinSelectionIndex();
1182 if (jTableFfs
.getSelectedRow() < 0) {
1185 subsectionsTableModel
.setRowCount(0);
1186 ArrayList
<String
> al
= new ArrayList
<String
>();
1187 ffc
.getBuildOptionsFfsSectionsSectionsSection(jTableFfs
.getSelectedRow(), sectionsRow
, al
);
1188 for (int i
= 0; i
< al
.size(); ++i
) {
1189 String
[] subsectionRow
= { al
.get(i
) };
1190 subsectionsTableModel
.addRow(subsectionRow
);
1196 jTableFfsSections
.getModel().addTableModelListener(new TableModelListener() {
1197 public void tableChanged(TableModelEvent arg0
) {
1198 // TODO Auto-generated method stub
1199 int row
= arg0
.getFirstRow();
1200 TableModel m
= (TableModel
) arg0
.getSource();
1201 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
1202 //ToDo Data Validition check.
1203 String encapType
= m
.getValueAt(row
, 0) + "";
1204 docConsole
.setSaved(false);
1205 ffc
.updateBuildOptionsFfsSectionsSections(jTableFfs
.getSelectedRow(), row
, encapType
);
1210 return jTableFfsSections
;
1214 * This method initializes jSplitPaneFfsC
1216 * @return javax.swing.JSplitPane
1218 private JSplitPane
getJSplitPaneFfsC() {
1219 if (jSplitPaneFfsC
== null) {
1220 jSplitPaneFfsC
= new JSplitPane();
1221 jSplitPaneFfsC
.setOrientation(javax
.swing
.JSplitPane
.VERTICAL_SPLIT
);
1222 jSplitPaneFfsC
.setDividerLocation(130);
1223 jSplitPaneFfsC
.setTopComponent(getJPanelFfsCTop());
1224 jSplitPaneFfsC
.setBottomComponent(getJSplitPaneFfsCBottom());
1225 jSplitPaneFfsC
.setDividerSize(5);
1227 return jSplitPaneFfsC
;
1231 * This method initializes jPanelFfsCTop
1233 * @return javax.swing.JPanel
1235 private JPanel
getJPanelFfsCTop() {
1236 if (jPanelFfsCTop
== null) {
1237 jPanelFfsCTop
= new JPanel();
1238 jPanelFfsCTop
.setLayout(new BorderLayout());
1239 jPanelFfsCTop
.add(getJPanelSectionN(), java
.awt
.BorderLayout
.NORTH
);
1240 jPanelFfsCTop
.add(getJScrollPaneFfsSection(), java
.awt
.BorderLayout
.CENTER
);
1242 return jPanelFfsCTop
;
1246 * This method initializes jSplitPaneFfsCBottom
1248 * @return javax.swing.JSplitPane
1250 private JSplitPane
getJSplitPaneFfsCBottom() {
1251 if (jSplitPaneFfsCBottom
== null) {
1252 jSplitPaneFfsCBottom
= new JSplitPane();
1253 jSplitPaneFfsCBottom
.setDividerSize(5);
1254 jSplitPaneFfsCBottom
.setDividerLocation(130);
1255 jSplitPaneFfsCBottom
.setTopComponent(getJPanelFfsCBottomTop());
1256 jSplitPaneFfsCBottom
.setBottomComponent(getJPanelFfsCBottomBottom());
1257 jSplitPaneFfsCBottom
.setOrientation(javax
.swing
.JSplitPane
.VERTICAL_SPLIT
);
1259 return jSplitPaneFfsCBottom
;
1263 * This method initializes jPanelFfsCBottomTop
1265 * @return javax.swing.JPanel
1267 private JPanel
getJPanelFfsCBottomTop() {
1268 if (jPanelFfsCBottomTop
== null) {
1269 jPanelFfsCBottomTop
= new JPanel();
1270 jPanelFfsCBottomTop
.setLayout(new BorderLayout());
1271 jPanelFfsCBottomTop
.add(getJPanelSectionsN(), java
.awt
.BorderLayout
.NORTH
);
1272 jPanelFfsCBottomTop
.add(getJScrollPaneFfsSections(), java
.awt
.BorderLayout
.CENTER
);
1274 return jPanelFfsCBottomTop
;
1278 * This method initializes jPanelFfsCBottomBottom
1280 * @return javax.swing.JPanel
1282 private JPanel
getJPanelFfsCBottomBottom() {
1283 if (jPanelFfsCBottomBottom
== null) {
1284 jPanelFfsCBottomBottom
= new JPanel();
1285 jPanelFfsCBottomBottom
.setLayout(new BorderLayout());
1286 jPanelFfsCBottomBottom
.add(getJPanelSubSectionN(), java
.awt
.BorderLayout
.NORTH
);
1287 jPanelFfsCBottomBottom
.add(getJScrollPaneFfsSubSection(), java
.awt
.BorderLayout
.CENTER
);
1289 return jPanelFfsCBottomBottom
;
1293 * This method initializes jPanelSectionN
1295 * @return javax.swing.JPanel
1297 private JPanel
getJPanelSectionN() {
1298 if (jPanelSectionN
== null) {
1299 jPanelSectionN
= new JPanel();
1300 jLabelFfsSection
= new JLabel();
1301 jLabelFfsSection
.setText("Section");
1302 jPanelSectionN
.add(jLabelFfsSection
, null);
1303 jPanelSectionN
.add(getJButtonFfsSectionNew(), null);
1304 jPanelSectionN
.add(getJButtonFfsSectionRemove(), null);
1306 return jPanelSectionN
;
1310 * This method initializes jPanelSectionsN
1312 * @return javax.swing.JPanel
1314 private JPanel
getJPanelSectionsN() {
1315 if (jPanelSectionsN
== null) {
1316 jPanelSectionsN
= new JPanel();
1317 jLabelFfsSections
= new JLabel();
1318 jLabelFfsSections
.setText("Sections");
1319 jPanelSectionsN
.add(jLabelFfsSections
, null);
1320 jPanelSectionsN
.add(getJButtonFfsSectionsNew(), null);
1321 jPanelSectionsN
.add(getJButtonFfsSectionsRemove(), null);
1323 return jPanelSectionsN
;
1327 * This method initializes jPanelSubSectionN
1329 * @return javax.swing.JPanel
1331 private JPanel
getJPanelSubSectionN() {
1332 if (jPanelSubSectionN
== null) {
1333 jPanelSubSectionN
= new JPanel();
1334 jLabelFfsSubSections
= new JLabel();
1335 jLabelFfsSubSections
.setText("Sub-Sections");
1336 jPanelSubSectionN
.add(jLabelFfsSubSections
, null);
1337 jPanelSubSectionN
.add(getJButtonFfsSubSectionNew(), null);
1338 jPanelSubSectionN
.add(getJButtonFfsSubSectionRemove(), null);
1340 return jPanelSubSectionN
;
1344 * The following section contains all Build Options content
1348 * This method initializes jPanelOptionsTab
1350 * This is the main Options screen
1352 * @return javax.swing.JPanel jPanelOptionsTab
1354 private JPanel
getJPanelOptionsTab() {
1355 if (jPanelOptionsTab
== null) {
1356 // This container holds the Options Tab content
1358 // FlowLayout flowLayout9 = new FlowLayout();
1359 // flowLayout9.setAlignment(java.awt.FlowLayout.LEFT);
1361 jPanelOptionsTab
= new JPanel();
1362 jPanelOptionsTab
.setBounds(new java
.awt
.Rectangle(0, 0, dialogWidth
* 2, dialogHeight
* 3));
1363 jPanelOptionsTab
.setPreferredSize(new java
.awt
.Dimension(dialogWidth
+ 10, (dialogHeight
* 3) + 10));
1364 jPanelOptionsTab
.setAutoscrolls(true);
1365 jPanelOptionsTab
.setLocation(0, 0);
1366 jPanelOptionsTab
.setLayout(null);
1367 jPanelOptionsTab
.add(getJPanelOptionsContainer(), null);
1368 jPanelOptionsTab
.add(getJScrollPaneOptions(), null);
1371 return jPanelOptionsTab
;
1375 * This method initializes jPanelOptionsContainer
1377 * @return javax.swing.JPanel
1379 private JPanel
getJPanelOptionsContainer() {
1380 if (jPanelOptionsContainer
== null) {
1381 jLabelTagName
= new JLabel();
1382 jLabelTagName
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowOne
, labelWidth
, oneRowHeight
));
1383 jLabelTagName
.setLocation(new java
.awt
.Point(labelColumn
, rowOne
));
1384 jLabelTagName
.setText("Tag Name");
1385 jLabelBuildTargets
= new JLabel();
1386 jLabelBuildTargets
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowTwo
, labelWidth
, oneRowHeight
));
1387 jLabelBuildTargets
.setLocation(new java
.awt
.Point(labelColumn
, rowTwo
));
1388 jLabelBuildTargets
.setText("Build Targets");
1389 jLabelToolCmd
= new JLabel();
1390 jLabelToolCmd
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowThree
, labelWidth
, oneRowHeight
));
1391 jLabelToolCmd
.setLocation(new java
.awt
.Point(labelColumn
, rowThree
));
1392 jLabelToolCmd
.setText("Tool Command");
1393 jLabelSupArch
= new JLabel();
1394 jLabelSupArch
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowFour
, labelWidth
, oneRowHeight
));
1395 jLabelSupArch
.setLocation(new java
.awt
.Point(labelColumn
, rowFour
));
1396 jLabelSupArch
.setText("Supported Architectures");
1397 jLabelToolChainFamily
= new JLabel();
1398 jLabelToolChainFamily
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowFive
, labelWidth
, oneRowHeight
));
1399 jLabelToolChainFamily
.setLocation(new java
.awt
.Point(labelColumn
, rowFive
));
1400 jLabelToolChainFamily
.setText("Tool Chain Family");
1402 jLabelOptionContents
= new JLabel();
1403 jLabelOptionContents
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowSix
, labelWidth
, oneRowHeight
));
1404 jLabelOptionContents
.setLocation(new java
.awt
.Point(labelColumn
, rowSix
));
1405 jLabelOptionContents
.setText("Option Contents");
1407 jPanelOptionsContainer
= new JPanel();
1409 jPanelOptionsContainer
.setLayout(null);
1411 jPanelOptionsContainer
.setLocation(new java
.awt
.Point(2, 2));
1412 jPanelOptionsContainer
.setBounds(new java
.awt
.Rectangle(2, 2, dialogWidth
* 2, dialogHeight
));
1413 jPanelOptionsContainer
.setPreferredSize(new java
.awt
.Dimension(dialogWidth
, dialogHeight
));
1415 jPanelOptionsContainer
1416 .setBorder(javax.swing.BorderFactory
1417 .createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
1419 jPanelOptionsContainer
.add(jLabelTagName
, null);
1420 jPanelOptionsContainer
.add(getJTextFieldTagName(), null);
1422 jPanelOptionsContainer
.add(jLabelBuildTargets
, null);
1423 jPanelOptionsContainer
.add(getJTextFieldBuildTargets(), null);
1425 jPanelOptionsContainer
.add(jLabelToolChainFamily
, null);
1426 jPanelOptionsContainer
.add(getJTextFieldToolChainFamily(), null);
1428 jPanelOptionsContainer
.add(jLabelToolCmd
, null);
1429 jPanelOptionsContainer
.add(getJTextFieldToolCmd(), null);
1431 jPanelOptionsContainer
.add(jLabelSupArch
, null);
1432 jPanelOptionsContainer
.add(getArchitectureSelections(), null);
1434 jPanelOptionsContainer
.add(jLabelOptionContents
, null);
1435 jPanelOptionsContainer
.add(getJTextFieldOptionContents(), null);
1437 jPanelOptionsContainer
.add(getJButtonOptionsAdd(), null);
1438 jPanelOptionsContainer
.add(getJButtonOptionsDel(), null);
1440 return jPanelOptionsContainer
;
1444 * This method initializes jTextFieldOptionTagName Row 1
1446 * @return javax.swing.JTextField
1448 private JTextField
getJTextFieldTagName() {
1449 if (jTextFieldTagName
== null) {
1450 jTextFieldTagName
= new JTextField();
1451 jTextFieldTagName
.setBounds(new java
.awt
.Rectangle(fieldColumn
, rowOne
, fieldWidth
, oneRowHeight
));
1452 jTextFieldTagName
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1453 jTextFieldTagName
.setLocation(new java
.awt
.Point(fieldColumn
, rowOne
));
1455 return jTextFieldTagName
;
1459 * This method initializes jTextFieldBuildTargets Row 2
1461 * @return javax.swing.JTextField jTextFieldBuildTargets
1463 private JTextField
getJTextFieldBuildTargets() {
1464 if (jTextFieldBuildTargets
== null) {
1465 jTextFieldBuildTargets
= new JTextField();
1466 jTextFieldBuildTargets
.setBounds(new java
.awt
.Rectangle(fieldColumn
, rowTwo
, fieldWidth
, oneRowHeight
));
1467 jTextFieldBuildTargets
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1468 jTextFieldBuildTargets
.setLocation(new java
.awt
.Point(fieldColumn
, rowTwo
));
1470 return jTextFieldBuildTargets
;
1474 * This method initializes jTextFieldToolCmd Row 3
1476 * This should be a dropdown box of command codes from tools_def.txt
1478 * @return javax.swing.JTextField jTextFieldToolCmd
1480 private JTextField
getJTextFieldToolCmd() {
1481 if (jTextFieldToolCmd
== null) {
1482 jTextFieldToolCmd
= new JTextField();
1483 jTextFieldToolCmd
.setBounds(new java
.awt
.Rectangle(fieldColumn
, rowThree
, fieldWidth
, oneRowHeight
));
1484 jTextFieldToolCmd
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1485 jTextFieldToolCmd
.setLocation(new java
.awt
.Point(fieldColumn
, rowThree
));
1487 return jTextFieldToolCmd
;
1491 * This method initializes jArchitectureSelections Row 4
1493 * @return jArchitectureSelections
1495 private JPanel
getArchitectureSelections() {
1496 if (jArchitectureSelections
== null) {
1497 jArchitectureSelections
= new JPanel();
1498 jArchitectureSelections
.setLayout(null);
1499 jArchitectureSelections
.add(getJCheckBoxIA32(), null);
1500 jArchitectureSelections
.add(getJCheckBoxX64(), null);
1501 jArchitectureSelections
.add(getJCheckBoxIpf(), null);
1502 jArchitectureSelections
.add(getJCheckBoxEBC(), null);
1503 jArchitectureSelections
.add(getJCheckBoxARM(), null);
1504 jArchitectureSelections
.add(getJCheckBoxPPC(), null);
1505 jArchitectureSelections
.setBounds(new java
.awt
.Rectangle(fieldColumn
, rowFour
, fieldWidth
, oneRowHeight
));
1506 jArchitectureSelections
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1507 jArchitectureSelections
.setLocation(new java
.awt
.Point(fieldColumn
, rowFour
));
1509 return jArchitectureSelections
;
1513 * This method initializes jCheckBoxIA32
1515 * @return javax.swing.JCheckBox jCheckBoxIA32
1517 private JCheckBox
getJCheckBoxIA32() {
1518 if (jCheckBoxIA32
== null) {
1519 jCheckBoxIA32
= new JCheckBox();
1520 jCheckBoxIA32
.setBounds(new java
.awt
.Rectangle(0, 0, 55, 20));
1521 jCheckBoxIA32
.setText("IA32");
1523 return jCheckBoxIA32
;
1527 * This method initializes jCheckBoxX64
1529 * @return javax.swing.JCheckBox jCheckBoxX64
1531 private JCheckBox
getJCheckBoxX64() {
1532 if (jCheckBoxX64
== null) {
1533 jCheckBoxX64
= new JCheckBox();
1534 jCheckBoxX64
.setText("X64");
1535 jCheckBoxX64
.setBounds(new java
.awt
.Rectangle(55, 0, 53, 20));
1537 return jCheckBoxX64
;
1541 * This method initializes jCheckBoxIpf
1543 * @return javax.swing.JCheckBox jCheckBoxIpf
1545 private JCheckBox
getJCheckBoxIpf() {
1546 if (jCheckBoxIpf
== null) {
1547 jCheckBoxIpf
= new JCheckBox();
1548 jCheckBoxIpf
.setBounds(new java
.awt
.Rectangle(108, 0, 52, 20));
1549 jCheckBoxIpf
.setText("IPF");
1551 return jCheckBoxIpf
;
1556 * This method initializes jCheckBoxEBC
1558 * @return javax.swing.JCheckBox jCheckBoxEBC
1560 private JCheckBox
getJCheckBoxEBC() {
1561 if (jCheckBoxEBC
== null) {
1562 jCheckBoxEBC
= new JCheckBox();
1563 jCheckBoxEBC
.setBounds(new java
.awt
.Rectangle(160, 0, 53, 20));
1564 jCheckBoxEBC
.setText("EBC");
1566 return jCheckBoxEBC
;
1570 * This method initializes jCheckBoxARM
1572 * @return javax.swing.JCheckBox jCheckBoxARM
1574 private JCheckBox
getJCheckBoxARM() {
1575 if (jCheckBoxARM
== null) {
1576 jCheckBoxARM
= new JCheckBox();
1577 jCheckBoxARM
.setBounds(new java
.awt
.Rectangle(213, 0, 54, 20));
1578 jCheckBoxARM
.setText("ARM");
1580 return jCheckBoxARM
;
1584 * This method initializes jCheckBoxPPC
1586 * @return javax.swing.JCheckBox jCheckBoxPPC
1588 private JCheckBox
getJCheckBoxPPC() {
1589 if (jCheckBoxPPC
== null) {
1590 jCheckBoxPPC
= new JCheckBox();
1591 jCheckBoxPPC
.setBounds(new java
.awt
.Rectangle(267, 0, 53, 20));
1592 jCheckBoxPPC
.setText("PPC");
1594 return jCheckBoxPPC
;
1598 * This method initializes jTextFieldToolChainFamily Row 5
1600 * This should be a drop down for MSFT, INTEL, GCC or USER_DEFINED
1602 * @return javax.swing.JTextField
1604 private JTextField
getJTextFieldToolChainFamily() {
1605 if (jTextFieldToolChainFamily
== null) {
1606 jTextFieldToolChainFamily
= new JTextField();
1607 jTextFieldToolChainFamily
.setBounds(new java
.awt
.Rectangle(fieldColumn
, rowFive
, fieldWidth
, oneRowHeight
));
1608 jTextFieldToolChainFamily
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1609 jTextFieldToolChainFamily
.setLocation(new java
.awt
.Point(fieldColumn
, rowFive
));
1611 return jTextFieldToolChainFamily
;
1615 * This method initializes jTextFieldOptionContents Row 6
1617 * This is where we should put the checkbox & entry data for the command arguments
1619 * @return javax.swing.JTextField
1621 private JTextField
getJTextFieldOptionContents() {
1622 if (jTextFieldOptionContents
== null) {
1623 jTextFieldOptionContents
= new JTextField();
1624 jTextFieldOptionContents
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1625 jTextFieldOptionContents
.setBounds(fieldColumn
, rowSix
, fieldWidth
, oneRowHeight
);
1626 jTextFieldOptionContents
.setLocation(new java
.awt
.Point(fieldColumn
, rowSix
));
1628 return jTextFieldOptionContents
;
1632 * This method initializes jButtonOptionsAdd
1634 * Add entry from the top screen to the table
1636 * @return javax.swing.JButton jButtonOptionsAdd
1638 private JButton
getJButtonOptionsAdd() {
1639 if (jButtonOptionsAdd
== null) {
1640 jButtonOptionsAdd
= new JButton();
1641 jButtonOptionsAdd
.setText("Add");
1643 jButtonOptionsAdd
.setPreferredSize(new java
.awt
.Dimension(buttonWidth
, oneRowHeight
));
1644 jButtonOptionsAdd
.setBounds(new java
.awt
.Rectangle(firstButtonLoc
, buttonRow
, buttonWidth
, oneRowHeight
));
1645 jButtonOptionsAdd
.setLocation(new java
.awt
.Point(firstButtonLoc
, buttonRow
));
1646 jButtonOptionsAdd
.addActionListener(new AbstractAction() {
1650 private static final long serialVersionUID
= 1L;
1652 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1653 boolean[] boolArray
= { jCheckBoxIA32
.isSelected(), jCheckBoxIpf
.isSelected(),
1654 jCheckBoxX64
.isSelected(), jCheckBoxEBC
.isSelected(),
1655 jCheckBoxARM
.isSelected(), jCheckBoxPPC
.isSelected() };
1656 String s
= boolToList(boolArray
);
1657 Object
[] o
= { jTextFieldBuildTargets
.getText(), jTextFieldToolChainFamily
.getText(), s
,
1658 jTextFieldToolCmd
.getText(), jTextFieldTagName
.getText(),
1659 jTextFieldOptionContents
.getText() };
1660 optionsTableModel
.addRow(o
);
1661 docConsole
.setSaved(false);
1662 ffc
.genBuildOptionsOpt(stringToVector(jTextFieldBuildTargets
.getText()),
1663 jTextFieldToolChainFamily
.getText(), jTextFieldTagName
.getText(),
1664 jTextFieldToolCmd
.getText(), stringToVector(s
),
1665 jTextFieldOptionContents
.getText());
1669 return jButtonOptionsAdd
;
1673 * This method initializes jButtonOptionsDel
1675 * Remove a line from the table below
1677 * @return javax.swing.JButton jButtonOptionsDel
1679 private JButton
getJButtonOptionsDel() {
1680 if (jButtonOptionsDel
== null) {
1681 jButtonOptionsDel
= new JButton();
1682 jButtonOptionsDel
.setText("Delete");
1683 jButtonOptionsDel
.setPreferredSize(new java
.awt
.Dimension(buttonWidth
, oneRowHeight
));
1684 jButtonOptionsDel
.setBounds(new java
.awt
.Rectangle(next2LastButtonLoc
, buttonRow
, buttonWidth
, oneRowHeight
));
1685 jButtonOptionsDel
.setLocation(new java
.awt
.Point(next2LastButtonLoc
, buttonRow
));
1686 jButtonOptionsDel
.addActionListener(new AbstractAction() {
1690 private static final long serialVersionUID
= 1L;
1692 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1693 if (selectedRow
>= 0) {
1694 optionsTableModel
.removeRow(selectedRow
);
1695 docConsole
.setSaved(false);
1696 ffc
.removeBuildOptionsOpt(selectedRow
);
1701 return jButtonOptionsDel
;
1705 * This method initializes jScrollPaneOptions
1706 * Contains the Table and is located below the data entry section
1707 * @return javax.swing.JScrollPane jScrollPaneOptoins
1709 private JScrollPane
getJScrollPaneOptions() {
1710 if (jScrollPaneOptions
== null) {
1711 jScrollPaneOptions
= new JScrollPane();
1712 jScrollPaneOptions
.setPreferredSize(new java
.awt
.Dimension(dialogWidth
, dialogHeight
* 2));
1713 jScrollPaneOptions
.setBounds(new java
.awt
.Rectangle(2, (dialogHeight
* 2) + 2, dialogWidth
* 2, dialogHeight
* 2));
1714 jScrollPaneOptions
.setLocation(new java
.awt
.Point(2, dialogHeight
+ 2));
1716 jScrollPaneOptions
.setViewportView(getJTableOptions());
1718 return jScrollPaneOptions
;
1722 * This method initializes jTableOptions
1724 * @return javax.swing.JTable jTableOptions
1726 private JTable
getJTableOptions() {
1727 if (jTableOptions
== null) {
1728 jTitle
= new JLabel();
1729 jTitle
.setText("Current Option Configuration Lines");
1730 jTitle
.setBounds(2, 2, labelWidth
, oneRowHeight
);
1732 optionsTableModel
= new DefaultTableModel();
1733 jTableOptions
= new JTable(optionsTableModel
);
1734 jTableOptions
.setRowHeight(20);
1735 optionsTableModel
.addColumn("Build Targets");
1736 optionsTableModel
.addColumn("Tool Chain Family");
1737 optionsTableModel
.addColumn("Supported Architectures");
1738 optionsTableModel
.addColumn("Tool Command Code");
1739 optionsTableModel
.addColumn("TagName");
1740 optionsTableModel
.addColumn("Contents");
1742 javax
.swing
.table
.TableColumn toolFamilyCol
= jTableOptions
.getColumnModel().getColumn(1);
1743 JComboBox cb
= new JComboBox();
1746 cb
.addItem("CYGWIN");
1747 cb
.addItem("INTEL");
1748 cb
.addItem("USER_DEFINED");
1749 toolFamilyCol
.setCellEditor(new DefaultCellEditor(cb
));
1750 Vector
<String
> vArch
= new Vector
<String
>();
1757 jTableOptions
.getColumnModel().getColumn(2).setCellEditor(new ListEditor(vArch
));
1759 jTableOptions
.getColumnModel().getColumn(5).setCellEditor(new LongTextEditor());
1761 jTableOptions
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
1762 jTableOptions
.setAutoResizeMode(javax
.swing
.JTable
.AUTO_RESIZE_OFF
);
1763 jTableOptions
.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
1764 public void valueChanged(ListSelectionEvent e
) {
1766 if (e
.getValueIsAdjusting()) {
1769 ListSelectionModel lsm
= (ListSelectionModel
) e
.getSource();
1770 if (lsm
.isSelectionEmpty()) {
1773 selectedRow
= lsm
.getMinSelectionIndex();
1778 jTableOptions
.getModel().addTableModelListener(new TableModelListener() {
1779 public void tableChanged(TableModelEvent arg0
) {
1780 // TODO Auto-generated method stub
1781 int row
= arg0
.getFirstRow();
1782 TableModel m
= (TableModel
) arg0
.getSource();
1783 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
1784 //ToDo Data Validition check.
1785 String targets
= m
.getValueAt(row
, 0) + "";
1786 Vector
<Object
> targetName
= new Vector
<Object
>();
1787 String
[] sArray
= targets
.split("( )+");
1788 for (int i
= 0; i
< sArray
.length
; ++i
) {
1789 targetName
.add(sArray
[i
]);
1791 String toolChain
= m
.getValueAt(row
, 1) + "";
1792 String archs
= m
.getValueAt(row
, 2) + "";
1793 Vector
<Object
> supArch
= null;
1794 if (archs
.length() > 0) {
1795 supArch
= new Vector
<Object
>();
1796 String
[] sArray1
= archs
.split("( )+");
1797 for (int i
= 0; i
< sArray1
.length
; ++i
) {
1798 supArch
.add(sArray1
[i
]);
1802 String toolCmd
= m
.getValueAt(row
, 3) + "";
1803 String tagName
= m
.getValueAt(row
, 4) + "";
1804 String contents
= m
.getValueAt(row
, 5) + "";
1805 docConsole
.setSaved(false);
1806 ffc
.updateBuildOptionsOpt(row
, targetName
, toolChain
, tagName
, toolCmd
, supArch
, contents
);
1811 return jTableOptions
;
1814 private Vector
<Object
> stringToVector(String s
) {
1815 String
[] sArray
= s
.split(" ");
1816 Vector
<Object
> v
= null;
1817 if (s
.length() > 0) {
1818 v
= new Vector
<Object
>();
1819 for (int i
= 0; i
< sArray
.length
; ++i
) {
1826 private String
boolToList(boolean[] bool
) {
1852 private void initOptionTable() {
1853 if (ffc
.getBuildOptionsOptCount() == 0) {
1854 //ToDo get default options from *.txt file
1857 String
[][] saa
= new String
[ffc
.getBuildOptionsOptCount()][6];
1858 ffc
.getBuildOptionsOpts(saa
);
1859 for (int i
= 0; i
< saa
.length
; ++i
) {
1860 optionsTableModel
.addRow(saa
[i
]);
1866 * Everything below should pertain to the ANT Task Tab
1870 * This method initializes jButton12
1872 * @return javax.swing.JButton
1874 private JButton
getJButtonAntTaskFileBrowse() {
1875 if (jButtonAntTaskFileBrowse
== null) {
1876 jButtonAntTaskFileBrowse
= new JButton();
1877 jButtonAntTaskFileBrowse
.setPreferredSize(new Dimension(buttonWidth
, oneRowHeight
));
1878 jButtonAntTaskFileBrowse
.setText("Browse");
1879 jButtonAntTaskFileBrowse
.addActionListener(new AbstractAction() {
1880 private static final long serialVersionUID
= 1L;
1882 public void actionPerformed(ActionEvent arg0
) {
1884 // Select files from current workspace
1886 String dirPrefix
= System
.getenv("WORKSPACE");
1887 JFileChooser chooser
= new JFileChooser(dirPrefix
);
1888 File theFile
= null;
1889 String headerDest
= null;
1891 chooser
.setMultiSelectionEnabled(false);
1892 chooser
.setFileSelectionMode(JFileChooser
.FILES_ONLY
);
1893 int retval
= chooser
.showOpenDialog(frame
);
1894 if (retval
== JFileChooser
.APPROVE_OPTION
) {
1896 theFile
= chooser
.getSelectedFile();
1897 String file
= theFile
.getPath();
1898 if (!file
.startsWith(dirPrefix
)) {
1899 JOptionPane
.showMessageDialog(frame
, "You can only select files in current package!");
1906 headerDest
= theFile
.getPath();
1907 jTextFieldAntTaskFile
.setText(headerDest
.substring(dirPrefix
.length()).replace('\\', '/'));
1913 return jButtonAntTaskFileBrowse
;
1917 * This method initializes jPanelUserDefCenterN
1919 * @return javax.swing.JPanel
1921 private JPanel
getJPanelUserDefCenterN() {
1922 if (jPanelUserDefCenterN
== null) {
1923 jPanelUserDefCenterN
= new JPanel();
1924 jPanelUserDefCenterN
.add(jLabelAntCmdOpts
, null);
1925 jPanelUserDefCenterN
.add(getJTextFieldAntCmdOpts(), null);
1926 jPanelUserDefCenterN
.add(getJButtonAntTaskAdd(), null);
1927 jPanelUserDefCenterN
.add(getJButtonAntTaskDel(), null);
1929 return jPanelUserDefCenterN
;
1933 * This method initializes jPanel8
1935 * @return javax.swing.JPanel
1937 private JPanel
getJPanelUserDef() {
1938 if (jPanelUserDef
== null) {
1939 jPanelUserDef
= new JPanel();
1940 jPanelUserDef
.setLayout(new BorderLayout());
1941 jPanelUserDef
.add(getJPanelUserDefNorth(), java
.awt
.BorderLayout
.NORTH
);
1942 jPanelUserDef
.add(getJPanelUserDefCenter(), java
.awt
.BorderLayout
.CENTER
);
1945 return jPanelUserDef
;
1949 * This method initializes jPanel9
1951 * @return javax.swing.JPanel
1953 private JPanel
getJPanelUserDefNorth() {
1954 if (jPanelUserDefNorth
== null) {
1955 jLabelAntTaskFile
= new JLabel();
1956 jLabelAntTaskFile
.setText("ANT Task File");
1957 jLabelAntTaskFile
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1958 FlowLayout flowLayout8
= new FlowLayout();
1959 flowLayout8
.setAlignment(java
.awt
.FlowLayout
.CENTER
);
1960 jLabelAntTaskId
= new JLabel();
1961 jLabelAntTaskId
.setText("ID");
1962 jPanelUserDefNorth
= new JPanel();
1963 jPanelUserDefNorth
.setLayout(flowLayout8
);
1964 jPanelUserDefNorth
.add(jLabelAntTaskFile
, null);
1965 jPanelUserDefNorth
.add(getJTextFieldAntTaskFile(), null);
1966 jPanelUserDefNorth
.add(getJButtonAntTaskFileBrowse(), null);
1967 jPanelUserDefNorth
.add(jLabelAntTaskId
, null);
1968 jPanelUserDefNorth
.add(getJTextFieldAntTaskId(), null);
1970 return jPanelUserDefNorth
;
1974 * This method initializes jPanel11
1976 * @return javax.swing.JPanel
1978 private JPanel
getJPanelUserDefCenter() {
1979 if (jPanelUserDefCenter
== null) {
1980 jLabelAntCmdOpts
= new JLabel();
1981 jLabelAntCmdOpts
.setText("ANT Command Options");
1982 jLabelAntCmdOpts
.setPreferredSize(new java
.awt
.Dimension(131, 20));
1983 jPanelUserDefCenter
= new JPanel();
1984 jPanelUserDefCenter
.setLayout(new BorderLayout());
1986 jPanelUserDefCenter
.add(getJPanelUserDefCenterN(), java
.awt
.BorderLayout
.NORTH
);
1987 jPanelUserDefCenter
.add(getJScrollPaneAntTasks(), java
.awt
.BorderLayout
.CENTER
);
1989 return jPanelUserDefCenter
;
1993 * This method initializes jTextField2
1995 * @return javax.swing.JTextField
1997 private JTextField
getJTextFieldAntTaskFile() {
1998 if (jTextFieldAntTaskFile
== null) {
1999 jTextFieldAntTaskFile
= new JTextField();
2000 jTextFieldAntTaskFile
.setPreferredSize(new java
.awt
.Dimension(200, 20));
2002 return jTextFieldAntTaskFile
;
2006 * This method initializes jTextField3
2008 * @return javax.swing.JTextField
2010 private JTextField
getJTextFieldAntTaskId() {
2011 if (jTextFieldAntTaskId
== null) {
2012 jTextFieldAntTaskId
= new JTextField();
2013 jTextFieldAntTaskId
.setPreferredSize(new java
.awt
.Dimension(100, 20));
2015 return jTextFieldAntTaskId
;
2019 * This method initializes jButton4
2021 * @return javax.swing.JButton
2023 private JButton
getJButtonAntTaskAdd() {
2024 if (jButtonAntTaskAdd
== null) {
2025 jButtonAntTaskAdd
= new JButton();
2026 jButtonAntTaskAdd
.setPreferredSize(new java
.awt
.Dimension(90, 20));
2027 jButtonAntTaskAdd
.setText("Add");
2028 jButtonAntTaskAdd
.addActionListener(new ActionListener() {
2029 public void actionPerformed(ActionEvent e
) {
2030 if (!DataValidation
.isInt(jTextFieldAntTaskId
.getText())
2031 || jTextFieldAntTaskId
.getText().length() != 8) {
2032 JOptionPane
.showMessageDialog(frame
, "ID must be an 8-digit integer.");
2035 Object
[] o
= { jTextFieldAntTaskId
.getText(), null, null };
2036 o
[1] = jTextFieldAntTaskFile
.getText();
2037 o
[2] = jTextFieldAntCmdOpts
.getText();
2038 ffc
.genBuildOptionsUserDefAntTask(o
[0] + "", o
[1] + "", o
[2] + "");
2039 antTaskTableModel
.addRow(o
);
2040 docConsole
.setSaved(false);
2044 return jButtonAntTaskAdd
;
2048 * This method initializes jButton5
2050 * @return javax.swing.JButton
2052 private JButton
getJButtonAntTaskDel() {
2053 if (jButtonAntTaskDel
== null) {
2054 jButtonAntTaskDel
= new JButton();
2055 jButtonAntTaskDel
.setPreferredSize(new java
.awt
.Dimension(90, 20));
2056 jButtonAntTaskDel
.setText("Delete");
2057 jButtonAntTaskDel
.addActionListener(new ActionListener() {
2058 public void actionPerformed(ActionEvent e
) {
2059 if (selectedRow
>= 0) {
2060 docConsole
.setSaved(false);
2061 antTaskTableModel
.removeRow(selectedRow
);
2062 ffc
.removeBuildOptionsUserDefAntTask(selectedRow
);
2067 return jButtonAntTaskDel
;
2071 * This method initializes jTextField4
2073 * @return javax.swing.JTextField
2075 private JTextField
getJTextFieldAntCmdOpts() {
2076 if (jTextFieldAntCmdOpts
== null) {
2077 jTextFieldAntCmdOpts
= new JTextField();
2078 jTextFieldAntCmdOpts
.setPreferredSize(new java
.awt
.Dimension(270, 20));
2079 jTextFieldAntCmdOpts
.setEnabled(true);
2081 return jTextFieldAntCmdOpts
;
2085 * This method initializes jScrollPane2
2087 * @return javax.swing.JScrollPane
2089 private JScrollPane
getJScrollPaneAntTasks() {
2090 if (jScrollPaneAntTasks
== null) {
2091 jScrollPaneAntTasks
= new JScrollPane();
2092 jScrollPaneAntTasks
.setPreferredSize(new java
.awt
.Dimension(600, 400));
2093 jScrollPaneAntTasks
.setViewportView(getJTableAntTasks());
2095 return jScrollPaneAntTasks
;
2099 * This method initializes jTable2
2101 * @return javax.swing.JTable
2103 private JTable
getJTableAntTasks() {
2104 if (jTableAntTasks
== null) {
2105 antTaskTableModel
= new DefaultTableModel();
2106 jTableAntTasks
= new JTable(antTaskTableModel
);
2107 jTableAntTasks
.setRowHeight(20);
2108 antTaskTableModel
.addColumn("ID");
2109 antTaskTableModel
.addColumn("Filename");
2110 antTaskTableModel
.addColumn("ANT Command Options");
2112 jTableAntTasks
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
2113 jTableAntTasks
.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
2114 public void valueChanged(ListSelectionEvent e
) {
2116 if (e
.getValueIsAdjusting()) {
2119 ListSelectionModel lsm
= (ListSelectionModel
) e
.getSource();
2120 if (lsm
.isSelectionEmpty()) {
2123 selectedRow
= lsm
.getMinSelectionIndex();
2128 jTableAntTasks
.getModel().addTableModelListener(new TableModelListener() {
2129 public void tableChanged(TableModelEvent arg0
) {
2130 // TODO Auto-generated method stub
2131 int row
= arg0
.getFirstRow();
2132 TableModel m
= (TableModel
) arg0
.getSource();
2133 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
2134 //ToDo Data Validition check.
2135 String id
= m
.getValueAt(row
, 0) + "";
2136 String file
= m
.getValueAt(row
, 1) + "";
2137 String execOrder
= m
.getValueAt(row
, 2) + "";
2138 if (id
.length() == 0) {
2141 if (file
.length() == 0 && execOrder
.length() == 0) {
2144 if (file
.length() == 0) {
2147 if (execOrder
.length() == 0) {
2150 ffc
.updateBuildOptionsUserDefAntTask(row
, id
, file
, execOrder
);
2156 return jTableAntTasks
;
2159 private void initAntTaskTable() {
2160 if (ffc
.getBuildOptionsUserDefAntTaskCount() == 0) {
2163 String
[][] saa
= new String
[ffc
.getBuildOptionsUserDefAntTaskCount()][3];
2164 ffc
.getBuildOptionsUserDefAntTasks(saa
);
2165 for (int i
= 0; i
< saa
.length
; ++i
) {
2166 antTaskTableModel
.addRow(saa
[i
]);
2170 } // @jve:decl-index=0:visual-constraint="10,10"