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 / FpdFlash.java
1 /** @file
2 Java class FpdFlash is GUI for Flash element operation in SPD file.
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 **/
13 package org.tianocore.frameworkwizard.platform.ui;
14
15 import java.awt.BorderLayout;
16 import javax.swing.JPanel;
17
18 import javax.swing.AbstractAction;
19 import javax.swing.DefaultCellEditor;
20 import javax.swing.JFileChooser;
21 import javax.swing.JFrame;
22 import javax.swing.JOptionPane;
23 import javax.swing.JTabbedPane;
24 import javax.swing.JButton;
25 import javax.swing.ListSelectionModel;
26
27 import org.tianocore.PlatformSurfaceAreaDocument;
28 import org.tianocore.frameworkwizard.common.DataValidation;
29 import org.tianocore.frameworkwizard.common.GlobalData;
30 import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
31 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
32 import org.tianocore.frameworkwizard.common.ui.StarLabel;
33 import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
34 import org.tianocore.frameworkwizard.platform.ui.FpdFrameworkModules;
35 import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;
36
37 import java.awt.FlowLayout;
38 import java.awt.event.ActionEvent;
39 import java.awt.event.ComponentAdapter;
40 import java.awt.event.ComponentEvent;
41 import java.awt.event.ItemEvent;
42 import java.awt.event.ItemListener;
43 import java.io.BufferedReader;
44 import java.io.File;
45 import java.io.FileReader;
46 import java.util.ArrayList;
47 import java.util.HashMap;
48 import java.util.Iterator;
49 import java.util.LinkedHashMap;
50 import java.util.Map;
51 import java.util.Set;
52 import java.util.Vector;
53
54 import javax.swing.JCheckBox;
55 import javax.swing.JTextField;
56 import java.awt.GridLayout;
57 import javax.swing.JLabel;
58 import javax.swing.JScrollPane;
59 import javax.swing.JTable;
60 import javax.swing.event.InternalFrameAdapter;
61 import javax.swing.event.InternalFrameEvent;
62 import javax.swing.event.ListSelectionEvent;
63 import javax.swing.event.ListSelectionListener;
64 import javax.swing.event.TableModelEvent;
65 import javax.swing.event.TableModelListener;
66 import javax.swing.table.DefaultTableModel;
67 import javax.swing.table.TableColumn;
68 import javax.swing.table.TableModel;
69 import javax.swing.JComboBox;
70 import java.awt.Dimension;
71 import javax.swing.JSplitPane;
72
73 public class FpdFlash extends IInternalFrame {
74
75 /**
76 *
77 */
78 private static final long serialVersionUID = 1L;
79 private final int startIndexOfDynamicTab = 2;
80 static JFrame frame;
81 private JPanel jContentPane = null;
82 private JPanel jPanelContentEast = null;
83 private JPanel jPanelContentSouth = null;
84 private JPanel jPanelContentWest = null;
85 private JPanel jPanelContentNorth = null;
86 private JTabbedPane jTabbedPane = null;
87 private JPanel jPanelFvImages = null;
88 private JPanel jPanelFvImageN = null;
89 private JPanel jPanelFvImageS = null;
90 private JCheckBox jCheckBoxFvProperty = null;
91 private JLabel jLabelFvPropName = null;
92 private JTextField jTextFieldFvPropName = null;
93 private JLabel jLabelFvPropValue = null;
94 private JTextField jTextFieldFvPropValue = null;
95 private JButton jButtonFvPropAdd = null;
96 private JScrollPane jScrollPaneFvProp = null;
97 private JTable jTableFvProp = null;
98 private JPanel jPanelFvPropButtonGroup = null;
99 private JButton jButtonFvPropDel = null;
100 private DefaultTableModel fvPropertyTableModel = null;
101 private DefaultTableModel fvImageNameTableModel = null;
102 private ImageParaTableModel fvImageParaTableModel = null;
103 private DefaultTableModel fvOptionTableModel = null;
104 private JPanel jPanelFvImageC = null;
105 private JCheckBox jCheckBoxFvImagePara = null;
106 private JLabel jLabelFvParaType = null;
107 private JComboBox jComboBoxFvParaType = null;
108 private JLabel jLabelFvImageNames = null;
109 private JLabel jLabelFvParaName = null;
110 private JTextField jTextFieldFvParaName = null;
111 private JButton jButtonFvParaAdd = null;
112 private JScrollPane jScrollPaneFvImageNames = null;
113 private JTable jTableFvImageNames = null;
114 private JButton jButtonFvParaDel = null;
115 private JPanel jPanelFvImageOpts = null;
116 private JButton jButtonAddFvImage = null;
117 private JScrollPane jScrollPaneFvInfo = null;
118 private JTable jTableFvInfo = null;
119 private JButton jButtonDelFvImage = null;
120 private JCheckBox jCheckBoxFvImageOpts = null;
121 private JPanel jPanelFvImagePara = null;
122 private OpeningPlatformType docConsole = null;
123 private FpdFileContents ffc = null;
124 private JPanel jPanelFdf = null;
125 private JCheckBox jCheckBoxFdf = null;
126 private JTextField jTextFieldFdf = null;
127 private JButton jButtonFdfBrowse = null;
128 private JLabel jLabelFvImageOptName = null;
129 private JTextField jTextFieldFvImageOptName = null;
130 private JLabel jLabelFvImageOptValue = null;
131 private JTextField jTextFieldFvImageOptValue = null;
132 private JPanel jPanelFvImageOptsButtonGroup = null;
133 private JButton jButtonFvImageOptAdd = null;
134 private JButton jButtonFvImageOptDel = null;
135 private JScrollPane jScrollPane = null;
136 private JTable jTableFvImageOpts = null;
137 private JButton jButtonUpdateFvImage = null;
138 private JPanel jPanelFdfN = null;
139 private JPanel jPanelFdfS = null;
140 private JSplitPane jSplitPaneFdfC = null;
141 private JPanel jPanelFdfCTop = null;
142 private JPanel jPanelFdfCBottom = null;
143 private JPanel jPanelFdfCTopN = null;
144 private JPanel jPanelFdfCTopS = null;
145 private JPanel jPanelFdfCTopC = null;
146 private JPanel jPanelFdfCBottomN = null;
147 private JPanel jPanelFdfCBottomC = null;
148 private JLabel jLabelFvInFdf = null;
149 private JLabel jLabelFvAdditional = null;
150 private JScrollPane jScrollPaneFvInFdf = null;
151 private JTable jTableFvInFdf = null;
152 private NonEditableTableModel fvInFdfTableModel = null; // @jve:decl-index=0:visual-constraint=""
153 private JButton jButtonFvInFdfOptions = null;
154 private JScrollPane jScrollPaneFvAdditional = null;
155 private JTable jTableFvAdditional = null;
156 private DefaultTableModel fvAdditionalTableModel = null; // @jve:decl-index=0:visual-constraint=""
157 private JButton jButtonAddFv = null;
158 private JButton jButtonDelFv = null;
159 private JButton jButtonAddFvOptions = null;
160 private int tabIndexForFv = -1;
161 private int selectedRowInFvAdditionalTable = -1;
162 private String oldFvName = null;
163 private Vector<String> vBlockSize = new Vector<String>();
164 private String erasePolarity = null;
165 boolean memModified = false;
166
167
168 public FpdFlash() {
169 super();
170 // TODO Auto-generated constructor stub
171
172 initialize();
173 this.setBounds(new java.awt.Rectangle(0, 0, 500, 370));
174 this.setVisible(true);
175 }
176
177 public FpdFlash(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd){
178 this();
179 ffc = new FpdFileContents(fpd);
180 init(ffc);
181 }
182
183 public FpdFlash(OpeningPlatformType opt) {
184 this(opt.getXmlFpd());
185 docConsole = opt;
186 }
187
188 /**
189 * This method initializes jPanel
190 *
191 * @return javax.swing.JPanel
192 */
193 private JPanel getJPanelContentEast() {
194 if (jPanelContentEast == null) {
195 jPanelContentEast = new JPanel();
196 }
197 return jPanelContentEast;
198 }
199
200 /**
201 * This method initializes jPanel1
202 *
203 * @return javax.swing.JPanel
204 */
205 private JPanel getJPanelContentSouth() {
206 if (jPanelContentSouth == null) {
207 FlowLayout flowLayout = new FlowLayout();
208 flowLayout.setAlignment(java.awt.FlowLayout.RIGHT);
209 flowLayout.setHgap(15);
210 jPanelContentSouth = new JPanel();
211 jPanelContentSouth.setLayout(flowLayout);
212 jPanelContentSouth.setComponentOrientation(java.awt.ComponentOrientation.LEFT_TO_RIGHT);
213 }
214 return jPanelContentSouth;
215 }
216
217 /**
218 * This method initializes jPanel2
219 *
220 * @return javax.swing.JPanel
221 */
222 private JPanel getJPanelContentWest() {
223 if (jPanelContentWest == null) {
224 jPanelContentWest = new JPanel();
225 }
226 return jPanelContentWest;
227 }
228
229 /**
230 * This method initializes jPanel3
231 *
232 * @return javax.swing.JPanel
233 */
234 private JPanel getJPanelContentNorth() {
235 if (jPanelContentNorth == null) {
236 jPanelContentNorth = new JPanel();
237 }
238 return jPanelContentNorth;
239 }
240
241 /**
242 * This method initializes jTabbedPane
243 *
244 * @return javax.swing.JTabbedPane
245 */
246 private JTabbedPane getJTabbedPane() {
247 if (jTabbedPane == null) {
248 jTabbedPane = new JTabbedPane();
249 jTabbedPane.addTab("General", null, getJPanelFdf(), null);
250 jTabbedPane.addTab("Advanced", null, getJPanelFvImages(), null);
251
252 }
253 return jTabbedPane;
254 }
255
256 /**
257 * This method initializes jPanelFvImages
258 *
259 * @return javax.swing.JPanel
260 */
261 private JPanel getJPanelFvImages() {
262 if (jPanelFvImages == null) {
263 jPanelFvImages = new JPanel();
264 jPanelFvImages.setLayout(new BorderLayout());
265 jPanelFvImages.add(getJPanelFvImageN(), java.awt.BorderLayout.NORTH);
266 // jPanelFvImages.add(getJPanelFvImageW(), java.awt.BorderLayout.WEST);
267 jPanelFvImages.add(getJPanelFvImageS(), java.awt.BorderLayout.SOUTH);
268 jPanelFvImages.add(getJPanelFvImageC(), java.awt.BorderLayout.CENTER);
269 jPanelFvImages.addComponentListener(new java.awt.event.ComponentAdapter() {
270 public void componentShown(java.awt.event.ComponentEvent e) {
271 fvImageParaTableModel.setRowCount(0);
272 fvPropertyTableModel.setRowCount(0);
273
274 if (ffc.getFvImagesFvImageCount("Attributes") == 0) {
275 return;
276 }
277 String[][] saa = new String[ffc.getFvImagesFvImageCount("Attributes")][2];
278 ffc.getFvImagesFvImages(saa, "Attributes");
279
280 int i = 0;
281 while (i < saa.length) {
282 fvImageParaTableModel.addRow(saa[i]);
283 ++i;
284 }
285
286 saa = new String[ffc.getFvImagesNameValueCount()][2];
287 ffc.getFvImagesNameValues(saa);
288 for (int m = 0; m < saa.length; ++m) {
289 fvPropertyTableModel.addRow(saa[m]);
290 }
291 }
292 });
293
294 }
295 return jPanelFvImages;
296 }
297
298 /**
299 * This method initializes jPanelFvImageN
300 *
301 * @return javax.swing.JPanel
302 */
303 private JPanel getJPanelFvImageN() {
304 if (jPanelFvImageN == null) {
305 jLabelFvPropValue = new JLabel();
306 jLabelFvPropValue.setText("Value");
307 jLabelFvPropValue.setEnabled(false);
308 jLabelFvPropValue.setPreferredSize(new java.awt.Dimension(38,20));
309 jLabelFvPropName = new JLabel();
310 jLabelFvPropName.setText("Name");
311 jLabelFvPropName.setEnabled(false);
312 jLabelFvPropName.setPreferredSize(new java.awt.Dimension(38,20));
313 FlowLayout flowLayout2 = new FlowLayout();
314 flowLayout2.setAlignment(java.awt.FlowLayout.LEFT);
315 flowLayout2.setHgap(15);
316 jPanelFvImageN = new JPanel();
317 jPanelFvImageN.setPreferredSize(new java.awt.Dimension(576,100));
318 jPanelFvImageN.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
319 jPanelFvImageN.setLayout(flowLayout2);
320 jPanelFvImageN.add(getJCheckBoxFvProperty(), null);
321 jPanelFvImageN.add(jLabelFvPropName, null);
322 jPanelFvImageN.add(getJTextFieldFvPropName(), null);
323 jPanelFvImageN.add(jLabelFvPropValue, null);
324 jPanelFvImageN.add(getJTextFieldFvPropValue(), null);
325 jPanelFvImageN.add(getJScrollPaneFvProp(), null);
326 jPanelFvImageN.add(getJPanelFvPropButtonGroup(), null);
327 }
328 return jPanelFvImageN;
329 }
330
331 /**
332 * This method initializes jPanelFvImageS
333 *
334 * @return javax.swing.JPanel
335 */
336 private JPanel getJPanelFvImageS() {
337 if (jPanelFvImageS == null) {
338 GridLayout gridLayout2 = new GridLayout();
339 gridLayout2.setRows(1);
340 jPanelFvImageS = new JPanel();
341 jPanelFvImageS.setPreferredSize(new java.awt.Dimension(480,190));
342 jPanelFvImageS.setLayout(gridLayout2);
343 jPanelFvImageS.add(getJScrollPaneFvInfo(), null);
344 }
345 return jPanelFvImageS;
346 }
347
348
349 /**
350 * This method initializes jCheckBox1
351 *
352 * @return javax.swing.JCheckBox
353 */
354 private JCheckBox getJCheckBoxFvProperty() {
355 if (jCheckBoxFvProperty == null) {
356 jCheckBoxFvProperty = new JCheckBox();
357 jCheckBoxFvProperty.setText("Global FV Variables");
358 jCheckBoxFvProperty.addItemListener(new ItemListener(){
359
360 public void itemStateChanged(ItemEvent arg0) {
361 // TODO Auto-generated method stub
362 boolean seleted = jCheckBoxFvProperty.isSelected();
363
364 jLabelFvPropName.setEnabled(seleted);
365 jTextFieldFvPropName.setEnabled(seleted);
366 jLabelFvPropValue.setEnabled(seleted);
367 jTextFieldFvPropValue.setEnabled(seleted);
368 jTableFvProp.setEnabled(seleted);
369 jButtonFvPropAdd.setEnabled(seleted);
370 jButtonFvPropDel.setEnabled(seleted);
371
372
373 }
374
375 });
376 }
377 return jCheckBoxFvProperty;
378 }
379
380
381 /**
382 * This method initializes jTextField
383 *
384 * @return javax.swing.JTextField
385 */
386 private JTextField getJTextFieldFvPropName() {
387 if (jTextFieldFvPropName == null) {
388 jTextFieldFvPropName = new JTextField();
389 jTextFieldFvPropName.setPreferredSize(new java.awt.Dimension(100,20));
390 jTextFieldFvPropName.setEnabled(false);
391 }
392 return jTextFieldFvPropName;
393 }
394
395
396 /**
397 * This method initializes jTextField1
398 *
399 * @return javax.swing.JTextField
400 */
401 private JTextField getJTextFieldFvPropValue() {
402 if (jTextFieldFvPropValue == null) {
403 jTextFieldFvPropValue = new JTextField();
404 jTextFieldFvPropValue.setPreferredSize(new java.awt.Dimension(100,20));
405 jTextFieldFvPropValue.setEnabled(false);
406 }
407 return jTextFieldFvPropValue;
408 }
409
410
411 /**
412 * This method initializes jButton
413 *
414 * @return javax.swing.JButton
415 */
416 private JButton getJButtonFvPropAdd() {
417 if (jButtonFvPropAdd == null) {
418 jButtonFvPropAdd = new JButton();
419 jButtonFvPropAdd.setPreferredSize(new java.awt.Dimension(80,20));
420 jButtonFvPropAdd.setEnabled(false);
421 jButtonFvPropAdd.setText("Add");
422 jButtonFvPropAdd.addActionListener(new AbstractAction() {
423 /**
424 *
425 */
426 private static final long serialVersionUID = 1L;
427
428 public void actionPerformed(ActionEvent e) {
429 if (jTextFieldFvPropName.getText().length() > 0 && jTextFieldFvPropValue.getText().length() > 0){
430 String[] row = {jTextFieldFvPropName.getText(), jTextFieldFvPropValue.getText()};
431 fvPropertyTableModel.addRow(row);
432 docConsole.setSaved(false);
433 ffc.genFvImagesNameValue(row[0], row[1]);
434 }
435 }
436 });
437 }
438 return jButtonFvPropAdd;
439 }
440
441
442 /**
443 * This method initializes jScrollPane1
444 *
445 * @return javax.swing.JScrollPane
446 */
447 private JScrollPane getJScrollPaneFvProp() {
448 if (jScrollPaneFvProp == null) {
449 jScrollPaneFvProp = new JScrollPane();
450 jScrollPaneFvProp.setPreferredSize(new java.awt.Dimension(350,55));
451 jScrollPaneFvProp.setViewportView(getJTableFvProp());
452 }
453 return jScrollPaneFvProp;
454 }
455
456
457 /**
458 * This method initializes jTable
459 *
460 * @return javax.swing.JTable
461 */
462 private JTable getJTableFvProp() {
463 if (jTableFvProp == null) {
464 fvPropertyTableModel = new DefaultTableModel();
465 jTableFvProp = new JTable(fvPropertyTableModel);
466 fvPropertyTableModel.addColumn("Name");
467 fvPropertyTableModel.addColumn("Value");
468 jTableFvProp.setRowHeight(20);
469 jTableFvProp.setEnabled(false);
470
471 jTableFvProp.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
472 jTableFvProp.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
473 public void valueChanged(ListSelectionEvent e) {
474 if (e.getValueIsAdjusting()){
475 return;
476 }
477 ListSelectionModel lsm = (ListSelectionModel)e.getSource();
478 if (lsm.isSelectionEmpty()) {
479 return;
480 }
481 else{
482 // selectedRow = lsm.getMinSelectionIndex();
483 }
484 }
485 });
486
487 jTableFvProp.getModel().addTableModelListener(new TableModelListener(){
488 public void tableChanged(TableModelEvent arg0) {
489 // TODO Auto-generated method stub
490 int row = arg0.getFirstRow();
491 TableModel m = (TableModel)arg0.getSource();
492 if (arg0.getType() == TableModelEvent.UPDATE){
493
494 String name = m.getValueAt(row, 0) + "";
495 String value = m.getValueAt(row, 1) + "";
496 docConsole.setSaved(false);
497 ffc.updateFvImagesNameValue(row, name, value);
498 }
499 }
500 });
501 }
502 return jTableFvProp;
503 }
504
505
506 /**
507 * This method initializes jPanel4
508 *
509 * @return javax.swing.JPanel
510 */
511 private JPanel getJPanelFvPropButtonGroup() {
512 if (jPanelFvPropButtonGroup == null) {
513 jPanelFvPropButtonGroup = new JPanel();
514 jPanelFvPropButtonGroup.setPreferredSize(new java.awt.Dimension(80,55));
515
516 jPanelFvPropButtonGroup.add(getJButtonFvPropAdd(), null);
517 jPanelFvPropButtonGroup.add(getJButtonFvPropDel(), null);
518 }
519 return jPanelFvPropButtonGroup;
520 }
521
522
523 /**
524 * This method initializes jButton1
525 *
526 * @return javax.swing.JButton
527 */
528 private JButton getJButtonFvPropDel() {
529 if (jButtonFvPropDel == null) {
530 jButtonFvPropDel = new JButton();
531 jButtonFvPropDel.setPreferredSize(new java.awt.Dimension(80,20));
532 jButtonFvPropDel.setEnabled(false);
533 jButtonFvPropDel.setText("Delete");
534 jButtonFvPropDel.addActionListener(new AbstractAction() {
535 /**
536 *
537 */
538 private static final long serialVersionUID = 1L;
539
540 public void actionPerformed(ActionEvent e) {
541 if (jTableFvProp.getSelectedRow() >= 0){
542 fvPropertyTableModel.removeRow(jTableFvProp.getSelectedRow());
543 docConsole.setSaved(false);
544 ffc.removeFvImagesNameValue(jTableFvProp.getSelectedRow());
545 }
546 }
547 });
548 }
549 return jButtonFvPropDel;
550 }
551
552
553 /**
554 * This method initializes jPanelFvImageC
555 *
556 * @return javax.swing.JPanel
557 */
558 private JPanel getJPanelFvImageC() {
559 if (jPanelFvImageC == null) {
560 jLabelFvParaName = new JLabel();
561 jLabelFvParaName.setPreferredSize(new Dimension(38, 20));
562 jLabelFvParaName.setEnabled(false);
563 jLabelFvParaName.setText("Name");
564 jLabelFvImageNames = new JLabel();
565 jLabelFvImageNames.setText("FV Image Names");
566 jLabelFvImageNames.setEnabled(false);
567 jLabelFvImageNames.setPreferredSize(new java.awt.Dimension(150,20));
568 jLabelFvParaType = new JLabel();
569 jLabelFvParaType.setText("Type");
570 jLabelFvParaType.setEnabled(false);
571 jLabelFvParaType.setPreferredSize(new java.awt.Dimension(70,20));
572 FlowLayout flowLayout3 = new FlowLayout();
573 flowLayout3.setAlignment(java.awt.FlowLayout.LEFT);
574 flowLayout3.setHgap(5);
575 jPanelFvImageC = new JPanel();
576 jPanelFvImageC.setLayout(flowLayout3);
577 jPanelFvImageC.add(getJPanelFvImagePara(), null);
578
579 jPanelFvImageC.add(getJPanelFvImageOpts(), null);
580
581 }
582 return jPanelFvImageC;
583 }
584
585
586 /**
587 * This method initializes jCheckBox2
588 *
589 * @return javax.swing.JCheckBox
590 */
591 private JCheckBox getJCheckBoxFvImagePara() {
592 if (jCheckBoxFvImagePara == null) {
593 jCheckBoxFvImagePara = new JCheckBox();
594 jCheckBoxFvImagePara.setText("FV Image Parameters");
595 jCheckBoxFvImagePara.setPreferredSize(new java.awt.Dimension(200,20));
596 jCheckBoxFvImagePara.addItemListener(new ItemListener(){
597
598 public void itemStateChanged(ItemEvent arg0) {
599 // TODO Auto-generated method stub
600 boolean seleted = jCheckBoxFvImagePara.isSelected();
601
602 jLabelFvParaType.setEnabled(seleted);
603 jLabelFvImageNames.setEnabled(seleted);
604 jLabelFvParaName.setEnabled(seleted);
605 jComboBoxFvParaType.setEnabled(seleted);
606 jTextFieldFvParaName.setEnabled(seleted);
607
608 jTableFvImageNames.setEnabled(seleted);
609 jButtonFvParaAdd.setEnabled(seleted);
610 jButtonFvParaDel.setEnabled(seleted);
611
612
613 }
614
615 });
616 }
617 return jCheckBoxFvImagePara;
618 }
619
620
621 /**
622 * This method initializes jComboBox
623 *
624 * @return javax.swing.JComboBox
625 */
626 private JComboBox getJComboBoxFvParaType() {
627 if (jComboBoxFvParaType == null) {
628 jComboBoxFvParaType = new JComboBox();
629 // jComboBoxFvParaType.addItem("ImageName");
630 jComboBoxFvParaType.addItem("Attributes");
631 jComboBoxFvParaType.addItem("Options");
632 // jComboBoxFvParaType.addItem("Components");
633 jComboBoxFvParaType.setPreferredSize(new java.awt.Dimension(180,20));
634 jComboBoxFvParaType.setEnabled(false);
635 jComboBoxFvParaType.addItemListener(new ItemListener() {
636
637 public void itemStateChanged(ItemEvent arg0) {
638 // TODO disable attribute settings when ValidImageNames selected.
639
640 }
641
642 });
643 }
644 return jComboBoxFvParaType;
645 }
646
647
648 /**
649 * This method initializes jTextField2
650 *
651 * @return javax.swing.JTextField
652 */
653 private JTextField getJTextFieldFvParaName() {
654 if (jTextFieldFvParaName == null) {
655 jTextFieldFvParaName = new JTextField();
656 jTextFieldFvParaName.setPreferredSize(new java.awt.Dimension(140,20));
657 jTextFieldFvParaName.setEnabled(false);
658 }
659 return jTextFieldFvParaName;
660 }
661
662
663 /**
664 * This method initializes jButton2
665 *
666 * @return javax.swing.JButton
667 */
668 private JButton getJButtonFvParaAdd() {
669 if (jButtonFvParaAdd == null) {
670 jButtonFvParaAdd = new JButton();
671 jButtonFvParaAdd.setPreferredSize(new Dimension(80, 20));
672 jButtonFvParaAdd.setEnabled(false);
673 jButtonFvParaAdd.setText("Add");
674 jButtonFvParaAdd.addActionListener(new AbstractAction() {
675 /**
676 *
677 */
678 private static final long serialVersionUID = 1L;
679
680 public void actionPerformed(java.awt.event.ActionEvent e) {
681 if (jTextFieldFvParaName.getText().length() > 0){
682 String[] row = {jTextFieldFvParaName.getText()};
683 fvImageNameTableModel.addRow(row);
684 }
685 }
686 });
687 }
688 return jButtonFvParaAdd;
689 }
690
691
692 /**
693 * This method initializes jScrollPane2
694 *
695 * @return javax.swing.JScrollPane
696 */
697 private JScrollPane getJScrollPaneFvImageNames() {
698 if (jScrollPaneFvImageNames == null) {
699 jScrollPaneFvImageNames = new JScrollPane();
700 jScrollPaneFvImageNames.setPreferredSize(new java.awt.Dimension(350,50));
701 jScrollPaneFvImageNames.setViewportView(getJTableFvImageNames());
702 }
703 return jScrollPaneFvImageNames;
704 }
705
706
707 /**
708 * This method initializes jTable1
709 *
710 * @return javax.swing.JTable
711 */
712 private JTable getJTableFvImageNames() {
713 if (jTableFvImageNames == null) {
714 fvImageNameTableModel = new DefaultTableModel();
715 jTableFvImageNames = new JTable(fvImageNameTableModel);
716 jTableFvImageNames.setEnabled(false);
717 fvImageNameTableModel.addColumn("FV Image Name");
718 }
719 return jTableFvImageNames;
720 }
721
722
723 /**
724 * This method initializes jButton3
725 *
726 * @return javax.swing.JButton
727 */
728 private JButton getJButtonFvParaDel() {
729 if (jButtonFvParaDel == null) {
730 jButtonFvParaDel = new JButton();
731 jButtonFvParaDel.setPreferredSize(new Dimension(80, 20));
732 jButtonFvParaDel.setEnabled(false);
733 jButtonFvParaDel.setText("Delete");
734 jButtonFvParaDel.addActionListener(new AbstractAction() {
735 /**
736 *
737 */
738 private static final long serialVersionUID = 1L;
739
740 public void actionPerformed(java.awt.event.ActionEvent e) {
741 if (jTableFvImageNames.getSelectedRow() >= 0){
742
743 fvImageNameTableModel.removeRow(jTableFvImageNames.getSelectedRow());
744 }
745 }
746 });
747 }
748 return jButtonFvParaDel;
749 }
750
751
752
753
754 private JPanel getJPanelFvImageOpts() {
755
756
757 if (jPanelFvImageOpts == null) {
758 //ToDo add ButtonGroup for RadioButtons
759 jLabelFvImageOptValue = new JLabel();
760 jLabelFvImageOptValue.setEnabled(true);
761 jLabelFvImageOptValue.setText("Value");
762 jLabelFvImageOptValue.setPreferredSize(new Dimension(38, 20));
763 jLabelFvImageOptName = new JLabel();
764 jLabelFvImageOptName.setEnabled(true);
765 jLabelFvImageOptName.setText("Name");
766 jLabelFvImageOptName.setPreferredSize(new Dimension(38, 20));
767 jPanelFvImageOpts = new JPanel();
768 jPanelFvImageOpts.setPreferredSize(new java.awt.Dimension(480,150));
769
770 jPanelFvImageOpts.setLayout(new FlowLayout());
771
772 jPanelFvImageOpts.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.LOWERED));
773 jPanelFvImageOpts.add(getJCheckBoxFvImageOpts(), null);
774 jPanelFvImageOpts.add(jLabelFvImageOptName, null);
775 jPanelFvImageOpts.add(getJTextFieldFvImageOptName(), null);
776 jPanelFvImageOpts.add(jLabelFvImageOptValue, null);
777 jPanelFvImageOpts.add(getJTextFieldFvImageOptValue(), null);
778 jPanelFvImageOpts.add(getJScrollPane(), null);
779 jPanelFvImageOpts.add(getJPanelFvImageOptsButtonGroup(), null);
780 jPanelFvImageOpts.add(getJButtonAddFvImage(), null);
781 jPanelFvImageOpts.add(getJButtonDelFvImage(), null);
782 jPanelFvImageOpts.add(getJButtonUpdateFvImage(), null);
783
784
785
786
787
788 }
789 return jPanelFvImageOpts;
790 }
791
792
793 /**
794 * This method initializes jButton4
795 *
796 * @return javax.swing.JButton
797 */
798 private JButton getJButtonAddFvImage() {
799 if (jButtonAddFvImage == null) {
800 jButtonAddFvImage = new JButton();
801 jButtonAddFvImage.setPreferredSize(new java.awt.Dimension(120,20));
802 // jButton4.setEnabled(false);
803 jButtonAddFvImage.setText("Add FV Image");
804 jButtonAddFvImage.addActionListener(new AbstractAction() {
805 /**
806 *
807 */
808 private static final long serialVersionUID = 1L;
809
810 public void actionPerformed(java.awt.event.ActionEvent e) {
811 if (jTableFvInfo.isEditing()) {
812 jTableFvInfo.getCellEditor().stopCellEditing();
813 }
814 if (jTableFvImageOpts.isEditing()) {
815 jTableFvImageOpts.getCellEditor().stopCellEditing();
816 }
817 if (jTableFvImageNames.getRowCount()== 0){
818 return;
819 }
820 String imageName = " ";
821 for (int i = 0; i < jTableFvImageNames.getRowCount(); ++i){
822 imageName += (String)jTableFvImageNames.getValueAt(i, 0);
823 imageName += " ";
824 }
825 imageName = imageName.trim();
826
827 if (!jCheckBoxFvImageOpts.isSelected() && jComboBoxFvParaType.getSelectedIndex() != 0){
828 return;
829
830 }
831
832 LinkedHashMap<String, String> m = null;
833 if (jCheckBoxFvImageOpts.isSelected()) {
834 m = new LinkedHashMap<String, String>();
835 getOptionNameValue(m);
836 }
837 ffc.genFvImagesFvImage(imageName.split(" "), jComboBoxFvParaType.getSelectedItem()+"", m);
838 docConsole.setSaved(false);
839 Object[] row = {imageName, jComboBoxFvParaType.getSelectedItem()};
840 fvImageParaTableModel.addRow(row);
841 }
842 });
843 }
844 return jButtonAddFvImage;
845 }
846
847
848 /**
849 * This method initializes jScrollPane3
850 *
851 * @return javax.swing.JScrollPane
852 */
853 private JScrollPane getJScrollPaneFvInfo() {
854 if (jScrollPaneFvInfo == null) {
855 jScrollPaneFvInfo = new JScrollPane();
856 jScrollPaneFvInfo.setPreferredSize(new java.awt.Dimension(480,150));
857 jScrollPaneFvInfo.setViewportView(getJTableFvInfo());
858 }
859 return jScrollPaneFvInfo;
860 }
861
862
863 /**
864 * This method initializes jTable2
865 *
866 * @return javax.swing.JTable
867 */
868 private JTable getJTableFvInfo() {
869 if (jTableFvInfo == null) {
870 fvImageParaTableModel = new ImageParaTableModel();
871 jTableFvInfo = new JTable(fvImageParaTableModel);
872 fvImageParaTableModel.addColumn("FvImageNames");
873 fvImageParaTableModel.addColumn("Type");
874
875
876 // TableColumn typeCol = jTableFvInfo.getColumnModel().getColumn(1);
877 // JComboBox cb = new JComboBox();
878 // cb.addItem("ImageName");
879 // cb.addItem("Attributes");
880 // cb.addItem("Options");
881 // cb.addItem("Components");
882 // typeCol.setCellEditor(new DefaultCellEditor(cb));
883
884 jTableFvInfo.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
885 jTableFvInfo.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
886 public void valueChanged(ListSelectionEvent e) {
887 if (e.getValueIsAdjusting()){
888 return;
889 }
890 ListSelectionModel lsm = (ListSelectionModel)e.getSource();
891 if (lsm.isSelectionEmpty()) {
892 return;
893 }
894 else{
895 int selectedRow = lsm.getMinSelectionIndex();
896 if (fvImageParaTableModel.getValueAt(selectedRow, 1).equals("ImageName")) {
897 String[] fvNames = fvImageParaTableModel.getValueAt(selectedRow, 0).toString().split(" ");
898 for (int i = 0; i < fvNames.length; ++i) {
899 String[] row = {fvNames[i]};
900 fvImageNameTableModel.addRow(row);
901 }
902 return;
903 }
904 LinkedHashMap<String, String> optionMap = new LinkedHashMap<String, String>();
905 ffc.getFvImagesFvImageOptions(selectedRow, optionMap);
906 if (optionMap.size() > 0){
907 fvOptionTableModel.setRowCount(0);
908 Set<String> key = optionMap.keySet();
909 Iterator<String> i = key.iterator();
910 while (i.hasNext()) {
911
912 String k = (String)i.next();
913 String[] row = {k, optionMap.get(k)};
914
915 fvOptionTableModel.addRow(row);
916 }
917 }
918
919 }
920 }
921 });
922
923
924 }
925 return jTableFvInfo;
926 }
927
928
929 /**
930 * This method initializes jButton6
931 *
932 * @return javax.swing.JButton
933 */
934 private JButton getJButtonDelFvImage() {
935 if (jButtonDelFvImage == null) {
936 jButtonDelFvImage = new JButton();
937 jButtonDelFvImage.setPreferredSize(new java.awt.Dimension(120,20));
938 jButtonDelFvImage.setEnabled(false);
939 jButtonDelFvImage.setText("Delete Row");
940 jButtonDelFvImage.addActionListener(new AbstractAction() {
941 /**
942 *
943 */
944 private static final long serialVersionUID = 1L;
945
946 public void actionPerformed(ActionEvent arg0) {
947 // TODO Auto-generated method stub
948 if (jTableFvInfo.getSelectedRow() >= 0 ) {
949 ffc.removeFvImagesFvImage(jTableFvInfo.getSelectedRow());
950 fvImageParaTableModel.removeRow(jTableFvInfo.getSelectedRow());
951 docConsole.setSaved(false);
952 }
953 }
954
955 });
956 }
957 return jButtonDelFvImage;
958 }
959
960
961 /**
962 * This method initializes jCheckBox3
963 *
964 * @return javax.swing.JCheckBox
965 */
966 private JCheckBox getJCheckBoxFvImageOpts() {
967 if (jCheckBoxFvImageOpts == null) {
968 jCheckBoxFvImageOpts = new JCheckBox();
969 jCheckBoxFvImageOpts.setText("FV Image Options");
970 jCheckBoxFvImageOpts.addItemListener(new ItemListener(){
971
972 public void itemStateChanged(ItemEvent arg0) {
973 // TODO Auto-generated method stub
974 // boolean selected = jCheckBox3.isSelected();
975
976 if (!jCheckBoxFvImagePara.isSelected() || jComboBoxFvParaType.getSelectedIndex() == 0) {
977 return;
978 }
979
980 }
981
982 });
983 }
984 return jCheckBoxFvImageOpts;
985 }
986
987
988 /**
989 * This method initializes jPanel6
990 *
991 * @return javax.swing.JPanel
992 */
993 private JPanel getJPanelFvImagePara() {
994 if (jPanelFvImagePara == null) {
995 StarLabel starLabel = new StarLabel();
996 starLabel.setVisible(false);
997 jPanelFvImagePara = new JPanel();
998 jPanelFvImagePara.setPreferredSize(new java.awt.Dimension(480,120));
999 jPanelFvImagePara.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
1000 jPanelFvImagePara.add(getJCheckBoxFvImagePara(), null);
1001 jPanelFvImagePara.add(jLabelFvParaType, null);
1002 jPanelFvImagePara.add(getJComboBoxFvParaType(), null);
1003 jPanelFvImagePara.add(new StarLabel(), null);
1004 jPanelFvImagePara.add(jLabelFvImageNames, null);
1005 jPanelFvImagePara.add(jLabelFvParaName, null);
1006 jPanelFvImagePara.add(getJTextFieldFvParaName(), null);
1007 jPanelFvImagePara.add(getJButtonFvParaAdd(), null);
1008 jPanelFvImagePara.add(getJScrollPaneFvImageNames(), null);
1009 jPanelFvImagePara.add(getJButtonFvParaDel(), null);
1010 }
1011 return jPanelFvImagePara;
1012 }
1013
1014 /**
1015 * This method initializes jPanel7
1016 *
1017 * @return javax.swing.JPanel
1018 */
1019 private JPanel getJPanelFdf() {
1020 if (jPanelFdf == null) {
1021 jPanelFdf = new JPanel();
1022 jPanelFdf.setLayout(new BorderLayout());
1023
1024 jPanelFdf.add(getJPanelFdfN(), java.awt.BorderLayout.NORTH);
1025 jPanelFdf.add(getJPanelFdfS(), java.awt.BorderLayout.SOUTH);
1026 jPanelFdf.add(getJSplitPaneFdfC(), java.awt.BorderLayout.CENTER);
1027 jPanelFdf.addComponentListener(new ComponentAdapter(){
1028 public void componentShown(ComponentEvent e) {
1029 // if (ffc.getFlashDefinitionFile() != null) {
1030 // jTextFieldFdf.setText(ffc.getFlashDefinitionFile());
1031 // initFvInFdfTable(System.getenv("WORKSPACE") + File.separator + jTextFieldFdf.getText());
1032 //
1033 // }
1034 }
1035 public void componentHidden(ComponentEvent e) {
1036 if (jCheckBoxFdf.isSelected()) {
1037 ffc.genFlashDefinitionFile(jTextFieldFdf.getText());
1038 }
1039 }
1040 });
1041 }
1042 return jPanelFdf;
1043 }
1044
1045 /**
1046 * This method initializes jCheckBox
1047 *
1048 * @return javax.swing.JCheckBox
1049 */
1050 private JCheckBox getJCheckBoxFdf() {
1051 if (jCheckBoxFdf == null) {
1052 jCheckBoxFdf = new JCheckBox();
1053 jCheckBoxFdf.setText("Flash Definition File");
1054 jCheckBoxFdf.addItemListener(new ItemListener() {
1055
1056 public void itemStateChanged(ItemEvent arg0) {
1057 // TODO Auto-generated method stub
1058 if (jCheckBoxFdf.isSelected()){
1059 jTextFieldFdf.setEnabled(true);
1060 jButtonFdfBrowse.setEnabled(true);
1061 }
1062 else {
1063
1064 jTextFieldFdf.setEnabled(false);
1065 jButtonFdfBrowse.setEnabled(false);
1066 }
1067 }
1068 });
1069 }
1070 return jCheckBoxFdf;
1071 }
1072
1073 /**
1074 * This method initializes jTextField3
1075 *
1076 * @return javax.swing.JTextField
1077 */
1078 private JTextField getJTextFieldFdf() {
1079 if (jTextFieldFdf == null) {
1080 jTextFieldFdf = new JTextField();
1081 jTextFieldFdf.setEnabled(false);
1082 jTextFieldFdf.setEditable(false);
1083 jTextFieldFdf.setPreferredSize(new Dimension(300, 20));
1084 jTextFieldFdf.addFocusListener(new java.awt.event.FocusAdapter() {
1085 public void focusLost(java.awt.event.FocusEvent e) {
1086 ffc.genFlashDefinitionFile(jTextFieldFdf.getText());
1087 }
1088 });
1089 }
1090 return jTextFieldFdf;
1091 }
1092
1093 /**
1094 * This method initializes jButton5
1095 *
1096 * @return javax.swing.JButton
1097 */
1098 private JButton getJButtonFdfBrowse() {
1099 if (jButtonFdfBrowse == null) {
1100 jButtonFdfBrowse = new JButton();
1101 jButtonFdfBrowse.setEnabled(false);
1102 jButtonFdfBrowse.setText("Browse");
1103 jButtonFdfBrowse.setPreferredSize(new Dimension(78, 20));
1104 jButtonFdfBrowse.addActionListener(new AbstractAction(){
1105 /**
1106 *
1107 */
1108 private static final long serialVersionUID = 1L;
1109
1110 public void actionPerformed(ActionEvent e) {
1111 // TODO Auto-generated method stub
1112 String wsDir = System.getenv("WORKSPACE");
1113 JFileChooser chooser = new JFileChooser(wsDir);
1114 chooser.setMultiSelectionEnabled(false);
1115 chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
1116 int retval = chooser.showOpenDialog(frame);
1117 if (retval == JFileChooser.APPROVE_OPTION) {
1118
1119 File theFile = chooser.getSelectedFile();
1120 String filePath = theFile.getPath();
1121 if (!filePath.startsWith(wsDir)) {
1122 JOptionPane.showMessageDialog(frame, "You can only select files in current WORKSPACE.");
1123 return;
1124 }
1125 jTextFieldFdf.setText(filePath.substring(wsDir.length() + 1).replace('\\', '/'));
1126 ffc.genFlashDefinitionFile(jTextFieldFdf.getText());
1127 docConsole.setSaved(false);
1128 initFvInFdfTable(filePath);
1129 }
1130 }
1131
1132 });
1133 }
1134 return jButtonFdfBrowse;
1135 }
1136
1137 private void initFvAdditionalTable() {
1138 Vector<String> vFvNames = new Vector<String>();
1139 ffc.getFvImagesFvImageFvImageNames(vFvNames);
1140 for (int i = 0; i < vFvNames.size(); ++i) {
1141 String fvName = vFvNames.get(i);
1142 if (fvNameExists(fvName)) {
1143 continue;
1144 }
1145 HashMap<String, String> mFvOpts = new HashMap<String, String>();
1146 ffc.getFvImagesFvImageOptions(fvName, mFvOpts);
1147 String bSize = "";
1148 String numBlks = "";
1149 String fvSize = "";
1150 String fvFile = "";
1151 if (mFvOpts.get("EFI_FILE_NAME") != null) {
1152 fvFile = mFvOpts.get("EFI_FILE_NAME");
1153 }
1154 if (mFvOpts.get("EFI_BLOCK_SIZE") != null && mFvOpts.get("EFI_NUM_BLOCKS") != null) {
1155 bSize = mFvOpts.get("EFI_BLOCK_SIZE");
1156 numBlks = mFvOpts.get("EFI_NUM_BLOCKS");
1157 boolean blockSizeWellFormat = true;
1158 boolean numOfBlockWellFormat = true;
1159 if (!DataValidation.isHexDoubleWordDataType(bSize) && !DataValidation.isInt(bSize)) {
1160 blockSizeWellFormat = false;
1161 JOptionPane.showMessageDialog(frame, fvName + " block size bad format.");
1162 }
1163 if (!DataValidation.isHexDoubleWordDataType(numBlks) && !DataValidation.isInt(numBlks)) {
1164 numOfBlockWellFormat = false;
1165 JOptionPane.showMessageDialog(frame, fvName + " number of blocks bad format.");
1166 }
1167 if (blockSizeWellFormat && numOfBlockWellFormat) {
1168 int size = Integer.decode(bSize);
1169 int num = Integer.decode(numBlks);
1170 fvSize = size*num + "";
1171 }
1172 }
1173 fvAdditionalTableModel.addRow(new String[]{fvName, fvSize, fvFile});
1174 addTabForFv(new FvInfoFromFdf(fvName, "", ""));
1175 }
1176 }
1177
1178 private void initFvInFdfTable(String fdfPath){
1179 Vector<FvInfoFromFdf> vFvInfo = new Vector<FvInfoFromFdf>();
1180 getFvInfoFromFdf(fdfPath, vFvInfo);
1181 getFlashInfoFromFdf (fdfPath, vBlockSize, erasePolarity);
1182 ffc.setTypedFvImageNameValue("Attributes", "ErasePolarity", erasePolarity);
1183 // BugBug: assume all blocks have same size;
1184 String blkSize = vBlockSize.get(0);
1185
1186 getFvInFdfTableModel().setRowCount(0);
1187 for (int j = 0; j < vFvInfo.size(); ++j) {
1188 FvInfoFromFdf fvInfo = vFvInfo.get(j);
1189 String[] row = {fvInfo.getFvName(), fvInfo.getSize(), fvInfo.getEfiFileName()};
1190 getFvInFdfTableModel().addRow(row);
1191 try {
1192 int blockSize = Integer.decode(blkSize);
1193 int fvSize = Integer.decode(row[1]);
1194 int numBlocks = fvSize/blockSize;
1195 // if no options for this FV before, generate a new options entry for this FV.
1196 if (ffc.getFvImagesFvImageWithName(row[0], "Options") == null) {
1197 HashMap<String, String> mOptions = new HashMap<String, String>();
1198 mOptions.put("EFI_BLOCK_SIZE", blkSize);
1199 mOptions.put("EFI_NUM_BLOCKS", numBlocks+"");
1200 mOptions.put("EFI_FILE_NAME", row[2]);
1201 ffc.genFvImagesFvImage(new String[]{row[0]}, "Options", mOptions);
1202 memModified = true;
1203 }
1204 else {
1205 ffc.setTypedNamedFvImageNameValue(row[0], "Options", "EFI_BLOCK_SIZE", blkSize);
1206 ffc.setTypedNamedFvImageNameValue(row[0], "Options", "EFI_NUM_BLOCKS", numBlocks + "");
1207 ffc.setTypedNamedFvImageNameValue(row[0], "Options", "EFI_FILE_NAME", row[2]);
1208 }
1209 }
1210 catch (NumberFormatException e){
1211 JOptionPane.showMessageDialog(frame, e.getMessage());
1212 }
1213 }
1214
1215 for (int k = 0; k < vFvInfo.size(); ++k) {
1216 FvInfoFromFdf fvInfo = vFvInfo.get(k);
1217 addTabForFv(fvInfo);
1218 }
1219
1220 }
1221
1222 private void addTabForFv (FvInfoFromFdf fvInfo) {
1223 String fvName = fvInfo.getFvName();
1224 String outputFile = fvInfo.getEfiFileName();
1225 int index = jTabbedPane.indexOfTab(fvName);
1226 if (index >= startIndexOfDynamicTab) {
1227 return;
1228 }
1229 jTabbedPane.addTab(fvName, null, new ModuleOrderPane(fvName, outputFile), null);
1230 }
1231 /**
1232 * This method initializes jTextField4
1233 *
1234 * @return javax.swing.JTextField
1235 */
1236 private JTextField getJTextFieldFvImageOptName() {
1237 if (jTextFieldFvImageOptName == null) {
1238 jTextFieldFvImageOptName = new JTextField();
1239 jTextFieldFvImageOptName.setEnabled(true);
1240 jTextFieldFvImageOptName.setPreferredSize(new Dimension(100, 20));
1241 }
1242 return jTextFieldFvImageOptName;
1243 }
1244
1245 /**
1246 * This method initializes jTextField5
1247 *
1248 * @return javax.swing.JTextField
1249 */
1250 private JTextField getJTextFieldFvImageOptValue() {
1251 if (jTextFieldFvImageOptValue == null) {
1252 jTextFieldFvImageOptValue = new JTextField();
1253 jTextFieldFvImageOptValue.setEnabled(true);
1254 jTextFieldFvImageOptValue.setPreferredSize(new Dimension(100, 20));
1255 }
1256 return jTextFieldFvImageOptValue;
1257 }
1258
1259 /**
1260 * This method initializes jPanel8
1261 *
1262 * @return javax.swing.JPanel
1263 */
1264 private JPanel getJPanelFvImageOptsButtonGroup() {
1265 if (jPanelFvImageOptsButtonGroup == null) {
1266 jPanelFvImageOptsButtonGroup = new JPanel();
1267 jPanelFvImageOptsButtonGroup.setPreferredSize(new Dimension(80, 55));
1268 jPanelFvImageOptsButtonGroup.add(getJButtonFvImageOptAdd(), null);
1269 jPanelFvImageOptsButtonGroup.add(getJButtonFvImageOptDel(), null);
1270 }
1271 return jPanelFvImageOptsButtonGroup;
1272 }
1273
1274 /**
1275 * This method initializes jButton7
1276 *
1277 * @return javax.swing.JButton
1278 */
1279 private JButton getJButtonFvImageOptAdd() {
1280 if (jButtonFvImageOptAdd == null) {
1281 jButtonFvImageOptAdd = new JButton();
1282 jButtonFvImageOptAdd.setEnabled(true);
1283 jButtonFvImageOptAdd.setText("Add");
1284 jButtonFvImageOptAdd.setPreferredSize(new Dimension(80, 20));
1285 jButtonFvImageOptAdd.addActionListener(new AbstractAction() {
1286 /**
1287 *
1288 */
1289 private static final long serialVersionUID = 1L;
1290
1291 public void actionPerformed(ActionEvent e) {
1292 if (jTextFieldFvImageOptName.getText().length() > 0 && jTextFieldFvImageOptValue.getText().length() > 0){
1293 String[] row = {jTextFieldFvImageOptName.getText(), jTextFieldFvImageOptValue.getText()};
1294 fvOptionTableModel.addRow(row);
1295 }
1296 }
1297 });
1298 }
1299 return jButtonFvImageOptAdd;
1300 }
1301
1302 /**
1303 * This method initializes jButton8
1304 *
1305 * @return javax.swing.JButton
1306 */
1307 private JButton getJButtonFvImageOptDel() {
1308 if (jButtonFvImageOptDel == null) {
1309 jButtonFvImageOptDel = new JButton();
1310 jButtonFvImageOptDel.setEnabled(true);
1311 jButtonFvImageOptDel.setText("Delete");
1312 jButtonFvImageOptDel.setPreferredSize(new Dimension(80, 20));
1313 jButtonFvImageOptDel.addActionListener(new AbstractAction() {
1314 /**
1315 *
1316 */
1317 private static final long serialVersionUID = 1L;
1318
1319 public void actionPerformed(ActionEvent e) {
1320 if (jTableFvImageOpts.getSelectedRow() >= 0){
1321 fvOptionTableModel.removeRow(jTableFvProp.getSelectedRow());
1322 }
1323 }
1324 });
1325 }
1326 return jButtonFvImageOptDel;
1327 }
1328
1329 /**
1330 * This method initializes jScrollPane
1331 *
1332 * @return javax.swing.JScrollPane
1333 */
1334 private JScrollPane getJScrollPane() {
1335 if (jScrollPane == null) {
1336 jScrollPane = new JScrollPane();
1337 jScrollPane.setPreferredSize(new java.awt.Dimension(350,80));
1338 jScrollPane.setViewportView(getJTableFvImageOpts());
1339 }
1340 return jScrollPane;
1341 }
1342
1343 /**
1344 * This method initializes jTable3
1345 *
1346 * @return javax.swing.JTable
1347 */
1348 private JTable getJTableFvImageOpts() {
1349 if (jTableFvImageOpts == null) {
1350 fvOptionTableModel = new DefaultTableModel();
1351 fvOptionTableModel.addColumn("Name");
1352 fvOptionTableModel.addColumn("Value");
1353 jTableFvImageOpts = new JTable(fvOptionTableModel);
1354
1355 jTableFvImageOpts.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
1356 jTableFvImageOpts.setRowHeight(20);
1357
1358 }
1359 return jTableFvImageOpts;
1360 }
1361
1362 /**
1363 * This method initializes jButton9
1364 *
1365 * @return javax.swing.JButton
1366 */
1367 private JButton getJButtonUpdateFvImage() {
1368 if (jButtonUpdateFvImage == null) {
1369 jButtonUpdateFvImage = new JButton();
1370 jButtonUpdateFvImage.setPreferredSize(new Dimension(120, 20));
1371 jButtonUpdateFvImage.setActionCommand("Update");
1372 jButtonUpdateFvImage.setEnabled(false);
1373 jButtonUpdateFvImage.setText("Update FV");
1374 jButtonUpdateFvImage.addActionListener(new java.awt.event.ActionListener() {
1375 public void actionPerformed(java.awt.event.ActionEvent e) {
1376 int row = jTableFvInfo.getSelectedRow();
1377 if (jTableFvInfo.isEditing()) {
1378 jTableFvInfo.getCellEditor().stopCellEditing();
1379 }
1380 if (jTableFvImageOpts.isEditing()) {
1381 jTableFvImageOpts.getCellEditor().stopCellEditing();
1382 }
1383
1384 //ToDo Check data validity before update
1385 String name = fvImageParaTableModel.getValueAt(row, 0) + "";
1386 String type = fvImageParaTableModel.getValueAt(row, 1) + "";
1387
1388 LinkedHashMap<String, String> lhm = new LinkedHashMap<String, String>();
1389 getOptionNameValue(lhm);
1390
1391 docConsole.setSaved(false);
1392 ffc.updateFvImagesFvImage(row, name.split(" "), type, lhm);
1393
1394 }
1395 });
1396 }
1397 return jButtonUpdateFvImage;
1398 }
1399
1400 // private JButton getJButtonTest() {
1401 // if (jButtonTest == null) {
1402 // jButtonTest = new JButton();
1403 // jButtonTest.addActionListener(new java.awt.event.ActionListener() {
1404 // public void actionPerformed(java.awt.event.ActionEvent e) {
1405 // docConsole.setSaved(false);
1406 // String[][] includeModules = {{"1", "a"}, {"2", "b"}};
1407 // ffc.genBuildOptionsUserExtensions("FV_RECOVERY", "FvRecovery.inf", null, includeModules);
1408 // int i = ffc.getUserExtsIncModCount("FV_RECOVERY");
1409 // String[][] saa = new String[i][2];
1410 // ffc.getUserExtsIncMods("FV_RECOVERY", saa);
1411 // jTextFieldFdf.setText(saa[0][0] + saa[0][1] + saa[1][0] + saa[1][1]);
1412 //
1413 // }
1414 // });
1415 // }
1416 // return jButtonTest;
1417 // }
1418
1419 /**
1420 * This method initializes jPanelFdfN
1421 *
1422 * @return javax.swing.JPanel
1423 */
1424 private JPanel getJPanelFdfN() {
1425 if (jPanelFdfN == null) {
1426 jPanelFdfN = new JPanel();
1427 jPanelFdfN.add(getJCheckBoxFdf(), null);
1428 jPanelFdfN.add(getJTextFieldFdf(), null);
1429 jPanelFdfN.add(getJButtonFdfBrowse(), null);
1430 }
1431 return jPanelFdfN;
1432 }
1433
1434 /**
1435 * This method initializes jPanelFdfS
1436 *
1437 * @return javax.swing.JPanel
1438 */
1439 private JPanel getJPanelFdfS() {
1440 if (jPanelFdfS == null) {
1441 FlowLayout flowLayout4 = new FlowLayout();
1442 flowLayout4.setAlignment(java.awt.FlowLayout.RIGHT);
1443 jPanelFdfS = new JPanel();
1444 jPanelFdfS.setLayout(flowLayout4);
1445 jPanelFdfS.add(getJButtonAddFv(), null);
1446 jPanelFdfS.add(getJButtonDelFv(), null);
1447 jPanelFdfS.add(getJButtonAddFvOptions(), null);
1448 }
1449 return jPanelFdfS;
1450 }
1451
1452 /**
1453 * This method initializes jSplitPaneFdfC
1454 *
1455 * @return javax.swing.JSplitPane
1456 */
1457 private JSplitPane getJSplitPaneFdfC() {
1458 if (jSplitPaneFdfC == null) {
1459 jSplitPaneFdfC = new JSplitPane();
1460 jSplitPaneFdfC.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
1461 jSplitPaneFdfC.setDividerSize(5);
1462 jSplitPaneFdfC.setTopComponent(getJPanelFdfCTop());
1463 jSplitPaneFdfC.setBottomComponent(getJPanelFdfCBottom());
1464 jSplitPaneFdfC.setDividerLocation(280);
1465 }
1466 return jSplitPaneFdfC;
1467 }
1468
1469 /**
1470 * This method initializes jPanelFdfCTop
1471 *
1472 * @return javax.swing.JPanel
1473 */
1474 private JPanel getJPanelFdfCTop() {
1475 if (jPanelFdfCTop == null) {
1476 jPanelFdfCTop = new JPanel();
1477 jPanelFdfCTop.setLayout(new BorderLayout());
1478 jPanelFdfCTop.add(getJPanelFdfCTopN(), java.awt.BorderLayout.NORTH);
1479 jPanelFdfCTop.add(getJPanelFdfCTopS(), java.awt.BorderLayout.SOUTH);
1480 jPanelFdfCTop.add(getJPanelFdfCTopC(), java.awt.BorderLayout.CENTER);
1481 }
1482 return jPanelFdfCTop;
1483 }
1484
1485 /**
1486 * This method initializes jPanelFdfCBottom
1487 *
1488 * @return javax.swing.JPanel
1489 */
1490 private JPanel getJPanelFdfCBottom() {
1491 if (jPanelFdfCBottom == null) {
1492 jPanelFdfCBottom = new JPanel();
1493 jPanelFdfCBottom.setLayout(new BorderLayout());
1494 jPanelFdfCBottom.add(getJPanelFdfCBottomN(), java.awt.BorderLayout.NORTH);
1495 jPanelFdfCBottom.add(getJPanelFdfCBottomC(), java.awt.BorderLayout.CENTER);
1496 }
1497 return jPanelFdfCBottom;
1498 }
1499
1500 /**
1501 * This method initializes jPanelFdfCTopN
1502 *
1503 * @return javax.swing.JPanel
1504 */
1505 private JPanel getJPanelFdfCTopN() {
1506 if (jPanelFdfCTopN == null) {
1507 jLabelFvInFdf = new JLabel();
1508 jLabelFvInFdf.setText("FVs in Flash Definition File");
1509 jPanelFdfCTopN = new JPanel();
1510 jPanelFdfCTopN.add(jLabelFvInFdf, null);
1511 }
1512 return jPanelFdfCTopN;
1513 }
1514
1515 /**
1516 * This method initializes jPanelFdfCTopS
1517 *
1518 * @return javax.swing.JPanel
1519 */
1520 private JPanel getJPanelFdfCTopS() {
1521 if (jPanelFdfCTopS == null) {
1522 FlowLayout flowLayout1 = new FlowLayout();
1523 flowLayout1.setAlignment(java.awt.FlowLayout.RIGHT);
1524 jPanelFdfCTopS = new JPanel();
1525 jPanelFdfCTopS.setLayout(flowLayout1);
1526 jPanelFdfCTopS.add(getJButtonFvInFdfOptions(), null);
1527 }
1528 return jPanelFdfCTopS;
1529 }
1530
1531 /**
1532 * This method initializes jPanelFdfCTopC
1533 *
1534 * @return javax.swing.JPanel
1535 */
1536 private JPanel getJPanelFdfCTopC() {
1537 if (jPanelFdfCTopC == null) {
1538 jPanelFdfCTopC = new JPanel();
1539 jPanelFdfCTopC.add(getJScrollPaneFvInFdf(), null);
1540 }
1541 return jPanelFdfCTopC;
1542 }
1543
1544 /**
1545 * This method initializes jPanelFdfCBottomN
1546 *
1547 * @return javax.swing.JPanel
1548 */
1549 private JPanel getJPanelFdfCBottomN() {
1550 if (jPanelFdfCBottomN == null) {
1551 jLabelFvAdditional = new JLabel();
1552 jLabelFvAdditional.setText("Additional FVs");
1553 jPanelFdfCBottomN = new JPanel();
1554 jPanelFdfCBottomN.add(jLabelFvAdditional, null);
1555 }
1556 return jPanelFdfCBottomN;
1557 }
1558
1559 /**
1560 * This method initializes jPanelFdfCBottomC
1561 *
1562 * @return javax.swing.JPanel
1563 */
1564 private JPanel getJPanelFdfCBottomC() {
1565 if (jPanelFdfCBottomC == null) {
1566 jPanelFdfCBottomC = new JPanel();
1567 jPanelFdfCBottomC.add(getJScrollPaneFvAdditional(), null);
1568 }
1569 return jPanelFdfCBottomC;
1570 }
1571
1572 /**
1573 * This method initializes jScrollPaneFvInFdf
1574 *
1575 * @return javax.swing.JScrollPane
1576 */
1577 private JScrollPane getJScrollPaneFvInFdf() {
1578 if (jScrollPaneFvInFdf == null) {
1579 jScrollPaneFvInFdf = new JScrollPane();
1580 jScrollPaneFvInFdf.setPreferredSize(new java.awt.Dimension(653,200));
1581 jScrollPaneFvInFdf.setViewportView(getJTableFvInFdf());
1582 }
1583 return jScrollPaneFvInFdf;
1584 }
1585
1586 /**
1587 * This method initializes jTableFvInFdf
1588 *
1589 * @return javax.swing.JTable
1590 */
1591 private JTable getJTableFvInFdf() {
1592 if (jTableFvInFdf == null) {
1593 jTableFvInFdf = new JTable();
1594 jTableFvInFdf.setRowHeight(20);
1595 jTableFvInFdf.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
1596 jTableFvInFdf.setModel(getFvInFdfTableModel());
1597 }
1598 return jTableFvInFdf;
1599 }
1600
1601 /**
1602 * This method initializes fvInFdfTableModel
1603 *
1604 * @return org.tianocore.frameworkwizard.platform.ui.NonEditableTableModel
1605 */
1606 private NonEditableTableModel getFvInFdfTableModel() {
1607 if (fvInFdfTableModel == null) {
1608 fvInFdfTableModel = new NonEditableTableModel();
1609 fvInFdfTableModel.addColumn("FV Name");
1610 fvInFdfTableModel.addColumn("Size");
1611 fvInFdfTableModel.addColumn("Corresponding File Name");
1612 }
1613 return fvInFdfTableModel;
1614 }
1615
1616 /**
1617 * This method initializes jButtonFvInFdfOptions
1618 *
1619 * @return javax.swing.JButton
1620 */
1621 private JButton getJButtonFvInFdfOptions() {
1622 if (jButtonFvInFdfOptions == null) {
1623 jButtonFvInFdfOptions = new JButton();
1624 jButtonFvInFdfOptions.setPreferredSize(new java.awt.Dimension(80,20));
1625 jButtonFvInFdfOptions.setEnabled(false);
1626 jButtonFvInFdfOptions.setText("Options");
1627 jButtonFvInFdfOptions.addActionListener(new java.awt.event.ActionListener() {
1628 public void actionPerformed(java.awt.event.ActionEvent e) {
1629 int selectedRow = jTableFvInFdf.getSelectedRow();
1630 if (selectedRow < 0) {
1631 return;
1632 }
1633 }
1634 });
1635 }
1636 return jButtonFvInFdfOptions;
1637 }
1638
1639 /**
1640 * This method initializes jScrollPaneFvAdditional
1641 *
1642 * @return javax.swing.JScrollPane
1643 */
1644 private JScrollPane getJScrollPaneFvAdditional() {
1645 if (jScrollPaneFvAdditional == null) {
1646 jScrollPaneFvAdditional = new JScrollPane();
1647 jScrollPaneFvAdditional.setPreferredSize(new java.awt.Dimension(653,200));
1648 jScrollPaneFvAdditional.setViewportView(getJTableFvAdditional());
1649 }
1650 return jScrollPaneFvAdditional;
1651 }
1652
1653 /**
1654 * This method initializes jTableFvAdditional
1655 *
1656 * @return javax.swing.JTable
1657 */
1658 private JTable getJTableFvAdditional() {
1659 if (jTableFvAdditional == null) {
1660 jTableFvAdditional = new JTable();
1661 jTableFvAdditional.setRowHeight(20);
1662 jTableFvAdditional.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
1663 jTableFvAdditional.setModel(getFvAdditionalTableModel());
1664
1665 jTableFvAdditional.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
1666 public void valueChanged(ListSelectionEvent e) {
1667 if (e.getValueIsAdjusting()) {
1668 return;
1669 }
1670 ListSelectionModel lsm = (ListSelectionModel) e.getSource();
1671 if (lsm.isSelectionEmpty()) {
1672 return;
1673 } else {
1674 selectedRowInFvAdditionalTable = lsm.getMinSelectionIndex();
1675 oldFvName = jTableFvAdditional.getValueAt(selectedRowInFvAdditionalTable, 0)+"";
1676 }
1677 }
1678 });
1679
1680 jTableFvAdditional.getModel().addTableModelListener(new TableModelListener() {
1681 public void tableChanged(TableModelEvent arg0) {
1682 // TODO Auto-generated method stub
1683 int row = arg0.getFirstRow();
1684 int col = arg0.getColumn();
1685 TableModel m = (TableModel) arg0.getSource();
1686 if (arg0.getType() == TableModelEvent.UPDATE) {
1687 if (col == 0) {
1688 String newFvName = m.getValueAt(row, 0) + "";
1689 if (newFvName.equals(oldFvName)) {
1690 return;
1691 }
1692 if (fvNameExists(newFvName)) {
1693 JOptionPane.showMessageDialog(frame, "This FV already exists. Please choose another FV name.");
1694 m.setValueAt(oldFvName, row, 0);
1695 return;
1696 }
1697
1698 tabIndexForFv = jTabbedPane.indexOfTab(oldFvName);
1699 if (tabIndexForFv >= startIndexOfDynamicTab) {
1700 jTabbedPane.setTitleAt(tabIndexForFv, newFvName);
1701 // change FvName in UserExtensions
1702 ffc.updateBuildOptionsUserExtensions(oldFvName, newFvName);
1703 // change FvBinding in ModuleSA
1704 ffc.appendFvBindingFor(oldFvName, newFvName);
1705 ffc.removeFvBindingAll(oldFvName);
1706 // change FvImageNames in Flash
1707 ffc.updateFvImageNameAll(oldFvName, newFvName);
1708
1709 } else {
1710 jTabbedPane.addTab(newFvName, new ModuleOrderPane(newFvName, ""));
1711 // Add FvImageNames in Flash
1712 String[] fvNames = {newFvName};
1713 ffc.AddFvImageFvImageNames(fvNames);
1714 }
1715
1716 oldFvName = newFvName;
1717 }
1718 docConsole.setSaved(false);
1719 }
1720 }
1721 });
1722 }
1723 return jTableFvAdditional;
1724 }
1725
1726 private boolean fvNameExistsInFvInFdfTable (String fvName) {
1727 for (int i = 0; i < jTableFvInFdf.getRowCount(); ++i) {
1728 if (fvInFdfTableModel.getValueAt(i, 0).equals(fvName)) {
1729 return true;
1730 }
1731 }
1732 return false;
1733 }
1734
1735 private boolean fvNameExists (String fvName) {
1736 if (fvNameExistsInFvInFdfTable(fvName)) {
1737 return true;
1738 }
1739
1740 for (int j = 0; j < jTableFvAdditional.getRowCount(); ++j) {
1741 if (fvAdditionalTableModel.getValueAt(j, 0).equals(fvName) && j != selectedRowInFvAdditionalTable) {
1742 return true;
1743 }
1744 }
1745 return false;
1746 }
1747
1748 /**
1749 * This method initializes fvAdditionalTableModel
1750 *
1751 * @return javax.swing.table.DefaultTableModel
1752 */
1753 private DefaultTableModel getFvAdditionalTableModel() {
1754 if (fvAdditionalTableModel == null) {
1755 fvAdditionalTableModel = new DefaultTableModel();
1756 fvAdditionalTableModel.addColumn("FV Name");
1757 fvAdditionalTableModel.addColumn("Size");
1758 fvAdditionalTableModel.addColumn("Corresponding File Name");
1759 }
1760 return fvAdditionalTableModel;
1761 }
1762
1763 /**
1764 * This method initializes jButtonAddFv
1765 *
1766 * @return javax.swing.JButton
1767 */
1768 private JButton getJButtonAddFv() {
1769 if (jButtonAddFv == null) {
1770 jButtonAddFv = new JButton();
1771 jButtonAddFv.setPreferredSize(new java.awt.Dimension(80,20));
1772 jButtonAddFv.setEnabled(true);
1773 jButtonAddFv.setText("New");
1774 jButtonAddFv.addActionListener(new java.awt.event.ActionListener() {
1775 public void actionPerformed(java.awt.event.ActionEvent e) {
1776 if (jTableFvAdditional.isEditing()) {
1777 jTableFvAdditional.getCellEditor().stopCellEditing();
1778 }
1779 String[] row = {"", "", ""};
1780 fvAdditionalTableModel.addRow(row);
1781 }
1782 });
1783 }
1784 return jButtonAddFv;
1785 }
1786
1787 /**
1788 * This method initializes jButtonDelFv
1789 *
1790 * @return javax.swing.JButton
1791 */
1792 private JButton getJButtonDelFv() {
1793 if (jButtonDelFv == null) {
1794 jButtonDelFv = new JButton();
1795 jButtonDelFv.setPreferredSize(new java.awt.Dimension(80,20));
1796 jButtonDelFv.setEnabled(true);
1797 jButtonDelFv.setText("Delete");
1798 jButtonDelFv.addActionListener(new java.awt.event.ActionListener() {
1799 public void actionPerformed(java.awt.event.ActionEvent e) {
1800 //delete row in FvAdditional table.
1801 int selectedRow = jTableFvAdditional.getSelectedRow();
1802 if (selectedRow < 0) {
1803 return;
1804 }
1805 String fvName = fvAdditionalTableModel.getValueAt(selectedRow, 0) + "";
1806 fvAdditionalTableModel.removeRow(selectedRow);
1807 //
1808 //delete tab with selected FV name.
1809 //
1810 jTabbedPane.removeTabAt(jTabbedPane.indexOfTab(fvName));
1811 //delete FV Name from FvImages element.
1812 ffc.updateFvImageNameAll(fvName, null);
1813 //delete FvBinding from ModuleSA.
1814 ffc.removeFvBindingAll(fvName);
1815 docConsole.setSaved(false);
1816 }
1817 });
1818 }
1819 return jButtonDelFv;
1820 }
1821
1822 /**
1823 * This method initializes jButtonAddFvOptions
1824 *
1825 * @return javax.swing.JButton
1826 */
1827 private JButton getJButtonAddFvOptions() {
1828 if (jButtonAddFvOptions == null) {
1829 jButtonAddFvOptions = new JButton();
1830 jButtonAddFvOptions.setPreferredSize(new java.awt.Dimension(80,20));
1831 jButtonAddFvOptions.setEnabled(false);
1832 jButtonAddFvOptions.setText("Options");
1833 jButtonAddFvOptions.addActionListener(new java.awt.event.ActionListener() {
1834 public void actionPerformed(java.awt.event.ActionEvent e) {
1835 System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
1836 }
1837 });
1838 }
1839 return jButtonAddFvOptions;
1840 }
1841
1842 /**
1843 * @param args
1844 */
1845 public static void main(String[] args) {
1846 // TODO Auto-generated method stub
1847 new FpdFlash().setVisible(true);
1848 }
1849
1850 /**
1851 * This method initializes this
1852 *
1853 * @return void
1854 */
1855 private void initialize() {
1856 this.setSize(518, 650);
1857 this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
1858 this.setContentPane(getJContentPane());
1859 this.setTitle("FPD Flash Definitions");
1860 this.addInternalFrameListener(new InternalFrameAdapter(){
1861 public void internalFrameDeactivated(InternalFrameEvent e){
1862 if (jTableFvProp.isEditing()) {
1863 jTableFvProp.getCellEditor().stopCellEditing();
1864 }
1865 if (jTableFvImageNames.isEditing()) {
1866 jTableFvImageNames.getCellEditor().stopCellEditing();
1867 }
1868 if (jTableFvInfo.isEditing()) {
1869 jTableFvInfo.getCellEditor().stopCellEditing();
1870 }
1871 if (jTableFvAdditional.isEditing()) {
1872 jTableFvAdditional.getCellEditor().stopCellEditing();
1873 }
1874 }
1875 });
1876 }
1877
1878 private void init(FpdFileContents ffc) {
1879
1880 jTextFieldFdf.setText("");
1881 String fdfFile = ffc.getFlashDefinitionFile();
1882 if (fdfFile != null) {
1883 jTextFieldFdf.setText(fdfFile);
1884 }
1885
1886 String fdfPath = System.getenv("WORKSPACE") + File.separator + fdfFile;
1887 initFvInFdfTable(fdfPath);
1888 initFvAdditionalTable();
1889 }
1890
1891 private void getOptionNameValue(Map<String, String> m){
1892 for (int i = 0; i < jTableFvImageOpts.getRowCount(); ++i) {
1893 m.put(fvOptionTableModel.getValueAt(i, 0)+"", fvOptionTableModel.getValueAt(i, 1)+"");
1894 }
1895 }
1896 /**
1897 * This method initializes jContentPane
1898 *
1899 * @return javax.swing.JPanel
1900 */
1901 private JPanel getJContentPane() {
1902 if (jContentPane == null) {
1903 jContentPane = new JPanel();
1904 jContentPane.setLayout(new BorderLayout());
1905 jContentPane.add(getJPanelContentEast(), java.awt.BorderLayout.EAST);
1906 jContentPane.add(getJPanelContentSouth(), java.awt.BorderLayout.SOUTH);
1907 jContentPane.add(getJPanelContentWest(), java.awt.BorderLayout.WEST);
1908 jContentPane.add(getJPanelContentNorth(), java.awt.BorderLayout.NORTH);
1909 jContentPane.add(getJTabbedPane(), java.awt.BorderLayout.CENTER);
1910 }
1911 return jContentPane;
1912 }
1913
1914 private void getFlashInfoFromFdf (String fdfPath, Vector<String> vBlockSize, String erasePolarity) {
1915 File fdf = new File(fdfPath);
1916 if (!fdf.exists()) {
1917 return;
1918 }
1919 int lines = 0;
1920
1921 try {
1922 FileReader reader = new FileReader(fdf);
1923 BufferedReader in = new BufferedReader(reader);
1924 String str;
1925
1926 while ((str = in.readLine()) != null) {
1927 ++lines;
1928 str = str.trim();
1929 //
1930 // skip empty line, comment (start with //)
1931 //
1932 if (str.length() == 0 || str.startsWith("//")) {
1933 continue;
1934 }
1935 //
1936 // ErasePolarity
1937 //
1938 if (str.startsWith("ErasePolarity")) {
1939 erasePolarity = str.substring(str.indexOf("=") + 1, str.lastIndexOf(","));
1940 }
1941 //
1942 // dig into Block section.
1943 //
1944 if (str.startsWith("Block") && str.endsWith("}")) {
1945 String[] blockSec = str.split(",");
1946 String nv = blockSec[1].trim();
1947 String[] sizeSec = nv.split("=");
1948 vBlockSize.add(sizeSec[1].trim());
1949 }
1950
1951 }
1952
1953 reader.close();
1954 in.close();
1955 }
1956 catch (Exception e) {
1957
1958 }
1959 }
1960
1961 private void getFvInfoFromFdf(String fdfPath, Vector<FvInfoFromFdf> vFvInfo) {
1962 File fdf = new File(fdfPath);
1963 if (!fdf.exists()) {
1964 return;
1965 }
1966 int lines = 0;
1967
1968 try {
1969 FileReader reader = new FileReader(fdf);
1970 BufferedReader in = new BufferedReader(reader);
1971 String str;
1972
1973 while ((str = in.readLine()) != null) {
1974 ++lines;
1975 str = str.trim();
1976 //
1977 // skip empty line, comment (start with //)
1978 //
1979 if (str.length() == 0 || str.startsWith("//")) {
1980 continue;
1981 }
1982 //
1983 // dig into Region {} section, create FvInfoFromFdf object for it.
1984 //
1985 if (str.startsWith("Region") && str.endsWith("{")) {
1986 FvInfoFromFdf fvInfo = new FvInfoFromFdf();
1987 boolean nameFound = false;
1988 boolean sizeFound = false;
1989 while ((str = in.readLine()) != null) {
1990 ++lines;
1991 str = str.trim();
1992 //
1993 // skip empty line, comment (start with //)
1994 //
1995 if (str.length() == 0 || str.startsWith("//")) {
1996 continue;
1997 }
1998
1999 if (str.startsWith("Name")) {
2000 int firstQuote = str.indexOf("\"");
2001 int lastQuote = str.lastIndexOf("\"");
2002 fvInfo.setFvName(str.substring(firstQuote + 1, lastQuote));
2003 nameFound = true;
2004 }
2005
2006 if (str.startsWith("Size")) {
2007 int equalIndex = str.indexOf("=");
2008 int commaIndex = str.indexOf(",");
2009 fvInfo.setSize(str.substring(equalIndex + 1, commaIndex).trim());
2010 sizeFound = true;
2011 }
2012
2013 if (nameFound && sizeFound) {
2014 break;
2015 }
2016 }
2017
2018 vFvInfo.add(fvInfo);
2019 }
2020 //
2021 // dig into File {} section, supply file name information to existing FvInfoFromFdf object.
2022 //
2023 if (str.startsWith("File")) {
2024 boolean fileNameFound = false;
2025 boolean fvFound = false;
2026 String fileName = "";
2027 String fvName = "";
2028 while ((str = in.readLine()) != null) {
2029 ++lines;
2030 str = str.trim();
2031 //
2032 // skip empty line, comment (start with //)
2033 //
2034 if (str.length() == 0 || str.startsWith("//")) {
2035 continue;
2036 }
2037
2038 if (str.startsWith("Name")) {
2039 int firstQuote = str.indexOf("\"");
2040 int lastQuote = str.lastIndexOf("\"");
2041 fileName = str.substring(firstQuote + 1, lastQuote);
2042 fileNameFound = true;
2043 }
2044
2045 if (str.startsWith("Region")) {
2046 int firstQuote = str.indexOf("\"");
2047 int lastQuote = str.lastIndexOf("\"");
2048 fvName = str.substring(firstQuote + 1, lastQuote);
2049 fvFound = true;
2050 }
2051
2052 if (fileNameFound && fvFound) {
2053 break;
2054 }
2055 }
2056
2057 for (int i = 0; i <vFvInfo.size(); ++i) {
2058 if (vFvInfo.get(i).getFvName().equals(fvName)) {
2059 vFvInfo.get(i).setEfiFileName(fileName);
2060 }
2061 }
2062 }
2063
2064 }
2065
2066 reader.close();
2067 in.close();
2068 }
2069 catch (Exception e) {
2070
2071 }
2072
2073 }
2074
2075 private class ModuleOrderPane extends JPanel {
2076
2077 /**
2078 *
2079 */
2080 private static final long serialVersionUID = 1L;
2081 private JPanel jPanelModOrderN = null;
2082 private JPanel jPanelModOrderS = null;
2083 private JPanel jPanelModOrderC = null;
2084 private JScrollPane jScrollPaneModInFv = null;
2085 private JTable jTableModInFv = null;
2086 private JPanel jPanelController = null;
2087 private JScrollPane jScrollPaneFpdModules = null;
2088 private JTable jTableFpdModules = null;
2089 private JButton jButtonUp = null;
2090 private JButton jButtonInsert = null;
2091 private JButton jButtonRemove = null;
2092 private JButton jButtonDown = null;
2093 private JButton jButtonOk = null;
2094 private JButton jButtonCancel = null;
2095 private NonEditableTableModel modInFvTableModel = null;
2096 private NonEditableTableModel fpdModTableModel = null;
2097 private HashMap<String, ModuleIdentification> mGuidToModuleId = null;
2098 private ArrayList<String> listModGuidInFv = null;
2099 private String title = null;
2100 private String outputFileName = null;
2101
2102 public ModuleOrderPane(String tabTitle, String file) {
2103 super(new BorderLayout());
2104 title = tabTitle;
2105 outputFileName = file;
2106 mGuidToModuleId = new HashMap<String, ModuleIdentification>();
2107 listModGuidInFv = new ArrayList<String>();
2108 add(getJPanelModOrderN(), java.awt.BorderLayout.NORTH);
2109 add(getJPanelModOrderS(), java.awt.BorderLayout.SOUTH);
2110 add(getJPanelModOrderC(), java.awt.BorderLayout.CENTER);
2111 showModulesInFv(title);
2112 showAllModulesInPlatform();
2113 }
2114
2115 private void showModulesInFv(String fvName) {
2116 int size = ffc.getUserExtsIncModCount(fvName);
2117
2118 if (size != -1) {
2119 String[][] saa = new String[size][2];
2120 ffc.getUserExtsIncMods(fvName, saa);
2121
2122 for (int i = 0; i < size; ++i) {
2123 listModGuidInFv.add(saa[i][0].toLowerCase());
2124 String name = getModuleName(saa[i][0]);
2125 String[] row = { name };
2126 modInFvTableModel.addRow(row);
2127 }
2128 }
2129 //
2130 // From ModuleSAs, get module guids with FvBinding = fvName.
2131 //
2132 Vector<String> vGuid = new Vector<String>();
2133 ffc.getFrameworkModuleGuid(fvName, vGuid);
2134 //
2135 // If BuildOptions->UserExtensions already contain these module info,
2136 // no need to add them into table again.
2137 //
2138 Iterator<String> iter = vGuid.iterator();
2139 while (iter.hasNext()){
2140 String guid = iter.next();
2141 // String moduleName = getModuleName(guid);
2142 // if (existedInTable(moduleName, modInFvTableModel)) {
2143 // vGuid.remove(guid);
2144 // }
2145 if (!listModGuidInFv.contains(guid.toLowerCase())) {
2146 String[] row = {getModuleName(guid)};
2147 modInFvTableModel.addRow(row);
2148 }
2149 }
2150
2151 }
2152
2153 private void showAllModulesInPlatform() {
2154 int size = ffc.getFrameworkModulesCount();
2155 String[][] saa = new String[size][5];
2156 ffc.getFrameworkModulesInfo(saa);
2157
2158 for (int i = 0; i < size; ++i) {
2159 String name = getModuleName(saa[i][0]);
2160 if (existedInTable(name, modInFvTableModel) || existedInTable(name, fpdModTableModel)) {
2161 continue;
2162 }
2163 String[] row = {name};
2164 fpdModTableModel.addRow(row);
2165 }
2166
2167 TableSorter sorter = (TableSorter)jTableFpdModules.getModel();
2168 sorter.setSortState(0, TableSorter.ASCENDING);
2169 }
2170
2171 private String getModuleName (String guid) {
2172
2173 for (int i = 0; i < GlobalData.vModuleList.size(); ++i) {
2174 ModuleIdentification mi = GlobalData.vModuleList.get(i);
2175 String mg = mi.getGuid();
2176 if (mg == null) {
2177 continue;
2178 }
2179 if (mg.equalsIgnoreCase(guid)) {
2180 mGuidToModuleId.put(guid.toLowerCase(), mi);
2181 return mi.getName();
2182 }
2183 }
2184
2185 return "";
2186 }
2187
2188 private boolean existedInTable (String name, DefaultTableModel model) {
2189 int size = model.getDataVector().size();
2190 for (int i = 0; i < size; ++i) {
2191 if (((Vector)model.getDataVector().elementAt(i)).contains(name)) {
2192 return true;
2193 }
2194 }
2195 return false;
2196 }
2197
2198
2199
2200 /**
2201 * This method initializes jPanelModOrderN
2202 *
2203 * @return javax.swing.JPanel
2204 */
2205 private JPanel getJPanelModOrderN() {
2206 if (jPanelModOrderN == null) {
2207 jPanelModOrderN = new JPanel();
2208 }
2209 return jPanelModOrderN;
2210 }
2211
2212 /**
2213 * This method initializes jPanelModOrderS
2214 *
2215 * @return javax.swing.JPanel
2216 */
2217 private JPanel getJPanelModOrderS() {
2218 if (jPanelModOrderS == null) {
2219 FlowLayout flowLayout6 = new FlowLayout();
2220 flowLayout6.setAlignment(java.awt.FlowLayout.RIGHT);
2221 jPanelModOrderS = new JPanel();
2222 jPanelModOrderS.setLayout(flowLayout6);
2223 jPanelModOrderS.add(getJButtonOk(), null);
2224 jPanelModOrderS.add(getJButtonCancel(), null);
2225 }
2226 return jPanelModOrderS;
2227 }
2228
2229 /**
2230 * This method initializes jPanelModOrderC
2231 *
2232 * @return javax.swing.JPanel
2233 */
2234 private JPanel getJPanelModOrderC() {
2235 if (jPanelModOrderC == null) {
2236 jPanelModOrderC = new JPanel();
2237 jPanelModOrderC.add(getJScrollPaneModInFv(), null);
2238 jPanelModOrderC.add(getJPanelController(), null);
2239 jPanelModOrderC.add(getJScrollPaneFpdModules(), null);
2240 }
2241 return jPanelModOrderC;
2242 }
2243
2244 /**
2245 * This method initializes jScrollPaneModInFv
2246 *
2247 * @return javax.swing.JScrollPane
2248 */
2249 private JScrollPane getJScrollPaneModInFv() {
2250 if (jScrollPaneModInFv == null) {
2251 jScrollPaneModInFv = new JScrollPane();
2252 jScrollPaneModInFv.setPreferredSize(new java.awt.Dimension(200,500));
2253 jScrollPaneModInFv.setViewportView(getJTableModInFv());
2254 }
2255 return jScrollPaneModInFv;
2256 }
2257
2258 /**
2259 * This method initializes jTableModInFv
2260 *
2261 * @return javax.swing.JTable
2262 */
2263 private JTable getJTableModInFv() {
2264 if (jTableModInFv == null) {
2265 modInFvTableModel = new NonEditableTableModel();
2266 modInFvTableModel.addColumn("Module Orders in FV");
2267 jTableModInFv = new JTable(modInFvTableModel);
2268 jTableModInFv.setRowHeight(20);
2269 jTableModInFv.setShowGrid(false);
2270
2271 }
2272 return jTableModInFv;
2273 }
2274
2275 /**
2276 * This method initializes jPanelController
2277 *
2278 * @return javax.swing.JPanel
2279 */
2280 private JPanel getJPanelController() {
2281 if (jPanelController == null) {
2282 FlowLayout flowLayout5 = new FlowLayout();
2283 flowLayout5.setVgap(50);
2284 flowLayout5.setHgap(50);
2285 jPanelController = new JPanel();
2286 jPanelController.setLayout(flowLayout5);
2287 jPanelController.setPreferredSize(new java.awt.Dimension(150,500));
2288 jPanelController.add(getJButtonUp(), null);
2289 jPanelController.add(getJButtonInsert(), null);
2290 jPanelController.add(getJButtonRemove(), null);
2291 jPanelController.add(getJButtonDown(), null);
2292 }
2293 return jPanelController;
2294 }
2295
2296 /**
2297 * This method initializes jScrollPaneFpdModules
2298 *
2299 * @return javax.swing.JScrollPane
2300 */
2301 private JScrollPane getJScrollPaneFpdModules() {
2302 if (jScrollPaneFpdModules == null) {
2303 jScrollPaneFpdModules = new JScrollPane();
2304 jScrollPaneFpdModules.setPreferredSize(new java.awt.Dimension(200,500));
2305 jScrollPaneFpdModules.setViewportView(getJTableFpdModules());
2306 }
2307 return jScrollPaneFpdModules;
2308 }
2309
2310 /**
2311 * This method initializes jTableFpdModules
2312 *
2313 * @return javax.swing.JTable
2314 */
2315 private JTable getJTableFpdModules() {
2316 if (jTableFpdModules == null) {
2317 fpdModTableModel = new NonEditableTableModel();
2318 TableSorter sorter = new TableSorter(fpdModTableModel);
2319 jTableFpdModules = new JTable(sorter);
2320 jTableFpdModules.setRowHeight(20);
2321 jTableFpdModules.setShowGrid(false);
2322 fpdModTableModel.addColumn("Modules in Platform");
2323
2324 }
2325 return jTableFpdModules;
2326 }
2327
2328 /**
2329 * This method initializes jButtonUp
2330 *
2331 * @return javax.swing.JButton
2332 */
2333 private JButton getJButtonUp() {
2334 if (jButtonUp == null) {
2335 jButtonUp = new JButton();
2336 jButtonUp.setPreferredSize(new java.awt.Dimension(60,20));
2337 jButtonUp.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 14));
2338 jButtonUp.setText("^");
2339 jButtonUp.addActionListener(new java.awt.event.ActionListener() {
2340 public void actionPerformed(java.awt.event.ActionEvent e) {
2341 int selectedRow = jTableModInFv.getSelectedRow();
2342 if (selectedRow <= 0) {
2343 return;
2344 }
2345 modInFvTableModel.moveRow(selectedRow, selectedRow, selectedRow - 1);
2346 jTableModInFv.changeSelection(selectedRow - 1, 0, false, false);
2347 }
2348 });
2349 }
2350 return jButtonUp;
2351 }
2352
2353 /**
2354 * This method initializes jButtonInsert
2355 *
2356 * @return javax.swing.JButton
2357 */
2358 private JButton getJButtonInsert() {
2359 if (jButtonInsert == null) {
2360 jButtonInsert = new JButton();
2361 jButtonInsert.setText("<<");
2362 jButtonInsert.setPreferredSize(new java.awt.Dimension(60,20));
2363 jButtonInsert.addActionListener(new java.awt.event.ActionListener() {
2364 public void actionPerformed(java.awt.event.ActionEvent e) {
2365 int selectedRowRight = jTableFpdModules.getSelectedRow();
2366 if (selectedRowRight < 0) {
2367 return;
2368 }
2369
2370 int rowInModel = ((TableSorter)jTableFpdModules.getModel()).getModelRowIndex(selectedRowRight);
2371
2372 String[] row = {jTableFpdModules.getValueAt(selectedRowRight, 0)+""};
2373 int selectedRowLeft = jTableModInFv.getSelectedRow();
2374 if (selectedRowLeft < 0) {
2375 modInFvTableModel.addRow(row);
2376 jTableModInFv.changeSelection(jTableModInFv.getRowCount() - 1, 0, false, false);
2377 }
2378 else {
2379 modInFvTableModel.insertRow(selectedRowLeft, row);
2380 jTableModInFv.changeSelection(selectedRowLeft, 0, false, false);
2381 }
2382 fpdModTableModel.removeRow(rowInModel);
2383 }
2384 });
2385 }
2386 return jButtonInsert;
2387 }
2388
2389 /**
2390 * This method initializes jButtonRemove
2391 *
2392 * @return javax.swing.JButton
2393 */
2394 private JButton getJButtonRemove() {
2395 if (jButtonRemove == null) {
2396 jButtonRemove = new JButton();
2397 jButtonRemove.setPreferredSize(new java.awt.Dimension(60,20));
2398 jButtonRemove.setText(">>");
2399 jButtonRemove.addActionListener(new java.awt.event.ActionListener() {
2400 public void actionPerformed(java.awt.event.ActionEvent e) {
2401 int selectedRowLeft = jTableModInFv.getSelectedRow();
2402 if (selectedRowLeft < 0) {
2403 return;
2404 }
2405
2406 String[] row = {jTableModInFv.getValueAt(selectedRowLeft, 0)+""};
2407 fpdModTableModel.addRow(row);
2408 int viewIndex = ((TableSorter) jTableFpdModules.getModel()).getViewIndexArray()[jTableFpdModules
2409 .getRowCount() - 1];
2410 jTableFpdModules.changeSelection(viewIndex, 0, false, false);
2411 modInFvTableModel.removeRow(selectedRowLeft);
2412 }
2413 });
2414 }
2415 return jButtonRemove;
2416 }
2417
2418 /**
2419 * This method initializes jButtonDown
2420 *
2421 * @return javax.swing.JButton
2422 */
2423 private JButton getJButtonDown() {
2424 if (jButtonDown == null) {
2425 jButtonDown = new JButton();
2426 jButtonDown.setPreferredSize(new java.awt.Dimension(60,20));
2427 jButtonDown.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
2428 jButtonDown.setText("v");
2429 jButtonDown.addActionListener(new java.awt.event.ActionListener() {
2430 public void actionPerformed(java.awt.event.ActionEvent e) {
2431 int selectedRow = jTableModInFv.getSelectedRow();
2432 if (selectedRow >= jTableModInFv.getRowCount() - 1) {
2433 return;
2434 }
2435 modInFvTableModel.moveRow(selectedRow, selectedRow, selectedRow + 1);
2436 jTableModInFv.changeSelection(selectedRow + 1, 0, false, false);
2437 }
2438 });
2439 }
2440 return jButtonDown;
2441 }
2442
2443 /**
2444 * This method initializes jButtonOk
2445 *
2446 * @return javax.swing.JButton
2447 */
2448 private JButton getJButtonOk() {
2449 if (jButtonOk == null) {
2450 jButtonOk = new JButton();
2451 jButtonOk.setPreferredSize(new java.awt.Dimension(80,20));
2452 jButtonOk.setText("Ok");
2453 jButtonOk.addActionListener(new java.awt.event.ActionListener() {
2454 public void actionPerformed(java.awt.event.ActionEvent e) {
2455 // need reset FvBindings in ModuleSA.
2456 ffc.removeFvBindingAll(title);
2457 //
2458 // collect module order information to store them into <BuildOptions> -> <UserExtensions>.
2459 // also update the FvBinding info in <ModuleSA>.
2460 //
2461 Vector<String[]> vModInFv = new Vector<String[]>();
2462 for (int i = 0; i < jTableModInFv.getRowCount(); ++i) {
2463 String moduleName = jTableModInFv.getValueAt(i, 0)+"";
2464 if (moduleName.length() == 0) {
2465 continue;
2466 }
2467 ModuleIdentification mi = null;
2468 Set<String> key = mGuidToModuleId.keySet();
2469 Iterator<String> iter = key.iterator();
2470 while (iter.hasNext()) {
2471 String guid = iter.next();
2472 mi = mGuidToModuleId.get(guid);
2473 if (mi.getName().equals(moduleName)) {
2474 String[] sa = {guid, WorkspaceProfile.getModuleBaseName(mi)};
2475 vModInFv.add(sa);
2476 ffc.updateFvBindingInModuleSA (mi, title);
2477 break;
2478 }
2479 }
2480
2481 }
2482 ffc.removeBuildOptionsUserExtensions(title);
2483 ffc.genBuildOptionsUserExtensions(title, outputFileName, vModInFv);
2484
2485 docConsole.setSaved(false);
2486 jTabbedPane.setSelectedIndex(0);
2487 }
2488 });
2489 }
2490 return jButtonOk;
2491 }
2492
2493 /**
2494 * This method initializes jButtonCancel
2495 *
2496 * @return javax.swing.JButton
2497 */
2498 private JButton getJButtonCancel() {
2499 if (jButtonCancel == null) {
2500 jButtonCancel = new JButton();
2501 jButtonCancel.setPreferredSize(new java.awt.Dimension(80,20));
2502 jButtonCancel.setText("Cancel");
2503 jButtonCancel.addActionListener(new java.awt.event.ActionListener() {
2504 public void actionPerformed(java.awt.event.ActionEvent e) {
2505 jTabbedPane.setSelectedIndex(0);
2506 }
2507 });
2508 }
2509 return jButtonCancel;
2510 }
2511 }
2512
2513 } // @jve:decl-index=0:visual-constraint="10,10"
2514
2515 class ImageParaTableModel extends DefaultTableModel {
2516
2517 private static final long serialVersionUID = 1L;
2518
2519 public boolean isCellEditable(int row, int col) {
2520 // if (getValueAt(row, 1).equals("ImageName") && col >=1) {
2521 // return false;
2522 // }
2523 // return true;
2524 return false;
2525 }
2526 }
2527
2528 class FvInfoFromFdf {
2529 private String fvName;
2530 private String size;
2531 private String efiFileName;
2532
2533 public FvInfoFromFdf () {
2534 fvName = "";
2535 size = "";
2536 efiFileName = "";
2537 }
2538 public FvInfoFromFdf (String f, String s, String e) {
2539 this();
2540 fvName = f;
2541 size = s;
2542 efiFileName = e;
2543 }
2544 public String getEfiFileName() {
2545 return efiFileName;
2546 }
2547 public void setEfiFileName(String efiFileName) {
2548 this.efiFileName = efiFileName;
2549 }
2550 public String getFvName() {
2551 return fvName;
2552 }
2553 public void setFvName(String fvName) {
2554 this.fvName = fvName;