]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java
Use unified global data to get module informations.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdBuildOptions.java
CommitLineData
a13899c5 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
15package org.tianocore.frameworkwizard.platform.ui;\r
16\r
17import java.awt.BorderLayout;\r
a13899c5 18\r
19import javax.swing.JPanel;\r
a13899c5 20import javax.swing.JTabbedPane;\r
21import javax.swing.JCheckBox;\r
22import javax.swing.JLabel;\r
23import java.awt.FlowLayout;\r
24import javax.swing.AbstractAction;\r
25import java.awt.event.ActionEvent;\r
26import java.awt.event.ActionListener;\r
a13899c5 27\r
a13899c5 28import javax.swing.DefaultCellEditor;\r
af25df16 29import javax.swing.JFileChooser;\r
d6d24759 30import javax.swing.JFrame;\r
31import javax.swing.JOptionPane;\r
a13899c5 32import javax.swing.JTextField;\r
33import javax.swing.JButton;\r
34import javax.swing.JScrollPane;\r
35import javax.swing.JTable;\r
36import javax.swing.JComboBox;\r
a13899c5 37import javax.swing.ListSelectionModel;\r
44053733 38import javax.swing.event.InternalFrameAdapter;\r
39import javax.swing.event.InternalFrameEvent;\r
a13899c5 40import javax.swing.event.ListSelectionEvent;\r
41import javax.swing.event.ListSelectionListener;\r
42import javax.swing.event.TableModelEvent;\r
43import javax.swing.event.TableModelListener;\r
44import javax.swing.table.DefaultTableModel;\r
a13899c5 45import javax.swing.table.TableModel;\r
a13899c5 46\r
47import org.tianocore.PlatformSurfaceAreaDocument;\r
d6d24759 48import org.tianocore.frameworkwizard.common.DataValidation;\r
49import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;\r
a13899c5 50import org.tianocore.frameworkwizard.common.ui.IInternalFrame;\r
af25df16 51\r
52import java.io.File;\r
6cba26e8 53import java.util.ArrayList;\r
54import java.util.Iterator;\r
55import java.util.LinkedHashMap;\r
56import java.util.Set;\r
1800d80f 57import java.util.Vector;\r
af25df16 58import java.awt.Dimension;\r
c1dbe93d 59import javax.swing.JSplitPane;\r
a13899c5 60\r
61public class FpdBuildOptions extends IInternalFrame {\r
62\r
63 private static final long serialVersionUID = 1L;\r
d6d24759 64 static JFrame frame;\r
a13899c5 65 private JPanel jContentPane = null;\r
4da2e625 66 private JPanel jPanelContentSouth = null;\r
67 private JPanel jPanelContentNorth = null;\r
68 private JPanel jPanelContentWest = null;\r
69 private JPanel jPanelContentEast = null;\r
a13899c5 70 private JTabbedPane jTabbedPane = null;\r
4da2e625 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
44053733 82 private DefaultTableModel ffsTableModel = null;\r
6cba26e8 83 private DefaultTableModel sectionsTableModel = null;\r
84 private DefaultTableModel sectionTableModel = null;\r
85 private DefaultTableModel subsectionsTableModel = null;\r
a13899c5 86 private DefaultTableModel antTaskTableModel = null;\r
87 private DefaultTableModel ffsAttributesTableModel = null;\r
88 private DefaultTableModel optionsTableModel = null;\r
4da2e625 89 private JPanel jPanelFfsTab = null;\r
90 private JPanel jPanelFfsTabCenter = null;\r
91 private JPanel jPanelFfsTabCenterN = null;\r
92 private JPanel jPanelFfsTabCenterS = null;\r
4da2e625 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
4da2e625 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
a13899c5 112 private FpdFileContents ffc = null;\r
d6d24759 113 private OpeningPlatformType docConsole = null;\r
4da2e625 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
a13899c5 124 private int selectedRow = -1;\r
4da2e625 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
c1dbe93d 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
a13899c5 164 /**\r
165 * This method initializes jPanel \r
166 * \r
167 * @return javax.swing.JPanel \r
168 */\r
4da2e625 169 private JPanel getJPanelContentSouth() {\r
170 if (jPanelContentSouth == null) {\r
171 jPanelContentSouth = new JPanel();\r
a13899c5 172 }\r
4da2e625 173 return jPanelContentSouth;\r
a13899c5 174 }\r
175\r
176 /**\r
177 * This method initializes jPanel1 \r
178 * \r
179 * @return javax.swing.JPanel \r
180 */\r
4da2e625 181 private JPanel getJPanelContentNorth() {\r
182 if (jPanelContentNorth == null) {\r
183 jPanelContentNorth = new JPanel();\r
a13899c5 184 }\r
4da2e625 185 return jPanelContentNorth;\r
a13899c5 186 }\r
187\r
188 /**\r
189 * This method initializes jPanel2 \r
190 * \r
191 * @return javax.swing.JPanel \r
192 */\r
4da2e625 193 private JPanel getJPanelContentWest() {\r
194 if (jPanelContentWest == null) {\r
195 jPanelContentWest = new JPanel();\r
a13899c5 196 }\r
4da2e625 197 return jPanelContentWest;\r
a13899c5 198 }\r
199\r
200 /**\r
201 * This method initializes jPanel3 \r
202 * \r
203 * @return javax.swing.JPanel \r
204 */\r
4da2e625 205 private JPanel getJPanelContentEast() {\r
206 if (jPanelContentEast == null) {\r
207 jPanelContentEast = new JPanel();\r
a13899c5 208 }\r
4da2e625 209 return jPanelContentEast;\r
a13899c5 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
4da2e625 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
a13899c5 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
4da2e625 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
202c4f38 239\r
a13899c5 240 }\r
4da2e625 241 return jPanelUserDef;\r
a13899c5 242 }\r
243\r
244 /**\r
245 * This method initializes jPanel9 \r
246 * \r
247 * @return javax.swing.JPanel \r
248 */\r
4da2e625 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
a13899c5 254 FlowLayout flowLayout8 = new FlowLayout();\r
c1dbe93d 255 flowLayout8.setAlignment(java.awt.FlowLayout.CENTER);\r
4da2e625 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
a13899c5 265 }\r
4da2e625 266 return jPanelUserDefNorth;\r
a13899c5 267 }\r
268\r
269 /**\r
270 * This method initializes jPanel11 \r
271 * \r
272 * @return javax.swing.JPanel \r
273 */\r
4da2e625 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
4da2e625 279 jPanelUserDefCenter = new JPanel();\r
c1dbe93d 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
a13899c5 284 }\r
4da2e625 285 return jPanelUserDefCenter;\r
a13899c5 286 }\r
287\r
a13899c5 288 /**\r
289 * This method initializes jTextField2 \r
290 * \r
291 * @return javax.swing.JTextField \r
292 */\r
4da2e625 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
a13899c5 297 }\r
4da2e625 298 return jTextFieldAntTaskFile;\r
a13899c5 299 }\r
300\r
301 /**\r
302 * This method initializes jTextField3 \r
303 * \r
304 * @return javax.swing.JTextField \r
305 */\r
4da2e625 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
a13899c5 310 }\r
4da2e625 311 return jTextFieldAntTaskId;\r
a13899c5 312 }\r
313\r
314 /**\r
315 * This method initializes jButton4 \r
316 * \r
317 * @return javax.swing.JButton \r
318 */\r
4da2e625 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
a13899c5 325 public void actionPerformed(ActionEvent e) {\r
4da2e625 326 if (!DataValidation.isInt(jTextFieldAntTaskId.getText()) || jTextFieldAntTaskId.getText().length() != 8) {\r
af25df16 327 JOptionPane.showMessageDialog(frame, "ID must be an 8-digit integer.");\r
d6d24759 328 return;\r
329 }\r
4da2e625 330 Object[] o = {jTextFieldAntTaskId.getText(), null, null};\r
331 o[1] = jTextFieldAntTaskFile.getText();\r
332 o[2] = jTextFieldAntCmdOpts.getText();\r
af25df16 333 ffc.genBuildOptionsUserDefAntTask(o[0]+"", o[1]+"", o[2]+"");\r
a13899c5 334 antTaskTableModel.addRow(o);\r
d6d24759 335 docConsole.setSaved(false);\r
a13899c5 336 }\r
337 });\r
338 }\r
4da2e625 339 return jButtonAntTaskAdd;\r
a13899c5 340 }\r
341\r
342 /**\r
343 * This method initializes jButton5 \r
344 * \r
345 * @return javax.swing.JButton \r
346 */\r
4da2e625 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
a13899c5 353 public void actionPerformed(ActionEvent e) {\r
354 if (selectedRow >= 0) {\r
d6d24759 355 docConsole.setSaved(false);\r
a13899c5 356 antTaskTableModel.removeRow(selectedRow);\r
357 ffc.removeBuildOptionsUserDefAntTask(selectedRow);\r
358 }\r
359 }\r
360 });\r
361 }\r
4da2e625 362 return jButtonAntTaskDel;\r
a13899c5 363 }\r
364\r
a13899c5 365 /**\r
366 * This method initializes jTextField4 \r
367 * \r
368 * @return javax.swing.JTextField \r
369 */\r
c1dbe93d 370 private JTextField getJTextFieldAntCmdOpts() {\r
4da2e625 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
a13899c5 375 }\r
4da2e625 376 return jTextFieldAntCmdOpts;\r
a13899c5 377 }\r
378\r
379 /**\r
380 * This method initializes jScrollPane2 \r
381 * \r
382 * @return javax.swing.JScrollPane \r
383 */\r
4da2e625 384 private JScrollPane getJScrollPaneAntTasks() {\r
385 if (jScrollPaneAntTasks == null) {\r
386 jScrollPaneAntTasks = new JScrollPane();\r
c1dbe93d 387 jScrollPaneAntTasks.setPreferredSize(new java.awt.Dimension(600,400));\r
4da2e625 388 jScrollPaneAntTasks.setViewportView(getJTableAntTasks());\r
a13899c5 389 }\r
4da2e625 390 return jScrollPaneAntTasks;\r
a13899c5 391 }\r
392\r
393 /**\r
394 * This method initializes jTable2 \r
395 * \r
396 * @return javax.swing.JTable \r
397 */\r
4da2e625 398 private JTable getJTableAntTasks() {\r
399 if (jTableAntTasks == null) {\r
a13899c5 400 antTaskTableModel = new DefaultTableModel();\r
4da2e625 401 jTableAntTasks = new JTable(antTaskTableModel);\r
402 jTableAntTasks.setRowHeight(20);\r
a13899c5 403 antTaskTableModel.addColumn("ID");\r
404 antTaskTableModel.addColumn("Filename");\r
202c4f38 405 antTaskTableModel.addColumn("ANT Command Options");\r
a13899c5 406 \r
4da2e625 407 jTableAntTasks.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
408 jTableAntTasks.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\r
a13899c5 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
4da2e625 424 jTableAntTasks.getModel().addTableModelListener(new TableModelListener() {\r
a13899c5 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
4da2e625 452 return jTableAntTasks;\r
a13899c5 453 }\r
454\r
455 /**\r
456 * This method initializes jPanel13 \r
457 * \r
458 * @return javax.swing.JPanel \r
459 */\r
4da2e625 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
a13899c5 466 }\r
4da2e625 467 return jPanelFfsTab;\r
a13899c5 468 }\r
469\r
a13899c5 470 /**\r
471 * This method initializes jPanel18 \r
472 * \r
473 * @return javax.swing.JPanel \r
474 */\r
4da2e625 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
c1dbe93d 481 jPanelFfsTabCenter.add(getJSplitPaneFfsC(), java.awt.BorderLayout.CENTER);\r
a13899c5 482 }\r
4da2e625 483 return jPanelFfsTabCenter;\r
a13899c5 484 }\r
485\r
a13899c5 486 /**\r
487 * This method initializes jPanel15 \r
488 * \r
489 * @return javax.swing.JPanel \r
490 */\r
4da2e625 491 private JPanel getJPanelFfsTabCenterN() {\r
492 if (jPanelFfsTabCenterN == null) {\r
493 jLabelEncapType = new JLabel();\r
494 jLabelEncapType.setText("Encapsulation Type");\r
a13899c5 495 FlowLayout flowLayout5 = new FlowLayout();\r
496 flowLayout5.setAlignment(java.awt.FlowLayout.RIGHT);\r
4da2e625 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
a13899c5 507 }\r
4da2e625 508 return jPanelFfsTabCenterN;\r
a13899c5 509 }\r
510\r
511 /**\r
512 * This method initializes jPanel16 \r
513 * \r
514 * @return javax.swing.JPanel \r
515 */\r
4da2e625 516 private JPanel getJPanelFfsTabCenterS() {\r
517 if (jPanelFfsTabCenterS == null) {\r
518 jLabelFfsAttribs = new JLabel();\r
519 jLabelFfsAttribs.setText("Attributes");\r
a13899c5 520 FlowLayout flowLayout6 = new FlowLayout();\r
521 flowLayout6.setHgap(5);\r
6cba26e8 522 flowLayout6.setVgap(20);\r
523 flowLayout6.setAlignment(java.awt.FlowLayout.CENTER);\r
4da2e625 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
a13899c5 530 }\r
4da2e625 531 return jPanelFfsTabCenterS;\r
a13899c5 532 }\r
533\r
a13899c5 534 /**\r
535 * This method initializes jTextField6 \r
536 * \r
537 * @return javax.swing.JTextField \r
538 */\r
4da2e625 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
3b405e9b 545 public void focusLost(java.awt.event.FocusEvent e) {\r
4da2e625 546 if (jTableFfs.getSelectedRow() < 0) {\r
3b405e9b 547 return;\r
548 }\r
549// ffc.updateBuildOptionsFfsKey(jTable.getSelectedRow(), jTextField6.getText());\r
550 }\r
551 });\r
a13899c5 552 }\r
4da2e625 553 return jTextFieldFfsKey;\r
a13899c5 554 }\r
555\r
556 /**\r
557 * This method initializes jButton8 \r
558 * \r
559 * @return javax.swing.JButton \r
560 */\r
4da2e625 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
44053733 567 /**\r
568 * \r
569 */\r
570 private static final long serialVersionUID = -2923720717273384221L;\r
571\r
a13899c5 572 public void actionPerformed(java.awt.event.ActionEvent e) {\r
4da2e625 573 if (jTextFieldFfsKey.getText().length() > 0) {\r
574 String[] row = {jTextFieldFfsKey.getText()};\r
6cba26e8 575 ffsTableModel.addRow(row);\r
d6d24759 576 docConsole.setSaved(false);\r
4da2e625 577 ffc.genBuildOptionsFfs(jTextFieldFfsKey.getText(), jTextFieldEncapType.getText());\r
a13899c5 578 }\r
579 }\r
580 });\r
581 }\r
4da2e625 582 return jButtonFfsAdd;\r
a13899c5 583 }\r
584\r
585 /**\r
586 * This method initializes jButton9 \r
587 * \r
588 * @return javax.swing.JButton \r
589 */\r
4da2e625 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
44053733 596 /**\r
597 * \r
598 */\r
599 private static final long serialVersionUID = -4002678939178194476L;\r
600\r
a13899c5 601 public void actionPerformed(ActionEvent arg0){\r
4da2e625 602 if (jTableFfs.getSelectedRow() < 0) {\r
6cba26e8 603 return;\r
604 }\r
d6d24759 605 docConsole.setSaved(false);\r
4da2e625 606 ffc.removeBuildOptionsFfs(jTableFfs.getSelectedRow());\r
c1dbe93d 607 ffsTableModel.removeRow(jTableFfs.getSelectedRow());\r
a13899c5 608 }\r
609 });\r
610 }\r
4da2e625 611 return jButtonFfsDel;\r
a13899c5 612 }\r
613\r
a13899c5 614 /**\r
615 * This method initializes jScrollPane5 \r
616 * \r
617 * @return javax.swing.JScrollPane \r
618 */\r
4da2e625 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
a13899c5 624 }\r
4da2e625 625 return jScrollPaneFfsAttribs;\r
a13899c5 626 }\r
627\r
628 /**\r
629 * This method initializes jTable4 \r
630 * \r
631 * @return javax.swing.JTable \r
632 */\r
4da2e625 633 private JTable getJTableFfsAttribs() {\r
634 if (jTableFfsAttribs == null) {\r
a13899c5 635 ffsAttributesTableModel = new DefaultTableModel();\r
4da2e625 636 jTableFfsAttribs = new JTable(ffsAttributesTableModel);\r
637 jTableFfsAttribs.setPreferredSize(new java.awt.Dimension(400,80));\r
638 jTableFfsAttribs.setRowHeight(20);\r
a13899c5 639 ffsAttributesTableModel.addColumn("Name");\r
640 ffsAttributesTableModel.addColumn("Value");\r
6cba26e8 641 \r
4da2e625 642 jTableFfsAttribs.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
643 jTableFfsAttribs.getModel().addTableModelListener(new TableModelListener() {\r
6cba26e8 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
d6d24759 659 docConsole.setSaved(false);\r
4da2e625 660 ffc.updateBuildOptionsFfsAttribute(jTableFfs.getSelectedRow(), row, name, value);\r
6cba26e8 661 }\r
662 }\r
663 });\r
a13899c5 664 }\r
4da2e625 665 return jTableFfsAttribs;\r
a13899c5 666 }\r
667\r
a13899c5 668 /**\r
669 * This method initializes jPanel20 \r
670 * \r
671 * @return javax.swing.JPanel \r
672 */\r
4da2e625 673 private JPanel getJPanelOptionsTab() {\r
674 if (jPanelOptionsTab == null) {\r
675 jLabelTagName = new JLabel();\r
676 jLabelTagName.setText("Tag Name");\r
a13899c5 677 FlowLayout flowLayout9 = new FlowLayout();\r
678 flowLayout9.setAlignment(java.awt.FlowLayout.LEFT);\r
4da2e625 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
c1dbe93d 691 jPanelOptionsTab.add(getJPanelOptionsContainer(), null);\r
4da2e625 692 jPanelOptionsTab.add(getJScrollPaneOptions(), null);\r
c1dbe93d 693 \r
4da2e625 694 }\r
695 return jPanelOptionsTab;\r
a13899c5 696 }\r
697\r
698 /**\r
699 * This method initializes jTextField7 \r
700 * \r
701 * @return javax.swing.JTextField \r
702 */\r
4da2e625 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
a13899c5 707 }\r
4da2e625 708 return jTextFieldOptionContents;\r
a13899c5 709 }\r
710\r
711 /**\r
712 * This method initializes jTextField8 \r
713 * \r
714 * @return javax.swing.JTextField \r
715 */\r
4da2e625 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
a13899c5 720 }\r
4da2e625 721 return jTextFieldToolCmd;\r
a13899c5 722 }\r
723\r
724 /**\r
725 * This method initializes jScrollPane6 \r
726 * \r
727 * @return javax.swing.JScrollPane \r
728 */\r
4da2e625 729 private JScrollPane getJScrollPaneOptions() {\r
730 if (jScrollPaneOptions == null) {\r
731 jScrollPaneOptions = new JScrollPane();\r
c1dbe93d 732 jScrollPaneOptions.setPreferredSize(new java.awt.Dimension(650,400));\r
4da2e625 733 jScrollPaneOptions.setViewportView(getJTableOptions());\r
a13899c5 734 }\r
4da2e625 735 return jScrollPaneOptions;\r
a13899c5 736 }\r
737\r
738 /**\r
739 * This method initializes jTable5 \r
740 * \r
741 * @return javax.swing.JTable \r
742 */\r
4da2e625 743 private JTable getJTableOptions() {\r
744 if (jTableOptions == null) {\r
a13899c5 745 optionsTableModel = new DefaultTableModel();\r
4da2e625 746 jTableOptions = new JTable(optionsTableModel);\r
747 jTableOptions.setRowHeight(20);\r
a13899c5 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
af25df16 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
d6d24759 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
4da2e625 769 jTableOptions.getColumnModel().getColumn(2).setCellEditor(new ListEditor(vArch));\r
770 jTableOptions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
771 jTableOptions.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\r
a13899c5 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
4da2e625 787 jTableOptions.getModel().addTableModelListener(new TableModelListener() {\r
a13899c5 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
1800d80f 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
a13899c5 800 String toolChain = m.getValueAt(row, 1) + "";\r
1800d80f 801 String archs = m.getValueAt(row, 2) + "";\r
d6d24759 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
1800d80f 809 }\r
d6d24759 810 \r
a13899c5 811 String toolCmd = m.getValueAt(row, 3) + "";\r
812 String tagName = m.getValueAt(row, 4) + "";\r
813 String contents = m.getValueAt(row, 5) + "";\r
d6d24759 814 docConsole.setSaved(false);\r
a13899c5 815 ffc.updateBuildOptionsOpt(row, targetName, toolChain, tagName, toolCmd, supArch, contents);\r
816 }\r
817 }\r
818 });\r
819 }\r
4da2e625 820 return jTableOptions;\r
a13899c5 821 }\r
822\r
823 /**\r
824 * This method initializes jButton10 \r
825 * \r
826 * @return javax.swing.JButton \r
827 */\r
4da2e625 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
44053733 834 /**\r
835 * \r
836 */\r
837 private static final long serialVersionUID = 1L;\r
838\r
a13899c5 839 public void actionPerformed(java.awt.event.ActionEvent e) {\r
4da2e625 840 boolean[] boolArray = {jCheckBoxIA32.isSelected(),jCheckBoxIpf.isSelected(),jCheckBoxX64.isSelected(),\r
841 jCheckBoxEBC.isSelected(),jCheckBoxARM.isSelected(),jCheckBoxPPC.isSelected()};\r
a13899c5 842 String s = boolToList(boolArray);\r
4da2e625 843 Object[] o = {jTextFieldBuildTargets.getText(), jTextFieldToolChainFamily.getText(), s,\r
844 jTextFieldToolCmd.getText(), jTextFieldTagName.getText(), jTextFieldOptionContents.getText()};\r
a13899c5 845 optionsTableModel.addRow(o);\r
d6d24759 846 docConsole.setSaved(false);\r
4da2e625 847 ffc.genBuildOptionsOpt(stringToVector(jTextFieldBuildTargets.getText()), jTextFieldToolChainFamily.getText(), jTextFieldTagName.getText(), jTextFieldToolCmd.getText(), stringToVector(s), jTextFieldOptionContents.getText());\r
a13899c5 848 }\r
849 });\r
850 }\r
4da2e625 851 return jButtonOptionsAdd;\r
a13899c5 852 }\r
853 \r
1800d80f 854 private Vector<Object> stringToVector(String s) {\r
855 String[] sArray = s.split(" ");\r
d6d24759 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
1800d80f 862 }\r
863 return v;\r
864 }\r
865 \r
a13899c5 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
1800d80f 886 if (s == " ") {\r
887 s += "IA32";\r
888 }\r
a13899c5 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
4da2e625 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
44053733 903 /**\r
904 * \r
905 */\r
906 private static final long serialVersionUID = 1L;\r
907\r
a13899c5 908 public void actionPerformed(java.awt.event.ActionEvent e) {\r
909 if (selectedRow >= 0) {\r
910 optionsTableModel.removeRow(selectedRow);\r
d6d24759 911 docConsole.setSaved(false);\r
a13899c5 912 ffc.removeBuildOptionsOpt(selectedRow);\r
913 }\r
914 }\r
915 });\r
916 }\r
4da2e625 917 return jButtonOptionsDel;\r
a13899c5 918 }\r
919\r
a13899c5 920 /**\r
921 * This method initializes jButton17 \r
922 * \r
923 * @return javax.swing.JButton \r
924 */\r
4da2e625 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
44053733 931 /**\r
932 * \r
933 */\r
934 private static final long serialVersionUID = 1L;\r
935\r
a13899c5 936 public void actionPerformed(ActionEvent arg0){\r
4da2e625 937 if (jTableFfs.getSelectedRow() < 0) {\r
6cba26e8 938 return;\r
939 }\r
a13899c5 940 Object[] o = {"", ""};\r
941 ffsAttributesTableModel.addRow(o);\r
d6d24759 942 docConsole.setSaved(false);\r
4da2e625 943 ffc.genBuildOptionsFfsAttribute(jTableFfs.getSelectedRow(), "", "");\r
a13899c5 944 }\r
945 });\r
946 }\r
4da2e625 947 return jButtonFfsAttribNew;\r
a13899c5 948 }\r
949\r
950 /**\r
951 * This method initializes jButton18 \r
952 * \r
953 * @return javax.swing.JButton \r
954 */\r
4da2e625 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
44053733 961 /**\r
962 * \r
963 */\r
964 private static final long serialVersionUID = 1L;\r
965\r
a13899c5 966 public void actionPerformed(ActionEvent arg0){\r
4da2e625 967 if (jTableFfs.getSelectedRow() < 0) {\r
6cba26e8 968 return;\r
969 }\r
4da2e625 970 if (jTableFfsAttribs.getSelectedRow() >= 0){\r
d6d24759 971 docConsole.setSaved(false);\r
4da2e625 972 ffsAttributesTableModel.removeRow(jTableFfsAttribs.getSelectedRow());\r
973 ffc.removeBuildOptionsFfsAttribute(jTableFfs.getSelectedRow(), jTableFfsAttribs.getSelectedRow());\r
a13899c5 974 }\r
975 }\r
976 });\r
977 }\r
4da2e625 978 return jButtonFfsAttribRemove;\r
a13899c5 979 }\r
980\r
a13899c5 981 /**\r
982 * This method initializes jCheckBox9 \r
983 * \r
984 * @return javax.swing.JCheckBox \r
985 */\r
4da2e625 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
a13899c5 991 }\r
4da2e625 992 return jCheckBoxIA32;\r
a13899c5 993 }\r
994\r
995 /**\r
996 * This method initializes jCheckBox10 \r
997 * \r
998 * @return javax.swing.JCheckBox \r
999 */\r
4da2e625 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
a13899c5 1005 }\r
4da2e625 1006 return jCheckBoxIpf;\r
a13899c5 1007 }\r
1008\r
1009 /**\r
1010 * This method initializes jCheckBox11 \r
1011 * \r
1012 * @return javax.swing.JCheckBox \r
1013 */\r
4da2e625 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
a13899c5 1019 }\r
4da2e625 1020 return jCheckBoxX64;\r
a13899c5 1021 }\r
1022\r
1023 /**\r
1024 * This method initializes jCheckBox12 \r
1025 * \r
1026 * @return javax.swing.JCheckBox \r
1027 */\r
4da2e625 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
a13899c5 1033 }\r
4da2e625 1034 return jCheckBoxEBC;\r
a13899c5 1035 }\r
1036\r
1037 /**\r
1038 * This method initializes jCheckBox13 \r
1039 * \r
1040 * @return javax.swing.JCheckBox \r
1041 */\r
4da2e625 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
a13899c5 1047 }\r
4da2e625 1048 return jCheckBoxARM;\r
a13899c5 1049 }\r
1050\r
1051 /**\r
1052 * This method initializes jCheckBox14 \r
1053 * \r
1054 * @return javax.swing.JCheckBox \r
1055 */\r
4da2e625 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
a13899c5 1061 }\r
4da2e625 1062 return jCheckBoxPPC;\r
a13899c5 1063 }\r
1064\r
1065 /**\r
1066 * This method initializes jTextField12 \r
1067 * \r
1068 * @return javax.swing.JTextField \r
1069 */\r
4da2e625 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
a13899c5 1074 }\r
4da2e625 1075 return jTextFieldBuildTargets;\r
a13899c5 1076 }\r
1077\r
1078 /**\r
1079 * This method initializes jTextField13 \r
1080 * \r
1081 * @return javax.swing.JTextField \r
1082 */\r
4da2e625 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
a13899c5 1087 }\r
4da2e625 1088 return jTextFieldTagName;\r
a13899c5 1089 }\r
1090\r
44053733 1091 /**\r
1092 * This method initializes jScrollPane \r
1093 * \r
1094 * @return javax.swing.JScrollPane \r
1095 */\r
4da2e625 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
44053733 1101 }\r
4da2e625 1102 return jScrollPaneFfs;\r
44053733 1103 }\r
1104\r
1105 /**\r
1106 * This method initializes jTable \r
1107 * \r
1108 * @return javax.swing.JTable \r
1109 */\r
4da2e625 1110 private JTable getJTableFfs() {\r
1111 if (jTableFfs == null) {\r
44053733 1112 ffsTableModel = new DefaultTableModel();\r
1113 ffsTableModel.addColumn("FFS Type");\r
4da2e625 1114 jTableFfs = new JTable(ffsTableModel);\r
1115 jTableFfs.setShowGrid(false);\r
1116 jTableFfs.setRowHeight(20);\r
6cba26e8 1117 \r
4da2e625 1118 jTableFfs.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
1119 jTableFfs.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\r
6cba26e8 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
4da2e625 1140 jTextFieldFfsKey.setText(sArray[0]);\r
1141 jTextFieldEncapType.setText(sArray[1]);\r
6cba26e8 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
4da2e625 1164 jTableFfs.getModel().addTableModelListener(new TableModelListener() {\r
6cba26e8 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
d6d24759 1176 docConsole.setSaved(false);\r
3b405e9b 1177 ffc.updateBuildOptionsFfsKey(row, id);\r
6cba26e8 1178 }\r
1179 }\r
1180 });\r
44053733 1181 }\r
4da2e625 1182 return jTableFfs;\r
44053733 1183 }\r
1184\r
6cba26e8 1185 /**\r
1186 * This method initializes jScrollPane1 \r
1187 * \r
1188 * @return javax.swing.JScrollPane \r
1189 */\r
4da2e625 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
6cba26e8 1195 }\r
4da2e625 1196 return jScrollPaneFfsSection;\r
6cba26e8 1197 }\r
1198\r
1199 /**\r
1200 * This method initializes jTable1 \r
1201 * \r
1202 * @return javax.swing.JTable \r
1203 */\r
4da2e625 1204 private JTable getJTableFfsSection() {\r
1205 if (jTableFfsSection == null) {\r
6cba26e8 1206 sectionTableModel = new DefaultTableModel();\r
1207 sectionTableModel.addColumn("SectionType");\r
1208 \r
4da2e625 1209 jTableFfsSection = new JTable(sectionTableModel);\r
1210 jTableFfsSection.setRowHeight(20);\r
3b405e9b 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
4da2e625 1225 jTableFfsSection.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(cb));\r
3b405e9b 1226 \r
4da2e625 1227 jTableFfsSection.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
3b405e9b 1228 \r
4da2e625 1229 jTableFfsSection.getModel().addTableModelListener(new TableModelListener() {\r
3b405e9b 1230 public void tableChanged(TableModelEvent arg0) {\r
1231 // TODO Auto-generated method stub\r
4da2e625 1232 if (jTableFfs.getSelectedRow() < 0) {\r
3b405e9b 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
d6d24759 1240 docConsole.setSaved(false);\r
4da2e625 1241 ffc.updateBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(), row, type);\r
3b405e9b 1242 }\r
1243 }\r
1244 });\r
6cba26e8 1245 }\r
4da2e625 1246 return jTableFfsSection;\r
6cba26e8 1247 }\r
1248\r
1249 /**\r
1250 * This method initializes jScrollPane3 \r
1251 * \r
1252 * @return javax.swing.JScrollPane \r
1253 */\r
4da2e625 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
6cba26e8 1259 }\r
4da2e625 1260 return jScrollPaneFfsSubSection;\r
6cba26e8 1261 }\r
1262\r
1263 /**\r
1264 * This method initializes jTable3 \r
1265 * \r
1266 * @return javax.swing.JTable \r
1267 */\r
4da2e625 1268 private JTable getJTableFfsSubSection() {\r
1269 if (jTableFfsSubSection == null) {\r
6cba26e8 1270 subsectionsTableModel = new DefaultTableModel();\r
1271 subsectionsTableModel.addColumn("SectionType");\r
4da2e625 1272 jTableFfsSubSection = new JTable(subsectionsTableModel);\r
1273 jTableFfsSubSection.setRowHeight(20);\r
3b405e9b 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
4da2e625 1288 jTableFfsSubSection.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(cb));\r
1289 jTableFfsSubSection.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
3b405e9b 1290 \r
4da2e625 1291 jTableFfsSubSection.getModel().addTableModelListener(new TableModelListener() {\r
3b405e9b 1292 public void tableChanged(TableModelEvent arg0) {\r
1293 // TODO Auto-generated method stub\r
4da2e625 1294 if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0) {\r
3b405e9b 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
d6d24759 1302 docConsole.setSaved(false);\r
4da2e625 1303 ffc.updateBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(), jTableFfsSections.getSelectedRow(), row, type);\r
3b405e9b 1304 }\r
1305 }\r
1306 });\r
6cba26e8 1307 }\r
4da2e625 1308 return jTableFfsSubSection;\r
6cba26e8 1309 }\r
1310\r
1311 /**\r
1312 * This method initializes jTextField \r
1313 * \r
1314 * @return javax.swing.JTextField \r
1315 */\r
4da2e625 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
3b405e9b 1321 public void focusLost(java.awt.event.FocusEvent e) {\r
4da2e625 1322 if (jTableFfs.getSelectedRow() < 0) {\r
3b405e9b 1323 return;\r
1324 }\r
4da2e625 1325 ffc.updateBuildOptionsFfsSectionsType(jTableFfs.getSelectedRow(), jTextFieldEncapType.getText());\r
3b405e9b 1326 }\r
1327 });\r
6cba26e8 1328 }\r
4da2e625 1329 return jTextFieldEncapType;\r
6cba26e8 1330 }\r
1331\r
1332 /**\r
1333 * This method initializes jPanel4 \r
1334 * \r
1335 * @return javax.swing.JPanel \r
1336 */\r
4da2e625 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
6cba26e8 1343 }\r
4da2e625 1344 return jPanelFfsAttribButtonGroup;\r
6cba26e8 1345 }\r
1346\r
1347 /**\r
1348 * This method initializes jButton \r
1349 * \r
1350 * @return javax.swing.JButton \r
1351 */\r
4da2e625 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
3b405e9b 1358 public void actionPerformed(java.awt.event.ActionEvent e) {\r
4da2e625 1359 if (jTableFfs.getSelectedRow() < 0) {\r
3b405e9b 1360 return;\r
1361 }\r
d6d24759 1362 docConsole.setSaved(false);\r
3b405e9b 1363 String[] row = {"EFI_SECTION_RAW"};\r
1364 sectionTableModel.addRow(row);\r
4da2e625 1365 ffc.genBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(), row[0]);\r
3b405e9b 1366 }\r
1367 });\r
6cba26e8 1368 }\r
4da2e625 1369 return jButtonFfsSectionNew;\r
6cba26e8 1370 }\r
1371\r
1372 /**\r
1373 * This method initializes jButton1 \r
1374 * \r
1375 * @return javax.swing.JButton \r
1376 */\r
4da2e625 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
3b405e9b 1382 \r
4da2e625 1383 jButtonFfsSectionRemove.addActionListener(new java.awt.event.ActionListener() {\r
3b405e9b 1384 public void actionPerformed(java.awt.event.ActionEvent e) {\r
4da2e625 1385 if (jTableFfs.getSelectedRow() < 0 || jTableFfsSection.getSelectedRow() < 0) {\r
3b405e9b 1386 return;\r
1387 }\r
d6d24759 1388 docConsole.setSaved(false);\r
4da2e625 1389 sectionTableModel.removeRow(jTableFfsSection.getSelectedRow());\r
1390 ffc.removeBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(), jTableFfsSection.getSelectedRow());\r
3b405e9b 1391 }\r
1392 });\r
6cba26e8 1393 }\r
4da2e625 1394 return jButtonFfsSectionRemove;\r
6cba26e8 1395 }\r
1396\r
1397 /**\r
1398 * This method initializes jButton2 \r
1399 * \r
1400 * @return javax.swing.JButton \r
1401 */\r
4da2e625 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
3b405e9b 1408 public void actionPerformed(java.awt.event.ActionEvent e) {\r
4da2e625 1409 if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0) {\r
3b405e9b 1410 return;\r
1411 }\r
d6d24759 1412 docConsole.setSaved(false);\r
3b405e9b 1413 String[] row = {"EFI_SECTION_RAW"};\r
1414 subsectionsTableModel.addRow(row);\r
4da2e625 1415 ffc.genBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(), jTableFfsSections.getSelectedRow(), row[0]);\r
3b405e9b 1416 \r
1417 }\r
1418 });\r
6cba26e8 1419 }\r
4da2e625 1420 return jButtonFfsSubSectionNew;\r
6cba26e8 1421 }\r
1422\r
1423 /**\r
1424 * This method initializes jButton3 \r
1425 * \r
1426 * @return javax.swing.JButton \r
1427 */\r
4da2e625 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
3b405e9b 1434 public void actionPerformed(java.awt.event.ActionEvent e) {\r
4da2e625 1435 if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0 || jTableFfsSubSection.getSelectedRow() < 0) {\r
3b405e9b 1436 return;\r
1437 }\r
d6d24759 1438 docConsole.setSaved(false);\r
4da2e625 1439 subsectionsTableModel.removeRow(jTableFfsSubSection.getSelectedRow());\r
1440 ffc.removeBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(), jTableFfsSections.getSelectedRow(), jTableFfsSubSection.getSelectedRow());\r
3b405e9b 1441 }\r
1442 });\r
6cba26e8 1443 }\r
4da2e625 1444 return jButtonFfsSubSectionRemove;\r
6cba26e8 1445 }\r
1446\r
1447 /**\r
1448 * This method initializes jButton6 \r
1449 * \r
1450 * @return javax.swing.JButton \r
1451 */\r
4da2e625 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
3b405e9b 1458 public void actionPerformed(java.awt.event.ActionEvent e) {\r
4da2e625 1459 if (jTableFfs.getSelectedRow() < 0) {\r
3b405e9b 1460 return;\r
1461 }\r
d6d24759 1462 docConsole.setSaved(false);\r
3b405e9b 1463 String[] row = {""};\r
1464 sectionsTableModel.addRow(row);\r
4da2e625 1465 ffc.genBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(), "");\r
3b405e9b 1466 }\r
1467 });\r
6cba26e8 1468 }\r
4da2e625 1469 return jButtonFfsSectionsNew;\r
6cba26e8 1470 }\r
1471\r
1472 /**\r
1473 * This method initializes jButton7 \r
1474 * \r
1475 * @return javax.swing.JButton \r
1476 */\r
4da2e625 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
3b405e9b 1483 public void actionPerformed(java.awt.event.ActionEvent e) {\r
4da2e625 1484 if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0) {\r
3b405e9b 1485 return;\r
1486 }\r
d6d24759 1487 docConsole.setSaved(false);\r
4da2e625 1488 sectionsTableModel.removeRow(jTableFfsSections.getSelectedRow());\r
1489 ffc.removeBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(), jTableFfsSections.getSelectedRow());\r
3b405e9b 1490 }\r
1491 });\r
6cba26e8 1492 }\r
4da2e625 1493 return jButtonFfsSectionsRemove;\r
6cba26e8 1494 }\r
1495\r
1496 /**\r
1497 * This method initializes jScrollPane4 \r
1498 * \r
1499 * @return javax.swing.JScrollPane \r
1500 */\r
4da2e625 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
6cba26e8 1506 }\r
4da2e625 1507 return jScrollPaneFfsSections;\r
6cba26e8 1508 }\r
1509\r
1510 /**\r
1511 * This method initializes jTable6 \r
1512 * \r
1513 * @return javax.swing.JTable \r
1514 */\r
4da2e625 1515 private JTable getJTableFfsSections() {\r
1516 if (jTableFfsSections == null) {\r
6cba26e8 1517 sectionsTableModel = new DefaultTableModel();\r
1518 sectionsTableModel.addColumn("EncapsulationType");\r
4da2e625 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
6cba26e8 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
4da2e625 1533 if (jTableFfs.getSelectedRow() < 0) {\r
6cba26e8 1534 return;\r
1535 }\r
1536 subsectionsTableModel.setRowCount(0);\r
1537 ArrayList<String> al = new ArrayList<String>();\r
4da2e625 1538 ffc.getBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(), sectionsRow, al);\r
6cba26e8 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
4da2e625 1547 jTableFfsSections.getModel().addTableModelListener(new TableModelListener() {\r
6cba26e8 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
3b405e9b 1554 String encapType = m.getValueAt(row, 0) + "";\r
d6d24759 1555 docConsole.setSaved(false);\r
4da2e625 1556 ffc.updateBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(), row, encapType);\r
6cba26e8 1557 }\r
1558 }\r
1559 });\r
1560 }\r
4da2e625 1561 return jTableFfsSections;\r
6cba26e8 1562 }\r
1563\r
af25df16 1564 /**\r
1565 * This method initializes jButton12 \r
1566 * \r
1567 * @return javax.swing.JButton \r
1568 */\r
4da2e625 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
af25df16 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
4da2e625 1603 jTextFieldAntTaskFile.setText(headerDest.substring(dirPrefix.length()).replace('\\', '/'));\r
af25df16 1604 \r
1605 }\r
1606\r
1607 });\r
1608 }\r
4da2e625 1609 return jButtonAntTaskFileBrowse;\r
af25df16 1610 }\r
1611\r
1612 /**\r
1613 * This method initializes jTextField1 \r
1614 * \r
1615 * @return javax.swing.JTextField \r
1616 */\r
4da2e625 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
af25df16 1621 }\r
4da2e625 1622 return jTextFieldToolChainFamily;\r
af25df16 1623 }\r
1624\r
c1dbe93d 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
a13899c5 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
d6d24759 1881 \r
1882 public FpdBuildOptions(OpeningPlatformType opt) {\r
1883 this(opt.getXmlFpd());\r
1884 docConsole = opt;\r
1885 }\r
a13899c5 1886\r
1887 private void init(FpdFileContents ffc) {\r
1888 initOptionTable();\r
1889 initAntTaskTable();\r
6cba26e8 1890 initFfsTable();\r
44053733 1891 this.addInternalFrameListener(new InternalFrameAdapter(){\r
1892 public void internalFrameDeactivated(InternalFrameEvent e){\r
4da2e625 1893 if (jTableFfs.isEditing()) {\r
1894 jTableFfs.getCellEditor().stopCellEditing();\r
44053733 1895 }\r
4da2e625 1896 if (jTableFfsSection.isEditing()) {\r
1897 jTableFfsSection.getCellEditor().stopCellEditing();\r
6cba26e8 1898 }\r
4da2e625 1899 if (jTableAntTasks.isEditing()) {\r
1900 jTableAntTasks.getCellEditor().stopCellEditing();\r
44053733 1901 }\r
4da2e625 1902 if (jTableFfsSubSection.isEditing()) {\r
1903 jTableFfsSubSection.getCellEditor().stopCellEditing();\r
6cba26e8 1904 }\r
4da2e625 1905 if (jTableFfsAttribs.isEditing()) {\r
1906 jTableFfsAttribs.getCellEditor().stopCellEditing();\r
44053733 1907 }\r
4da2e625 1908 if (jTableOptions.isEditing()) {\r
1909 jTableOptions.getCellEditor().stopCellEditing();\r
44053733 1910 }\r
1911 }\r
1912 });\r
a13899c5 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
6cba26e8 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
a13899c5 1949 /**\r
1950 * This method initializes this\r
1951 * \r
1952 * @return void\r
1953 */\r
1954 private void initialize() {\r
6cba26e8 1955 this.setSize(722, 577);\r
a13899c5 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
4da2e625 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
a13899c5 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