3 The file is used to create, update BuildOptions of Fpd file
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 package org
.tianocore
.frameworkwizard
.platform
.ui
;
17 import java
.awt
.BorderLayout
;
18 import javax
.swing
.BoxLayout
;
20 import javax
.swing
.JPanel
;
21 import javax
.swing
.JTabbedPane
;
22 import javax
.swing
.JCheckBox
;
23 import javax
.swing
.JLabel
;
24 import java
.awt
.FlowLayout
;
25 import javax
.swing
.AbstractAction
;
26 import java
.awt
.event
.ActionEvent
;
27 import java
.awt
.event
.ActionListener
;
29 import javax
.swing
.DefaultCellEditor
;
30 import javax
.swing
.JFileChooser
;
31 import javax
.swing
.JFrame
;
32 import javax
.swing
.JOptionPane
;
33 import javax
.swing
.JTextField
;
34 import javax
.swing
.JButton
;
35 import javax
.swing
.JScrollPane
;
36 import javax
.swing
.JTable
;
37 import javax
.swing
.JComboBox
;
38 import javax
.swing
.ListSelectionModel
;
39 import javax
.swing
.event
.InternalFrameAdapter
;
40 import javax
.swing
.event
.InternalFrameEvent
;
41 import javax
.swing
.event
.ListSelectionEvent
;
42 import javax
.swing
.event
.ListSelectionListener
;
43 import javax
.swing
.event
.TableModelEvent
;
44 import javax
.swing
.event
.TableModelListener
;
45 import javax
.swing
.table
.DefaultTableModel
;
46 import javax
.swing
.table
.TableModel
;
48 import org
.tianocore
.PlatformSurfaceAreaDocument
;
49 import org
.tianocore
.frameworkwizard
.common
.DataValidation
;
50 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningPlatformType
;
51 import org
.tianocore
.frameworkwizard
.common
.ui
.IInternalFrame
;
52 import org
.tianocore
.frameworkwizard
.common
.ui
.ArchCheckBox
;
55 import java
.util
.ArrayList
;
56 import java
.util
.Iterator
;
57 import java
.util
.LinkedHashMap
;
59 import java
.util
.Vector
;
60 import java
.awt
.Dimension
;
61 import javax
.swing
.JSplitPane
;
63 public class FpdBuildOptions
extends IInternalFrame
{
65 private final int oneRowHeight
= 20;
67 private final int twoRowHeight
= 40;
69 private final int threeRowHeight
= 60;
71 private final int sepHeight
= 6;
73 private final int sepWidth
= 10;
75 private final int buttonWidth
= 90;
77 private final int rowOne
= 12;
79 private final int dialogWidth
= 600;
81 private final int rowTwo
= rowOne
+ oneRowHeight
+ sepHeight
;
83 private final int rowThree
= rowTwo
+ oneRowHeight
+ sepHeight
;
85 private final int rowFour
= rowThree
+ oneRowHeight
+ sepHeight
;
87 private final int rowFive
= rowFour
+ oneRowHeight
+ sepHeight
;
89 private final int rowSix
= rowFive
+ oneRowHeight
+ sepHeight
;
91 private final int rowSeven
= rowSix
+ oneRowHeight
+ sepHeight
;
93 private final int buttonRow
= rowSeven
+ oneRowHeight
+ sepHeight
+ sepHeight
;
95 private final int dialogHeight
= buttonRow
+ twoRowHeight
+ twoRowHeight
;
97 private final int lastButtonXLoc
= dialogWidth
- buttonWidth
- sepWidth
;
99 private final int next2LastButtonLoc
= lastButtonXLoc
- buttonWidth
- sepWidth
;
101 private final int firstButtonLoc
= next2LastButtonLoc
- buttonWidth
- sepWidth
;
103 private final int starColumn
= 2;
105 private final int labelColumn
= 12;
107 private final int fieldColumn
= 168;
109 private final int labelWidth
= 155;
111 private final int fieldWidth
= 320;
113 private static final long serialVersionUID
= 1L;
117 private JPanel jContentPane
= null;
119 // private JPanel jPanelContentSouth = null;
121 // private JPanel jPanelContentNorth = null;
123 // private JPanel jPanelContentWest = null;
125 // private JPanel jPanelContentEast = null;
127 private JTabbedPane jTabbedPane
= null;
129 private JPanel jPanelUserDef
= null;
131 private JPanel jPanelUserDefNorth
= null;
133 private JPanel jPanelUserDefCenter
= null;
135 private JTextField jTextFieldAntTaskFile
= null;
137 private JLabel jLabelAntTaskId
= null;
139 private JTextField jTextFieldAntTaskId
= null;
141 private JButton jButtonAntTaskAdd
= null;
143 private JButton jButtonAntTaskDel
= null;
145 private JTextField jTextFieldAntCmdOpts
= null;
147 private JScrollPane jScrollPaneAntTasks
= null;
149 private JTable jTableAntTasks
= null;
151 private DefaultTableModel ffsTableModel
= null;
153 private DefaultTableModel sectionsTableModel
= null;
155 private DefaultTableModel sectionTableModel
= null;
157 private DefaultTableModel subsectionsTableModel
= null;
159 private DefaultTableModel antTaskTableModel
= null;
161 private DefaultTableModel ffsAttributesTableModel
= null;
163 private DefaultTableModel optionsTableModel
= null;
165 private JPanel jPanelFfsTab
= null;
167 private JPanel jPanelFfsTabCenter
= null;
169 private JPanel jPanelFfsTabCenterN
= null;
171 private JPanel jPanelFfsTabCenterS
= null;
173 private JLabel jLabelFfsKey
= null;
175 private JTextField jTextFieldFfsKey
= null;
177 private JButton jButtonFfsAdd
= null;
179 private JButton jButtonFfsDel
= null;
181 private JScrollPane jScrollPaneFfsAttribs
= null;
183 private JTable jTableFfsAttribs
= null;
185 private JPanel jPanelOptionsTab
= null;
187 private JLabel jLabelOptionContents
= null;
189 private JTextField jTextFieldOptionContents
= null;
191 private JLabel jLabelToolChainFamily
= null;
193 private JLabel jLabelSupArch
= null;
195 private JLabel jLabelToolCmd
= null;
197 private JTextField jTextFieldToolCmd
= null;
199 private JScrollPane jScrollPaneOptions
= null;
201 private JTable jTableOptions
= null;
203 private JLabel jTitle
= null;
205 private JButton jButtonOptionsAdd
= null;
207 private JButton jButtonOptionsDel
= null;
209 private JButton jButtonFfsAttribNew
= null;
211 private JButton jButtonFfsAttribRemove
= null;
213 private FpdFileContents ffc
= null;
215 private OpeningPlatformType docConsole
= null;
217 private JPanel jArchitectureSelections
= null;
219 private JCheckBox jCheckBoxIA32
= null;
221 private JCheckBox jCheckBoxIpf
= null;
223 private JCheckBox jCheckBoxX64
= null;
225 private JCheckBox jCheckBoxEBC
= null;
227 private JCheckBox jCheckBoxARM
= null;
229 private JCheckBox jCheckBoxPPC
= null;
231 private JLabel jLabelBuildTargets
= null;
233 private JTextField jTextFieldBuildTargets
= null;
235 private JTextField jTextFieldTagName
= null;
237 private JLabel jLabelTagName
= null;
239 private int selectedRow
= -1;
241 private JLabel jLabelAntTaskFile
= null;
243 private JLabel jLabelAntCmdOpts
= null;
245 private JScrollPane jScrollPaneFfs
= null;
247 private JTable jTableFfs
= null;
249 private JLabel jLabelFfsSection
= null;
251 private JScrollPane jScrollPaneFfsSection
= null;
253 private JTable jTableFfsSection
= null;
255 private JLabel jLabelFfsSubSections
= null;
257 private JScrollPane jScrollPaneFfsSubSection
= null;
259 private JTable jTableFfsSubSection
= null;
261 private JLabel jLabelEncapType
= null;
263 private JTextField jTextFieldEncapType
= null;
265 private JPanel jPanelFfsAttribButtonGroup
= null;
267 private JLabel jLabelFfsAttribs
= null;
269 private JButton jButtonFfsSectionNew
= null;
271 private JButton jButtonFfsSectionRemove
= null;
273 private JButton jButtonFfsSubSectionNew
= null;
275 private JButton jButtonFfsSubSectionRemove
= null;
277 private JLabel jLabelFfsSections
= null;
279 private JButton jButtonFfsSectionsNew
= null;
281 private JButton jButtonFfsSectionsRemove
= null;
283 private JScrollPane jScrollPaneFfsSections
= null;
285 private JTable jTableFfsSections
= null;
287 private JButton jButtonAntTaskFileBrowse
= null;
289 private JTextField jTextFieldToolChainFamily
= null;
291 private JSplitPane jSplitPaneFfsC
= null;
293 private JPanel jPanelFfsCTop
= null;
295 private JSplitPane jSplitPaneFfsCBottom
= null;
297 private JPanel jPanelFfsCBottomTop
= null;
299 private JPanel jPanelFfsCBottomBottom
= null;
301 private JPanel jPanelSectionN
= null;
303 private JPanel jPanelSectionC
= null;
305 private JPanel jPanelSectionsN
= null;
307 private JPanel jPanelSectionsC
= null;
309 private JPanel jPanelSubSectionN
= null;
311 private JPanel jPanelSubSectionC
= null;
313 private JPanel jPanelOptionsContainer
= null;
315 private JPanel jPanelUserDefCenterN
= null;
317 private JPanel jPanelUserDefCenterC
= null;
320 * This method initializes jPanel
322 * @return javax.swing.JPanel
323 private JPanel getJPanelContentSouth() {
324 if (jPanelContentSouth == null) {
325 jPanelContentSouth = new JPanel();
327 return jPanelContentSouth;
332 * This method initializes jPanel1
334 * @return javax.swing.JPanel
335 private JPanel getJPanelContentNorth() {
336 if (jPanelContentNorth == null) {
337 jPanelContentNorth = new JPanel();
339 return jPanelContentNorth;
344 * This method initializes jPanel2
346 * @return javax.swing.JPanel
347 private JPanel getJPanelContentWest() {
348 if (jPanelContentWest == null) {
349 jPanelContentWest = new JPanel();
351 return jPanelContentWest;
356 * This method initializes jPanel3
358 * @return javax.swing.JPanel
359 private JPanel getJPanelContentEast() {
360 if (jPanelContentEast == null) {
361 jPanelContentEast = new JPanel();
363 return jPanelContentEast;
368 * This method initializes jTabbedPane
370 * @return javax.swing.JTabbedPane
372 private JTabbedPane
getJTabbedPane() {
373 if (jTabbedPane
== null) {
374 jTabbedPane
= new JTabbedPane();
375 jTabbedPane
.addTab("Flash Filesystem Options", null, getJPanelFfsTab(), null);
376 jTabbedPane
.addTab("Tool Arguments", null, getJPanelOptionsTab(), null);
377 jTabbedPane
.addTab("User Defined ANT Tasks", null, getJPanelUserDef(), null);
383 * This method initializes this
387 private void initialize() {
388 this.setSize(722, 577);
389 this.setTitle("Platform Build Options");
390 this.setContentPane(getJContentPane());
394 * This method initializes jContentPane
396 * @return javax.swing.JPanel
398 private JPanel
getJContentPane() {
399 if (jContentPane
== null) {
400 jContentPane
= new JPanel();
401 jContentPane
.setLayout(new BorderLayout());
402 // jContentPane.add(getJPanelContentSouth(), java.awt.BorderLayout.SOUTH);
403 // jContentPane.add(getJPanelContentNorth(), java.awt.BorderLayout.NORTH);
404 // jContentPane.add(getJPanelContentWest(), java.awt.BorderLayout.WEST);
405 // jContentPane.add(getJPanelContentEast(), java.awt.BorderLayout.EAST);
406 jContentPane
.add(getJTabbedPane(), java
.awt
.BorderLayout
.CENTER
);
414 public static void main(String
[] args
) {
415 // TODO Auto-generated method stub
416 new FpdBuildOptions().setVisible(true);
420 * This is the default constructor
422 public FpdBuildOptions() {
425 this.setVisible(true);
428 public FpdBuildOptions(PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
430 ffc
= new FpdFileContents(fpd
);
434 public FpdBuildOptions(OpeningPlatformType opt
) {
435 this(opt
.getXmlFpd());
439 private void init(FpdFileContents ffc
) {
443 this.addInternalFrameListener(new InternalFrameAdapter() {
444 public void internalFrameDeactivated(InternalFrameEvent e
) {
445 if (jTableFfs
.isEditing()) {
446 jTableFfs
.getCellEditor().stopCellEditing();
448 if (jTableFfsSection
.isEditing()) {
449 jTableFfsSection
.getCellEditor().stopCellEditing();
451 if (jTableAntTasks
.isEditing()) {
452 jTableAntTasks
.getCellEditor().stopCellEditing();
454 if (jTableFfsSubSection
.isEditing()) {
455 jTableFfsSubSection
.getCellEditor().stopCellEditing();
457 if (jTableFfsAttribs
.isEditing()) {
458 jTableFfsAttribs
.getCellEditor().stopCellEditing();
460 if (jTableOptions
.isEditing()) {
461 jTableOptions
.getCellEditor().stopCellEditing();
468 * This method initializes jPanel13
470 * @return javax.swing.JPanel
472 private JPanel
getJPanelFfsTab() {
473 if (jPanelFfsTab
== null) {
474 jPanelFfsTab
= new JPanel();
475 jPanelFfsTab
.setLayout(new BorderLayout());
476 jPanelFfsTab
.add(getJPanelFfsTabCenter(), java
.awt
.BorderLayout
.CENTER
);
477 jPanelFfsTab
.add(getJScrollPaneFfs(), java
.awt
.BorderLayout
.WEST
);
483 * This method initializes jPanel18
485 * @return javax.swing.JPanel
487 private JPanel
getJPanelFfsTabCenter() {
488 if (jPanelFfsTabCenter
== null) {
489 jPanelFfsTabCenter
= new JPanel();
490 jPanelFfsTabCenter
.setLayout(new BorderLayout());
491 jPanelFfsTabCenter
.add(getJPanelFfsTabCenterN(), java
.awt
.BorderLayout
.NORTH
);
492 jPanelFfsTabCenter
.add(getJPanelFfsTabCenterS(), java
.awt
.BorderLayout
.SOUTH
);
493 jPanelFfsTabCenter
.add(getJSplitPaneFfsC(), java
.awt
.BorderLayout
.CENTER
);
495 return jPanelFfsTabCenter
;
499 * This method initializes jPanel15
501 * @return javax.swing.JPanel
503 private JPanel
getJPanelFfsTabCenterN() {
504 if (jPanelFfsTabCenterN
== null) {
505 jLabelEncapType
= new JLabel();
506 jLabelEncapType
.setText("Encapsulation Type");
507 FlowLayout flowLayout5
= new FlowLayout();
508 flowLayout5
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
509 jLabelFfsKey
= new JLabel();
510 jLabelFfsKey
.setText("FFS Key");
511 jPanelFfsTabCenterN
= new JPanel();
512 jPanelFfsTabCenterN
.setLayout(flowLayout5
);
513 jPanelFfsTabCenterN
.add(jLabelFfsKey
, null);
514 jPanelFfsTabCenterN
.add(getJTextFieldFfsKey(), null);
515 jPanelFfsTabCenterN
.add(jLabelEncapType
, null);
516 jPanelFfsTabCenterN
.add(getJTextFieldEncapType(), null);
517 jPanelFfsTabCenterN
.add(getJButtonFfsAdd(), null);
518 jPanelFfsTabCenterN
.add(getJButtonFfsDel(), null);
520 return jPanelFfsTabCenterN
;
524 * This method initializes jPanel16
526 * @return javax.swing.JPanel
528 private JPanel
getJPanelFfsTabCenterS() {
529 if (jPanelFfsTabCenterS
== null) {
530 jLabelFfsAttribs
= new JLabel();
531 jLabelFfsAttribs
.setText("Attributes");
532 FlowLayout flowLayout6
= new FlowLayout();
533 flowLayout6
.setHgap(5);
534 flowLayout6
.setVgap(20);
535 flowLayout6
.setAlignment(java
.awt
.FlowLayout
.CENTER
);
536 jPanelFfsTabCenterS
= new JPanel();
537 jPanelFfsTabCenterS
.setPreferredSize(new java
.awt
.Dimension(491, 130));
538 jPanelFfsTabCenterS
.setLayout(flowLayout6
);
539 jPanelFfsTabCenterS
.add(jLabelFfsAttribs
, null);
540 jPanelFfsTabCenterS
.add(getJScrollPaneFfsAttribs(), null);
541 jPanelFfsTabCenterS
.add(getJPanelFfsAttribButtonGroup(), null);
543 return jPanelFfsTabCenterS
;
547 * This method initializes jTextField6
549 * @return javax.swing.JTextField
551 private JTextField
getJTextFieldFfsKey() {
552 if (jTextFieldFfsKey
== null) {
553 jTextFieldFfsKey
= new JTextField();
554 jTextFieldFfsKey
.setPreferredSize(new java
.awt
.Dimension(100, 20));
555 jTextFieldFfsKey
.setEditable(true);
556 jTextFieldFfsKey
.addFocusListener(new java
.awt
.event
.FocusAdapter() {
557 public void focusLost(java
.awt
.event
.FocusEvent e
) {
558 if (jTableFfs
.getSelectedRow() < 0) {
561 // ffc.updateBuildOptionsFfsKey(jTable.getSelectedRow(), jTextField6.getText());
565 return jTextFieldFfsKey
;
569 * This method initializes jButton8
571 * @return javax.swing.JButton
573 private JButton
getJButtonFfsAdd() {
574 if (jButtonFfsAdd
== null) {
575 jButtonFfsAdd
= new JButton();
576 jButtonFfsAdd
.setPreferredSize(new java
.awt
.Dimension(70, 20));
577 jButtonFfsAdd
.setText("Add");
578 jButtonFfsAdd
.addActionListener(new AbstractAction() {
582 private static final long serialVersionUID
= -2923720717273384221L;
584 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
585 if (jTextFieldFfsKey
.getText().length() > 0) {
586 String
[] row
= { jTextFieldFfsKey
.getText() };
587 ffsTableModel
.addRow(row
);
588 docConsole
.setSaved(false);
589 ffc
.genBuildOptionsFfs(jTextFieldFfsKey
.getText(), jTextFieldEncapType
.getText());
594 return jButtonFfsAdd
;
598 * This method initializes jButton9
600 * @return javax.swing.JButton
602 private JButton
getJButtonFfsDel() {
603 if (jButtonFfsDel
== null) {
604 jButtonFfsDel
= new JButton();
605 jButtonFfsDel
.setPreferredSize(new java
.awt
.Dimension(70, 20));
606 jButtonFfsDel
.setText("Delete");
607 jButtonFfsDel
.addActionListener(new AbstractAction() {
611 private static final long serialVersionUID
= -4002678939178194476L;
613 public void actionPerformed(ActionEvent arg0
) {
614 if (jTableFfs
.getSelectedRow() < 0) {
617 docConsole
.setSaved(false);
618 ffc
.removeBuildOptionsFfs(jTableFfs
.getSelectedRow());
619 ffsTableModel
.removeRow(jTableFfs
.getSelectedRow());
623 return jButtonFfsDel
;
627 * This method initializes jScrollPane5
629 * @return javax.swing.JScrollPane
631 private JScrollPane
getJScrollPaneFfsAttribs() {
632 if (jScrollPaneFfsAttribs
== null) {
633 jScrollPaneFfsAttribs
= new JScrollPane();
634 jScrollPaneFfsAttribs
.setPreferredSize(new java
.awt
.Dimension(350, 100));
635 jScrollPaneFfsAttribs
.setViewportView(getJTableFfsAttribs());
637 return jScrollPaneFfsAttribs
;
641 * This method initializes jTable4
643 * @return javax.swing.JTable
645 private JTable
getJTableFfsAttribs() {
646 if (jTableFfsAttribs
== null) {
647 ffsAttributesTableModel
= new DefaultTableModel();
648 jTableFfsAttribs
= new JTable(ffsAttributesTableModel
);
649 jTableFfsAttribs
.setPreferredSize(new java
.awt
.Dimension(400, 80));
650 jTableFfsAttribs
.setRowHeight(20);
651 ffsAttributesTableModel
.addColumn("Name");
652 ffsAttributesTableModel
.addColumn("Value");
654 jTableFfsAttribs
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
655 jTableFfsAttribs
.getModel().addTableModelListener(new TableModelListener() {
656 public void tableChanged(TableModelEvent arg0
) {
657 // TODO Auto-generated method stub
658 int row
= arg0
.getFirstRow();
659 TableModel m
= (TableModel
) arg0
.getSource();
660 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
661 //ToDo Data Validition check.
662 String name
= m
.getValueAt(row
, 0) + "";
663 String value
= m
.getValueAt(row
, 1) + "";
665 if (name
.length() == 0) {
668 if (value
.length() == 0) {
671 docConsole
.setSaved(false);
672 ffc
.updateBuildOptionsFfsAttribute(jTableFfs
.getSelectedRow(), row
, name
, value
);
677 return jTableFfsAttribs
;
680 private void initFfsTable() {
681 int ffsCount
= ffc
.getBuildOptionsFfsCount();
685 String
[][] saa
= new String
[ffsCount
][1];
686 ffc
.getBuildOptionsFfsKey(saa
);
687 for (int i
= 0; i
< saa
.length
; ++i
) {
688 ffsTableModel
.addRow(saa
[i
]);
693 * This method initializes jButton17
695 * @return javax.swing.JButton
697 private JButton
getJButtonFfsAttribNew() {
698 if (jButtonFfsAttribNew
== null) {
699 jButtonFfsAttribNew
= new JButton();
700 jButtonFfsAttribNew
.setPreferredSize(new java
.awt
.Dimension(80, 20));
701 jButtonFfsAttribNew
.setText("New");
702 jButtonFfsAttribNew
.addActionListener(new AbstractAction() {
706 private static final long serialVersionUID
= 1L;
708 public void actionPerformed(ActionEvent arg0
) {
709 if (jTableFfs
.getSelectedRow() < 0) {
712 Object
[] o
= { "", "" };
713 ffsAttributesTableModel
.addRow(o
);
714 docConsole
.setSaved(false);
715 ffc
.genBuildOptionsFfsAttribute(jTableFfs
.getSelectedRow(), "", "");
719 return jButtonFfsAttribNew
;
723 * This method initializes jButton18
725 * @return javax.swing.JButton
727 private JButton
getJButtonFfsAttribRemove() {
728 if (jButtonFfsAttribRemove
== null) {
729 jButtonFfsAttribRemove
= new JButton();
730 jButtonFfsAttribRemove
.setPreferredSize(new java
.awt
.Dimension(80, 20));
731 jButtonFfsAttribRemove
.setText("Remove");
732 jButtonFfsAttribRemove
.addActionListener(new AbstractAction() {
736 private static final long serialVersionUID
= 1L;
738 public void actionPerformed(ActionEvent arg0
) {
739 if (jTableFfs
.getSelectedRow() < 0) {
742 if (jTableFfsAttribs
.getSelectedRow() >= 0) {
743 docConsole
.setSaved(false);
744 ffsAttributesTableModel
.removeRow(jTableFfsAttribs
.getSelectedRow());
745 ffc
.removeBuildOptionsFfsAttribute(jTableFfs
.getSelectedRow(),
746 jTableFfsAttribs
.getSelectedRow());
751 return jButtonFfsAttribRemove
;
755 * This method initializes jScrollPane
757 * @return javax.swing.JScrollPane
759 private JScrollPane
getJScrollPaneFfs() {
760 if (jScrollPaneFfs
== null) {
761 jScrollPaneFfs
= new JScrollPane();
762 jScrollPaneFfs
.setPreferredSize(new java
.awt
.Dimension(150, 419));
763 jScrollPaneFfs
.setViewportView(getJTableFfs());
765 return jScrollPaneFfs
;
769 * This method initializes jTable
771 * @return javax.swing.JTable
773 private JTable
getJTableFfs() {
774 if (jTableFfs
== null) {
775 ffsTableModel
= new DefaultTableModel();
776 ffsTableModel
.addColumn("FFS Type");
777 jTableFfs
= new JTable(ffsTableModel
);
778 jTableFfs
.setShowGrid(false);
779 jTableFfs
.setRowHeight(20);
781 jTableFfs
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
782 jTableFfs
.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
783 public void valueChanged(ListSelectionEvent e
) {
785 if (e
.getValueIsAdjusting()) {
788 ListSelectionModel lsm
= (ListSelectionModel
) e
.getSource();
789 if (lsm
.isSelectionEmpty()) {
792 int row
= lsm
.getMinSelectionIndex();
793 sectionTableModel
.setRowCount(0);
794 sectionsTableModel
.setRowCount(0);
795 subsectionsTableModel
.setRowCount(0);
796 ffsAttributesTableModel
.setRowCount(0);
797 String
[] sArray
= { "", "" };
798 LinkedHashMap
<String
, String
> lhm
= new LinkedHashMap
<String
, String
>();
799 ArrayList
<String
> alSections
= new ArrayList
<String
>();
800 ArrayList
<String
> alSection
= new ArrayList
<String
>();
801 ffc
.getBuildOptionsFfs(row
, sArray
, lhm
, alSections
, alSection
);
802 jTextFieldFfsKey
.setText(sArray
[0]);
803 jTextFieldEncapType
.setText(sArray
[1]);
804 for (int i
= 0; i
< alSection
.size(); ++i
) {
805 String
[] sectionRow
= { alSection
.get(i
) };
806 sectionTableModel
.addRow(sectionRow
);
808 for (int j
= 0; j
< alSections
.size(); ++j
) {
809 String
[] sectionsRow
= { alSections
.get(j
) };
810 sectionsTableModel
.addRow(sectionsRow
);
812 if (lhm
.size() <= 0) {
815 Set
<String
> keySet
= lhm
.keySet();
816 Iterator
<String
> is
= keySet
.iterator();
817 while (is
.hasNext()) {
818 String key
= is
.next();
819 String
[] attribRow
= { key
, lhm
.get(key
) };
820 ffsAttributesTableModel
.addRow(attribRow
);
826 jTableFfs
.getModel().addTableModelListener(new TableModelListener() {
827 public void tableChanged(TableModelEvent arg0
) {
828 // TODO Auto-generated method stub
829 int row
= arg0
.getFirstRow();
830 TableModel m
= (TableModel
) arg0
.getSource();
831 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
832 //ToDo Data Validition check.
833 String id
= m
.getValueAt(row
, 0) + "";
835 if (id
.length() == 0) {
838 docConsole
.setSaved(false);
839 ffc
.updateBuildOptionsFfsKey(row
, id
);
848 * This method initializes jScrollPane1
850 * @return javax.swing.JScrollPane
852 private JScrollPane
getJScrollPaneFfsSection() {
853 if (jScrollPaneFfsSection
== null) {
854 jScrollPaneFfsSection
= new JScrollPane();
855 jScrollPaneFfsSection
.setPreferredSize(new java
.awt
.Dimension(500, 80));
856 jScrollPaneFfsSection
.setViewportView(getJTableFfsSection());
858 return jScrollPaneFfsSection
;
862 * This method initializes jTable1
864 * @return javax.swing.JTable
866 private JTable
getJTableFfsSection() {
867 if (jTableFfsSection
== null) {
868 sectionTableModel
= new DefaultTableModel();
869 sectionTableModel
.addColumn("SectionType");
871 jTableFfsSection
= new JTable(sectionTableModel
);
872 jTableFfsSection
.setRowHeight(20);
873 JComboBox cb
= new JComboBox();
874 cb
.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");
875 cb
.addItem("EFI_SECTION_VERSION");
876 cb
.addItem("EFI_SECTION_USER_INTERFACE");
877 cb
.addItem("EFI_SECTION_DXE_DEPEX");
878 cb
.addItem("EFI_SECTION_PEI_DEPEX");
879 cb
.addItem("EFI_SECTION_PE32");
880 cb
.addItem("EFI_SECTION_PIC");
881 cb
.addItem("EFI_SECTION_TE");
882 cb
.addItem("EFI_SECTION_RAW");
883 cb
.addItem("EFI_SECTION_COMPRESSION");
884 cb
.addItem("EFI_SECTION_GUID_DEFINED");
885 cb
.addItem("EFI_SECTION_COMPATIBILITY16");
886 cb
.addItem("EFI_SECTION_FIRMWARE_VOLUME_IMAGE");
887 jTableFfsSection
.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(cb
));
889 jTableFfsSection
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
891 jTableFfsSection
.getModel().addTableModelListener(new TableModelListener() {
892 public void tableChanged(TableModelEvent arg0
) {
893 // TODO Auto-generated method stub
894 if (jTableFfs
.getSelectedRow() < 0) {
897 int row
= arg0
.getFirstRow();
898 TableModel m
= (TableModel
) arg0
.getSource();
899 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
900 //ToDo Data Validition check.
901 String type
= m
.getValueAt(row
, 0) + "";
902 docConsole
.setSaved(false);
903 ffc
.updateBuildOptionsFfsSectionsSection(jTableFfs
.getSelectedRow(), row
, type
);
908 return jTableFfsSection
;
912 * This method initializes jScrollPane3
914 * @return javax.swing.JScrollPane
916 private JScrollPane
getJScrollPaneFfsSubSection() {
917 if (jScrollPaneFfsSubSection
== null) {
918 jScrollPaneFfsSubSection
= new JScrollPane();
919 jScrollPaneFfsSubSection
.setPreferredSize(new java
.awt
.Dimension(500, 90));
920 jScrollPaneFfsSubSection
.setViewportView(getJTableFfsSubSection());
922 return jScrollPaneFfsSubSection
;
926 * This method initializes jTable3
928 * @return javax.swing.JTable
930 private JTable
getJTableFfsSubSection() {
931 if (jTableFfsSubSection
== null) {
932 subsectionsTableModel
= new DefaultTableModel();
933 subsectionsTableModel
.addColumn("SectionType");
934 jTableFfsSubSection
= new JTable(subsectionsTableModel
);
935 jTableFfsSubSection
.setRowHeight(20);
936 JComboBox cb
= new JComboBox();
937 cb
.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");
938 cb
.addItem("EFI_SECTION_VERSION");
939 cb
.addItem("EFI_SECTION_USER_INTERFACE");
940 cb
.addItem("EFI_SECTION_DXE_DEPEX");
941 cb
.addItem("EFI_SECTION_PEI_DEPEX");
942 cb
.addItem("EFI_SECTION_PE32");
943 cb
.addItem("EFI_SECTION_PIC");
944 cb
.addItem("EFI_SECTION_TE");
945 cb
.addItem("EFI_SECTION_RAW");
946 cb
.addItem("EFI_SECTION_COMPRESSION");
947 cb
.addItem("EFI_SECTION_GUID_DEFINED");
948 cb
.addItem("EFI_SECTION_COMPATIBILITY16");
949 cb
.addItem("EFI_SECTION_FIRMWARE_VOLUME_IMAGE");
950 jTableFfsSubSection
.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(cb
));
951 jTableFfsSubSection
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
953 jTableFfsSubSection
.getModel().addTableModelListener(new TableModelListener() {
954 public void tableChanged(TableModelEvent arg0
) {
955 // TODO Auto-generated method stub
956 if (jTableFfs
.getSelectedRow() < 0 || jTableFfsSections
.getSelectedRow() < 0) {
959 int row
= arg0
.getFirstRow();
960 TableModel m
= (TableModel
) arg0
.getSource();
961 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
962 //ToDo Data Validition check.
963 String type
= m
.getValueAt(row
, 0) + "";
964 docConsole
.setSaved(false);
965 ffc
.updateBuildOptionsFfsSectionsSectionsSection(jTableFfs
.getSelectedRow(),
966 jTableFfsSections
.getSelectedRow(), row
, type
);
971 return jTableFfsSubSection
;
975 * This method initializes jTextField
977 * @return javax.swing.JTextField
979 private JTextField
getJTextFieldEncapType() {
980 if (jTextFieldEncapType
== null) {
981 jTextFieldEncapType
= new JTextField();
982 jTextFieldEncapType
.setPreferredSize(new java
.awt
.Dimension(100, 20));
983 jTextFieldEncapType
.addFocusListener(new java
.awt
.event
.FocusAdapter() {
984 public void focusLost(java
.awt
.event
.FocusEvent e
) {
985 if (jTableFfs
.getSelectedRow() < 0) {
988 ffc
.updateBuildOptionsFfsSectionsType(jTableFfs
.getSelectedRow(), jTextFieldEncapType
.getText());
992 return jTextFieldEncapType
;
996 * This method initializes jPanel4
998 * @return javax.swing.JPanel
1000 private JPanel
getJPanelFfsAttribButtonGroup() {
1001 if (jPanelFfsAttribButtonGroup
== null) {
1002 jPanelFfsAttribButtonGroup
= new JPanel();
1003 jPanelFfsAttribButtonGroup
.setPreferredSize(new java
.awt
.Dimension(100, 100));
1004 jPanelFfsAttribButtonGroup
.add(getJButtonFfsAttribNew(), null);
1005 jPanelFfsAttribButtonGroup
.add(getJButtonFfsAttribRemove(), null);
1007 return jPanelFfsAttribButtonGroup
;
1011 * This method initializes jButton
1013 * @return javax.swing.JButton
1015 private JButton
getJButtonFfsSectionNew() {
1016 if (jButtonFfsSectionNew
== null) {
1017 jButtonFfsSectionNew
= new JButton();
1018 jButtonFfsSectionNew
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1019 jButtonFfsSectionNew
.setText("New");
1020 jButtonFfsSectionNew
.addActionListener(new java
.awt
.event
.ActionListener() {
1021 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1022 if (jTableFfs
.getSelectedRow() < 0) {
1025 docConsole
.setSaved(false);
1026 String
[] row
= { "EFI_SECTION_RAW" };
1027 sectionTableModel
.addRow(row
);
1028 ffc
.genBuildOptionsFfsSectionsSection(jTableFfs
.getSelectedRow(), row
[0]);
1032 return jButtonFfsSectionNew
;
1036 * This method initializes jButton1
1038 * @return javax.swing.JButton
1040 private JButton
getJButtonFfsSectionRemove() {
1041 if (jButtonFfsSectionRemove
== null) {
1042 jButtonFfsSectionRemove
= new JButton();
1043 jButtonFfsSectionRemove
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1044 jButtonFfsSectionRemove
.setText("Remove");
1046 jButtonFfsSectionRemove
.addActionListener(new java
.awt
.event
.ActionListener() {
1047 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1048 if (jTableFfs
.getSelectedRow() < 0 || jTableFfsSection
.getSelectedRow() < 0) {
1051 docConsole
.setSaved(false);
1052 sectionTableModel
.removeRow(jTableFfsSection
.getSelectedRow());
1053 ffc
.removeBuildOptionsFfsSectionsSection(jTableFfs
.getSelectedRow(),
1054 jTableFfsSection
.getSelectedRow());
1058 return jButtonFfsSectionRemove
;
1062 * This method initializes jButton2
1064 * @return javax.swing.JButton
1066 private JButton
getJButtonFfsSubSectionNew() {
1067 if (jButtonFfsSubSectionNew
== null) {
1068 jButtonFfsSubSectionNew
= new JButton();
1069 jButtonFfsSubSectionNew
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1070 jButtonFfsSubSectionNew
.setText("New");
1071 jButtonFfsSubSectionNew
.addActionListener(new java
.awt
.event
.ActionListener() {
1072 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1073 if (jTableFfs
.getSelectedRow() < 0 || jTableFfsSections
.getSelectedRow() < 0) {
1076 docConsole
.setSaved(false);
1077 String
[] row
= { "EFI_SECTION_RAW" };
1078 subsectionsTableModel
.addRow(row
);
1079 ffc
.genBuildOptionsFfsSectionsSectionsSection(jTableFfs
.getSelectedRow(),
1080 jTableFfsSections
.getSelectedRow(), row
[0]);
1085 return jButtonFfsSubSectionNew
;
1089 * This method initializes jButton3
1091 * @return javax.swing.JButton
1093 private JButton
getJButtonFfsSubSectionRemove() {
1094 if (jButtonFfsSubSectionRemove
== null) {
1095 jButtonFfsSubSectionRemove
= new JButton();
1096 jButtonFfsSubSectionRemove
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1097 jButtonFfsSubSectionRemove
.setText("Remove");
1098 jButtonFfsSubSectionRemove
.addActionListener(new java
.awt
.event
.ActionListener() {
1099 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1100 if (jTableFfs
.getSelectedRow() < 0 || jTableFfsSections
.getSelectedRow() < 0
1101 || jTableFfsSubSection
.getSelectedRow() < 0) {
1104 docConsole
.setSaved(false);
1105 subsectionsTableModel
.removeRow(jTableFfsSubSection
.getSelectedRow());
1106 ffc
.removeBuildOptionsFfsSectionsSectionsSection(jTableFfs
.getSelectedRow(),
1107 jTableFfsSections
.getSelectedRow(),
1108 jTableFfsSubSection
.getSelectedRow());
1112 return jButtonFfsSubSectionRemove
;
1116 * This method initializes jButton6
1118 * @return javax.swing.JButton
1120 private JButton
getJButtonFfsSectionsNew() {
1121 if (jButtonFfsSectionsNew
== null) {
1122 jButtonFfsSectionsNew
= new JButton();
1123 jButtonFfsSectionsNew
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1124 jButtonFfsSectionsNew
.setText("New");
1125 jButtonFfsSectionsNew
.addActionListener(new java
.awt
.event
.ActionListener() {
1126 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1127 if (jTableFfs
.getSelectedRow() < 0) {
1130 docConsole
.setSaved(false);
1131 String
[] row
= { "" };
1132 sectionsTableModel
.addRow(row
);
1133 ffc
.genBuildOptionsFfsSectionsSections(jTableFfs
.getSelectedRow(), "");
1137 return jButtonFfsSectionsNew
;
1141 * This method initializes jButton7
1143 * @return javax.swing.JButton
1145 private JButton
getJButtonFfsSectionsRemove() {
1146 if (jButtonFfsSectionsRemove
== null) {
1147 jButtonFfsSectionsRemove
= new JButton();
1148 jButtonFfsSectionsRemove
.setPreferredSize(new java
.awt
.Dimension(80, 20));
1149 jButtonFfsSectionsRemove
.setText("Remove");
1150 jButtonFfsSectionsRemove
.addActionListener(new java
.awt
.event
.ActionListener() {
1151 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1152 if (jTableFfs
.getSelectedRow() < 0 || jTableFfsSections
.getSelectedRow() < 0) {
1155 docConsole
.setSaved(false);
1156 sectionsTableModel
.removeRow(jTableFfsSections
.getSelectedRow());
1157 ffc
.removeBuildOptionsFfsSectionsSections(jTableFfs
.getSelectedRow(),
1158 jTableFfsSections
.getSelectedRow());
1162 return jButtonFfsSectionsRemove
;
1165 private JScrollPane
getJScrollPaneFfsSections() {
1166 if (jScrollPaneFfsSections
== null) {
1167 jScrollPaneFfsSections
= new JScrollPane();
1168 jScrollPaneFfsSections
.setPreferredSize(new java
.awt
.Dimension(500, 80));
1169 jScrollPaneFfsSections
.setViewportView(getJTableFfsSections());
1171 return jScrollPaneFfsSections
;
1175 * This method initializes jTable6
1177 * @return javax.swing.JTable
1179 private JTable
getJTableFfsSections() {
1180 if (jTableFfsSections
== null) {
1181 sectionsTableModel
= new DefaultTableModel();
1182 sectionsTableModel
.addColumn("EncapsulationType");
1183 jTableFfsSections
= new JTable(sectionsTableModel
);
1184 jTableFfsSections
.setRowHeight(20);
1185 jTableFfsSections
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
1186 jTableFfsSections
.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
1187 public void valueChanged(ListSelectionEvent e
) {
1188 if (e
.getValueIsAdjusting()) {
1191 ListSelectionModel lsm
= (ListSelectionModel
) e
.getSource();
1192 if (lsm
.isSelectionEmpty()) {
1195 int sectionsRow
= lsm
.getMinSelectionIndex();
1196 if (jTableFfs
.getSelectedRow() < 0) {
1199 subsectionsTableModel
.setRowCount(0);
1200 ArrayList
<String
> al
= new ArrayList
<String
>();
1201 ffc
.getBuildOptionsFfsSectionsSectionsSection(jTableFfs
.getSelectedRow(), sectionsRow
, al
);
1202 for (int i
= 0; i
< al
.size(); ++i
) {
1203 String
[] subsectionRow
= { al
.get(i
) };
1204 subsectionsTableModel
.addRow(subsectionRow
);
1210 jTableFfsSections
.getModel().addTableModelListener(new TableModelListener() {
1211 public void tableChanged(TableModelEvent arg0
) {
1212 // TODO Auto-generated method stub
1213 int row
= arg0
.getFirstRow();
1214 TableModel m
= (TableModel
) arg0
.getSource();
1215 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
1216 //ToDo Data Validition check.
1217 String encapType
= m
.getValueAt(row
, 0) + "";
1218 docConsole
.setSaved(false);
1219 ffc
.updateBuildOptionsFfsSectionsSections(jTableFfs
.getSelectedRow(), row
, encapType
);
1224 return jTableFfsSections
;
1228 * This method initializes jSplitPaneFfsC
1230 * @return javax.swing.JSplitPane
1232 private JSplitPane
getJSplitPaneFfsC() {
1233 if (jSplitPaneFfsC
== null) {
1234 jSplitPaneFfsC
= new JSplitPane();
1235 jSplitPaneFfsC
.setOrientation(javax
.swing
.JSplitPane
.VERTICAL_SPLIT
);
1236 jSplitPaneFfsC
.setDividerLocation(130);
1237 jSplitPaneFfsC
.setTopComponent(getJPanelFfsCTop());
1238 jSplitPaneFfsC
.setBottomComponent(getJSplitPaneFfsCBottom());
1239 jSplitPaneFfsC
.setDividerSize(5);
1241 return jSplitPaneFfsC
;
1245 * This method initializes jPanelFfsCTop
1247 * @return javax.swing.JPanel
1249 private JPanel
getJPanelFfsCTop() {
1250 if (jPanelFfsCTop
== null) {
1251 jPanelFfsCTop
= new JPanel();
1252 jPanelFfsCTop
.setLayout(new BorderLayout());
1253 jPanelFfsCTop
.add(getJPanelSectionN(), java
.awt
.BorderLayout
.NORTH
);
1254 jPanelFfsCTop
.add(getJPanelSectionC(), java
.awt
.BorderLayout
.CENTER
);
1256 return jPanelFfsCTop
;
1260 * This method initializes jSplitPaneFfsCBottom
1262 * @return javax.swing.JSplitPane
1264 private JSplitPane
getJSplitPaneFfsCBottom() {
1265 if (jSplitPaneFfsCBottom
== null) {
1266 jSplitPaneFfsCBottom
= new JSplitPane();
1267 jSplitPaneFfsCBottom
.setDividerSize(5);
1268 jSplitPaneFfsCBottom
.setDividerLocation(130);
1269 jSplitPaneFfsCBottom
.setTopComponent(getJPanelFfsCBottomTop());
1270 jSplitPaneFfsCBottom
.setBottomComponent(getJPanelFfsCBottomBottom());
1271 jSplitPaneFfsCBottom
.setOrientation(javax
.swing
.JSplitPane
.VERTICAL_SPLIT
);
1273 return jSplitPaneFfsCBottom
;
1277 * This method initializes jPanelFfsCBottomTop
1279 * @return javax.swing.JPanel
1281 private JPanel
getJPanelFfsCBottomTop() {
1282 if (jPanelFfsCBottomTop
== null) {
1283 jPanelFfsCBottomTop
= new JPanel();
1284 jPanelFfsCBottomTop
.setLayout(new BorderLayout());
1285 jPanelFfsCBottomTop
.add(getJPanelSectionsN(), java
.awt
.BorderLayout
.NORTH
);
1286 jPanelFfsCBottomTop
.add(getJPanelSectionsC(), java
.awt
.BorderLayout
.CENTER
);
1288 return jPanelFfsCBottomTop
;
1292 * This method initializes jPanelFfsCBottomBottom
1294 * @return javax.swing.JPanel
1296 private JPanel
getJPanelFfsCBottomBottom() {
1297 if (jPanelFfsCBottomBottom
== null) {
1298 jPanelFfsCBottomBottom
= new JPanel();
1299 jPanelFfsCBottomBottom
.setLayout(new BorderLayout());
1300 jPanelFfsCBottomBottom
.add(getJPanelSubSectionN(), java
.awt
.BorderLayout
.NORTH
);
1301 jPanelFfsCBottomBottom
.add(getJPanelSubSectionC(), java
.awt
.BorderLayout
.CENTER
);
1303 return jPanelFfsCBottomBottom
;
1307 * This method initializes jPanelSectionN
1309 * @return javax.swing.JPanel
1311 private JPanel
getJPanelSectionN() {
1312 if (jPanelSectionN
== null) {
1313 jPanelSectionN
= new JPanel();
1314 jLabelFfsSection
= new JLabel();
1315 jLabelFfsSection
.setText("Section");
1316 jPanelSectionN
.add(jLabelFfsSection
, null);
1317 jPanelSectionN
.add(getJButtonFfsSectionNew(), null);
1318 jPanelSectionN
.add(getJButtonFfsSectionRemove(), null);
1320 return jPanelSectionN
;
1324 * This method initializes jPanelSectionC
1326 * @return javax.swing.JPanel
1328 private JPanel
getJPanelSectionC() {
1329 if (jPanelSectionC
== null) {
1330 jPanelSectionC
= new JPanel();
1331 jPanelSectionC
.add(getJScrollPaneFfsSection(), null);
1333 return jPanelSectionC
;
1337 * This method initializes jPanelSectionsN
1339 * @return javax.swing.JPanel
1341 private JPanel
getJPanelSectionsN() {
1342 if (jPanelSectionsN
== null) {
1343 jPanelSectionsN
= new JPanel();
1344 jLabelFfsSections
= new JLabel();
1345 jLabelFfsSections
.setText("Sections");
1346 jPanelSectionsN
.add(jLabelFfsSections
, null);
1347 jPanelSectionsN
.add(getJButtonFfsSectionsNew(), null);
1348 jPanelSectionsN
.add(getJButtonFfsSectionsRemove(), null);
1350 return jPanelSectionsN
;
1354 * This method initializes jPanelSectionsC
1356 * @return javax.swing.JPanel
1358 private JPanel
getJPanelSectionsC() {
1359 if (jPanelSectionsC
== null) {
1360 jPanelSectionsC
= new JPanel();
1361 jPanelSectionsC
.add(getJScrollPaneFfsSections(), null);
1363 return jPanelSectionsC
;
1367 * This method initializes jPanelSubSectionN
1369 * @return javax.swing.JPanel
1371 private JPanel
getJPanelSubSectionN() {
1372 if (jPanelSubSectionN
== null) {
1373 jPanelSubSectionN
= new JPanel();
1374 jLabelFfsSubSections
= new JLabel();
1375 jLabelFfsSubSections
.setText("Sub-Sections");
1376 jPanelSubSectionN
.add(jLabelFfsSubSections
, null);
1377 jPanelSubSectionN
.add(getJButtonFfsSubSectionNew(), null);
1378 jPanelSubSectionN
.add(getJButtonFfsSubSectionRemove(), null);
1380 return jPanelSubSectionN
;
1384 * This method initializes jPanelSubSectionC
1386 * @return javax.swing.JPanel
1388 private JPanel
getJPanelSubSectionC() {
1389 if (jPanelSubSectionC
== null) {
1390 jPanelSubSectionC
= new JPanel();
1391 jPanelSubSectionC
.add(getJScrollPaneFfsSubSection(), null);
1393 return jPanelSubSectionC
;
1397 * The following section contains all Build Options content
1401 * This method initializes jPanelOptionsTab
1403 * This is the main Options screen
1405 * @return javax.swing.JPanel jPanelOptionsTab
1407 private JPanel
getJPanelOptionsTab() {
1408 if (jPanelOptionsTab
== null) {
1409 // This container holds the Options Tab content
1411 // FlowLayout flowLayout9 = new FlowLayout();
1412 // flowLayout9.setAlignment(java.awt.FlowLayout.LEFT);
1414 jPanelOptionsTab
= new JPanel();
1415 jPanelOptionsTab
.setBounds(new java
.awt
.Rectangle(0, 0, dialogWidth
* 2, dialogHeight
* 3));
1416 jPanelOptionsTab
.setPreferredSize(new java
.awt
.Dimension(dialogWidth
+ 10, (dialogHeight
* 3) + 10));
1417 jPanelOptionsTab
.setAutoscrolls(true);
1418 jPanelOptionsTab
.setLocation(0, 0);
1419 jPanelOptionsTab
.setLayout(null);
1420 jPanelOptionsTab
.add(getJPanelOptionsContainer(), null);
1421 jPanelOptionsTab
.add(getJScrollPaneOptions(), null);
1424 return jPanelOptionsTab
;
1428 * This method initializes jPanelOptionsContainer
1430 * @return javax.swing.JPanel
1432 private JPanel
getJPanelOptionsContainer() {
1433 if (jPanelOptionsContainer
== null) {
1434 jLabelTagName
= new JLabel();
1435 jLabelTagName
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowOne
, labelWidth
, oneRowHeight
));
1436 jLabelTagName
.setLocation(new java
.awt
.Point(labelColumn
, rowOne
));
1437 jLabelTagName
.setText("Tag Name");
1438 jLabelBuildTargets
= new JLabel();
1439 jLabelBuildTargets
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowTwo
, labelWidth
, oneRowHeight
));
1440 jLabelBuildTargets
.setLocation(new java
.awt
.Point(labelColumn
, rowTwo
));
1441 jLabelBuildTargets
.setText("Build Targets");
1442 jLabelToolCmd
= new JLabel();
1443 jLabelToolCmd
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowThree
, labelWidth
, oneRowHeight
));
1444 jLabelToolCmd
.setLocation(new java
.awt
.Point(labelColumn
, rowThree
));
1445 jLabelToolCmd
.setText("Tool Command");
1446 jLabelSupArch
= new JLabel();
1447 jLabelSupArch
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowFour
, labelWidth
, oneRowHeight
));
1448 jLabelSupArch
.setLocation(new java
.awt
.Point(labelColumn
, rowFour
));
1449 jLabelSupArch
.setText("Supported Architectures");
1450 jLabelToolChainFamily
= new JLabel();
1451 jLabelToolChainFamily
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowFive
, labelWidth
, oneRowHeight
));
1452 jLabelToolChainFamily
.setLocation(new java
.awt
.Point(labelColumn
, rowFive
));
1453 jLabelToolChainFamily
.setText("Tool Chain Family");
1455 jLabelOptionContents
= new JLabel();
1456 jLabelOptionContents
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowSix
, labelWidth
, oneRowHeight
));
1457 jLabelOptionContents
.setLocation(new java
.awt
.Point(labelColumn
, rowSix
));
1458 jLabelOptionContents
.setText("Option Contents");
1460 jPanelOptionsContainer
= new JPanel();
1462 jPanelOptionsContainer
.setLayout(null);
1464 jPanelOptionsContainer
.setLocation(new java
.awt
.Point(2, 2));
1465 jPanelOptionsContainer
.setBounds(new java
.awt
.Rectangle(2, 2, dialogWidth
* 2, dialogHeight
));
1466 jPanelOptionsContainer
.setPreferredSize(new java
.awt
.Dimension(dialogWidth
, dialogHeight
));
1468 jPanelOptionsContainer
1469 .setBorder(javax.swing.BorderFactory
1470 .createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
1472 jPanelOptionsContainer
.add(jLabelTagName
, null);
1473 jPanelOptionsContainer
.add(getJTextFieldTagName(), null);
1475 jPanelOptionsContainer
.add(jLabelBuildTargets
, null);
1476 jPanelOptionsContainer
.add(getJTextFieldBuildTargets(), null);
1478 jPanelOptionsContainer
.add(jLabelToolChainFamily
, null);
1479 jPanelOptionsContainer
.add(getJTextFieldToolChainFamily(), null);
1481 jPanelOptionsContainer
.add(jLabelToolCmd
, null);
1482 jPanelOptionsContainer
.add(getJTextFieldToolCmd(), null);
1484 jPanelOptionsContainer
.add(jLabelSupArch
, null);
1485 jPanelOptionsContainer
.add(getArchitectureSelections(), null);
1487 jPanelOptionsContainer
.add(jLabelOptionContents
, null);
1488 jPanelOptionsContainer
.add(getJTextFieldOptionContents(), null);
1490 jPanelOptionsContainer
.add(getJButtonOptionsAdd(), null);
1491 jPanelOptionsContainer
.add(getJButtonOptionsDel(), null);
1493 return jPanelOptionsContainer
;
1497 * This method initializes jTextFieldOptionTagName Row 1
1499 * @return javax.swing.JTextField
1501 private JTextField
getJTextFieldTagName() {
1502 if (jTextFieldTagName
== null) {
1503 jTextFieldTagName
= new JTextField();
1504 jTextFieldTagName
.setBounds(new java
.awt
.Rectangle(fieldColumn
, rowOne
, fieldWidth
, oneRowHeight
));
1505 jTextFieldTagName
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1506 jTextFieldTagName
.setLocation(new java
.awt
.Point(fieldColumn
, rowOne
));
1508 return jTextFieldTagName
;
1512 * This method initializes jTextFieldBuildTargets Row 2
1514 * @return javax.swing.JTextField jTextFieldBuildTargets
1516 private JTextField
getJTextFieldBuildTargets() {
1517 if (jTextFieldBuildTargets
== null) {
1518 jTextFieldBuildTargets
= new JTextField();
1519 jTextFieldBuildTargets
.setBounds(new java
.awt
.Rectangle(fieldColumn
, rowTwo
, fieldWidth
, oneRowHeight
));
1520 jTextFieldBuildTargets
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1521 jTextFieldBuildTargets
.setLocation(new java
.awt
.Point(fieldColumn
, rowTwo
));
1523 return jTextFieldBuildTargets
;
1527 * This method initializes jTextFieldToolCmd Row 3
1529 * This should be a dropdown box of command codes from tools_def.txt
1531 * @return javax.swing.JTextField jTextFieldToolCmd
1533 private JTextField
getJTextFieldToolCmd() {
1534 if (jTextFieldToolCmd
== null) {
1535 jTextFieldToolCmd
= new JTextField();
1536 jTextFieldToolCmd
.setBounds(new java
.awt
.Rectangle(fieldColumn
, rowThree
, fieldWidth
, oneRowHeight
));
1537 jTextFieldToolCmd
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1538 jTextFieldToolCmd
.setLocation(new java
.awt
.Point(fieldColumn
, rowThree
));
1540 return jTextFieldToolCmd
;
1544 * This method initializes jArchitectureSelections Row 4
1546 * @return jArchitectureSelections
1548 private JPanel
getArchitectureSelections() {
1549 if (jArchitectureSelections
== null) {
1550 jArchitectureSelections
= new JPanel();
1551 jArchitectureSelections
.setLayout(null);
1552 jArchitectureSelections
.add(getJCheckBoxIA32(), null);
1553 jArchitectureSelections
.add(getJCheckBoxX64(), null);
1554 jArchitectureSelections
.add(getJCheckBoxIpf(), null);
1555 jArchitectureSelections
.add(getJCheckBoxEBC(), null);
1556 jArchitectureSelections
.add(getJCheckBoxARM(), null);
1557 jArchitectureSelections
.add(getJCheckBoxPPC(), null);
1558 jArchitectureSelections
.setBounds(new java
.awt
.Rectangle(fieldColumn
, rowFour
, fieldWidth
, oneRowHeight
));
1559 jArchitectureSelections
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1560 jArchitectureSelections
.setLocation(new java
.awt
.Point(fieldColumn
, rowFour
));
1562 return jArchitectureSelections
;
1566 * This method initializes jCheckBoxIA32
1568 * @return javax.swing.JCheckBox jCheckBoxIA32
1570 private JCheckBox
getJCheckBoxIA32() {
1571 if (jCheckBoxIA32
== null) {
1572 jCheckBoxIA32
= new JCheckBox();
1573 jCheckBoxIA32
.setBounds(new java
.awt
.Rectangle(0, 0, 55, 20));
1574 jCheckBoxIA32
.setText("IA32");
1576 return jCheckBoxIA32
;
1580 * This method initializes jCheckBoxX64
1582 * @return javax.swing.JCheckBox jCheckBoxX64
1584 private JCheckBox
getJCheckBoxX64() {
1585 if (jCheckBoxX64
== null) {
1586 jCheckBoxX64
= new JCheckBox();
1587 jCheckBoxX64
.setText("X64");
1588 jCheckBoxX64
.setBounds(new java
.awt
.Rectangle(55, 0, 53, 20));
1590 return jCheckBoxX64
;
1594 * This method initializes jCheckBoxIpf
1596 * @return javax.swing.JCheckBox jCheckBoxIpf
1598 private JCheckBox
getJCheckBoxIpf() {
1599 if (jCheckBoxIpf
== null) {
1600 jCheckBoxIpf
= new JCheckBox();
1601 jCheckBoxIpf
.setBounds(new java
.awt
.Rectangle(108, 0, 52, 20));
1602 jCheckBoxIpf
.setText("IPF");
1604 return jCheckBoxIpf
;
1609 * This method initializes jCheckBoxEBC
1611 * @return javax.swing.JCheckBox jCheckBoxEBC
1613 private JCheckBox
getJCheckBoxEBC() {
1614 if (jCheckBoxEBC
== null) {
1615 jCheckBoxEBC
= new JCheckBox();
1616 jCheckBoxEBC
.setBounds(new java
.awt
.Rectangle(160, 0, 53, 20));
1617 jCheckBoxEBC
.setText("EBC");
1619 return jCheckBoxEBC
;
1623 * This method initializes jCheckBoxARM
1625 * @return javax.swing.JCheckBox jCheckBoxARM
1627 private JCheckBox
getJCheckBoxARM() {
1628 if (jCheckBoxARM
== null) {
1629 jCheckBoxARM
= new JCheckBox();
1630 jCheckBoxARM
.setBounds(new java
.awt
.Rectangle(213, 0, 54, 20));
1631 jCheckBoxARM
.setText("ARM");
1633 return jCheckBoxARM
;
1637 * This method initializes jCheckBoxPPC
1639 * @return javax.swing.JCheckBox jCheckBoxPPC
1641 private JCheckBox
getJCheckBoxPPC() {
1642 if (jCheckBoxPPC
== null) {
1643 jCheckBoxPPC
= new JCheckBox();
1644 jCheckBoxPPC
.setBounds(new java
.awt
.Rectangle(267, 0, 53, 20));
1645 jCheckBoxPPC
.setText("PPC");
1647 return jCheckBoxPPC
;
1651 * This method initializes jTextFieldToolChainFamily Row 5
1653 * This should be a drop down for MSFT, INTEL, GCC or USER_DEFINED
1655 * @return javax.swing.JTextField
1657 private JTextField
getJTextFieldToolChainFamily() {
1658 if (jTextFieldToolChainFamily
== null) {
1659 jTextFieldToolChainFamily
= new JTextField();
1660 jTextFieldToolChainFamily
.setBounds(new java
.awt
.Rectangle(fieldColumn
, rowFive
, fieldWidth
, oneRowHeight
));
1661 jTextFieldToolChainFamily
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1662 jTextFieldToolChainFamily
.setLocation(new java
.awt
.Point(fieldColumn
, rowFive
));
1664 return jTextFieldToolChainFamily
;
1668 * This method initializes jTextFieldOptionContents Row 6
1670 * This is where we should put the checkbox & entry data for the command arguments
1672 * @return javax.swing.JTextField
1674 private JTextField
getJTextFieldOptionContents() {
1675 if (jTextFieldOptionContents
== null) {
1676 jTextFieldOptionContents
= new JTextField();
1677 jTextFieldOptionContents
.setPreferredSize(new java
.awt
.Dimension(fieldWidth
, oneRowHeight
));
1678 jTextFieldOptionContents
.setBounds(fieldColumn
, rowSix
, fieldWidth
, oneRowHeight
);
1679 jTextFieldOptionContents
.setLocation(new java
.awt
.Point(fieldColumn
, rowSix
));
1681 return jTextFieldOptionContents
;
1685 * This method initializes jButtonOptionsAdd
1687 * Add entry from the top screen to the table
1689 * @return javax.swing.JButton jButtonOptionsAdd
1691 private JButton
getJButtonOptionsAdd() {
1692 if (jButtonOptionsAdd
== null) {
1693 jButtonOptionsAdd
= new JButton();
1694 jButtonOptionsAdd
.setText("Add");
1696 jButtonOptionsAdd
.setPreferredSize(new java
.awt
.Dimension(buttonWidth
, oneRowHeight
));
1697 jButtonOptionsAdd
.setBounds(new java
.awt
.Rectangle(firstButtonLoc
, buttonRow
, buttonWidth
, oneRowHeight
));
1698 jButtonOptionsAdd
.setLocation(new java
.awt
.Point(firstButtonLoc
, buttonRow
));
1699 jButtonOptionsAdd
.addActionListener(new AbstractAction() {
1703 private static final long serialVersionUID
= 1L;
1705 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1706 boolean[] boolArray
= { jCheckBoxIA32
.isSelected(), jCheckBoxIpf
.isSelected(),
1707 jCheckBoxX64
.isSelected(), jCheckBoxEBC
.isSelected(),
1708 jCheckBoxARM
.isSelected(), jCheckBoxPPC
.isSelected() };
1709 String s
= boolToList(boolArray
);
1710 Object
[] o
= { jTextFieldBuildTargets
.getText(), jTextFieldToolChainFamily
.getText(), s
,
1711 jTextFieldToolCmd
.getText(), jTextFieldTagName
.getText(),
1712 jTextFieldOptionContents
.getText() };
1713 optionsTableModel
.addRow(o
);
1714 docConsole
.setSaved(false);
1715 ffc
.genBuildOptionsOpt(stringToVector(jTextFieldBuildTargets
.getText()),
1716 jTextFieldToolChainFamily
.getText(), jTextFieldTagName
.getText(),
1717 jTextFieldToolCmd
.getText(), stringToVector(s
),
1718 jTextFieldOptionContents
.getText());
1722 return jButtonOptionsAdd
;
1726 * This method initializes jButtonOptionsDel
1728 * Remove a line from the table below
1730 * @return javax.swing.JButton jButtonOptionsDel
1732 private JButton
getJButtonOptionsDel() {
1733 if (jButtonOptionsDel
== null) {
1734 jButtonOptionsDel
= new JButton();
1735 jButtonOptionsDel
.setText("Delete");
1736 jButtonOptionsDel
.setPreferredSize(new java
.awt
.Dimension(buttonWidth
, oneRowHeight
));
1737 jButtonOptionsDel
.setBounds(new java
.awt
.Rectangle(next2LastButtonLoc
, buttonRow
, buttonWidth
, oneRowHeight
));
1738 jButtonOptionsDel
.setLocation(new java
.awt
.Point(next2LastButtonLoc
, buttonRow
));
1739 jButtonOptionsDel
.addActionListener(new AbstractAction() {
1743 private static final long serialVersionUID
= 1L;
1745 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1746 if (selectedRow
>= 0) {
1747 optionsTableModel
.removeRow(selectedRow
);
1748 docConsole
.setSaved(false);
1749 ffc
.removeBuildOptionsOpt(selectedRow
);
1754 return jButtonOptionsDel
;
1758 * This method initializes jScrollPaneOptions
1759 * Contains the Table and is located below the data entry section
1760 * @return javax.swing.JScrollPane jScrollPaneOptoins
1762 private JScrollPane
getJScrollPaneOptions() {
1763 if (jScrollPaneOptions
== null) {
1764 jScrollPaneOptions
= new JScrollPane();
1765 jScrollPaneOptions
.setPreferredSize(new java
.awt
.Dimension(dialogWidth
, dialogHeight
* 2));
1766 jScrollPaneOptions
.setBounds(new java
.awt
.Rectangle(2, (dialogHeight
* 2) + 2, dialogWidth
* 2, dialogHeight
* 2));
1767 jScrollPaneOptions
.setLocation(new java
.awt
.Point(2, dialogHeight
+ 2));
1769 jScrollPaneOptions
.setViewportView(getJTableOptions());
1771 return jScrollPaneOptions
;
1775 * This method initializes jTableOptions
1777 * @return javax.swing.JTable jTableOptions
1779 private JTable
getJTableOptions() {
1780 if (jTableOptions
== null) {
1781 jTitle
= new JLabel();
1782 jTitle
.setText("Current Option Configuration Lines");
1783 jTitle
.setBounds(2, 2, labelWidth
, oneRowHeight
);
1785 optionsTableModel
= new DefaultTableModel();
1786 jTableOptions
= new JTable(optionsTableModel
);
1787 jTableOptions
.setRowHeight(20);
1788 optionsTableModel
.addColumn("Build Targets");
1789 optionsTableModel
.addColumn("Tool Chain Family");
1790 optionsTableModel
.addColumn("Supported Architectures");
1791 optionsTableModel
.addColumn("Tool Command Code");
1792 optionsTableModel
.addColumn("TagName");
1793 optionsTableModel
.addColumn("Contents");
1795 javax
.swing
.table
.TableColumn toolFamilyCol
= jTableOptions
.getColumnModel().getColumn(1);
1796 JComboBox cb
= new JComboBox();
1799 cb
.addItem("CYGWIN");
1800 cb
.addItem("INTEL");
1801 cb
.addItem("USER_DEFINED");
1802 toolFamilyCol
.setCellEditor(new DefaultCellEditor(cb
));
1803 Vector
<String
> vArch
= new Vector
<String
>();
1810 jTableOptions
.getColumnModel().getColumn(2).setCellEditor(new ListEditor(vArch
));
1811 jTableOptions
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
1812 jTableOptions
.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
1813 public void valueChanged(ListSelectionEvent e
) {
1815 if (e
.getValueIsAdjusting()) {
1818 ListSelectionModel lsm
= (ListSelectionModel
) e
.getSource();
1819 if (lsm
.isSelectionEmpty()) {
1822 selectedRow
= lsm
.getMinSelectionIndex();
1827 jTableOptions
.getModel().addTableModelListener(new TableModelListener() {
1828 public void tableChanged(TableModelEvent arg0
) {
1829 // TODO Auto-generated method stub
1830 int row
= arg0
.getFirstRow();
1831 TableModel m
= (TableModel
) arg0
.getSource();
1832 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
1833 //ToDo Data Validition check.
1834 String targets
= m
.getValueAt(row
, 0) + "";
1835 Vector
<Object
> targetName
= new Vector
<Object
>();
1836 String
[] sArray
= targets
.split("( )+");
1837 for (int i
= 0; i
< sArray
.length
; ++i
) {
1838 targetName
.add(sArray
[i
]);
1840 String toolChain
= m
.getValueAt(row
, 1) + "";
1841 String archs
= m
.getValueAt(row
, 2) + "";
1842 Vector
<Object
> supArch
= null;
1843 if (archs
.length() > 0) {
1844 supArch
= new Vector
<Object
>();
1845 String
[] sArray1
= archs
.split("( )+");
1846 for (int i
= 0; i
< sArray1
.length
; ++i
) {
1847 supArch
.add(sArray1
[i
]);
1851 String toolCmd
= m
.getValueAt(row
, 3) + "";
1852 String tagName
= m
.getValueAt(row
, 4) + "";
1853 String contents
= m
.getValueAt(row
, 5) + "";
1854 docConsole
.setSaved(false);
1855 ffc
.updateBuildOptionsOpt(row
, targetName
, toolChain
, tagName
, toolCmd
, supArch
, contents
);
1860 return jTableOptions
;
1863 private Vector
<Object
> stringToVector(String s
) {
1864 String
[] sArray
= s
.split(" ");
1865 Vector
<Object
> v
= null;
1866 if (s
.length() > 0) {
1867 v
= new Vector
<Object
>();
1868 for (int i
= 0; i
< sArray
.length
; ++i
) {
1875 private String
boolToList(boolean[] bool
) {
1901 private void initOptionTable() {
1902 if (ffc
.getBuildOptionsOptCount() == 0) {
1903 //ToDo get default options from *.txt file
1906 String
[][] saa
= new String
[ffc
.getBuildOptionsOptCount()][6];
1907 ffc
.getBuildOptionsOpts(saa
);
1908 for (int i
= 0; i
< saa
.length
; ++i
) {
1909 optionsTableModel
.addRow(saa
[i
]);
1915 * Everything below should pertain to the ANT Task Tab
1919 * This method initializes jButton12
1921 * @return javax.swing.JButton
1923 private JButton
getJButtonAntTaskFileBrowse() {
1924 if (jButtonAntTaskFileBrowse
== null) {
1925 jButtonAntTaskFileBrowse
= new JButton();
1926 jButtonAntTaskFileBrowse
.setPreferredSize(new Dimension(buttonWidth
, oneRowHeight
));
1927 jButtonAntTaskFileBrowse
.setText("Browse");
1928 jButtonAntTaskFileBrowse
.addActionListener(new AbstractAction() {
1929 private static final long serialVersionUID
= 1L;
1931 public void actionPerformed(ActionEvent arg0
) {
1933 // Select files from current workspace
1935 String dirPrefix
= System
.getenv("WORKSPACE");
1936 JFileChooser chooser
= new JFileChooser(dirPrefix
);
1937 File theFile
= null;
1938 String headerDest
= null;
1940 chooser
.setMultiSelectionEnabled(false);
1941 chooser
.setFileSelectionMode(JFileChooser
.FILES_ONLY
);
1942 int retval
= chooser
.showOpenDialog(frame
);
1943 if (retval
== JFileChooser
.APPROVE_OPTION
) {
1945 theFile
= chooser
.getSelectedFile();
1946 String file
= theFile
.getPath();
1947 if (!file
.startsWith(dirPrefix
)) {
1948 JOptionPane
.showMessageDialog(frame
, "You can only select files in current package!");
1955 headerDest
= theFile
.getPath();
1956 jTextFieldAntTaskFile
.setText(headerDest
.substring(dirPrefix
.length()).replace('\\', '/'));
1962 return jButtonAntTaskFileBrowse
;
1966 * This method initializes jPanelUserDefCenterN
1968 * @return javax.swing.JPanel
1970 private JPanel
getJPanelUserDefCenterN() {
1971 if (jPanelUserDefCenterN
== null) {
1972 jPanelUserDefCenterN
= new JPanel();
1973 jPanelUserDefCenterN
.add(jLabelAntCmdOpts
, null);
1974 jPanelUserDefCenterN
.add(getJTextFieldAntCmdOpts(), null);
1975 jPanelUserDefCenterN
.add(getJButtonAntTaskAdd(), null);
1976 jPanelUserDefCenterN
.add(getJButtonAntTaskDel(), null);
1978 return jPanelUserDefCenterN
;
1982 * This method initializes jPanelUserDefCenterC
1984 * @return javax.swing.JPanel
1986 private JPanel
getJPanelUserDefCenterC() {
1987 if (jPanelUserDefCenterC
== null) {
1988 jPanelUserDefCenterC
= new JPanel();
1989 jPanelUserDefCenterC
.add(getJScrollPaneAntTasks(), null);
1991 return jPanelUserDefCenterC
;
1995 * This method initializes jPanel8
1997 * @return javax.swing.JPanel
1999 private JPanel
getJPanelUserDef() {
2000 if (jPanelUserDef
== null) {
2001 jPanelUserDef
= new JPanel();
2002 jPanelUserDef
.setLayout(new BorderLayout());
2003 jPanelUserDef
.add(getJPanelUserDefNorth(), java
.awt
.BorderLayout
.NORTH
);
2004 jPanelUserDef
.add(getJPanelUserDefCenter(), java
.awt
.BorderLayout
.CENTER
);
2007 return jPanelUserDef
;
2011 * This method initializes jPanel9
2013 * @return javax.swing.JPanel
2015 private JPanel
getJPanelUserDefNorth() {
2016 if (jPanelUserDefNorth
== null) {
2017 jLabelAntTaskFile
= new JLabel();
2018 jLabelAntTaskFile
.setText("ANT Task File");
2019 jLabelAntTaskFile
.setPreferredSize(new java
.awt
.Dimension(80, 20));
2020 FlowLayout flowLayout8
= new FlowLayout();
2021 flowLayout8
.setAlignment(java
.awt
.FlowLayout
.CENTER
);
2022 jLabelAntTaskId
= new JLabel();
2023 jLabelAntTaskId
.setText("ID");
2024 jPanelUserDefNorth
= new JPanel();
2025 jPanelUserDefNorth
.setLayout(flowLayout8
);
2026 jPanelUserDefNorth
.add(jLabelAntTaskFile
, null);
2027 jPanelUserDefNorth
.add(getJTextFieldAntTaskFile(), null);
2028 jPanelUserDefNorth
.add(getJButtonAntTaskFileBrowse(), null);
2029 jPanelUserDefNorth
.add(jLabelAntTaskId
, null);
2030 jPanelUserDefNorth
.add(getJTextFieldAntTaskId(), null);
2032 return jPanelUserDefNorth
;
2036 * This method initializes jPanel11
2038 * @return javax.swing.JPanel
2040 private JPanel
getJPanelUserDefCenter() {
2041 if (jPanelUserDefCenter
== null) {
2042 jLabelAntCmdOpts
= new JLabel();
2043 jLabelAntCmdOpts
.setText("ANT Command Options");
2044 jLabelAntCmdOpts
.setPreferredSize(new java
.awt
.Dimension(131, 20));
2045 jPanelUserDefCenter
= new JPanel();
2046 jPanelUserDefCenter
.setLayout(new BorderLayout());
2048 jPanelUserDefCenter
.add(getJPanelUserDefCenterN(), java
.awt
.BorderLayout
.NORTH
);
2049 jPanelUserDefCenter
.add(getJPanelUserDefCenterC(), java
.awt
.BorderLayout
.CENTER
);
2051 return jPanelUserDefCenter
;
2055 * This method initializes jTextField2
2057 * @return javax.swing.JTextField
2059 private JTextField
getJTextFieldAntTaskFile() {
2060 if (jTextFieldAntTaskFile
== null) {
2061 jTextFieldAntTaskFile
= new JTextField();
2062 jTextFieldAntTaskFile
.setPreferredSize(new java
.awt
.Dimension(200, 20));
2064 return jTextFieldAntTaskFile
;
2068 * This method initializes jTextField3
2070 * @return javax.swing.JTextField
2072 private JTextField
getJTextFieldAntTaskId() {
2073 if (jTextFieldAntTaskId
== null) {
2074 jTextFieldAntTaskId
= new JTextField();
2075 jTextFieldAntTaskId
.setPreferredSize(new java
.awt
.Dimension(100, 20));
2077 return jTextFieldAntTaskId
;
2081 * This method initializes jButton4
2083 * @return javax.swing.JButton
2085 private JButton
getJButtonAntTaskAdd() {
2086 if (jButtonAntTaskAdd
== null) {
2087 jButtonAntTaskAdd
= new JButton();
2088 jButtonAntTaskAdd
.setPreferredSize(new java
.awt
.Dimension(90, 20));
2089 jButtonAntTaskAdd
.setText("Add");
2090 jButtonAntTaskAdd
.addActionListener(new ActionListener() {
2091 public void actionPerformed(ActionEvent e
) {
2092 if (!DataValidation
.isInt(jTextFieldAntTaskId
.getText())
2093 || jTextFieldAntTaskId
.getText().length() != 8) {
2094 JOptionPane
.showMessageDialog(frame
, "ID must be an 8-digit integer.");
2097 Object
[] o
= { jTextFieldAntTaskId
.getText(), null, null };
2098 o
[1] = jTextFieldAntTaskFile
.getText();
2099 o
[2] = jTextFieldAntCmdOpts
.getText();
2100 ffc
.genBuildOptionsUserDefAntTask(o
[0] + "", o
[1] + "", o
[2] + "");
2101 antTaskTableModel
.addRow(o
);
2102 docConsole
.setSaved(false);
2106 return jButtonAntTaskAdd
;
2110 * This method initializes jButton5
2112 * @return javax.swing.JButton
2114 private JButton
getJButtonAntTaskDel() {
2115 if (jButtonAntTaskDel
== null) {
2116 jButtonAntTaskDel
= new JButton();
2117 jButtonAntTaskDel
.setPreferredSize(new java
.awt
.Dimension(90, 20));
2118 jButtonAntTaskDel
.setText("Delete");
2119 jButtonAntTaskDel
.addActionListener(new ActionListener() {
2120 public void actionPerformed(ActionEvent e
) {
2121 if (selectedRow
>= 0) {
2122 docConsole
.setSaved(false);
2123 antTaskTableModel
.removeRow(selectedRow
);
2124 ffc
.removeBuildOptionsUserDefAntTask(selectedRow
);
2129 return jButtonAntTaskDel
;
2133 * This method initializes jTextField4
2135 * @return javax.swing.JTextField
2137 private JTextField
getJTextFieldAntCmdOpts() {
2138 if (jTextFieldAntCmdOpts
== null) {
2139 jTextFieldAntCmdOpts
= new JTextField();
2140 jTextFieldAntCmdOpts
.setPreferredSize(new java
.awt
.Dimension(270, 20));
2141 jTextFieldAntCmdOpts
.setEnabled(true);
2143 return jTextFieldAntCmdOpts
;
2147 * This method initializes jScrollPane2
2149 * @return javax.swing.JScrollPane
2151 private JScrollPane
getJScrollPaneAntTasks() {
2152 if (jScrollPaneAntTasks
== null) {
2153 jScrollPaneAntTasks
= new JScrollPane();
2154 jScrollPaneAntTasks
.setPreferredSize(new java
.awt
.Dimension(600, 400));
2155 jScrollPaneAntTasks
.setViewportView(getJTableAntTasks());
2157 return jScrollPaneAntTasks
;
2161 * This method initializes jTable2
2163 * @return javax.swing.JTable
2165 private JTable
getJTableAntTasks() {
2166 if (jTableAntTasks
== null) {
2167 antTaskTableModel
= new DefaultTableModel();
2168 jTableAntTasks
= new JTable(antTaskTableModel
);
2169 jTableAntTasks
.setRowHeight(20);
2170 antTaskTableModel
.addColumn("ID");
2171 antTaskTableModel
.addColumn("Filename");
2172 antTaskTableModel
.addColumn("ANT Command Options");
2174 jTableAntTasks
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
2175 jTableAntTasks
.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
2176 public void valueChanged(ListSelectionEvent e
) {
2178 if (e
.getValueIsAdjusting()) {
2181 ListSelectionModel lsm
= (ListSelectionModel
) e
.getSource();
2182 if (lsm
.isSelectionEmpty()) {
2185 selectedRow
= lsm
.getMinSelectionIndex();
2190 jTableAntTasks
.getModel().addTableModelListener(new TableModelListener() {
2191 public void tableChanged(TableModelEvent arg0
) {
2192 // TODO Auto-generated method stub
2193 int row
= arg0
.getFirstRow();
2194 TableModel m
= (TableModel
) arg0
.getSource();
2195 if (arg0
.getType() == TableModelEvent
.UPDATE
) {
2196 //ToDo Data Validition check.
2197 String id
= m
.getValueAt(row
, 0) + "";
2198 String file
= m
.getValueAt(row
, 1) + "";
2199 String execOrder
= m
.getValueAt(row
, 2) + "";
2200 if (id
.length() == 0) {
2203 if (file
.length() == 0 && execOrder
.length() == 0) {
2206 if (file
.length() == 0) {
2209 if (execOrder
.length() == 0) {
2212 ffc
.updateBuildOptionsUserDefAntTask(row
, id
, file
, execOrder
);
2218 return jTableAntTasks
;
2221 private void initAntTaskTable() {
2222 if (ffc
.getBuildOptionsUserDefAntTaskCount() == 0) {
2225 String
[][] saa
= new String
[ffc
.getBuildOptionsUserDefAntTaskCount()][3];
2226 ffc
.getBuildOptionsUserDefAntTasks(saa
);
2227 for (int i
= 0; i
< saa
.length
; ++i
) {
2228 antTaskTableModel
.addRow(saa
[i
]);
2232 } // @jve:decl-index=0:visual-constraint="10,10"