8584657c915ab04b4b17cd0be1d276a358f6db34
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdDynamicPcdBuildDefinitions.java
1 package org.tianocore.frameworkwizard.platform.ui;
2
3 import java.awt.BorderLayout;
4
5 import javax.swing.ButtonGroup;
6 import javax.swing.JOptionPane;
7 import javax.swing.JPanel;
8 import javax.swing.JScrollPane;
9 import javax.swing.JTable;
10 import javax.swing.ListSelectionModel;
11 import javax.swing.event.ListSelectionEvent;
12 import javax.swing.event.ListSelectionListener;
13 import javax.swing.table.DefaultTableModel;
14
15 import org.tianocore.PlatformSurfaceAreaDocument;
16 import org.tianocore.frameworkwizard.common.DataValidation;
17 import org.tianocore.frameworkwizard.common.Tools;
18 import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
19 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
20 import javax.swing.JCheckBox;
21 import java.awt.FlowLayout;
22 import javax.swing.JRadioButton;
23 import javax.swing.JButton;
24 import javax.swing.JLabel;
25 import javax.swing.JTextField;
26
27 public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
28
29 /**
30 *
31 */
32 private static final long serialVersionUID = 1L;
33 private JPanel jContentPane = null;
34 private JPanel jPanelContentNorth = null;
35 private JPanel jPanelContentCenter = null;
36 private JPanel jPanelContentSouth = null;
37 private JScrollPane jScrollPaneDynPcd = null;
38 private JTable jTableDynPcd = null;
39 private DynPcdTableModel modelPcd = null;
40 private DynPcdTableModel modelSku = null;
41 private FpdFileContents ffc = null;
42 private OpeningPlatformType docConsole = null;
43 private JPanel jPanelSkuInfo = null;
44 private JCheckBox jCheckBoxSkuEnable = null;
45 private JPanel jPanelDynPcdValue = null;
46 private JRadioButton jRadioButtonHii = null;
47 private JRadioButton jRadioButtonVpd = null;
48 private JScrollPane jScrollPaneSkuInfo = null;
49 private JTable jTableSkuInfo = null;
50 private JButton jButtonSkuInfoUpdate = null;
51 private JLabel jLabelVarName = null;
52 private JTextField jTextFieldVarName = null;
53 private JLabel jLabelVarGuid = null;
54 private JTextField jTextFieldVarGuid = null;
55 private JLabel jLabelPad = null;
56 private JLabel jLabelVarOffset = null;
57 private JTextField jTextFieldVarOffset = null;
58 private JLabel jLabelHiiDefaultValue = null;
59 private JTextField jTextFieldHiiDefaultValue = null;
60 private JTextField jTextFieldVpdOffset = null;
61 private JLabel jLabelVpdOffset = null;
62 private JTextField jTextFieldDefaultValue = null;
63 private JRadioButton jRadioButtonDefaultValue = null;
64 private ButtonGroup bg = new ButtonGroup();
65 private JLabel jLabelPadd = null;
66 /**
67 * This is the default constructor
68 */
69 public FpdDynamicPcdBuildDefinitions() {
70 super();
71 initialize();
72 }
73
74 public FpdDynamicPcdBuildDefinitions(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd){
75 this();
76 init(fpd);
77 }
78
79 public FpdDynamicPcdBuildDefinitions(OpeningPlatformType opt) {
80 this(opt.getXmlFpd());
81 docConsole = opt;
82 }
83
84 public void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
85 if (ffc == null) {
86 ffc = new FpdFileContents(fpd);
87 }
88 String[][] saa = new String[ffc.getDynamicPcdBuildDataCount()][5];
89 ffc.getDynamicPcdBuildData(saa);
90 for (int i = 0; i < saa.length; ++i) {
91 modelPcd.addRow(saa[i]);
92 }
93
94 saa = new String[ffc.getPlatformDefsSkuInfoCount()][2];
95 ffc.getPlatformDefsSkuInfos(saa);
96 for (int i = 0; i < saa.length; ++i) {
97 modelSku.addRow(saa[i]);
98 }
99
100 }
101 /**
102 * This method initializes this
103 *
104 * @return void
105 */
106 private void initialize() {
107 this.setSize(661, 558);
108 this.setTitle("Dynamic PCD Build Definitions");
109 this.setContentPane(getJContentPane());
110 this.setVisible(true);
111 }
112
113 /**
114 * This method initializes jContentPane
115 *
116 * @return javax.swing.JPanel
117 */
118 private JPanel getJContentPane() {
119 if (jContentPane == null) {
120 jContentPane = new JPanel();
121 jContentPane.setLayout(new BorderLayout());
122 jContentPane.add(getJPanelContentNorth(), java.awt.BorderLayout.NORTH);
123 jContentPane.add(getJPanelContentCenter(), java.awt.BorderLayout.CENTER);
124 jContentPane.add(getJPanelContentSouth(), java.awt.BorderLayout.SOUTH);
125 }
126 return jContentPane;
127 }
128
129 /**
130 * This method initializes jPanel
131 *
132 * @return javax.swing.JPanel
133 */
134 private JPanel getJPanelContentNorth() {
135 if (jPanelContentNorth == null) {
136 jPanelContentNorth = new JPanel();
137 }
138 return jPanelContentNorth;
139 }
140
141 /**
142 * This method initializes jPanel1
143 *
144 * @return javax.swing.JPanel
145 */
146 private JPanel getJPanelContentCenter() {
147 if (jPanelContentCenter == null) {
148 jPanelContentCenter = new JPanel();
149 jPanelContentCenter.add(getJScrollPaneDynPcd(), null);
150 jPanelContentCenter.add(getJPanelSkuInfo(), null);
151 jPanelContentCenter.add(getJPanelDynPcdValue(), null);
152 }
153 return jPanelContentCenter;
154 }
155
156 /**
157 * This method initializes jPanel2
158 *
159 * @return javax.swing.JPanel
160 */
161 private JPanel getJPanelContentSouth() {
162 if (jPanelContentSouth == null) {
163 jPanelContentSouth = new JPanel();
164 }
165 return jPanelContentSouth;
166 }
167
168 /**
169 * This method initializes jScrollPane
170 *
171 * @return javax.swing.JScrollPane
172 */
173 private JScrollPane getJScrollPaneDynPcd() {
174 if (jScrollPaneDynPcd == null) {
175 jScrollPaneDynPcd = new JScrollPane();
176 jScrollPaneDynPcd.setPreferredSize(new java.awt.Dimension(600,200));
177 jScrollPaneDynPcd.setViewportView(getJTableDynPcd());
178 }
179 return jScrollPaneDynPcd;
180 }
181
182 /**
183 * This method initializes jTable
184 *
185 * @return javax.swing.JTable
186 */
187 private JTable getJTableDynPcd() {
188 if (jTableDynPcd == null) {
189 modelPcd = new DynPcdTableModel();
190 modelPcd.addColumn("CName");
191 modelPcd.addColumn("Token");
192 modelPcd.addColumn("TokenSpaceGuid");
193 modelPcd.addColumn("MaxDatumSize");
194 modelPcd.addColumn("DatumType");
195 jTableDynPcd = new JTable(modelPcd);
196 jTableDynPcd.setRowHeight(20);
197 jTableDynPcd.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
198 jTableDynPcd.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
199 public void valueChanged(ListSelectionEvent e) {
200 if (e.getValueIsAdjusting()){
201 return;
202 }
203 ListSelectionModel lsm = (ListSelectionModel)e.getSource();
204 if (lsm.isSelectionEmpty()) {
205 return;
206 }
207 else{
208 int selectedRow = lsm.getMinSelectionIndex();
209 jTextFieldDefaultValue.setText("");
210 jTextFieldVpdOffset.setText("");
211 jTextFieldVarName.setText("");
212 jTextFieldVarGuid.setText("");
213 jTextFieldVarOffset.setText("");
214 jTextFieldHiiDefaultValue.setText("");
215 displayDetails(selectedRow);
216 }
217 }
218 });
219 }
220 return jTableDynPcd;
221 }
222 //
223 // should display default sku info here, as no selection event of table1 will be triggered when change selection of rows in table.
224 //
225 private void displayDetails(int i) {
226 jTableSkuInfo.changeSelection(0, 1, false, false);
227 int skuCount = ffc.getDynamicPcdSkuInfoCount(i);
228 String defaultVal = ffc.getDynamicPcdBuildDataValue(i);
229 if (defaultVal != null) {
230 jRadioButtonDefaultValue.setSelected(true);
231 jTextFieldDefaultValue.setText(defaultVal);
232 if ( skuCount == 1) {
233 jCheckBoxSkuEnable.setSelected(false);
234 }
235 else{
236 jCheckBoxSkuEnable.setSelected(true);
237 }
238 }
239
240 else if (ffc.getDynamicPcdBuildDataVpdOffset(i) != null) {
241 jRadioButtonVpd.setSelected(true);
242 jTextFieldVpdOffset.setText(ffc.getDynamicPcdBuildDataVpdOffset(i));
243 if (skuCount ==1) {
244 jCheckBoxSkuEnable.setSelected(false);
245
246 }
247 else{
248 jCheckBoxSkuEnable.setSelected(true);
249 }
250 }
251 else {
252 jRadioButtonHii.setSelected(true);
253 String[][] saa = new String[ffc.getDynamicPcdSkuInfoCount(i)][7];
254 ffc.getDynamicPcdSkuInfos(i, saa);
255
256 String varDisplayName = Tools.convertUnicodeHexStringToString(saa[0][1]);
257 jTextFieldVarName.setText(varDisplayName);
258
259 jTextFieldVarGuid.setText(saa[0][2]);
260 jTextFieldVarOffset.setText(saa[0][3]);
261 jTextFieldHiiDefaultValue.setText(saa[0][4]);
262 if (skuCount ==1) {
263 jCheckBoxSkuEnable.setSelected(false);
264 }
265 else{
266 jCheckBoxSkuEnable.setSelected(true);
267 }
268 }
269
270 }
271
272 private void displaySkuInfoDetails(int i) {
273 int pcdSelected = jTableDynPcd.getSelectedRow();
274 if (pcdSelected < 0) {
275 return;
276 }
277
278 String[][] saa = new String[ffc.getDynamicPcdSkuInfoCount(pcdSelected)][7];
279 ffc.getDynamicPcdSkuInfos(pcdSelected, saa);
280
281 if (saa[i][5] != null){
282 jRadioButtonVpd.setSelected(true);
283 jTextFieldVpdOffset.setText(saa[i][5]);
284 }
285
286 else if (saa[i][1] != null) {
287 jRadioButtonHii.setSelected(true);
288 String varDisplayName = Tools.convertUnicodeHexStringToString(saa[i][1]);
289 jTextFieldVarName.setText(varDisplayName);
290 jTextFieldVarGuid.setText(saa[i][2]);
291 jTextFieldVarOffset.setText(saa[i][3]);
292 jTextFieldHiiDefaultValue.setText(saa[i][4]);
293 }
294
295 else{
296 jRadioButtonDefaultValue.setSelected(true);
297 jTextFieldDefaultValue.setText(saa[i][6]);
298 }
299
300 }
301
302 /**
303 * This method initializes jPanel3
304 *
305 * @return javax.swing.JPanel
306 */
307 private JPanel getJPanelSkuInfo() {
308 if (jPanelSkuInfo == null) {
309 FlowLayout flowLayout = new FlowLayout();
310 flowLayout.setAlignment(java.awt.FlowLayout.LEFT);
311 jPanelSkuInfo = new JPanel();
312 jPanelSkuInfo.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
313 jPanelSkuInfo.setLayout(flowLayout);
314 jPanelSkuInfo.setPreferredSize(new java.awt.Dimension(600,100));
315 jPanelSkuInfo.add(getJCheckBoxSkuEnable(), null);
316 jPanelSkuInfo.add(getJScrollPaneSkuInfo(), null);
317 jPanelSkuInfo.add(getJButtonSkuInfoUpdate(), null);
318 }
319 return jPanelSkuInfo;
320 }
321
322 /**
323 * This method initializes jCheckBox
324 *
325 * @return javax.swing.JCheckBox
326 */
327 private JCheckBox getJCheckBoxSkuEnable() {
328 if (jCheckBoxSkuEnable == null) {
329 jCheckBoxSkuEnable = new JCheckBox();
330 jCheckBoxSkuEnable.setText("SKU Enable");
331 jCheckBoxSkuEnable.addItemListener(new java.awt.event.ItemListener() {
332 public void itemStateChanged(java.awt.event.ItemEvent e) {
333 jTableSkuInfo.setEnabled(jCheckBoxSkuEnable.isSelected());
334 }
335 });
336 }
337 return jCheckBoxSkuEnable;
338 }
339
340
341 /**
342 * This method initializes jPanel4
343 *
344 * @return javax.swing.JPanel
345 */
346 private JPanel getJPanelDynPcdValue() {
347 if (jPanelDynPcdValue == null) {
348 jLabelVpdOffset = new JLabel();
349 jLabelVpdOffset.setPreferredSize(new java.awt.Dimension(80,20));
350 jLabelVpdOffset.setText("VPD Offset");
351 jLabelHiiDefaultValue = new JLabel();
352 jLabelHiiDefaultValue.setPreferredSize(new java.awt.Dimension(100,20));
353 jLabelHiiDefaultValue.setText("HII Default Value");
354 jLabelVarOffset = new JLabel();
355 jLabelVarOffset.setText("Variable Offset");
356 jLabelVarOffset.setPreferredSize(new java.awt.Dimension(90,20));
357 jLabelPad = new JLabel();
358 jLabelPad.setText(" ");
359 jLabelVarGuid = new JLabel();
360 jLabelVarGuid.setText("Variable GUID");
361 jLabelVarGuid.setPreferredSize(new java.awt.Dimension(100,20));
362 jLabelVarName = new JLabel();
363 jLabelVarName.setText("Variable Name");
364 jLabelVarName.setToolTipText("");
365 jLabelVarName.setPreferredSize(new java.awt.Dimension(90,20));
366 FlowLayout flowLayout1 = new FlowLayout();
367 flowLayout1.setAlignment(java.awt.FlowLayout.LEFT);
368 jPanelDynPcdValue = new JPanel();
369 jPanelDynPcdValue.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.LOWERED));
370 jPanelDynPcdValue.setLayout(flowLayout1);
371 jPanelDynPcdValue.setPreferredSize(new java.awt.Dimension(600,120));
372 jPanelDynPcdValue.add(getJRadioButtonHii(), null);
373 jPanelDynPcdValue.add(jLabelVarName, null);
374 jPanelDynPcdValue.add(getJTextFieldVarName(), null);
375 jPanelDynPcdValue.add(jLabelVarGuid, null);
376 jPanelDynPcdValue.add(getJTextFieldVarGuid(), null);
377 jPanelDynPcdValue.add(jLabelPad, null);
378 jPanelDynPcdValue.add(jLabelVarOffset, null);
379 jPanelDynPcdValue.add(getJTextFieldVarOffset(), null);
380 jPanelDynPcdValue.add(jLabelHiiDefaultValue, null);
381 jPanelDynPcdValue.add(getJTextFieldHiiDefaultValue(), null);
382 jPanelDynPcdValue.add(getJRadioButtonVpd(), null);
383 jPanelDynPcdValue.add(jLabelVpdOffset, null);
384 jPanelDynPcdValue.add(getJTextFieldVpdOffset(), null);
385 jLabelPadd = new JLabel();
386 jLabelPadd.setText(" ");
387 jPanelDynPcdValue.add(jLabelPadd, null);
388 jLabelVarName.setEnabled(false);
389 jLabelVarGuid.setEnabled(false);
390 jLabelHiiDefaultValue.setEnabled(false);
391 jLabelVarOffset.setEnabled(false);
392 jLabelVpdOffset.setEnabled(false);
393 jPanelDynPcdValue.add(getJRadioButtonDefaultValue(), null);
394 jPanelDynPcdValue.add(getJTextFieldDefaultValue(), null);
395 bg.add(jRadioButtonHii);
396 bg.add(jRadioButtonVpd);
397 }
398
399 return jPanelDynPcdValue;
400 }
401
402 /**
403 * This method initializes jRadioButton
404 *
405 * @return javax.swing.JRadioButton
406 */
407 private JRadioButton getJRadioButtonHii() {
408 if (jRadioButtonHii == null) {
409 jRadioButtonHii = new JRadioButton();
410 jRadioButtonHii.setText("HII Enable");
411 jRadioButtonHii.addItemListener(new java.awt.event.ItemListener() {
412 public void itemStateChanged(java.awt.event.ItemEvent e) {
413 boolean selected = jRadioButtonHii.isSelected();
414 jLabelVarName.setEnabled(selected);
415 jLabelVarGuid.setEnabled(selected);
416 jLabelPad.setEnabled(selected);
417 jLabelVarOffset.setEnabled(selected);
418 jLabelHiiDefaultValue.setEnabled(selected);
419 jTextFieldVarName.setEnabled(selected);
420 jTextFieldVarGuid.setEnabled(selected);
421 jTextFieldVarOffset.setEnabled(selected);
422 jTextFieldHiiDefaultValue.setEnabled(selected);
423 }
424 });
425 }
426 return jRadioButtonHii;
427 }
428
429 /**
430 * This method initializes jRadioButton1
431 *
432 * @return javax.swing.JRadioButton
433 */
434 private JRadioButton getJRadioButtonVpd() {
435 if (jRadioButtonVpd == null) {
436 jRadioButtonVpd = new JRadioButton();
437 jRadioButtonVpd.setText("VPD Enable");
438 jRadioButtonVpd.addItemListener(new java.awt.event.ItemListener() {
439 public void itemStateChanged(java.awt.event.ItemEvent e) {
440 boolean selected = jRadioButtonVpd.isSelected();
441 jTextFieldVpdOffset.setEnabled(selected);
442 jLabelVpdOffset.setEnabled(selected);
443 }
444 });
445 }
446 return jRadioButtonVpd;
447 }
448
449 /**
450 * This method initializes jScrollPane1
451 *
452 * @return javax.swing.JScrollPane
453 */
454 private JScrollPane getJScrollPaneSkuInfo() {
455 if (jScrollPaneSkuInfo == null) {
456 jScrollPaneSkuInfo = new JScrollPane();
457 jScrollPaneSkuInfo.setPreferredSize(new java.awt.Dimension(300,80));
458 jScrollPaneSkuInfo.setViewportView(getJTableSkuInfo());
459 }
460 return jScrollPaneSkuInfo;
461 }
462
463 /**
464 * This method initializes jTable1
465 *
466 * @return javax.swing.JTable
467 */
468 private JTable getJTableSkuInfo() {
469 if (jTableSkuInfo == null) {
470 modelSku = new DynPcdTableModel();
471 jTableSkuInfo = new JTable(modelSku);
472 modelSku.addColumn("SKU ID");
473 modelSku.addColumn("SKU Name");
474
475 jTableSkuInfo.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
476 jTableSkuInfo.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
477 public void valueChanged(ListSelectionEvent e) {
478 if (jTableDynPcd.getSelectedRow() < 0) {
479 return;
480 }
481 if (e.getValueIsAdjusting()){
482 return;
483 }
484 ListSelectionModel lsm = (ListSelectionModel)e.getSource();
485 if (lsm.isSelectionEmpty()) {
486 return;
487 }
488 else{
489 jTextFieldDefaultValue.setText("");
490 jTextFieldVpdOffset.setText("");
491 jTextFieldVarName.setText("");
492 jTextFieldVarGuid.setText("");
493 jTextFieldVarOffset.setText("");
494 jTextFieldHiiDefaultValue.setText("");
495 int selected = lsm.getMinSelectionIndex();
496 displaySkuInfoDetails(selected);
497 }
498 }
499 });
500 }
501 return jTableSkuInfo;
502 }
503
504 /**
505 * This method initializes jButton
506 *
507 * @return javax.swing.JButton
508 */
509 private JButton getJButtonSkuInfoUpdate() {
510 if (jButtonSkuInfoUpdate == null) {
511 jButtonSkuInfoUpdate = new JButton();
512 jButtonSkuInfoUpdate.setPreferredSize(new java.awt.Dimension(180,20));
513 jButtonSkuInfoUpdate.setText(" Update SKU Information");
514 jButtonSkuInfoUpdate.addActionListener(new java.awt.event.ActionListener() {
515 public void actionPerformed(java.awt.event.ActionEvent e) {
516 int pcdSelected = jTableDynPcd.getSelectedRow();
517 if (pcdSelected < 0) {
518 return;
519 }
520 docConsole.setSaved(false);
521 updateSkuInfo(pcdSelected);
522
523 }
524 });
525 }
526 return jButtonSkuInfoUpdate;
527 }
528
529 private void updateSkuInfo (int pcdSelected) {
530 int skuCount = ffc.getDynamicPcdSkuInfoCount(pcdSelected);
531
532 String varName = null;
533 String varGuid = null;
534 String varOffset = null;
535 String hiiDefault = null;
536 String value = null;
537 String vpdOffset = null;
538 if (jRadioButtonHii.isSelected()) {
539 varName = Tools.convertStringToUnicodeHexString(jTextFieldVarName.getText());
540 if (varName.length() == 0) {
541 JOptionPane.showMessageDialog(this, "Variable Name is Empty.");
542 return;
543 }
544 varGuid = jTextFieldVarGuid.getText();
545 if (varGuid.length() == 0) {
546 JOptionPane.showMessageDialog(this, "Variable GUID is Empty.");
547 return;
548 }
549 varOffset = jTextFieldVarOffset.getText();
550 if (!DataValidation.isHex64BitDataType(varOffset)) {
551 JOptionPane.showMessageDialog(this, "Variable Offset is NOT Hex64BitDataType.");
552 return;
553 }
554 hiiDefault = jTextFieldHiiDefaultValue.getText();
555 if (!DataValidation.isDefaultValueType(hiiDefault)) {
556 JOptionPane.showMessageDialog(this, "Default Value is NOT DefaultValueType.");
557 return;
558 }
559 }
560 if (jRadioButtonVpd.isSelected()) {
561 vpdOffset = jTextFieldVpdOffset.getText();
562 if (!DataValidation.isHex64BitDataType(vpdOffset)) {
563 JOptionPane.showMessageDialog(this, "VPD Offset is NOT Hex64BitDataType.");
564 return;
565 }
566 }
567 if (jRadioButtonDefaultValue.isSelected()) {
568 value = jTextFieldDefaultValue.getText();
569 if (!DataValidation.isDefaultValueType(value)) {
570 JOptionPane.showMessageDialog(this, "Value is NOT DefaultValueType.");
571 return;
572 }
573 }
574 //
575 // SKU disabled. only modify data for default SKU.
576 //
577 if (!jCheckBoxSkuEnable.isSelected()) {
578 if (true) {
579 ffc.removeDynamicPcdBuildDataSkuInfo(pcdSelected);
580 if (jRadioButtonHii.isSelected()) {
581 ffc.genDynamicPcdBuildDataSkuInfo("0", varName, varGuid, varOffset, hiiDefault, null, null, pcdSelected);
582 }
583 else if (jRadioButtonVpd.isSelected()){
584 ffc.genDynamicPcdBuildDataSkuInfo("0", null, null, null, null, vpdOffset, null, pcdSelected);
585 }
586 else{
587 ffc.genDynamicPcdBuildDataSkuInfo("0", null, null, null, null, null, value, pcdSelected);
588 }
589 }
590 }
591 //
592 // SKU Enabled, need add data to all SKUs.
593 //
594 if (jCheckBoxSkuEnable.isSelected()) {
595 if (skuCount == 1) {
596
597 for (int i = 1; i < jTableSkuInfo.getRowCount(); ++i) {
598 ffc.genDynamicPcdBuildDataSkuInfo(jTableSkuInfo.getValueAt(i, 0)+"", varName, varGuid, varOffset, hiiDefault, vpdOffset, value, pcdSelected);
599 }
600 }
601 else {
602 int row = jTableSkuInfo.getSelectedRow();
603 if (row < 0) {
604 return;
605 }
606 ffc.updateDynamicPcdBuildDataSkuInfo(jTableSkuInfo.getValueAt(row, 0)+"", varName, varGuid, varOffset, hiiDefault, vpdOffset, value, pcdSelected);
607 }
608 }
609 }
610 /**
611 * This method initializes jTextField
612 *
613 * @return javax.swing.JTextField
614 */
615 private JTextField getJTextFieldVarName() {
616 if (jTextFieldVarName == null) {
617 jTextFieldVarName = new JTextField();
618 jTextFieldVarName.setPreferredSize(new java.awt.Dimension(150,20));
619 jTextFieldVarName.setEnabled(false);
620 }
621 return jTextFieldVarName;
622 }
623
624 /**
625 * This method initializes jTextField1
626 *
627 * @return javax.swing.JTextField
628 */
629 private JTextField getJTextFieldVarGuid() {
630 if (jTextFieldVarGuid == null) {
631 jTextFieldVarGuid = new JTextField();
632 jTextFieldVarGuid.setPreferredSize(new java.awt.Dimension(150,20));
633 jTextFieldVarGuid.setEnabled(false);
634 }
635 return jTextFieldVarGuid;
636 }
637
638 /**
639 * This method initializes jTextField2
640 *
641 * @return javax.swing.JTextField
642 */
643 private JTextField getJTextFieldVarOffset() {
644 if (jTextFieldVarOffset == null) {
645 jTextFieldVarOffset = new JTextField();
646 jTextFieldVarOffset.setPreferredSize(new java.awt.Dimension(150,20));
647 jTextFieldVarOffset.setEnabled(false);
648 }
649 return jTextFieldVarOffset;
650 }
651
652 /**
653 * This method initializes jTextField3
654 *
655 * @return javax.swing.JTextField
656 */
657 private JTextField getJTextFieldHiiDefaultValue() {
658 if (jTextFieldHiiDefaultValue == null) {
659 jTextFieldHiiDefaultValue = new JTextField();
660 jTextFieldHiiDefaultValue.setPreferredSize(new java.awt.Dimension(150,20));
661 jTextFieldHiiDefaultValue.setEnabled(false);
662 }
663 return jTextFieldHiiDefaultValue;
664 }
665
666 /**
667 * This method initializes jTextField4
668 *
669 * @return javax.swing.JTextField
670 */
671 private JTextField getJTextFieldVpdOffset() {
672 if (jTextFieldVpdOffset == null) {
673 jTextFieldVpdOffset = new JTextField();
674 jTextFieldVpdOffset.setPreferredSize(new java.awt.Dimension(150,20));
675 jTextFieldVpdOffset.setEnabled(false);
676 }
677 return jTextFieldVpdOffset;
678 }
679
680 /**
681 * This method initializes jTextField5
682 *
683 * @return javax.swing.JTextField
684 */
685 private JTextField getJTextFieldDefaultValue() {
686 if (jTextFieldDefaultValue == null) {
687 jTextFieldDefaultValue = new JTextField();
688 jTextFieldDefaultValue.setPreferredSize(new java.awt.Dimension(150,20));
689 }
690 return jTextFieldDefaultValue;
691 }
692
693 /**
694 * This method initializes jRadioButton2
695 *
696 * @return javax.swing.JRadioButton
697 */
698 private JRadioButton getJRadioButtonDefaultValue() {
699 if (jRadioButtonDefaultValue == null) {
700 jRadioButtonDefaultValue = new JRadioButton();
701 jRadioButtonDefaultValue.setText("Default PCD Value");
702 jRadioButtonDefaultValue.setSelected(true);
703 jRadioButtonDefaultValue.setPreferredSize(new java.awt.Dimension(175,20));
704 jRadioButtonDefaultValue.addItemListener(new java.awt.event.ItemListener() {
705 public void itemStateChanged(java.awt.event.ItemEvent e) {
706 jTextFieldDefaultValue.setEnabled(jRadioButtonDefaultValue.isSelected());
707 }
708 });
709 bg.add(jRadioButtonDefaultValue);
710 }
711 return jRadioButtonDefaultValue;
712 }
713
714 } // @jve:decl-index=0:visual-constraint="10,10"
715
716 class DynPcdTableModel extends DefaultTableModel {
717 /**
718 *
719 */
720 private static final long serialVersionUID = 1L;
721
722 public boolean isCellEditable(int row, int col) {
723
724 return false;
725 }
726 }