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