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