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