Use unified global data to get module informations.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdBuildOptions.java
1 /** @file
2
3 The file is used to create, update BuildOptions of Fpd file
4
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
10
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.
13
14 **/
15 package org.tianocore.frameworkwizard.platform.ui;
16
17 import java.awt.BorderLayout;
18
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;
27
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;
46
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;
51
52 import java.io.File;
53 import java.util.ArrayList;
54 import java.util.Iterator;
55 import java.util.LinkedHashMap;
56 import java.util.Set;
57 import java.util.Vector;
58 import java.awt.Dimension;
59 import javax.swing.JSplitPane;
60
61 public class FpdBuildOptions extends IInternalFrame {
62
63 private static final long serialVersionUID = 1L;
64 static JFrame frame;
65 private JPanel jContentPane = null;
66 private JPanel jPanelContentSouth = null;
67 private JPanel jPanelContentNorth = null;
68 private JPanel jPanelContentWest = null;
69 private JPanel jPanelContentEast = null;
70 private JTabbedPane jTabbedPane = null;
71 private JPanel jPanelUserDef = null;
72 private JPanel jPanelUserDefNorth = null;
73 private JPanel jPanelUserDefCenter = null;
74 private JTextField jTextFieldAntTaskFile = null;
75 private JLabel jLabelAntTaskId = null;
76 private JTextField jTextFieldAntTaskId = null;
77 private JButton jButtonAntTaskAdd = null;
78 private JButton jButtonAntTaskDel = null;
79 private JTextField jTextFieldAntCmdOpts = null;
80 private JScrollPane jScrollPaneAntTasks = null;
81 private JTable jTableAntTasks = null;
82 private DefaultTableModel ffsTableModel = null;
83 private DefaultTableModel sectionsTableModel = null;
84 private DefaultTableModel sectionTableModel = null;
85 private DefaultTableModel subsectionsTableModel = null;
86 private DefaultTableModel antTaskTableModel = null;
87 private DefaultTableModel ffsAttributesTableModel = null;
88 private DefaultTableModel optionsTableModel = null;
89 private JPanel jPanelFfsTab = null;
90 private JPanel jPanelFfsTabCenter = null;
91 private JPanel jPanelFfsTabCenterN = null;
92 private JPanel jPanelFfsTabCenterS = null;
93 private JLabel jLabelFfsKey = null;
94 private JTextField jTextFieldFfsKey = null;
95 private JButton jButtonFfsAdd = null;
96 private JButton jButtonFfsDel = null;
97 private JScrollPane jScrollPaneFfsAttribs = null;
98 private JTable jTableFfsAttribs = null;
99 private JPanel jPanelOptionsTab = null;
100 private JLabel jLabelOptionContents = null;
101 private JTextField jTextFieldOptionContents = null;
102 private JLabel jLabelToolChainFamily = null;
103 private JLabel jLabelSupArch = null;
104 private JLabel jLabelToolCmd = null;
105 private JTextField jTextFieldToolCmd = null;
106 private JScrollPane jScrollPaneOptions = null;
107 private JTable jTableOptions = null;
108 private JButton jButtonOptionsAdd = null;
109 private JButton jButtonOptionsDel = null;
110 private JButton jButtonFfsAttribNew = null;
111 private JButton jButtonFfsAttribRemove = null;
112 private FpdFileContents ffc = null;
113 private OpeningPlatformType docConsole = null;
114 private JCheckBox jCheckBoxIA32 = null;
115 private JCheckBox jCheckBoxIpf = null;
116 private JCheckBox jCheckBoxX64 = null;
117 private JCheckBox jCheckBoxEBC = null;
118 private JCheckBox jCheckBoxARM = null;
119 private JCheckBox jCheckBoxPPC = null;
120 private JLabel jLabelBuildTargets = null;
121 private JTextField jTextFieldBuildTargets = null;
122 private JTextField jTextFieldTagName = null;
123 private JLabel jLabelTagName = null;
124 private int selectedRow = -1;
125 private JLabel jLabelAntTaskFile = null;
126 private JLabel jLabelAntCmdOpts = null;
127 private JScrollPane jScrollPaneFfs = null;
128 private JTable jTableFfs = null;
129 private JLabel jLabelFfsSection = null;
130 private JScrollPane jScrollPaneFfsSection = null;
131 private JTable jTableFfsSection = null;
132 private JLabel jLabelFfsSubSections = null;
133 private JScrollPane jScrollPaneFfsSubSection = null;
134 private JTable jTableFfsSubSection = null;
135 private JLabel jLabelEncapType = null;
136 private JTextField jTextFieldEncapType = null;
137 private JPanel jPanelFfsAttribButtonGroup = null;
138 private JLabel jLabelFfsAttribs = null;
139 private JButton jButtonFfsSectionNew = null;
140 private JButton jButtonFfsSectionRemove = null;
141 private JButton jButtonFfsSubSectionNew = null;
142 private JButton jButtonFfsSubSectionRemove = null;
143 private JLabel jLabelFfsSections = null;
144 private JButton jButtonFfsSectionsNew = null;
145 private JButton jButtonFfsSectionsRemove = null;
146 private JScrollPane jScrollPaneFfsSections = null;
147 private JTable jTableFfsSections = null;
148 private JButton jButtonAntTaskFileBrowse = null;
149 private JTextField jTextFieldToolChainFamily = null;
150 private JSplitPane jSplitPaneFfsC = null;
151 private JPanel jPanelFfsCTop = null;
152 private JSplitPane jSplitPaneFfsCBottom = null;
153 private JPanel jPanelFfsCBottomTop = null;
154 private JPanel jPanelFfsCBottomBottom = null;
155 private JPanel jPanelSectionN = null;
156 private JPanel jPanelSectionC = null;
157 private JPanel jPanelSectionsN = null;
158 private JPanel jPanelSectionsC = null;
159 private JPanel jPanelSubSectionN = null;
160 private JPanel jPanelSubSectionC = null;
161 private JPanel jPanelOptionsContainer = null;
162 private JPanel jPanelUserDefCenterN = null;
163 private JPanel jPanelUserDefCenterC = null;
164 /**
165 * This method initializes jPanel
166 *
167 * @return javax.swing.JPanel
168 */
169 private JPanel getJPanelContentSouth() {
170 if (jPanelContentSouth == null) {
171 jPanelContentSouth = new JPanel();
172 }
173 return jPanelContentSouth;
174 }
175
176 /**
177 * This method initializes jPanel1
178 *
179 * @return javax.swing.JPanel
180 */
181 private JPanel getJPanelContentNorth() {
182 if (jPanelContentNorth == null) {
183 jPanelContentNorth = new JPanel();
184 }
185 return jPanelContentNorth;
186 }
187
188 /**
189 * This method initializes jPanel2
190 *
191 * @return javax.swing.JPanel
192 */
193 private JPanel getJPanelContentWest() {
194 if (jPanelContentWest == null) {
195 jPanelContentWest = new JPanel();
196 }
197 return jPanelContentWest;
198 }
199
200 /**
201 * This method initializes jPanel3
202 *
203 * @return javax.swing.JPanel
204 */
205 private JPanel getJPanelContentEast() {
206 if (jPanelContentEast == null) {
207 jPanelContentEast = new JPanel();
208 }
209 return jPanelContentEast;
210 }
211
212 /**
213 * This method initializes jTabbedPane
214 *
215 * @return javax.swing.JTabbedPane
216 */
217 private JTabbedPane getJTabbedPane() {
218 if (jTabbedPane == null) {
219 jTabbedPane = new JTabbedPane();
220 jTabbedPane.addTab("FFS", null, getJPanelFfsTab(), null);
221 jTabbedPane.addTab("Options", null, getJPanelOptionsTab(), null);
222 jTabbedPane.addTab("User Defined ANT Tasks", null, getJPanelUserDef(), null);
223 }
224 return jTabbedPane;
225 }
226
227
228 /**
229 * This method initializes jPanel8
230 *
231 * @return javax.swing.JPanel
232 */
233 private JPanel getJPanelUserDef() {
234 if (jPanelUserDef == null) {
235 jPanelUserDef = new JPanel();
236 jPanelUserDef.setLayout(new BorderLayout());
237 jPanelUserDef.add(getJPanelUserDefNorth(), java.awt.BorderLayout.NORTH);
238 jPanelUserDef.add(getJPanelUserDefCenter(), java.awt.BorderLayout.CENTER);
239
240 }
241 return jPanelUserDef;
242 }
243
244 /**
245 * This method initializes jPanel9
246 *
247 * @return javax.swing.JPanel
248 */
249 private JPanel getJPanelUserDefNorth() {
250 if (jPanelUserDefNorth == null) {
251 jLabelAntTaskFile = new JLabel();
252 jLabelAntTaskFile.setText("ANT Task File");
253 jLabelAntTaskFile.setPreferredSize(new java.awt.Dimension(80,20));
254 FlowLayout flowLayout8 = new FlowLayout();
255 flowLayout8.setAlignment(java.awt.FlowLayout.CENTER);
256 jLabelAntTaskId = new JLabel();
257 jLabelAntTaskId.setText("ID");
258 jPanelUserDefNorth = new JPanel();
259 jPanelUserDefNorth.setLayout(flowLayout8);
260 jPanelUserDefNorth.add(jLabelAntTaskFile, null);
261 jPanelUserDefNorth.add(getJTextFieldAntTaskFile(), null);
262 jPanelUserDefNorth.add(getJButtonAntTaskFileBrowse(), null);
263 jPanelUserDefNorth.add(jLabelAntTaskId, null);
264 jPanelUserDefNorth.add(getJTextFieldAntTaskId(), null);
265 }
266 return jPanelUserDefNorth;
267 }
268
269 /**
270 * This method initializes jPanel11
271 *
272 * @return javax.swing.JPanel
273 */
274 private JPanel getJPanelUserDefCenter() {
275 if (jPanelUserDefCenter == null) {
276 jLabelAntCmdOpts = new JLabel();
277 jLabelAntCmdOpts.setText("ANT Command Options");
278 jLabelAntCmdOpts.setPreferredSize(new java.awt.Dimension(131,20));
279 jPanelUserDefCenter = new JPanel();
280 jPanelUserDefCenter.setLayout(new BorderLayout());
281
282 jPanelUserDefCenter.add(getJPanelUserDefCenterN(), java.awt.BorderLayout.NORTH);
283 jPanelUserDefCenter.add(getJPanelUserDefCenterC(), java.awt.BorderLayout.CENTER);
284 }
285 return jPanelUserDefCenter;
286 }
287
288 /**
289 * This method initializes jTextField2
290 *
291 * @return javax.swing.JTextField
292 */
293 private JTextField getJTextFieldAntTaskFile() {
294 if (jTextFieldAntTaskFile == null) {
295 jTextFieldAntTaskFile = new JTextField();
296 jTextFieldAntTaskFile.setPreferredSize(new java.awt.Dimension(200,20));
297 }
298 return jTextFieldAntTaskFile;
299 }
300
301 /**
302 * This method initializes jTextField3
303 *
304 * @return javax.swing.JTextField
305 */
306 private JTextField getJTextFieldAntTaskId() {
307 if (jTextFieldAntTaskId == null) {
308 jTextFieldAntTaskId = new JTextField();
309 jTextFieldAntTaskId.setPreferredSize(new java.awt.Dimension(100,20));
310 }
311 return jTextFieldAntTaskId;
312 }
313
314 /**
315 * This method initializes jButton4
316 *
317 * @return javax.swing.JButton
318 */
319 private JButton getJButtonAntTaskAdd() {
320 if (jButtonAntTaskAdd == null) {
321 jButtonAntTaskAdd = new JButton();
322 jButtonAntTaskAdd.setPreferredSize(new java.awt.Dimension(90,20));
323 jButtonAntTaskAdd.setText("Add");
324 jButtonAntTaskAdd.addActionListener(new ActionListener() {
325 public void actionPerformed(ActionEvent e) {
326 if (!DataValidation.isInt(jTextFieldAntTaskId.getText()) || jTextFieldAntTaskId.getText().length() != 8) {
327 JOptionPane.showMessageDialog(frame, "ID must be an 8-digit integer.");
328 return;
329 }
330 Object[] o = {jTextFieldAntTaskId.getText(), null, null};
331 o[1] = jTextFieldAntTaskFile.getText();
332 o[2] = jTextFieldAntCmdOpts.getText();
333 ffc.genBuildOptionsUserDefAntTask(o[0]+"", o[1]+"", o[2]+"");
334 antTaskTableModel.addRow(o);
335 docConsole.setSaved(false);
336 }
337 });
338 }
339 return jButtonAntTaskAdd;
340 }
341
342 /**
343 * This method initializes jButton5
344 *
345 * @return javax.swing.JButton
346 */
347 private JButton getJButtonAntTaskDel() {
348 if (jButtonAntTaskDel == null) {
349 jButtonAntTaskDel = new JButton();
350 jButtonAntTaskDel.setPreferredSize(new java.awt.Dimension(90,20));
351 jButtonAntTaskDel.setText("Delete");
352 jButtonAntTaskDel.addActionListener(new ActionListener() {
353 public void actionPerformed(ActionEvent e) {
354 if (selectedRow >= 0) {
355 docConsole.setSaved(false);
356 antTaskTableModel.removeRow(selectedRow);
357 ffc.removeBuildOptionsUserDefAntTask(selectedRow);
358 }
359 }
360 });
361 }
362 return jButtonAntTaskDel;
363 }
364
365 /**
366 * This method initializes jTextField4
367 *
368 * @return javax.swing.JTextField
369 */
370 private JTextField getJTextFieldAntCmdOpts() {
371 if (jTextFieldAntCmdOpts == null) {
372 jTextFieldAntCmdOpts = new JTextField();
373 jTextFieldAntCmdOpts.setPreferredSize(new java.awt.Dimension(270,20));
374 jTextFieldAntCmdOpts.setEnabled(true);
375 }
376 return jTextFieldAntCmdOpts;
377 }
378
379 /**
380 * This method initializes jScrollPane2
381 *
382 * @return javax.swing.JScrollPane
383 */
384 private JScrollPane getJScrollPaneAntTasks() {
385 if (jScrollPaneAntTasks == null) {
386 jScrollPaneAntTasks = new JScrollPane();
387 jScrollPaneAntTasks.setPreferredSize(new java.awt.Dimension(600,400));
388 jScrollPaneAntTasks.setViewportView(getJTableAntTasks());
389 }
390 return jScrollPaneAntTasks;
391 }
392
393 /**
394 * This method initializes jTable2
395 *
396 * @return javax.swing.JTable
397 */
398 private JTable getJTableAntTasks() {
399 if (jTableAntTasks == null) {
400 antTaskTableModel = new DefaultTableModel();
401 jTableAntTasks = new JTable(antTaskTableModel);
402 jTableAntTasks.setRowHeight(20);
403 antTaskTableModel.addColumn("ID");
404 antTaskTableModel.addColumn("Filename");
405 antTaskTableModel.addColumn("ANT Command Options");
406
407 jTableAntTasks.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
408 jTableAntTasks.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
409 public void valueChanged(ListSelectionEvent e) {
410 selectedRow = -1;
411 if (e.getValueIsAdjusting()){
412 return;
413 }
414 ListSelectionModel lsm = (ListSelectionModel)e.getSource();
415 if (lsm.isSelectionEmpty()) {
416 return;
417 }
418 else{
419 selectedRow = lsm.getMinSelectionIndex();
420 }
421 }
422 });
423
424 jTableAntTasks.getModel().addTableModelListener(new TableModelListener() {
425 public void tableChanged(TableModelEvent arg0) {
426 // TODO Auto-generated method stub
427 int row = arg0.getFirstRow();
428 TableModel m = (TableModel)arg0.getSource();
429 if (arg0.getType() == TableModelEvent.UPDATE){
430 //ToDo Data Validition check.
431 String id = m.getValueAt(row, 0) + "";
432 String file = m.getValueAt(row, 1) + "";
433 String execOrder = m.getValueAt(row, 2) + "";
434 if (id.length() == 0) {
435 return;
436 }
437 if (file.length() == 0 && execOrder.length() == 0){
438 return;
439 }
440 if (file.length() == 0) {
441 file = null;
442 }
443 if (execOrder.length() == 0) {
444 execOrder = null;
445 }
446 ffc.updateBuildOptionsUserDefAntTask(row, id, file, execOrder);
447
448 }
449 }
450 });
451 }
452 return jTableAntTasks;
453 }
454
455 /**
456 * This method initializes jPanel13
457 *
458 * @return javax.swing.JPanel
459 */
460 private JPanel getJPanelFfsTab() {
461 if (jPanelFfsTab == null) {
462 jPanelFfsTab = new JPanel();
463 jPanelFfsTab.setLayout(new BorderLayout());
464 jPanelFfsTab.add(getJPanelFfsTabCenter(), java.awt.BorderLayout.CENTER);
465 jPanelFfsTab.add(getJScrollPaneFfs(), java.awt.BorderLayout.WEST);
466 }
467 return jPanelFfsTab;
468 }
469
470 /**
471 * This method initializes jPanel18
472 *
473 * @return javax.swing.JPanel
474 */
475 private JPanel getJPanelFfsTabCenter() {
476 if (jPanelFfsTabCenter == null) {
477 jPanelFfsTabCenter = new JPanel();
478 jPanelFfsTabCenter.setLayout(new BorderLayout());
479 jPanelFfsTabCenter.add(getJPanelFfsTabCenterN(), java.awt.BorderLayout.NORTH);
480 jPanelFfsTabCenter.add(getJPanelFfsTabCenterS(), java.awt.BorderLayout.SOUTH);
481 jPanelFfsTabCenter.add(getJSplitPaneFfsC(), java.awt.BorderLayout.CENTER);
482 }
483 return jPanelFfsTabCenter;
484 }
485
486 /**
487 * This method initializes jPanel15
488 *
489 * @return javax.swing.JPanel
490 */
491 private JPanel getJPanelFfsTabCenterN() {
492 if (jPanelFfsTabCenterN == null) {
493 jLabelEncapType = new JLabel();
494 jLabelEncapType.setText("Encapsulation Type");
495 FlowLayout flowLayout5 = new FlowLayout();
496 flowLayout5.setAlignment(java.awt.FlowLayout.RIGHT);
497 jLabelFfsKey = new JLabel();
498 jLabelFfsKey.setText("FFS Key");
499 jPanelFfsTabCenterN = new JPanel();
500 jPanelFfsTabCenterN.setLayout(flowLayout5);
501 jPanelFfsTabCenterN.add(jLabelFfsKey, null);
502 jPanelFfsTabCenterN.add(getJTextFieldFfsKey(), null);
503 jPanelFfsTabCenterN.add(jLabelEncapType, null);
504 jPanelFfsTabCenterN.add(getJTextFieldEncapType(), null);
505 jPanelFfsTabCenterN.add(getJButtonFfsAdd(), null);
506 jPanelFfsTabCenterN.add(getJButtonFfsDel(), null);
507 }
508 return jPanelFfsTabCenterN;
509 }
510
511 /**
512 * This method initializes jPanel16
513 *
514 * @return javax.swing.JPanel
515 */
516 private JPanel getJPanelFfsTabCenterS() {
517 if (jPanelFfsTabCenterS == null) {
518 jLabelFfsAttribs = new JLabel();
519 jLabelFfsAttribs.setText("Attributes");
520 FlowLayout flowLayout6 = new FlowLayout();
521 flowLayout6.setHgap(5);
522 flowLayout6.setVgap(20);
523 flowLayout6.setAlignment(java.awt.FlowLayout.CENTER);
524 jPanelFfsTabCenterS = new JPanel();
525 jPanelFfsTabCenterS.setPreferredSize(new java.awt.Dimension(491,130));
526 jPanelFfsTabCenterS.setLayout(flowLayout6);
527 jPanelFfsTabCenterS.add(jLabelFfsAttribs, null);
528 jPanelFfsTabCenterS.add(getJScrollPaneFfsAttribs(), null);
529 jPanelFfsTabCenterS.add(getJPanelFfsAttribButtonGroup(), null);
530 }
531 return jPanelFfsTabCenterS;
532 }
533
534 /**
535 * This method initializes jTextField6
536 *
537 * @return javax.swing.JTextField
538 */
539 private JTextField getJTextFieldFfsKey() {
540 if (jTextFieldFfsKey == null) {
541 jTextFieldFfsKey = new JTextField();
542 jTextFieldFfsKey.setPreferredSize(new java.awt.Dimension(100,20));
543 jTextFieldFfsKey.setEditable(true);
544 jTextFieldFfsKey.addFocusListener(new java.awt.event.FocusAdapter() {
545 public void focusLost(java.awt.event.FocusEvent e) {
546 if (jTableFfs.getSelectedRow() < 0) {
547 return;
548 }
549 // ffc.updateBuildOptionsFfsKey(jTable.getSelectedRow(), jTextField6.getText());
550 }
551 });
552 }
553 return jTextFieldFfsKey;
554 }
555
556 /**
557 * This method initializes jButton8
558 *
559 * @return javax.swing.JButton
560 */
561 private JButton getJButtonFfsAdd() {
562 if (jButtonFfsAdd == null) {
563 jButtonFfsAdd = new JButton();
564 jButtonFfsAdd.setPreferredSize(new java.awt.Dimension(70,20));
565 jButtonFfsAdd.setText("Add");
566 jButtonFfsAdd.addActionListener(new AbstractAction() {
567 /**
568 *
569 */
570 private static final long serialVersionUID = -2923720717273384221L;
571
572 public void actionPerformed(java.awt.event.ActionEvent e) {
573 if (jTextFieldFfsKey.getText().length() > 0) {
574 String[] row = {jTextFieldFfsKey.getText()};
575 ffsTableModel.addRow(row);
576 docConsole.setSaved(false);
577 ffc.genBuildOptionsFfs(jTextFieldFfsKey.getText(), jTextFieldEncapType.getText());
578 }
579 }
580 });
581 }
582 return jButtonFfsAdd;
583 }
584
585 /**
586 * This method initializes jButton9
587 *
588 * @return javax.swing.JButton
589 */
590 private JButton getJButtonFfsDel() {
591 if (jButtonFfsDel == null) {
592 jButtonFfsDel = new JButton();
593 jButtonFfsDel.setPreferredSize(new java.awt.Dimension(70,20));
594 jButtonFfsDel.setText("Delete");
595 jButtonFfsDel.addActionListener(new AbstractAction() {
596 /**
597 *
598 */
599 private static final long serialVersionUID = -4002678939178194476L;
600
601 public void actionPerformed(ActionEvent arg0){
602 if (jTableFfs.getSelectedRow() < 0) {
603 return;
604 }
605 docConsole.setSaved(false);
606 ffc.removeBuildOptionsFfs(jTableFfs.getSelectedRow());
607 ffsTableModel.removeRow(jTableFfs.getSelectedRow());
608 }
609 });
610 }
611 return jButtonFfsDel;
612 }
613
614 /**
615 * This method initializes jScrollPane5
616 *
617 * @return javax.swing.JScrollPane
618 */
619 private JScrollPane getJScrollPaneFfsAttribs() {
620 if (jScrollPaneFfsAttribs == null) {
621 jScrollPaneFfsAttribs = new JScrollPane();
622 jScrollPaneFfsAttribs.setPreferredSize(new java.awt.Dimension(350,100));
623 jScrollPaneFfsAttribs.setViewportView(getJTableFfsAttribs());
624 }
625 return jScrollPaneFfsAttribs;
626 }
627
628 /**
629 * This method initializes jTable4
630 *
631 * @return javax.swing.JTable
632 */
633 private JTable getJTableFfsAttribs() {
634 if (jTableFfsAttribs == null) {
635 ffsAttributesTableModel = new DefaultTableModel();
636 jTableFfsAttribs = new JTable(ffsAttributesTableModel);
637 jTableFfsAttribs.setPreferredSize(new java.awt.Dimension(400,80));
638 jTableFfsAttribs.setRowHeight(20);
639 ffsAttributesTableModel.addColumn("Name");
640 ffsAttributesTableModel.addColumn("Value");
641
642 jTableFfsAttribs.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
643 jTableFfsAttribs.getModel().addTableModelListener(new TableModelListener() {
644 public void tableChanged(TableModelEvent arg0) {
645 // TODO Auto-generated method stub
646 int row = arg0.getFirstRow();
647 TableModel m = (TableModel)arg0.getSource();
648 if (arg0.getType() == TableModelEvent.UPDATE){
649 //ToDo Data Validition check.
650 String name = m.getValueAt(row, 0) + "";
651 String value = m.getValueAt(row, 1) + "";
652
653 if (name.length() == 0) {
654 return;
655 }
656 if (value.length() == 0){
657 return;
658 }
659 docConsole.setSaved(false);
660 ffc.updateBuildOptionsFfsAttribute(jTableFfs.getSelectedRow(), row, name, value);
661 }
662 }
663 });
664 }
665 return jTableFfsAttribs;
666 }
667
668 /**
669 * This method initializes jPanel20
670 *
671 * @return javax.swing.JPanel
672 */
673 private JPanel getJPanelOptionsTab() {
674 if (jPanelOptionsTab == null) {
675 jLabelTagName = new JLabel();
676 jLabelTagName.setText("Tag Name");
677 FlowLayout flowLayout9 = new FlowLayout();
678 flowLayout9.setAlignment(java.awt.FlowLayout.LEFT);
679 jLabelBuildTargets = new JLabel();
680 jLabelBuildTargets.setText("Build Targets");
681 jLabelToolCmd = new JLabel();
682 jLabelToolCmd.setText("Tool Command");
683 jLabelSupArch = new JLabel();
684 jLabelSupArch.setText("Supported Arch");
685 jLabelToolChainFamily = new JLabel();
686 jLabelToolChainFamily.setText("Tool Chain Family");
687 jLabelOptionContents = new JLabel();
688 jLabelOptionContents.setText("Option Contents");
689 jPanelOptionsTab = new JPanel();
690 jPanelOptionsTab.setLayout(flowLayout9);
691 jPanelOptionsTab.add(getJPanelOptionsContainer(), null);
692 jPanelOptionsTab.add(getJScrollPaneOptions(), null);
693
694 }
695 return jPanelOptionsTab;
696 }
697
698 /**
699 * This method initializes jTextField7
700 *
701 * @return javax.swing.JTextField
702 */
703 private JTextField getJTextFieldOptionContents() {
704 if (jTextFieldOptionContents == null) {
705 jTextFieldOptionContents = new JTextField();
706 jTextFieldOptionContents.setPreferredSize(new java.awt.Dimension(300,20));
707 }
708 return jTextFieldOptionContents;
709 }
710
711 /**
712 * This method initializes jTextField8
713 *
714 * @return javax.swing.JTextField
715 */
716 private JTextField getJTextFieldToolCmd() {
717 if (jTextFieldToolCmd == null) {
718 jTextFieldToolCmd = new JTextField();
719 jTextFieldToolCmd.setPreferredSize(new java.awt.Dimension(110,20));
720 }
721 return jTextFieldToolCmd;
722 }
723
724 /**
725 * This method initializes jScrollPane6
726 *
727 * @return javax.swing.JScrollPane
728 */
729 private JScrollPane getJScrollPaneOptions() {
730 if (jScrollPaneOptions == null) {
731 jScrollPaneOptions = new JScrollPane();
732 jScrollPaneOptions.setPreferredSize(new java.awt.Dimension(650,400));
733 jScrollPaneOptions.setViewportView(getJTableOptions());
734 }
735 return jScrollPaneOptions;
736 }
737
738 /**
739 * This method initializes jTable5
740 *
741 * @return javax.swing.JTable
742 */
743 private JTable getJTableOptions() {
744 if (jTableOptions == null) {
745 optionsTableModel = new DefaultTableModel();
746 jTableOptions = new JTable(optionsTableModel);
747 jTableOptions.setRowHeight(20);
748 optionsTableModel.addColumn("BuildTargets");
749 optionsTableModel.addColumn("ToolChainFamily");
750 optionsTableModel.addColumn("SupportedArch");
751 optionsTableModel.addColumn("ToolCommand");
752 optionsTableModel.addColumn("TagName");
753 optionsTableModel.addColumn("Contents");
754
755 // TableColumn toolFamilyCol = jTable5.getColumnModel().getColumn(1);
756 // JComboBox cb = new JComboBox();
757 // cb.addItem("MSFT");
758 // cb.addItem("GCC");
759 // cb.addItem("CYGWIN");
760 // cb.addItem("INTEL");
761 // toolFamilyCol.setCellEditor(new DefaultCellEditor(cb));
762 Vector<String> vArch = new Vector<String>();
763 vArch.add("IA32");
764 vArch.add("X64");
765 vArch.add("IPF");
766 vArch.add("EBC");
767 vArch.add("ARM");
768 vArch.add("PPC");
769 jTableOptions.getColumnModel().getColumn(2).setCellEditor(new ListEditor(vArch));
770 jTableOptions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
771 jTableOptions.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
772 public void valueChanged(ListSelectionEvent e) {
773 selectedRow = -1;
774 if (e.getValueIsAdjusting()){
775 return;
776 }
777 ListSelectionModel lsm = (ListSelectionModel)e.getSource();
778 if (lsm.isSelectionEmpty()) {
779 return;
780 }
781 else{
782 selectedRow = lsm.getMinSelectionIndex();
783 }
784 }
785 });
786
787 jTableOptions.getModel().addTableModelListener(new TableModelListener() {
788 public void tableChanged(TableModelEvent arg0) {
789 // TODO Auto-generated method stub
790 int row = arg0.getFirstRow();
791 TableModel m = (TableModel)arg0.getSource();
792 if (arg0.getType() == TableModelEvent.UPDATE){
793 //ToDo Data Validition check.
794 String targets = m.getValueAt(row, 0) + "";
795 Vector<Object> targetName = new Vector<Object>();
796 String[] sArray = targets.split("( )+");
797 for (int i = 0; i < sArray.length; ++i) {
798 targetName.add(sArray[i]);
799 }
800 String toolChain = m.getValueAt(row, 1) + "";
801 String archs = m.getValueAt(row, 2) + "";
802 Vector<Object> supArch = null;
803 if (archs.length() > 0) {
804 supArch = new Vector<Object>();
805 String[] sArray1 = archs.split("( )+");
806 for (int i = 0; i < sArray1.length; ++i) {
807 supArch.add(sArray1[i]);
808 }
809 }
810
811 String toolCmd = m.getValueAt(row, 3) + "";
812 String tagName = m.getValueAt(row, 4) + "";
813 String contents = m.getValueAt(row, 5) + "";
814 docConsole.setSaved(false);
815 ffc.updateBuildOptionsOpt(row, targetName, toolChain, tagName, toolCmd, supArch, contents);
816 }
817 }
818 });
819 }
820 return jTableOptions;
821 }
822
823 /**
824 * This method initializes jButton10
825 *
826 * @return javax.swing.JButton
827 */
828 private JButton getJButtonOptionsAdd() {
829 if (jButtonOptionsAdd == null) {
830 jButtonOptionsAdd = new JButton();
831 jButtonOptionsAdd.setText("Add");
832 jButtonOptionsAdd.setPreferredSize(new java.awt.Dimension(90,20));
833 jButtonOptionsAdd.addActionListener(new AbstractAction() {
834 /**
835 *
836 */
837 private static final long serialVersionUID = 1L;
838
839 public void actionPerformed(java.awt.event.ActionEvent e) {
840 boolean[] boolArray = {jCheckBoxIA32.isSelected(),jCheckBoxIpf.isSelected(),jCheckBoxX64.isSelected(),
841 jCheckBoxEBC.isSelected(),jCheckBoxARM.isSelected(),jCheckBoxPPC.isSelected()};
842 String s = boolToList(boolArray);
843 Object[] o = {jTextFieldBuildTargets.getText(), jTextFieldToolChainFamily.getText(), s,
844 jTextFieldToolCmd.getText(), jTextFieldTagName.getText(), jTextFieldOptionContents.getText()};
845 optionsTableModel.addRow(o);
846 docConsole.setSaved(false);
847 ffc.genBuildOptionsOpt(stringToVector(jTextFieldBuildTargets.getText()), jTextFieldToolChainFamily.getText(), jTextFieldTagName.getText(), jTextFieldToolCmd.getText(), stringToVector(s), jTextFieldOptionContents.getText());
848 }
849 });
850 }
851 return jButtonOptionsAdd;
852 }
853
854 private Vector<Object> stringToVector(String s) {
855 String[] sArray = s.split(" ");
856 Vector<Object> v = null;
857 if (s.length() > 0) {
858 v = new Vector<Object>();
859 for (int i = 0; i < sArray.length; ++i) {
860 v.add(sArray[i]);
861 }
862 }
863 return v;
864 }
865
866 private String boolToList (boolean[] bool) {
867 String s = " ";
868 if (bool[0]) {
869 s += "IA32 ";
870 }
871 if (bool[1]) {
872 s += "IPF ";
873 }
874 if (bool[2]) {
875 s += "X64 ";
876 }
877 if (bool[3]) {
878 s += "EBC ";
879 }
880 if (bool[4]) {
881 s += "ARM ";
882 }
883 if (bool[5]) {
884 s += "PPC ";
885 }
886 if (s == " ") {
887 s += "IA32";
888 }
889 return s.trim();
890 }
891
892 /**
893 * This method initializes jButton11
894 *
895 * @return javax.swing.JButton
896 */
897 private JButton getJButtonOptionsDel() {
898 if (jButtonOptionsDel == null) {
899 jButtonOptionsDel = new JButton();
900 jButtonOptionsDel.setText("Delete");
901 jButtonOptionsDel.setPreferredSize(new java.awt.Dimension(90,20));
902 jButtonOptionsDel.addActionListener(new AbstractAction() {
903 /**
904 *
905 */
906 private static final long serialVersionUID = 1L;
907
908 public void actionPerformed(java.awt.event.ActionEvent e) {
909 if (selectedRow >= 0) {
910 optionsTableModel.removeRow(selectedRow);
911 docConsole.setSaved(false);
912 ffc.removeBuildOptionsOpt(selectedRow);
913 }
914 }
915 });
916 }
917 return jButtonOptionsDel;
918 }
919
920 /**
921 * This method initializes jButton17
922 *
923 * @return javax.swing.JButton
924 */
925 private JButton getJButtonFfsAttribNew() {
926 if (jButtonFfsAttribNew == null) {
927 jButtonFfsAttribNew = new JButton();
928 jButtonFfsAttribNew.setPreferredSize(new java.awt.Dimension(80,20));
929 jButtonFfsAttribNew.setText("New");
930 jButtonFfsAttribNew.addActionListener(new AbstractAction() {
931 /**
932 *
933 */
934 private static final long serialVersionUID = 1L;
935
936 public void actionPerformed(ActionEvent arg0){
937 if (jTableFfs.getSelectedRow() < 0) {
938 return;
939 }
940 Object[] o = {"", ""};
941 ffsAttributesTableModel.addRow(o);
942 docConsole.setSaved(false);
943 ffc.genBuildOptionsFfsAttribute(jTableFfs.getSelectedRow(), "", "");
944 }
945 });
946 }
947 return jButtonFfsAttribNew;
948 }
949
950 /**
951 * This method initializes jButton18
952 *
953 * @return javax.swing.JButton
954 */
955 private JButton getJButtonFfsAttribRemove() {
956 if (jButtonFfsAttribRemove == null) {
957 jButtonFfsAttribRemove = new JButton();
958 jButtonFfsAttribRemove.setPreferredSize(new java.awt.Dimension(80,20));
959 jButtonFfsAttribRemove.setText("Remove");
960 jButtonFfsAttribRemove.addActionListener(new AbstractAction(){
961 /**
962 *
963 */
964 private static final long serialVersionUID = 1L;
965
966 public void actionPerformed(ActionEvent arg0){
967 if (jTableFfs.getSelectedRow() < 0) {
968 return;
969 }
970 if (jTableFfsAttribs.getSelectedRow() >= 0){
971 docConsole.setSaved(false);
972 ffsAttributesTableModel.removeRow(jTableFfsAttribs.getSelectedRow());
973 ffc.removeBuildOptionsFfsAttribute(jTableFfs.getSelectedRow(), jTableFfsAttribs.getSelectedRow());
974 }
975 }
976 });
977 }
978 return jButtonFfsAttribRemove;
979 }
980
981 /**
982 * This method initializes jCheckBox9
983 *
984 * @return javax.swing.JCheckBox
985 */
986 private JCheckBox getJCheckBoxIA32() {
987 if (jCheckBoxIA32 == null) {
988 jCheckBoxIA32 = new JCheckBox();
989 jCheckBoxIA32.setPreferredSize(new java.awt.Dimension(50,20));
990 jCheckBoxIA32.setText("IA32");
991 }
992 return jCheckBoxIA32;
993 }
994
995 /**
996 * This method initializes jCheckBox10
997 *
998 * @return javax.swing.JCheckBox
999 */
1000 private JCheckBox getJCheckBoxIpf() {
1001 if (jCheckBoxIpf == null) {
1002 jCheckBoxIpf = new JCheckBox();
1003 jCheckBoxIpf.setPreferredSize(new java.awt.Dimension(50,20));
1004 jCheckBoxIpf.setText("IPF");
1005 }
1006 return jCheckBoxIpf;
1007 }
1008
1009 /**
1010 * This method initializes jCheckBox11
1011 *
1012 * @return javax.swing.JCheckBox
1013 */
1014 private JCheckBox getJCheckBoxX64() {
1015 if (jCheckBoxX64 == null) {
1016 jCheckBoxX64 = new JCheckBox();
1017 jCheckBoxX64.setText("X64");
1018 jCheckBoxX64.setPreferredSize(new java.awt.Dimension(47,20));
1019 }
1020 return jCheckBoxX64;
1021 }
1022
1023 /**
1024 * This method initializes jCheckBox12
1025 *
1026 * @return javax.swing.JCheckBox
1027 */
1028 private JCheckBox getJCheckBoxEBC() {
1029 if (jCheckBoxEBC == null) {
1030 jCheckBoxEBC = new JCheckBox();
1031 jCheckBoxEBC.setPreferredSize(new java.awt.Dimension(50,20));
1032 jCheckBoxEBC.setText("EBC");
1033 }
1034 return jCheckBoxEBC;
1035 }
1036
1037 /**
1038 * This method initializes jCheckBox13
1039 *
1040 * @return javax.swing.JCheckBox
1041 */
1042 private JCheckBox getJCheckBoxARM() {
1043 if (jCheckBoxARM == null) {
1044 jCheckBoxARM = new JCheckBox();
1045 jCheckBoxARM.setPreferredSize(new java.awt.Dimension(55,20));
1046 jCheckBoxARM.setText("ARM");
1047 }
1048 return jCheckBoxARM;
1049 }
1050
1051 /**
1052 * This method initializes jCheckBox14
1053 *
1054 * @return javax.swing.JCheckBox
1055 */
1056 private JCheckBox getJCheckBoxPPC() {
1057 if (jCheckBoxPPC == null) {
1058 jCheckBoxPPC = new JCheckBox();
1059 jCheckBoxPPC.setPreferredSize(new java.awt.Dimension(50,20));
1060 jCheckBoxPPC.setText("PPC");
1061 }
1062 return jCheckBoxPPC;
1063 }
1064
1065 /**
1066 * This method initializes jTextField12
1067 *
1068 * @return javax.swing.JTextField
1069 */
1070 private JTextField getJTextFieldBuildTargets() {
1071 if (jTextFieldBuildTargets == null) {
1072 jTextFieldBuildTargets = new JTextField();
1073 jTextFieldBuildTargets.setPreferredSize(new java.awt.Dimension(150,20));
1074 }
1075 return jTextFieldBuildTargets;
1076 }
1077
1078 /**
1079 * This method initializes jTextField13
1080 *
1081 * @return javax.swing.JTextField
1082 */
1083 private JTextField getJTextFieldTagName() {
1084 if (jTextFieldTagName == null) {
1085 jTextFieldTagName = new JTextField();
1086 jTextFieldTagName.setPreferredSize(new java.awt.Dimension(140,20));
1087 }
1088 return jTextFieldTagName;
1089 }
1090
1091 /**
1092 * This method initializes jScrollPane
1093 *
1094 * @return javax.swing.JScrollPane
1095 */
1096 private JScrollPane getJScrollPaneFfs() {
1097 if (jScrollPaneFfs == null) {
1098 jScrollPaneFfs = new JScrollPane();
1099 jScrollPaneFfs.setPreferredSize(new java.awt.Dimension(150,419));
1100 jScrollPaneFfs.setViewportView(getJTableFfs());
1101 }
1102 return jScrollPaneFfs;
1103 }
1104
1105 /**
1106 * This method initializes jTable
1107 *
1108 * @return javax.swing.JTable
1109 */
1110 private JTable getJTableFfs() {
1111 if (jTableFfs == null) {
1112 ffsTableModel = new DefaultTableModel();
1113 ffsTableModel.addColumn("FFS Type");
1114 jTableFfs = new JTable(ffsTableModel);
1115 jTableFfs.setShowGrid(false);
1116 jTableFfs.setRowHeight(20);
1117
1118 jTableFfs.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
1119 jTableFfs.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
1120 public void valueChanged(ListSelectionEvent e) {
1121
1122 if (e.getValueIsAdjusting()){
1123 return;
1124 }
1125 ListSelectionModel lsm = (ListSelectionModel)e.getSource();
1126 if (lsm.isSelectionEmpty()) {
1127 return;
1128 }
1129 else{
1130 int row = lsm.getMinSelectionIndex();
1131 sectionTableModel.setRowCount(0);
1132 sectionsTableModel.setRowCount(0);
1133 subsectionsTableModel.setRowCount(0);
1134 ffsAttributesTableModel.setRowCount(0);
1135 String[] sArray = {"", ""};
1136 LinkedHashMap<String, String> lhm = new LinkedHashMap<String, String>();
1137 ArrayList<String> alSections = new ArrayList<String>();
1138 ArrayList<String> alSection = new ArrayList<String>();
1139 ffc.getBuildOptionsFfs(row, sArray, lhm, alSections, alSection);
1140 jTextFieldFfsKey.setText(sArray[0]);
1141 jTextFieldEncapType.setText(sArray[1]);
1142 for (int i = 0; i < alSection.size(); ++i) {
1143 String[] sectionRow = {alSection.get(i)};
1144 sectionTableModel.addRow(sectionRow);
1145 }
1146 for (int j = 0; j < alSections.size(); ++j) {
1147 String[] sectionsRow = {alSections.get(j)};
1148 sectionsTableModel.addRow(sectionsRow);
1149 }
1150 if (lhm.size() <= 0 ) {
1151 return;
1152 }
1153 Set<String> keySet = lhm.keySet();
1154 Iterator<String> is = keySet.iterator();
1155 while(is.hasNext()) {
1156 String key = is.next();
1157 String[] attribRow = {key, lhm.get(key)};
1158 ffsAttributesTableModel.addRow(attribRow);
1159 }
1160 }
1161 }
1162 });
1163
1164 jTableFfs.getModel().addTableModelListener(new TableModelListener() {
1165 public void tableChanged(TableModelEvent arg0) {
1166 // TODO Auto-generated method stub
1167 int row = arg0.getFirstRow();
1168 TableModel m = (TableModel)arg0.getSource();
1169 if (arg0.getType() == TableModelEvent.UPDATE){
1170 //ToDo Data Validition check.
1171 String id = m.getValueAt(row, 0) + "";
1172
1173 if (id.length() == 0) {
1174 return;
1175 }
1176 docConsole.setSaved(false);
1177 ffc.updateBuildOptionsFfsKey(row, id);
1178 }
1179 }
1180 });
1181 }
1182 return jTableFfs;
1183 }
1184
1185 /**
1186 * This method initializes jScrollPane1
1187 *
1188 * @return javax.swing.JScrollPane
1189 */
1190 private JScrollPane getJScrollPaneFfsSection() {
1191 if (jScrollPaneFfsSection == null) {
1192 jScrollPaneFfsSection = new JScrollPane();
1193 jScrollPaneFfsSection.setPreferredSize(new java.awt.Dimension(500,80));
1194 jScrollPaneFfsSection.setViewportView(getJTableFfsSection());
1195 }
1196 return jScrollPaneFfsSection;
1197 }
1198
1199 /**
1200 * This method initializes jTable1
1201 *
1202 * @return javax.swing.JTable
1203 */
1204 private JTable getJTableFfsSection() {
1205 if (jTableFfsSection == null) {
1206 sectionTableModel = new DefaultTableModel();
1207 sectionTableModel.addColumn("SectionType");
1208
1209 jTableFfsSection = new JTable(sectionTableModel);
1210 jTableFfsSection.setRowHeight(20);
1211 JComboBox cb = new JComboBox();
1212 cb.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");
1213 cb.addItem("EFI_SECTION_VERSION");
1214 cb.addItem("EFI_SECTION_USER_INTERFACE");
1215 cb.addItem("EFI_SECTION_DXE_DEPEX");
1216 cb.addItem("EFI_SECTION_PEI_DEPEX");
1217 cb.addItem("EFI_SECTION_PE32");
1218 cb.addItem("EFI_SECTION_PIC");
1219 cb.addItem("EFI_SECTION_TE");
1220 cb.addItem("EFI_SECTION_RAW");
1221 cb.addItem("EFI_SECTION_COMPRESSION");
1222 cb.addItem("EFI_SECTION_GUID_DEFINED");
1223 cb.addItem("EFI_SECTION_COMPATIBILITY16");
1224 cb.addItem("EFI_SECTION_FIRMWARE_VOLUME_IMAGE");
1225 jTableFfsSection.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(cb));
1226
1227 jTableFfsSection.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
1228
1229 jTableFfsSection.getModel().addTableModelListener(new TableModelListener() {
1230 public void tableChanged(TableModelEvent arg0) {
1231 // TODO Auto-generated method stub
1232 if (jTableFfs.getSelectedRow() < 0) {
1233 return;
1234 }
1235 int row = arg0.getFirstRow();
1236 TableModel m = (TableModel)arg0.getSource();
1237 if (arg0.getType() == TableModelEvent.UPDATE){
1238 //ToDo Data Validition check.
1239 String type = m.getValueAt(row, 0) + "";
1240 docConsole.setSaved(false);
1241 ffc.updateBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(), row, type);
1242 }
1243 }
1244 });
1245 }
1246 return jTableFfsSection;
1247 }
1248
1249 /**
1250 * This method initializes jScrollPane3
1251 *
1252 * @return javax.swing.JScrollPane
1253 */
1254 private JScrollPane getJScrollPaneFfsSubSection() {
1255 if (jScrollPaneFfsSubSection == null) {
1256 jScrollPaneFfsSubSection = new JScrollPane();
1257 jScrollPaneFfsSubSection.setPreferredSize(new java.awt.Dimension(500,90));
1258 jScrollPaneFfsSubSection.setViewportView(getJTableFfsSubSection());
1259 }
1260 return jScrollPaneFfsSubSection;
1261 }
1262
1263 /**
1264 * This method initializes jTable3
1265 *
1266 * @return javax.swing.JTable
1267 */
1268 private JTable getJTableFfsSubSection() {
1269 if (jTableFfsSubSection == null) {
1270 subsectionsTableModel = new DefaultTableModel();
1271 subsectionsTableModel.addColumn("SectionType");
1272 jTableFfsSubSection = new JTable(subsectionsTableModel);
1273 jTableFfsSubSection.setRowHeight(20);
1274 JComboBox cb = new JComboBox();
1275 cb.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");
1276 cb.addItem("EFI_SECTION_VERSION");
1277 cb.addItem("EFI_SECTION_USER_INTERFACE");
1278 cb.addItem("EFI_SECTION_DXE_DEPEX");
1279 cb.addItem("EFI_SECTION_PEI_DEPEX");
1280 cb.addItem("EFI_SECTION_PE32");
1281 cb.addItem("EFI_SECTION_PIC");
1282 cb.addItem("EFI_SECTION_TE");
1283 cb.addItem("EFI_SECTION_RAW");
1284 cb.addItem("EFI_SECTION_COMPRESSION");
1285 cb.addItem("EFI_SECTION_GUID_DEFINED");
1286 cb.addItem("EFI_SECTION_COMPATIBILITY16");
1287 cb.addItem("EFI_SECTION_FIRMWARE_VOLUME_IMAGE");
1288 jTableFfsSubSection.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(cb));
1289 jTableFfsSubSection.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
1290
1291 jTableFfsSubSection.getModel().addTableModelListener(new TableModelListener() {
1292 public void tableChanged(TableModelEvent arg0) {
1293 // TODO Auto-generated method stub
1294 if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0) {
1295 return;
1296 }
1297 int row = arg0.getFirstRow();
1298 TableModel m = (TableModel)arg0.getSource();
1299 if (arg0.getType() == TableModelEvent.UPDATE){
1300 //ToDo Data Validition check.
1301 String type = m.getValueAt(row, 0) + "";
1302 docConsole.setSaved(false);
1303 ffc.updateBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(), jTableFfsSections.getSelectedRow(), row, type);
1304 }
1305 }
1306 });
1307 }
1308 return jTableFfsSubSection;
1309 }
1310
1311 /**
1312 * This method initializes jTextField
1313 *
1314 * @return javax.swing.JTextField
1315 */
1316 private JTextField getJTextFieldEncapType() {
1317 if (jTextFieldEncapType == null) {
1318 jTextFieldEncapType = new JTextField();
1319 jTextFieldEncapType.setPreferredSize(new java.awt.Dimension(100,20));
1320 jTextFieldEncapType.addFocusListener(new java.awt.event.FocusAdapter() {
1321 public void focusLost(java.awt.event.FocusEvent e) {
1322 if (jTableFfs.getSelectedRow() < 0) {
1323 return;
1324 }
1325 ffc.updateBuildOptionsFfsSectionsType(jTableFfs.getSelectedRow(), jTextFieldEncapType.getText());
1326 }
1327 });
1328 }
1329 return jTextFieldEncapType;
1330 }
1331
1332 /**
1333 * This method initializes jPanel4
1334 *
1335 * @return javax.swing.JPanel
1336 */
1337 private JPanel getJPanelFfsAttribButtonGroup() {
1338 if (jPanelFfsAttribButtonGroup == null) {
1339 jPanelFfsAttribButtonGroup = new JPanel();
1340 jPanelFfsAttribButtonGroup.setPreferredSize(new java.awt.Dimension(100,100));
1341 jPanelFfsAttribButtonGroup.add(getJButtonFfsAttribNew(), null);
1342 jPanelFfsAttribButtonGroup.add(getJButtonFfsAttribRemove(), null);
1343 }
1344 return jPanelFfsAttribButtonGroup;
1345 }
1346
1347 /**
1348 * This method initializes jButton
1349 *
1350 * @return javax.swing.JButton
1351 */
1352 private JButton getJButtonFfsSectionNew() {
1353 if (jButtonFfsSectionNew == null) {
1354 jButtonFfsSectionNew = new JButton();
1355 jButtonFfsSectionNew.setPreferredSize(new java.awt.Dimension(80,20));
1356 jButtonFfsSectionNew.setText("New");
1357 jButtonFfsSectionNew.addActionListener(new java.awt.event.ActionListener() {
1358 public void actionPerformed(java.awt.event.ActionEvent e) {
1359 if (jTableFfs.getSelectedRow() < 0) {
1360 return;
1361 }
1362 docConsole.setSaved(false);
1363 String[] row = {"EFI_SECTION_RAW"};
1364 sectionTableModel.addRow(row);
1365 ffc.genBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(), row[0]);
1366 }
1367 });
1368 }
1369 return jButtonFfsSectionNew;
1370 }
1371
1372 /**
1373 * This method initializes jButton1
1374 *
1375 * @return javax.swing.JButton
1376 */
1377 private JButton getJButtonFfsSectionRemove() {
1378 if (jButtonFfsSectionRemove == null) {
1379 jButtonFfsSectionRemove = new JButton();
1380 jButtonFfsSectionRemove.setPreferredSize(new java.awt.Dimension(80,20));
1381 jButtonFfsSectionRemove.setText("Remove");
1382
1383 jButtonFfsSectionRemove.addActionListener(new java.awt.event.ActionListener() {
1384 public void actionPerformed(java.awt.event.ActionEvent e) {
1385 if (jTableFfs.getSelectedRow() < 0 || jTableFfsSection.getSelectedRow() < 0) {
1386 return;
1387 }
1388 docConsole.setSaved(false);
1389 sectionTableModel.removeRow(jTableFfsSection.getSelectedRow());
1390 ffc.removeBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(), jTableFfsSection.getSelectedRow());
1391 }
1392 });
1393 }
1394 return jButtonFfsSectionRemove;
1395 }
1396
1397 /**
1398 * This method initializes jButton2
1399 *
1400 * @return javax.swing.JButton
1401 */
1402 private JButton getJButtonFfsSubSectionNew() {
1403 if (jButtonFfsSubSectionNew == null) {
1404 jButtonFfsSubSectionNew = new JButton();
1405 jButtonFfsSubSectionNew.setPreferredSize(new java.awt.Dimension(80,20));
1406 jButtonFfsSubSectionNew.setText("New");
1407 jButtonFfsSubSectionNew.addActionListener(new java.awt.event.ActionListener() {
1408 public void actionPerformed(java.awt.event.ActionEvent e) {
1409 if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0) {
1410 return;
1411 }
1412 docConsole.setSaved(false);
1413 String[] row = {"EFI_SECTION_RAW"};
1414 subsectionsTableModel.addRow(row);
1415 ffc.genBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(), jTableFfsSections.getSelectedRow(), row[0]);
1416
1417 }
1418 });
1419 }
1420 return jButtonFfsSubSectionNew;
1421 }
1422
1423 /**
1424 * This method initializes jButton3
1425 *
1426 * @return javax.swing.JButton
1427 */
1428 private JButton getJButtonFfsSubSectionRemove() {
1429 if (jButtonFfsSubSectionRemove == null) {
1430 jButtonFfsSubSectionRemove = new JButton();
1431 jButtonFfsSubSectionRemove.setPreferredSize(new java.awt.Dimension(80,20));
1432 jButtonFfsSubSectionRemove.setText("Remove");
1433 jButtonFfsSubSectionRemove.addActionListener(new java.awt.event.ActionListener() {
1434 public void actionPerformed(java.awt.event.ActionEvent e) {
1435 if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0 || jTableFfsSubSection.getSelectedRow() < 0) {
1436 return;
1437 }
1438 docConsole.setSaved(false);
1439 subsectionsTableModel.removeRow(jTableFfsSubSection.getSelectedRow());
1440 ffc.removeBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(), jTableFfsSections.getSelectedRow(), jTableFfsSubSection.getSelectedRow());
1441 }
1442 });
1443 }
1444 return jButtonFfsSubSectionRemove;
1445 }
1446
1447 /**
1448 * This method initializes jButton6
1449 *
1450 * @return javax.swing.JButton
1451 */
1452 private JButton getJButtonFfsSectionsNew() {
1453 if (jButtonFfsSectionsNew == null) {
1454 jButtonFfsSectionsNew = new JButton();
1455 jButtonFfsSectionsNew.setPreferredSize(new java.awt.Dimension(80,20));
1456 jButtonFfsSectionsNew.setText("New");
1457 jButtonFfsSectionsNew.addActionListener(new java.awt.event.ActionListener() {
1458 public void actionPerformed(java.awt.event.ActionEvent e) {
1459 if (jTableFfs.getSelectedRow() < 0) {
1460 return;
1461 }
1462 docConsole.setSaved(false);
1463 String[] row = {""};
1464 sectionsTableModel.addRow(row);
1465 ffc.genBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(), "");
1466 }
1467 });
1468 }
1469 return jButtonFfsSectionsNew;
1470 }
1471
1472 /**
1473 * This method initializes jButton7
1474 *
1475 * @return javax.swing.JButton
1476 */
1477 private JButton getJButtonFfsSectionsRemove() {
1478 if (jButtonFfsSectionsRemove == null) {
1479 jButtonFfsSectionsRemove = new JButton();
1480 jButtonFfsSectionsRemove.setPreferredSize(new java.awt.Dimension(80,20));
1481 jButtonFfsSectionsRemove.setText("Remove");
1482 jButtonFfsSectionsRemove.addActionListener(new java.awt.event.ActionListener() {
1483 public void actionPerformed(java.awt.event.ActionEvent e) {
1484 if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0) {
1485 return;
1486 }
1487 docConsole.setSaved(false);
1488 sectionsTableModel.removeRow(jTableFfsSections.getSelectedRow());
1489 ffc.removeBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(), jTableFfsSections.getSelectedRow());
1490 }
1491 });
1492 }
1493 return jButtonFfsSectionsRemove;
1494 }
1495
1496 /**
1497 * This method initializes jScrollPane4
1498 *
1499 * @return javax.swing.JScrollPane
1500 */
1501 private JScrollPane getJScrollPaneFfsSections() {
1502 if (jScrollPaneFfsSections == null) {
1503 jScrollPaneFfsSections = new JScrollPane();
1504 jScrollPaneFfsSections.setPreferredSize(new java.awt.Dimension(500,80));
1505 jScrollPaneFfsSections.setViewportView(getJTableFfsSections());
1506 }
1507 return jScrollPaneFfsSections;
1508 }
1509
1510 /**
1511 * This method initializes jTable6
1512 *
1513 * @return javax.swing.JTable
1514 */
1515 private JTable getJTableFfsSections() {
1516 if (jTableFfsSections == null) {
1517 sectionsTableModel = new DefaultTableModel();
1518 sectionsTableModel.addColumn("EncapsulationType");
1519 jTableFfsSections = new JTable(sectionsTableModel);
1520 jTableFfsSections.setRowHeight(20);
1521 jTableFfsSections.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
1522 jTableFfsSections.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
1523 public void valueChanged(ListSelectionEvent e) {
1524 if (e.getValueIsAdjusting()){
1525 return;
1526 }
1527 ListSelectionModel lsm = (ListSelectionModel)e.getSource();
1528 if (lsm.isSelectionEmpty()) {
1529 return;
1530 }
1531 else{
1532 int sectionsRow = lsm.getMinSelectionIndex();
1533 if (jTableFfs.getSelectedRow() < 0) {
1534 return;
1535 }
1536 subsectionsTableModel.setRowCount(0);
1537 ArrayList<String> al = new ArrayList<String>();
1538 ffc.getBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(), sectionsRow, al);
1539 for (int i = 0; i < al.size(); ++i) {
1540 String[] subsectionRow = {al.get(i)};
1541 subsectionsTableModel.addRow(subsectionRow);
1542 }
1543 }
1544 }
1545 });
1546
1547 jTableFfsSections.getModel().addTableModelListener(new TableModelListener() {
1548 public void tableChanged(TableModelEvent arg0) {
1549 // TODO Auto-generated method stub
1550 int row = arg0.getFirstRow();
1551 TableModel m = (TableModel)arg0.getSource();
1552 if (arg0.getType() == TableModelEvent.UPDATE){
1553 //ToDo Data Validition check.
1554 String encapType = m.getValueAt(row, 0) + "";
1555 docConsole.setSaved(false);
1556 ffc.updateBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(), row, encapType);
1557 }
1558 }
1559 });
1560 }
1561 return jTableFfsSections;
1562 }
1563
1564 /**
1565 * This method initializes jButton12
1566 *
1567 * @return javax.swing.JButton
1568 */
1569 private JButton getJButtonAntTaskFileBrowse() {
1570 if (jButtonAntTaskFileBrowse == null) {
1571 jButtonAntTaskFileBrowse = new JButton();
1572 jButtonAntTaskFileBrowse.setPreferredSize(new Dimension(90, 20));
1573 jButtonAntTaskFileBrowse.setText("Browse");
1574 jButtonAntTaskFileBrowse.addActionListener(new AbstractAction() {
1575 private static final long serialVersionUID = 1L;
1576
1577 public void actionPerformed(ActionEvent arg0) {
1578 //
1579 // Select files from current workspace
1580 //
1581 String dirPrefix = System.getenv("WORKSPACE");
1582 JFileChooser chooser = new JFileChooser(dirPrefix);
1583 File theFile = null;
1584 String headerDest = null;
1585
1586 chooser.setMultiSelectionEnabled(false);
1587 chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
1588 int retval = chooser.showOpenDialog(frame);
1589 if (retval == JFileChooser.APPROVE_OPTION) {
1590
1591 theFile = chooser.getSelectedFile();
1592 String file = theFile.getPath();
1593 if (!file.startsWith(dirPrefix)) {
1594 JOptionPane.showMessageDialog(frame, "You can only select files in current package!");
1595 return;
1596 }
1597 }
1598 else {
1599 return;
1600 }
1601
1602 headerDest = theFile.getPath();
1603 jTextFieldAntTaskFile.setText(headerDest.substring(dirPrefix.length()).replace('\\', '/'));
1604
1605 }
1606
1607 });
1608 }
1609 return jButtonAntTaskFileBrowse;
1610 }
1611
1612 /**
1613 * This method initializes jTextField1
1614 *
1615 * @return javax.swing.JTextField
1616 */
1617 private JTextField getJTextFieldToolChainFamily() {
1618 if (jTextFieldToolChainFamily == null) {
1619 jTextFieldToolChainFamily = new JTextField();
1620 jTextFieldToolChainFamily.setPreferredSize(new java.awt.Dimension(85,20));
1621 }
1622 return jTextFieldToolChainFamily;
1623 }
1624
1625 /**
1626 * This method initializes jSplitPaneFfsC
1627 *
1628 * @return javax.swing.JSplitPane
1629 */
1630 private JSplitPane getJSplitPaneFfsC() {
1631 if (jSplitPaneFfsC == null) {
1632 jSplitPaneFfsC = new JSplitPane();
1633 jSplitPaneFfsC.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
1634 jSplitPaneFfsC.setDividerLocation(130);
1635 jSplitPaneFfsC.setTopComponent(getJPanelFfsCTop());
1636 jSplitPaneFfsC.setBottomComponent(getJSplitPaneFfsCBottom());
1637 jSplitPaneFfsC.setDividerSize(5);
1638 }
1639 return jSplitPaneFfsC;
1640 }
1641
1642 /**
1643 * This method initializes jPanelFfsCTop
1644 *
1645 * @return javax.swing.JPanel
1646 */
1647 private JPanel getJPanelFfsCTop() {
1648 if (jPanelFfsCTop == null) {
1649 jPanelFfsCTop = new JPanel();
1650 jPanelFfsCTop.setLayout(new BorderLayout());
1651 jPanelFfsCTop.add(getJPanelSectionN(), java.awt.BorderLayout.NORTH);
1652 jPanelFfsCTop.add(getJPanelSectionC(), java.awt.BorderLayout.CENTER);
1653 }
1654 return jPanelFfsCTop;
1655 }
1656
1657 /**
1658 * This method initializes jSplitPaneFfsCBottom
1659 *
1660 * @return javax.swing.JSplitPane
1661 */
1662 private JSplitPane getJSplitPaneFfsCBottom() {
1663 if (jSplitPaneFfsCBottom == null) {
1664 jSplitPaneFfsCBottom = new JSplitPane();
1665 jSplitPaneFfsCBottom.setDividerSize(5);
1666 jSplitPaneFfsCBottom.setDividerLocation(130);
1667 jSplitPaneFfsCBottom.setTopComponent(getJPanelFfsCBottomTop());
1668 jSplitPaneFfsCBottom.setBottomComponent(getJPanelFfsCBottomBottom());
1669 jSplitPaneFfsCBottom.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
1670 }
1671 return jSplitPaneFfsCBottom;
1672 }
1673
1674 /**
1675 * This method initializes jPanelFfsCBottomTop
1676 *
1677 * @return javax.swing.JPanel
1678 */
1679 private JPanel getJPanelFfsCBottomTop() {
1680 if (jPanelFfsCBottomTop == null) {
1681 jPanelFfsCBottomTop = new JPanel();
1682 jPanelFfsCBottomTop.setLayout(new BorderLayout());
1683 jPanelFfsCBottomTop.add(getJPanelSectionsN(), java.awt.BorderLayout.NORTH);
1684 jPanelFfsCBottomTop.add(getJPanelSectionsC(), java.awt.BorderLayout.CENTER);
1685 }
1686 return jPanelFfsCBottomTop;
1687 }
1688
1689 /**
1690 * This method initializes jPanelFfsCBottomBottom
1691 *
1692 * @return javax.swing.JPanel
1693 */
1694 private JPanel getJPanelFfsCBottomBottom() {
1695 if (jPanelFfsCBottomBottom == null) {
1696 jPanelFfsCBottomBottom = new JPanel();
1697 jPanelFfsCBottomBottom.setLayout(new BorderLayout());
1698 jPanelFfsCBottomBottom.add(getJPanelSubSectionN(), java.awt.BorderLayout.NORTH);
1699 jPanelFfsCBottomBottom.add(getJPanelSubSectionC(), java.awt.BorderLayout.CENTER);
1700 }
1701 return jPanelFfsCBottomBottom;
1702 }
1703
1704 /**
1705 * This method initializes jPanelSectionN
1706 *
1707 * @return javax.swing.JPanel
1708 */
1709 private JPanel getJPanelSectionN() {
1710 if (jPanelSectionN == null) {
1711 jPanelSectionN = new JPanel();
1712 jLabelFfsSection = new JLabel();
1713 jLabelFfsSection.setText("Section");
1714 jPanelSectionN.add(jLabelFfsSection, null);
1715 jPanelSectionN.add(getJButtonFfsSectionNew(), null);
1716 jPanelSectionN.add(getJButtonFfsSectionRemove(), null);
1717 }
1718 return jPanelSectionN;
1719 }
1720
1721 /**
1722 * This method initializes jPanelSectionC
1723 *
1724 * @return javax.swing.JPanel
1725 */
1726 private JPanel getJPanelSectionC() {
1727 if (jPanelSectionC == null) {
1728 jPanelSectionC = new JPanel();
1729 jPanelSectionC.add(getJScrollPaneFfsSection(), null);
1730 }
1731 return jPanelSectionC;
1732 }
1733
1734 /**
1735 * This method initializes jPanelSectionsN
1736 *
1737 * @return javax.swing.JPanel
1738 */
1739 private JPanel getJPanelSectionsN() {
1740 if (jPanelSectionsN == null) {
1741 jPanelSectionsN = new JPanel();
1742 jLabelFfsSections = new JLabel();
1743 jLabelFfsSections.setText("Sections");
1744 jPanelSectionsN.add(jLabelFfsSections, null);
1745 jPanelSectionsN.add(getJButtonFfsSectionsNew(), null);
1746 jPanelSectionsN.add(getJButtonFfsSectionsRemove(), null);
1747 }
1748 return jPanelSectionsN;
1749 }
1750
1751 /**
1752 * This method initializes jPanelSectionsC
1753 *
1754 * @return javax.swing.JPanel
1755 */
1756 private JPanel getJPanelSectionsC() {
1757 if (jPanelSectionsC == null) {
1758 jPanelSectionsC = new JPanel();
1759 jPanelSectionsC.add(getJScrollPaneFfsSections(), null);
1760 }
1761 return jPanelSectionsC;
1762 }
1763
1764 /**
1765 * This method initializes jPanelSubSectionN
1766 *
1767 * @return javax.swing.JPanel
1768 */
1769 private JPanel getJPanelSubSectionN() {
1770 if (jPanelSubSectionN == null) {
1771 jPanelSubSectionN = new JPanel();
1772 jLabelFfsSubSections = new JLabel();
1773 jLabelFfsSubSections.setText("Sub-Sections");
1774 jPanelSubSectionN.add(jLabelFfsSubSections, null);
1775 jPanelSubSectionN.add(getJButtonFfsSubSectionNew(), null);
1776 jPanelSubSectionN.add(getJButtonFfsSubSectionRemove(), null);
1777 }
1778 return jPanelSubSectionN;
1779 }
1780
1781 /**
1782 * This method initializes jPanelSubSectionC
1783 *
1784 * @return javax.swing.JPanel
1785 */
1786 private JPanel getJPanelSubSectionC() {
1787 if (jPanelSubSectionC == null) {
1788 jPanelSubSectionC = new JPanel();
1789 jPanelSubSectionC.add(getJScrollPaneFfsSubSection(), null);
1790 }
1791 return jPanelSubSectionC;
1792 }
1793
1794 /**
1795 * This method initializes jPanelOptionsContainer
1796 *
1797 * @return javax.swing.JPanel
1798 */
1799 private JPanel getJPanelOptionsContainer() {
1800 if (jPanelOptionsContainer == null) {
1801 FlowLayout flowLayout = new FlowLayout();
1802 flowLayout.setAlignment(java.awt.FlowLayout.LEFT);
1803 jPanelOptionsContainer = new JPanel();
1804 jPanelOptionsContainer.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
1805 jPanelOptionsContainer.setLayout(flowLayout);
1806 jPanelOptionsContainer.setPreferredSize(new java.awt.Dimension(650,100));
1807 jPanelOptionsContainer.add(jLabelBuildTargets, null);
1808 jPanelOptionsContainer.add(getJTextFieldBuildTargets(), null);
1809 jPanelOptionsContainer.add(jLabelToolChainFamily, null);
1810 jPanelOptionsContainer.add(getJTextFieldToolChainFamily(), null);
1811 jPanelOptionsContainer.add(jLabelToolCmd, null);
1812 jPanelOptionsContainer.add(getJTextFieldToolCmd(), null);
1813 jPanelOptionsContainer.add(jLabelSupArch, null);
1814 jPanelOptionsContainer.add(getJCheckBoxIA32(), null);
1815 jPanelOptionsContainer.add(getJCheckBoxIpf(), null);
1816 jPanelOptionsContainer.add(getJCheckBoxX64(), null);
1817 jPanelOptionsContainer.add(getJCheckBoxEBC(), null);
1818 jPanelOptionsContainer.add(getJCheckBoxARM(), null);
1819 jPanelOptionsContainer.add(getJCheckBoxPPC(), null);
1820 jPanelOptionsContainer.add(jLabelTagName, null);
1821 jPanelOptionsContainer.add(getJTextFieldTagName(), null);
1822 jPanelOptionsContainer.add(jLabelOptionContents, null);
1823 jPanelOptionsContainer.add(getJTextFieldOptionContents(), null);
1824 jPanelOptionsContainer.add(getJButtonOptionsAdd(), null);
1825 jPanelOptionsContainer.add(getJButtonOptionsDel(), null);
1826 }
1827 return jPanelOptionsContainer;
1828 }
1829
1830 /**
1831 * This method initializes jPanelUserDefCenterN
1832 *
1833 * @return javax.swing.JPanel
1834 */
1835 private JPanel getJPanelUserDefCenterN() {
1836 if (jPanelUserDefCenterN == null) {
1837 jPanelUserDefCenterN = new JPanel();
1838 jPanelUserDefCenterN.add(jLabelAntCmdOpts, null);
1839 jPanelUserDefCenterN.add(getJTextFieldAntCmdOpts(), null);
1840 jPanelUserDefCenterN.add(getJButtonAntTaskAdd(), null);
1841 jPanelUserDefCenterN.add(getJButtonAntTaskDel(), null);
1842 }
1843 return jPanelUserDefCenterN;
1844 }
1845
1846 /**
1847 * This method initializes jPanelUserDefCenterC
1848 *
1849 * @return javax.swing.JPanel
1850 */
1851 private JPanel getJPanelUserDefCenterC() {
1852 if (jPanelUserDefCenterC == null) {
1853 jPanelUserDefCenterC = new JPanel();
1854 jPanelUserDefCenterC.add(getJScrollPaneAntTasks(), null);
1855 }
1856 return jPanelUserDefCenterC;
1857 }
1858
1859 /**
1860 * @param args
1861 */
1862 public static void main(String[] args) {
1863 // TODO Auto-generated method stub
1864 new FpdBuildOptions().setVisible(true);
1865 }
1866
1867 /**
1868 * This is the default constructor
1869 */
1870 public FpdBuildOptions() {
1871 super();
1872 initialize();
1873 this.setVisible(true);
1874 }
1875
1876 public FpdBuildOptions(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
1877 this();
1878 ffc = new FpdFileContents(fpd);
1879 init(ffc);
1880 }
1881
1882 public FpdBuildOptions(OpeningPlatformType opt) {
1883 this(opt.getXmlFpd());
1884 docConsole = opt;
1885 }
1886
1887 private void init(FpdFileContents ffc) {
1888 initOptionTable();
1889 initAntTaskTable();
1890 initFfsTable();
1891 this.addInternalFrameListener(new InternalFrameAdapter(){
1892 public void internalFrameDeactivated(InternalFrameEvent e){
1893 if (jTableFfs.isEditing()) {
1894 jTableFfs.getCellEditor().stopCellEditing();
1895 }
1896 if (jTableFfsSection.isEditing()) {
1897 jTableFfsSection.getCellEditor().stopCellEditing();
1898 }
1899 if (jTableAntTasks.isEditing()) {
1900 jTableAntTasks.getCellEditor().stopCellEditing();
1901 }
1902 if (jTableFfsSubSection.isEditing()) {
1903 jTableFfsSubSection.getCellEditor().stopCellEditing();
1904 }
1905 if (jTableFfsAttribs.isEditing()) {
1906 jTableFfsAttribs.getCellEditor().stopCellEditing();
1907 }
1908 if (jTableOptions.isEditing()) {
1909 jTableOptions.getCellEditor().stopCellEditing();
1910 }
1911 }
1912 });
1913 }
1914
1915 private void initOptionTable() {
1916 if (ffc.getBuildOptionsOptCount() == 0) {
1917 //ToDo get default options from *.txt file
1918 return;
1919 }
1920 String[][] saa = new String[ffc.getBuildOptionsOptCount()][6];
1921 ffc.getBuildOptionsOpts(saa);
1922 for (int i = 0; i < saa.length; ++i) {
1923 optionsTableModel.addRow(saa[i]);
1924 }
1925 }
1926
1927 private void initAntTaskTable() {
1928 if (ffc.getBuildOptionsUserDefAntTaskCount() == 0) {
1929 return;
1930 }
1931 String[][] saa = new String[ffc.getBuildOptionsUserDefAntTaskCount()][3];
1932 ffc.getBuildOptionsUserDefAntTasks(saa);
1933 for (int i = 0; i < saa.length; ++i) {
1934 antTaskTableModel.addRow(saa[i]);
1935 }
1936 }
1937
1938 private void initFfsTable(){
1939 int ffsCount = ffc.getBuildOptionsFfsCount();
1940 if (ffsCount < 0) {
1941 return;
1942 }
1943 String[][] saa = new String[ffsCount][1];
1944 ffc.getBuildOptionsFfsKey(saa);
1945 for (int i = 0; i < saa.length; ++i) {
1946 ffsTableModel.addRow(saa[i]);
1947 }
1948 }
1949 /**
1950 * This method initializes this
1951 *
1952 * @return void
1953 */
1954 private void initialize() {
1955 this.setSize(722, 577);
1956 this.setTitle("FPD Build Options");
1957 this.setContentPane(getJContentPane());
1958 }
1959
1960 /**
1961 * This method initializes jContentPane
1962 *
1963 * @return javax.swing.JPanel
1964 */
1965 private JPanel getJContentPane() {
1966 if (jContentPane == null) {
1967 jContentPane = new JPanel();
1968 jContentPane.setLayout(new BorderLayout());
1969 jContentPane.add(getJPanelContentSouth(), java.awt.BorderLayout.SOUTH);
1970 jContentPane.add(getJPanelContentNorth(), java.awt.BorderLayout.NORTH);
1971 jContentPane.add(getJPanelContentWest(), java.awt.BorderLayout.WEST);
1972 jContentPane.add(getJPanelContentEast(), java.awt.BorderLayout.EAST);
1973 jContentPane.add(getJTabbedPane(), java.awt.BorderLayout.CENTER);
1974 }
1975 return jContentPane;
1976 }
1977
1978 } // @jve:decl-index=0:visual-constraint="10,10"