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