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