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