]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java
Replaced set*(null) with unset*() to clear empty attributes that were causing invalid...
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / packaging / ui / SpdGuidDecls.java
1 /** @file
2 Java class SpdGuidDecls is GUI for create library definition elements of 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.packaging.ui;
14
15 import java.awt.Dimension;
16 import java.awt.event.ActionEvent;
17 import java.awt.event.ComponentEvent;
18 import java.util.Vector;
19
20 import javax.swing.JOptionPane;
21 import javax.swing.JPanel;
22 import javax.swing.JTable;
23 import javax.swing.JTextField;
24 import javax.swing.JLabel;
25 import javax.swing.JScrollPane;
26 import javax.swing.JButton;
27 import javax.swing.JFrame;
28 import javax.swing.ListSelectionModel;
29 import javax.swing.event.InternalFrameAdapter;
30 import javax.swing.event.InternalFrameEvent;
31 import javax.swing.event.ListSelectionEvent;
32 import javax.swing.event.ListSelectionListener;
33 import javax.swing.event.TableModelEvent;
34 import javax.swing.event.TableModelListener;
35 import javax.swing.table.DefaultTableModel;
36 import javax.swing.table.TableModel;
37
38 import org.tianocore.PackageSurfaceAreaDocument;
39 import org.tianocore.frameworkwizard.common.DataValidation;
40 import org.tianocore.frameworkwizard.common.Tools;
41 import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
42 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
43 import org.tianocore.frameworkwizard.common.ui.StarLabel;
44 import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
45 import org.tianocore.frameworkwizard.platform.ui.ListEditor;
46
47 /**
48 GUI for create library definition elements of spd file.
49
50 @since PackageEditor 1.0
51 **/
52 public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
53 /**
54 *
55 */
56 private static final long serialVersionUID = 1L;
57
58 static JFrame frame;
59
60 private SpdFileContents sfc = null;
61
62 private OpeningPackageType docConsole = null;
63
64 private JTable jTable = null;
65
66 private DefaultTableModel model = null;
67
68 private JPanel jContentPane = null;
69
70 private JTextField jTextFieldAdd = null;
71
72 private JScrollPane jScrollPane = null;
73
74 private JButton jButtonAdd = null;
75
76 private JButton jButtonRemove = null;
77
78 private JButton jButtonClearAll = null;
79
80 private JButton jButtonCancel = null;
81
82 private JButton jButtonOk = null;
83
84 private JButton jButtonGen = null;
85
86 private StarLabel jStarLabel1 = null;
87
88 private StarLabel jStarLabel2 = null;
89
90 private StarLabel jStarLabel3 = null;
91
92 private StarLabel jStarLabel4 = null;
93
94 protected int selectedRow = -1;
95
96 private JLabel jLabelName = null;
97
98 private JScrollPane jScrollPaneModule = null;
99
100 private JTextField jTextFieldName = null;
101
102 private JScrollPane jScrollPaneArch = null;
103
104 private JScrollPane jScrollPaneGuid = null;
105
106 private JLabel jLabelGuid = null;
107
108 private JScrollPane topScrollPane = null; // @jve:decl-index=0:visual-constraint="10,213"
109
110 private JLabel jLabelVer = null;
111
112 private GenGuidDialog guidDialog = null;
113
114 private JTextField jTextFieldVersion = null;
115
116 private JLabel jLabel = null;
117
118 private JTextField jTextField = null;
119
120 private JLabel jLabel1 = null;
121
122 private JLabel jLabel2 = null;
123
124 private ICheckBoxList iCheckBoxList = null;
125
126 private ICheckBoxList iCheckBoxList1 = null;
127
128 private ICheckBoxList iCheckBoxList2 = null;
129
130 private JLabel jLabel3 = null;
131
132
133
134 /**
135 This method initializes this
136
137 **/
138 protected void initialize() {
139
140 this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
141
142 }
143
144 /**
145 This method initializes jTextFieldAdd
146
147 @return javax.swing.JTextField
148 **/
149 protected JTextField getJTextFieldAdd() {
150 if (jTextFieldAdd == null) {
151 jTextFieldAdd = new JTextField();
152 jTextFieldAdd.setBounds(new java.awt.Rectangle(137,35,337,20));
153 jTextFieldAdd.setPreferredSize(new java.awt.Dimension(335,20));
154
155 }
156 return jTextFieldAdd;
157 }
158
159 /**
160 This method initializes jScrollPane
161
162 @return javax.swing.JScrollPane
163 **/
164 protected JScrollPane getJScrollPane() {
165 if (jScrollPane == null) {
166 jScrollPane = new JScrollPane();
167 jScrollPane.setBounds(new java.awt.Rectangle(5,256,472,292));
168 jScrollPane.setViewportView(getJTable());
169 }
170 return jScrollPane;
171 }
172
173 /**
174 This method initializes jTable
175
176 @return javax.swing.JTable
177 **/
178 protected JTable getJTable() {
179 if (jTable == null) {
180 model = new DefaultTableModel();
181 jTable = new JTable(model);
182 jTable.setRowHeight(20);
183 jTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
184 model.addColumn("Name");
185 model.addColumn("C_Name");
186 model.addColumn("GUID Value");
187 model.addColumn("HelpText");
188 model.addColumn("SupportedArch");
189 model.addColumn("SupportedModuleType");
190 model.addColumn("GuidTypes");
191 jTable.getColumnModel().getColumn(2).setCellEditor(new GuidEditor());
192
193 Vector<String> vArch = new Vector<String>();
194 vArch.add("IA32");
195 vArch.add("X64");
196 vArch.add("IPF");
197 vArch.add("EBC");
198 vArch.add("ARM");
199 vArch.add("PPC");
200 jTable.getColumnModel().getColumn(4).setCellEditor(new ListEditor(vArch));
201
202 Vector<String> vModule = new Vector<String>();
203 vModule.add("BASE");
204 vModule.add("SEC");
205 vModule.add("PEI_CORE");
206 vModule.add("PEIM");
207 vModule.add("DXE_CORE");
208 vModule.add("DXE_DRIVER");
209 vModule.add("DXE_RUNTIME_DRIVER");
210 vModule.add("DXE_SAL_DRIVER");
211 vModule.add("DXE_SMM_DRIVER");
212 vModule.add("UEFI_DRIVER");
213 vModule.add("UEFI_APPLICATION");
214 vModule.add("USER_DEFINED");
215 jTable.getColumnModel().getColumn(5).setCellEditor(new ListEditor(vModule));
216
217 Vector<String> vGuid = new Vector<String>();
218 vGuid.add("DATA_HUB_RECORD");
219 vGuid.add("EFI_EVENT");
220 vGuid.add("EFI_SYSTEM_CONFIGURATION_TABLE");
221 vGuid.add("EFI_VARIABLE");
222 vGuid.add("GUID");
223 vGuid.add("HII_PACKAGE_LIST");
224 vGuid.add("HOB");
225 vGuid.add("TOKEN_SPACE_GUID");
226 jTable.getColumnModel().getColumn(6).setCellEditor(new ListEditor(vGuid));
227
228 jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
229 jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
230 public void valueChanged(ListSelectionEvent e) {
231 if (e.getValueIsAdjusting()){
232 return;
233 }
234 ListSelectionModel lsm = (ListSelectionModel)e.getSource();
235 if (lsm.isSelectionEmpty()) {
236 return;
237 }
238 else{
239 selectedRow = lsm.getMinSelectionIndex();
240 }
241 }
242 });
243
244 jTable.getModel().addTableModelListener(this);
245 }
246 return jTable;
247 }
248
249
250 public void tableChanged(TableModelEvent arg0) {
251 // TODO Auto-generated method stub
252 int row = arg0.getFirstRow();
253 TableModel m = (TableModel)arg0.getSource();
254 if (arg0.getType() == TableModelEvent.UPDATE){
255 if (docConsole != null) {
256 docConsole.setSaved(false);
257 }
258 updateRow(row, m);
259 }
260 }
261
262 protected void updateRow(int row, TableModel m){
263 String name = m.getValueAt(row, 0) + "";
264 String cName = m.getValueAt(row, 1) + "";
265 String guid = m.getValueAt(row, 2) + "";
266 String help = m.getValueAt(row, 3) + "";
267 String archList = null;
268 if (m.getValueAt(row, 4) != null){
269 archList = m.getValueAt(row, 4).toString();
270 }
271 String modTypeList = null;
272 if (m.getValueAt(row, 5) != null) {
273 modTypeList = m.getValueAt(row, 5).toString();
274 }
275 String guidTypeList = null;
276 if (m.getValueAt(row, 6) != null){
277 guidTypeList = m.getValueAt(row, 6).toString();
278 }
279 String[] rowData = {name, cName, guid, help};
280 if (!dataValidation(rowData)){
281 return;
282 }
283
284 sfc.updateSpdGuidDecl(row, name, cName, guid, help, archList, modTypeList, guidTypeList);
285 }
286 /**
287 This method initializes jButtonAdd
288
289 @return javax.swing.JButton
290 **/
291 protected JButton getJButtonAdd() {
292 if (jButtonAdd == null) {
293 jButtonAdd = new JButton();
294 jButtonAdd.setBounds(new java.awt.Rectangle(167,227,90,20));
295 jButtonAdd.setText("Add");
296 jButtonAdd.addActionListener(this);
297 }
298 return jButtonAdd;
299 }
300
301 /**
302 This method initializes jButtonRemove
303
304 @return javax.swing.JButton
305 **/
306 protected JButton getJButtonRemove() {
307 if (jButtonRemove == null) {
308 jButtonRemove = new JButton();
309 jButtonRemove.setBounds(new java.awt.Rectangle(270,227,90,20));
310 jButtonRemove.setText("Remove");
311 jButtonRemove.addActionListener(this);
312 }
313 return jButtonRemove;
314 }
315
316 /**
317 This method initializes jButtonRemoveAll
318
319 @return javax.swing.JButton
320 **/
321 protected JButton getJButtonClearAll() {
322 if (jButtonClearAll == null) {
323 jButtonClearAll = new JButton();
324 jButtonClearAll.setBounds(new java.awt.Rectangle(380,227,90,20));
325 jButtonClearAll.setText("Clear All");
326 jButtonClearAll.addActionListener(this);
327 }
328 return jButtonClearAll;
329 }
330
331 /**
332 This method initializes jButtonCancel
333
334 @return javax.swing.JButton
335 **/
336 protected JButton getJButtonCancel() {
337 if (jButtonCancel == null) {
338 jButtonCancel = new JButton();
339 jButtonCancel.setPreferredSize(new java.awt.Dimension(90, 20));
340 jButtonCancel.setLocation(new java.awt.Point(390, 305));
341 jButtonCancel.setText("Cancel");
342 jButtonCancel.setSize(new java.awt.Dimension(90, 20));
343 jButtonCancel.setVisible(false);
344 jButtonCancel.addActionListener(this);
345 }
346 return jButtonCancel;
347 }
348
349 /**
350 This method initializes jButton
351
352 @return javax.swing.JButton
353 **/
354 protected JButton getJButtonOk() {
355 if (jButtonOk == null) {
356 jButtonOk = new JButton();
357 jButtonOk.setSize(new java.awt.Dimension(90, 20));
358 jButtonOk.setText("OK");
359 jButtonOk.setLocation(new java.awt.Point(290, 305));
360 jButtonOk.setVisible(false);
361 jButtonOk.addActionListener(this);
362 }
363 return jButtonOk;
364 }
365
366 /**
367 This is the default constructor
368 **/
369 public SpdGuidDecls() {
370 super();
371 initialize();
372 init();
373
374 }
375
376 public SpdGuidDecls(PackageSurfaceAreaDocument.PackageSurfaceArea inPsa){
377 this();
378 sfc = new SpdFileContents(inPsa);
379 init(sfc);
380 }
381
382 public SpdGuidDecls(OpeningPackageType opt) {
383 this(opt.getXmlSpd());
384 docConsole = opt;
385 }
386 /**
387 This method initializes this
388
389 @return void
390 **/
391 protected void init() {
392 this.setContentPane(getJContentPane());
393 this.addInternalFrameListener(new InternalFrameAdapter(){
394 public void internalFrameDeactivated(InternalFrameEvent e){
395 if (jTable.isEditing()) {
396 jTable.getCellEditor().stopCellEditing();
397 }
398 }
399 });
400 this.setBounds(new java.awt.Rectangle(0, 0, 500, 370));
401 this.setVisible(true);
402 initFrame();
403 }
404
405 protected void init(SpdFileContents sfc){
406 if (sfc.getSpdGuidDeclarationCount() == 0) {
407 return ;
408 }
409 //
410 // initialize table using SpdFileContents object
411 //
412 String[][] saa = new String[sfc.getSpdGuidDeclarationCount()][7];
413 sfc.getSpdGuidDeclarations(saa);
414 int i = 0;
415 while (i < saa.length) {
416 model.addRow(saa[i]);
417 i++;
418 }
419 }
420
421 protected JScrollPane getJContentPane(){
422 if (topScrollPane == null){
423 topScrollPane = new JScrollPane();
424 topScrollPane.setSize(new java.awt.Dimension(617,500));
425 topScrollPane.setPreferredSize(new java.awt.Dimension(498,500));
426 topScrollPane.setViewportView(getJContentPane1());
427 }
428 return topScrollPane;
429 }
430
431 /**
432 This method initializes jContentPane
433
434 @return javax.swing.JPanel
435 **/
436 protected JPanel getJContentPane1() {
437 if (jContentPane == null) {
438 jLabel3 = new JLabel();
439 jLabel3.setBounds(new java.awt.Rectangle(400,122,103,16));
440 jLabel3.setText("GUID Type List");
441 jLabel3.setEnabled(true);
442 jLabel2 = new JLabel();
443 jLabel2.setBounds(new java.awt.Rectangle(197,122,108,16));
444 jLabel2.setText("Supported Arch");
445 jLabel2.setEnabled(true);
446 jLabel1 = new JLabel();
447 jLabel1.setBounds(new java.awt.Rectangle(14,120,110,16));
448 jLabel1.setText("Supported Module");
449 jLabel1.setEnabled(true);
450 jLabel = new JLabel();
451 jLabel.setText("HelpText");
452 jLabel.setSize(new java.awt.Dimension(109,20));
453 jLabel.setLocation(new java.awt.Point(14,85));
454 jLabelVer = new JLabel();
455 jLabelVer.setBounds(new java.awt.Rectangle(14,60,111,20));
456 jLabelVer.setText("C_Name");
457 jLabelGuid = new JLabel();
458 jLabelGuid.setBounds(new java.awt.Rectangle(15,35,112,20));
459 jLabelGuid.setText("Guid Value");
460 jLabelName = new JLabel();
461 jLabelName.setBounds(new java.awt.Rectangle(15,10,113,20));
462 jLabelName.setText("Name");
463 jStarLabel1 = new StarLabel();
464 jStarLabel1.setLocation(new java.awt.Point(0, 10));
465 jStarLabel3 = new StarLabel();
466 jStarLabel3.setLocation(new java.awt.Point(0, 35));
467 jStarLabel4 = new StarLabel();
468 jStarLabel4.setLocation(new java.awt.Point(0, 60));
469 jStarLabel2 = new StarLabel();
470 jStarLabel2.setLocation(new java.awt.Point(0, 85));
471 jStarLabel2.setVisible(true);
472 jContentPane = new JPanel();
473 jContentPane.setLayout(null);
474 jContentPane.setPreferredSize(new Dimension(480, 375));
475 jContentPane.add(jStarLabel1, null);
476 jContentPane.add(jStarLabel2, null);
477 jContentPane.add(jStarLabel3, null);
478 jContentPane.add(jStarLabel4, null);
479 jContentPane.add(jLabelVer, null);
480 jContentPane.add(getJTextFieldVersion(), null);
481 jContentPane.add(getJTextFieldAdd(), null);
482 jContentPane.add(getJScrollPane(), null);
483 jContentPane.add(getJButtonAdd(), null);
484 jContentPane.add(getJButtonRemove(), null);
485 jContentPane.add(getJButtonClearAll(), null);
486 jContentPane.add(getJButtonCancel(), null);
487 jContentPane.add(getJButtonOk(), null);
488
489 jContentPane.add(getJButtonGen(), null);
490 jContentPane.add(jLabelName, null);
491 jContentPane.add(getJTextFieldName(), null);
492 jContentPane.add(jLabelGuid, null);
493 jContentPane.add(jLabel, null);
494 jContentPane.add(getJTextField(), null);
495 jContentPane.add(jLabel1, null);
496 jContentPane.add(jLabel2, null);
497 jContentPane.add(getJScrollPaneArch(), null);
498 jContentPane.add(getJScrollPaneGuid(), null);
499 jContentPane.add(getJScrollPaneModule(), null);
500 jContentPane.add(jLabel3, null);
501 }
502 return jContentPane;
503 }
504
505 /**
506 fill ComboBoxes with pre-defined contents
507 **/
508 protected void initFrame() {
509
510 this.setTitle("GUID Declarations");
511
512 }
513
514 /* (non-Javadoc)
515 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
516 */
517 public void actionPerformed(ActionEvent arg0) {
518
519 if (arg0.getSource() == jButtonOk) {
520 this.save();
521 this.dispose();
522
523 }
524 if (arg0.getSource() == jButtonCancel) {
525 this.dispose();
526 }
527
528 if (arg0.getSource() == jButtonAdd) {
529
530 //ToDo: check before add
531 String[] row = {"", "", "", "", "", "", ""};
532 row[3] = jTextField.getText();
533 row[2] = jTextFieldAdd.getText();
534 row[1] = jTextFieldVersion.getText();
535 row[0] = jTextFieldName.getText();
536 row[4] = vectorToString(iCheckBoxList.getAllCheckedItemsString());
537 if (row[4].length() == 0) {
538 row[4] = null;
539 }
540 row[5] = vectorToString(iCheckBoxList2.getAllCheckedItemsString());
541 if (row[5].length() == 0) {
542 row[5] = null;
543 }
544 row[6] = vectorToString(iCheckBoxList1.getAllCheckedItemsString());
545 if (row[6].length() == 0) {
546 row[6] = null;
547 }
548
549 if (!dataValidation(row)) {
550 return;
551 }
552 if (docConsole != null) {
553 docConsole.setSaved(false);
554 }
555 model.addRow(row);
556 jTable.changeSelection(model.getRowCount()-1, 0, false, false);
557 addRow(row);
558 }
559 //
560 // remove selected line
561 //
562 if (arg0.getSource() == jButtonRemove) {
563 if (jTable.isEditing()){
564 jTable.getCellEditor().stopCellEditing();
565 }
566 int rowSelected = selectedRow;
567 if (rowSelected >= 0) {
568 model.removeRow(rowSelected);
569 removeRow(rowSelected);
570 }
571 }
572
573 if (arg0.getSource() == jButtonClearAll) {
574 if (model.getRowCount() == 0) {
575 return;
576 }
577 model.setRowCount(0);
578 clearAllRow();
579 }
580
581 if (arg0.getSource() == jButtonGen) {
582 jTextFieldAdd.setText(Tools.generateUuidString());
583 }
584
585 if (arg0.getActionCommand().equals("GenGuidValue")) {
586 jTextFieldAdd.setText(guidDialog.getGuid());
587 }
588
589 }
590
591 protected boolean dataValidation(String[] row){
592 if (!DataValidation.isUiNameType(row[0])) {
593 JOptionPane.showMessageDialog(this, "Name is NOT UiNameType.");
594 return false;
595 }
596 if (!DataValidation.isGuid(row[2])) {
597 JOptionPane.showMessageDialog(this, "Guid Value is NOT GuidType.");
598 return false;
599 }
600 if (!DataValidation.isC_NameType(row[1])) {
601 JOptionPane.showMessageDialog(this, "C_Name is NOT C_NameType.");
602 return false;
603 }
604 if (row[3].length() == 0) {
605 JOptionPane.showMessageDialog(this, "HelpText could NOT be empty.");
606 return false;
607 }
608 return true;
609 }
610
611 protected void addRow(String[] row) {
612 Vector<String> vArch = iCheckBoxList.getAllCheckedItemsString();
613 Vector<String> vModType = iCheckBoxList2.getAllCheckedItemsString();
614 Vector<String> vguidType = iCheckBoxList1.getAllCheckedItemsString();
615 sfc.genSpdGuidDeclarations(row[0], row[1], row[2], row[3], vArch, vModType, vguidType);
616 }
617
618 protected void removeRow(int i){
619 sfc.removeSpdGuidDeclaration(i);
620 }
621
622 protected void clearAllRow(){
623 sfc.removeSpdGuidDeclaration();
624 }
625
626 /**
627 Add contents in list to sfc
628 **/
629 protected void save() {
630
631 }
632
633 /**
634 This method initializes jButtonBrowse
635
636 @return javax.swing.JButton
637 **/
638 protected JButton getJButtonGen() {
639 if (jButtonGen == null) {
640 jButtonGen = new JButton();
641 jButtonGen.setBounds(new java.awt.Rectangle(379,58,92,21));
642 jButtonGen.setText("Gen GUID");
643 jButtonGen.setPreferredSize(new java.awt.Dimension(80,20));
644 jButtonGen.addActionListener(this);
645 }
646 return jButtonGen;
647 }
648
649 /**
650 * This method initializes jTextFieldName
651 *
652 * @return javax.swing.JTextField
653 */
654 protected JTextField getJTextFieldName() {
655 if (jTextFieldName == null) {
656 jTextFieldName = new JTextField();
657 jTextFieldName.setBounds(new java.awt.Rectangle(138,10,337,20));
658 jTextFieldName.setPreferredSize(new java.awt.Dimension(335,20));
659 }
660 return jTextFieldName;
661 }
662
663 /**
664 * This method initializes jTextFieldVersion
665 *
666 * @return javax.swing.JTextField
667 */
668 protected JTextField getJTextFieldVersion() {
669 if (jTextFieldVersion == null) {
670 jTextFieldVersion = new JTextField();
671 jTextFieldVersion.setBounds(new java.awt.Rectangle(137,60,225,20));
672 jTextFieldVersion.setPreferredSize(new java.awt.Dimension(225,20));
673 }
674 return jTextFieldVersion;
675 }
676
677 public void componentResized(ComponentEvent arg0) {
678 int intPreferredWidth = 500;
679
680 resizeComponentWidth(this.jTextFieldName, this.getWidth(), intPreferredWidth);
681 resizeComponentWidth(this.jTextFieldAdd, this.getWidth(), intPreferredWidth);
682 resizeComponentWidth(this.jTextFieldVersion, this.getWidth(), intPreferredWidth);
683 resizeComponentWidth(this.jTextField, this.getWidth(), intPreferredWidth);
684 resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth);
685 relocateComponentX(this.jButtonGen, this.getWidth(), this.getPreferredSize().width, 40);
686
687 }
688
689 /**
690 * This method initializes jTextField
691 *
692 * @return javax.swing.JTextField
693 */
694 private JTextField getJTextField() {
695 if (jTextField == null) {
696 jTextField = new JTextField();
697 jTextField.setBounds(new java.awt.Rectangle(136,85,337,20));
698 jTextField.setPreferredSize(new Dimension(335, 20));
699 }
700 return jTextField;
701 }
702
703 private JScrollPane getJScrollPaneArch() {
704 if (jScrollPaneArch == null) {
705 jScrollPaneArch = new JScrollPane();
706 jScrollPaneArch.setBounds(new java.awt.Rectangle(197,142,188,74));
707 jScrollPaneArch.setPreferredSize(new java.awt.Dimension(188, 74));
708 jScrollPaneArch.setViewportView(getICheckBoxList());
709 }
710 return jScrollPaneArch;
711 }
712 /**
713 * This method initializes iCheckBoxList
714 *
715 * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
716 */
717 private ICheckBoxList getICheckBoxList() {
718 if (iCheckBoxList == null) {
719 iCheckBoxList = new ICheckBoxList();
720 iCheckBoxList.setBounds(new java.awt.Rectangle(197,142,188,74));
721 Vector<String> v = new Vector<String>();
722 v.add("IA32");
723 v.add("X64");
724 v.add("IPF");
725 v.add("EBC");
726 v.add("ARM");
727 v.add("PPC");
728 iCheckBoxList.setAllItems(v);
729 }
730 return iCheckBoxList;
731 }
732
733 protected JScrollPane getJScrollPaneGuid() {
734 if (jScrollPaneGuid== null) {
735 jScrollPaneGuid = new JScrollPane();
736 jScrollPaneGuid.setPreferredSize(new java.awt.Dimension(190,74));
737 jScrollPaneGuid.setLocation(new java.awt.Point(400,142));
738 jScrollPaneGuid.setSize(new java.awt.Dimension(260,74));
739 jScrollPaneGuid.setViewportView(getICheckBoxList1());
740 }
741 return jScrollPaneGuid;
742 }
743 /**
744 * This method initializes iCheckBoxList1
745 *
746 * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
747 */
748 private ICheckBoxList getICheckBoxList1() {
749 if (iCheckBoxList1 == null) {
750 iCheckBoxList1 = new ICheckBoxList();
751 iCheckBoxList1.setBounds(new java.awt.Rectangle(400,142,177,74));
752 Vector<String> v = new Vector<String>();
753 v.add("DATA_HUB_RECORD");
754 v.add("EFI_EVENT");
755 v.add("EFI_SYSTEM_CONFIGURATION_TABLE");
756 v.add("EFI_VARIABLE");
757 v.add("GUID");
758 v.add("HII_PACKAGE_LIST");
759 v.add("HOB");
760 v.add("TOKEN_SPACE_GUID");
761
762 iCheckBoxList1.setAllItems(v);
763 }
764 return iCheckBoxList1;
765 }
766
767 private JScrollPane getJScrollPaneModule() {
768 if (jScrollPaneModule == null) {
769 jScrollPaneModule = new JScrollPane();
770 jScrollPaneModule.setBounds(new java.awt.Rectangle(14,142,170,74));
771 jScrollPaneModule.setPreferredSize(new java.awt.Dimension(170, 74));
772 jScrollPaneModule.setViewportView(getICheckBoxList2());
773 }
774 return jScrollPaneModule;
775 }
776 /**
777 * This method initializes iCheckBoxList2
778 *
779 * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
780 */
781 private ICheckBoxList getICheckBoxList2() {
782 if (iCheckBoxList2 == null) {
783 iCheckBoxList2 = new ICheckBoxList();
784 iCheckBoxList2.setBounds(new java.awt.Rectangle(14,142,170,74));
785 Vector<String> v = new Vector<String>();
786 v.add("BASE");
787 v.add("SEC");
788 v.add("PEI_CORE");
789 v.add("PEIM");
790 v.add("DXE_CORE");
791 v.add("DXE_DRIVER");
792 v.add("DXE_RUNTIME_DRIVER");
793 v.add("DXE_SAL_DRIVER");
794 v.add("DXE_SMM_DRIVER");
795 v.add("UEFI_DRIVER");
796 v.add("UEFI_APPLICATION");
797 v.add("USER_DEFINED");
798 iCheckBoxList2.setAllItems(v);
799 }
800 return iCheckBoxList2;
801 }
802
803 public static void main(String[] args){
804 new SpdGuidDecls().setVisible(true);
805 }
806
807 protected DefaultTableModel getModel() {
808 return model;
809 }
810
811 protected void setModel(DefaultTableModel model) {
812 this.model = model;
813 }
814
815 protected String vectorToString(Vector<String> v) {
816 String s = " ";
817 for (int i = 0; i < v.size(); ++i) {
818 s += v.get(i);
819 s += " ";
820 }
821 return s.trim();
822 }
823
824 protected Vector<String> stringToVector(String s){
825 if (s == null) {
826 return null;
827 }
828 String[] sArray = s.split(" ");
829 Vector<String> v = new Vector<String>();
830 for (int i = 0; i < sArray.length; ++i) {
831 v.add(sArray[i]);
832 }
833 return v;
834 }
835
836 protected JLabel getJLabel3() {
837 return jLabel3;
838 }
839 }
840
841