]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java
55319196953e38b8c8fbe3920662f6e8e3ce4865
[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,196));
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 docConsole.setSaved(false);
553 model.addRow(row);
554 addRow(row);
555 }
556 //
557 // remove selected line
558 //
559 if (arg0.getSource() == jButtonRemove) {
560 if (jTable.isEditing()){
561 jTable.getCellEditor().stopCellEditing();
562 }
563 int rowSelected = selectedRow;
564 if (rowSelected >= 0) {
565 model.removeRow(rowSelected);
566 removeRow(rowSelected);
567 }
568 }
569
570 if (arg0.getSource() == jButtonClearAll) {
571 if (model.getRowCount() == 0) {
572 return;
573 }
574 model.setRowCount(0);
575 clearAllRow();
576 }
577
578 if (arg0.getSource() == jButtonGen) {
579 jTextFieldAdd.setText(Tools.generateUuidString());
580 }
581
582 if (arg0.getActionCommand().equals("GenGuidValue")) {
583 jTextFieldAdd.setText(guidDialog.getGuid());
584 }
585
586 }
587
588 protected boolean dataValidation(String[] row){
589 if (!DataValidation.isUiNameType(row[0])) {
590 JOptionPane.showMessageDialog(this, "Name is NOT UiNameType.");
591 return false;
592 }
593 if (!DataValidation.isGuid(row[2])) {
594 JOptionPane.showMessageDialog(this, "Guid Value is NOT GuidType.");
595 return false;
596 }
597 if (!DataValidation.isC_NameType(row[1])) {
598 JOptionPane.showMessageDialog(this, "C_Name is NOT C_NameType.");
599 return false;
600 }
601 if (row[3].length() == 0) {
602 JOptionPane.showMessageDialog(this, "HelpText could NOT be empty.");
603 return false;
604 }
605 return true;
606 }
607
608 protected void addRow(String[] row) {
609 Vector<String> vArch = iCheckBoxList.getAllCheckedItemsString();
610 Vector<String> vModType = iCheckBoxList2.getAllCheckedItemsString();
611 Vector<String> vguidType = iCheckBoxList1.getAllCheckedItemsString();
612 sfc.genSpdGuidDeclarations(row[0], row[1], row[2], row[3], vArch, vModType, vguidType);
613 }
614
615 protected void removeRow(int i){
616 sfc.removeSpdGuidDeclaration(i);
617 }
618
619 protected void clearAllRow(){
620 sfc.removeSpdGuidDeclaration();
621 }
622
623 /**
624 Add contents in list to sfc
625 **/
626 protected void save() {
627
628 }
629
630 /**
631 This method initializes jButtonBrowse
632
633 @return javax.swing.JButton
634 **/
635 protected JButton getJButtonGen() {
636 if (jButtonGen == null) {
637 jButtonGen = new JButton();
638 jButtonGen.setBounds(new java.awt.Rectangle(379,58,92,21));
639 jButtonGen.setText("Gen GUID");
640 jButtonGen.setPreferredSize(new java.awt.Dimension(80,20));
641 jButtonGen.addActionListener(this);
642 }
643 return jButtonGen;
644 }
645
646 /**
647 * This method initializes jTextFieldName
648 *
649 * @return javax.swing.JTextField
650 */
651 protected JTextField getJTextFieldName() {
652 if (jTextFieldName == null) {
653 jTextFieldName = new JTextField();
654 jTextFieldName.setBounds(new java.awt.Rectangle(138,10,337,20));
655 jTextFieldName.setPreferredSize(new java.awt.Dimension(335,20));
656 }
657 return jTextFieldName;
658 }
659
660 /**
661 * This method initializes jTextFieldVersion
662 *
663 * @return javax.swing.JTextField
664 */
665 protected JTextField getJTextFieldVersion() {
666 if (jTextFieldVersion == null) {
667 jTextFieldVersion = new JTextField();
668 jTextFieldVersion.setBounds(new java.awt.Rectangle(137,60,225,20));
669 jTextFieldVersion.setPreferredSize(new java.awt.Dimension(225,20));
670 }
671 return jTextFieldVersion;
672 }
673
674 public void componentResized(ComponentEvent arg0) {
675 int intPreferredWidth = 500;
676
677 resizeComponentWidth(this.jTextFieldName, this.getWidth(), intPreferredWidth);
678 resizeComponentWidth(this.jTextFieldAdd, this.getWidth(), intPreferredWidth);
679 resizeComponentWidth(this.jTextFieldVersion, this.getWidth(), intPreferredWidth);
680 resizeComponentWidth(this.jTextField, this.getWidth(), intPreferredWidth);
681 resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth);
682 relocateComponentX(this.jButtonGen, this.getWidth(), this.getPreferredSize().width, 40);
683
684 }
685
686 /**
687 * This method initializes jTextField
688 *
689 * @return javax.swing.JTextField
690 */
691 private JTextField getJTextField() {
692 if (jTextField == null) {
693 jTextField = new JTextField();
694 jTextField.setBounds(new java.awt.Rectangle(136,85,337,20));
695 jTextField.setPreferredSize(new Dimension(335, 20));
696 }
697 return jTextField;
698 }
699
700 private JScrollPane getJScrollPaneArch() {
701 if (jScrollPaneArch == null) {
702 jScrollPaneArch = new JScrollPane();
703 jScrollPaneArch.setBounds(new java.awt.Rectangle(197,142,188,74));
704 jScrollPaneArch.setPreferredSize(new java.awt.Dimension(188, 74));
705 jScrollPaneArch.setViewportView(getICheckBoxList());
706 }
707 return jScrollPaneArch;
708 }
709 /**
710 * This method initializes iCheckBoxList
711 *
712 * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
713 */
714 private ICheckBoxList getICheckBoxList() {
715 if (iCheckBoxList == null) {
716 iCheckBoxList = new ICheckBoxList();
717 iCheckBoxList.setBounds(new java.awt.Rectangle(197,142,188,74));
718 Vector<String> v = new Vector<String>();
719 v.add("IA32");
720 v.add("X64");
721 v.add("IPF");
722 v.add("EBC");
723 v.add("ARM");
724 v.add("PPC");
725 iCheckBoxList.setAllItems(v);
726 }
727 return iCheckBoxList;
728 }
729
730 protected JScrollPane getJScrollPaneGuid() {
731 if (jScrollPaneGuid== null) {
732 jScrollPaneGuid = new JScrollPane();
733 jScrollPaneGuid.setPreferredSize(new java.awt.Dimension(190,74));
734 jScrollPaneGuid.setLocation(new java.awt.Point(400,142));
735 jScrollPaneGuid.setSize(new java.awt.Dimension(260,74));
736 jScrollPaneGuid.setViewportView(getICheckBoxList1());
737 }
738 return jScrollPaneGuid;
739 }
740 /**
741 * This method initializes iCheckBoxList1
742 *
743 * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
744 */
745 private ICheckBoxList getICheckBoxList1() {
746 if (iCheckBoxList1 == null) {
747 iCheckBoxList1 = new ICheckBoxList();
748 iCheckBoxList1.setBounds(new java.awt.Rectangle(400,142,177,74));
749 Vector<String> v = new Vector<String>();
750 v.add("DATA_HUB_RECORD");
751 v.add("EFI_EVENT");
752 v.add("EFI_SYSTEM_CONFIGURATION_TABLE");
753 v.add("EFI_VARIABLE");
754 v.add("GUID");
755 v.add("HII_PACKAGE_LIST");
756 v.add("HOB");
757 v.add("TOKEN_SPACE_GUID");
758
759 iCheckBoxList1.setAllItems(v);
760 }
761 return iCheckBoxList1;
762 }
763
764 private JScrollPane getJScrollPaneModule() {
765 if (jScrollPaneModule == null) {
766 jScrollPaneModule = new JScrollPane();
767 jScrollPaneModule.setBounds(new java.awt.Rectangle(14,142,170,74));
768 jScrollPaneModule.setPreferredSize(new java.awt.Dimension(170, 74));
769 jScrollPaneModule.setViewportView(getICheckBoxList2());
770 }
771 return jScrollPaneModule;
772 }
773 /**
774 * This method initializes iCheckBoxList2
775 *
776 * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
777 */
778 private ICheckBoxList getICheckBoxList2() {
779 if (iCheckBoxList2 == null) {
780 iCheckBoxList2 = new ICheckBoxList();
781 iCheckBoxList2.setBounds(new java.awt.Rectangle(14,142,170,74));
782 Vector<String> v = new Vector<String>();
783 v.add("BASE");
784 v.add("SEC");
785 v.add("PEI_CORE");
786 v.add("PEIM");
787 v.add("DXE_CORE");
788 v.add("DXE_DRIVER");
789 v.add("DXE_RUNTIME_DRIVER");
790 v.add("DXE_SAL_DRIVER");
791 v.add("DXE_SMM_DRIVER");
792 v.add("UEFI_DRIVER");
793 v.add("UEFI_APPLICATION");
794 v.add("USER_DEFINED");
795 iCheckBoxList2.setAllItems(v);
796 }
797 return iCheckBoxList2;
798 }
799
800 public static void main(String[] args){
801 new SpdGuidDecls().setVisible(true);
802 }
803
804 protected DefaultTableModel getModel() {
805 return model;
806 }
807
808 protected void setModel(DefaultTableModel model) {
809 this.model = model;
810 }
811
812 protected String vectorToString(Vector<String> v) {
813 String s = " ";
814 for (int i = 0; i < v.size(); ++i) {
815 s += v.get(i);
816 s += " ";
817 }
818 return s.trim();
819 }
820
821 protected Vector<String> stringToVector(String s){
822 if (s == null) {
823 return null;
824 }
825 String[] sArray = s.split(" ");
826 Vector<String> v = new Vector<String>();
827 for (int i = 0; i < sArray.length; ++i) {
828 v.add(sArray[i]);
829 }
830 return v;
831 }
832
833 protected JLabel getJLabel3() {
834 return jLabel3;
835 }
836 }
837
838