2 Java class SpdGuidDecls is GUI for create library definition elements of spd file.
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
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.
13 package org
.tianocore
.frameworkwizard
.packaging
.ui
;
15 import java
.awt
.Dimension
;
16 import java
.awt
.Point
;
17 import java
.awt
.event
.ActionEvent
;
18 import java
.awt
.event
.ComponentEvent
;
19 import java
.util
.Vector
;
21 import javax
.swing
.JOptionPane
;
22 import javax
.swing
.JPanel
;
23 import javax
.swing
.JTable
;
24 import javax
.swing
.JTextField
;
25 import javax
.swing
.JLabel
;
26 import javax
.swing
.JScrollPane
;
27 import javax
.swing
.JButton
;
28 import javax
.swing
.JFrame
;
29 import javax
.swing
.ListSelectionModel
;
30 import javax
.swing
.event
.InternalFrameAdapter
;
31 import javax
.swing
.event
.InternalFrameEvent
;
32 import javax
.swing
.event
.ListSelectionEvent
;
33 import javax
.swing
.event
.ListSelectionListener
;
34 import javax
.swing
.event
.TableModelEvent
;
35 import javax
.swing
.event
.TableModelListener
;
36 import javax
.swing
.table
.DefaultTableModel
;
37 import javax
.swing
.table
.TableColumn
;
38 import javax
.swing
.table
.TableModel
;
40 import org
.tianocore
.PackageSurfaceAreaDocument
;
41 import org
.tianocore
.frameworkwizard
.common
.DataValidation
;
42 import org
.tianocore
.frameworkwizard
.common
.Tools
;
43 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningPackageType
;
44 import org
.tianocore
.frameworkwizard
.common
.ui
.IInternalFrame
;
45 import org
.tianocore
.frameworkwizard
.common
.ui
.StarLabel
;
46 import org
.tianocore
.frameworkwizard
.common
.ui
.iCheckBoxList
.ICheckBoxList
;
47 import org
.tianocore
.frameworkwizard
.platform
.ui
.ListEditor
;
48 import org
.tianocore
.frameworkwizard
.platform
.ui
.LongTextEditor
;
51 GUI for create library definition elements of spd file.
53 @since PackageEditor 1.0
55 public class SpdGuidDecls
extends IInternalFrame
implements TableModelListener
{
59 private static final long serialVersionUID
= 1L;
63 private SpdFileContents sfc
= null;
65 private OpeningPackageType docConsole
= null;
67 private JTable jTable
= null;
69 private DefaultTableModel model
= null;
71 private JPanel jContentPane
= null;
73 private JTextField jTextFieldGuid
= null;
75 private JScrollPane jScrollPane
= null;
77 private JButton jButtonAdd
= null;
79 private JButton jButtonRemove
= null;
81 private JButton jButtonClearAll
= null;
83 private JButton jButtonCancel
= null;
85 private JButton jButtonOk
= null;
87 private JButton jButtonGen
= null;
89 private StarLabel jStarLabel1
= null;
91 private StarLabel jStarLabel2
= null;
93 private StarLabel jStarLabel3
= null;
95 private StarLabel jStarLabel4
= null;
97 protected int selectedRow
= -1;
99 private JLabel jLabelName
= null;
101 private JScrollPane jScrollPaneModule
= null;
103 private JTextField jTextFieldName
= null;
105 private JScrollPane jScrollPaneArch
= null;
107 private JScrollPane jScrollPaneGuid
= null;
109 private JLabel jLabelGuid
= null;
111 private JScrollPane topScrollPane
= null; // @jve:decl-index=0:visual-constraint="10,213"
113 private JLabel jLabelCName
= null;
115 private GenGuidDialog guidDialog
= null;
117 private JTextField jTextFieldCName
= null;
119 private JLabel jLabelHelp
= null;
121 private JTextField jTextFieldHelp
= null;
123 private JLabel jLabelSupMod
= null;
125 private JLabel jLabelSupArch
= null;
127 private ICheckBoxList iCheckBoxListArch
= null;
129 private ICheckBoxList iCheckBoxListGuid
= null;
131 private ICheckBoxList iCheckBoxListMod
= null;
133 private JLabel jLabelGuidType
= null;
135 protected String
[][] saa
= null;
137 protected StarLabel starLabel
= null;
139 private final int guidNameMinWidth
= 200;
140 private final int guidCNameMinWidth
= 200;
141 private final int guidValueMinWidth
= 300;
142 private final int helpTextMinWidth
= 300;
143 private final int supArchMinWidth
= 200;
144 private final int supModMinWidth
= 200;
145 private final int guidTypeMinWidth
= 200;
149 This method initializes this
152 protected void initialize() {
154 this.setDefaultCloseOperation(javax
.swing
.WindowConstants
.DISPOSE_ON_CLOSE
);
159 This method initializes jTextFieldGuid
161 @return javax.swing.JTextField
163 protected JTextField
getJTextFieldGuid() {
164 if (jTextFieldGuid
== null) {
165 jTextFieldGuid
= new JTextField();
166 jTextFieldGuid
.setBounds(new java
.awt
.Rectangle(137,60,435,20));
167 jTextFieldGuid
.setPreferredSize(new java
.awt
.Dimension(200,20));
170 return jTextFieldGuid
;
174 This method initializes jScrollPane
176 @return javax.swing.JScrollPane
178 protected JScrollPane
getJScrollPane() {
179 if (jScrollPane
== null) {
180 jScrollPane
= new JScrollPane();
181 jScrollPane
.setBounds(new java
.awt
.Rectangle(5,256,472,292));
182 jScrollPane
.setViewportView(getJTable());
188 This method initializes jTable
190 @return javax.swing.JTable
192 protected JTable
getJTable() {
193 if (jTable
== null) {
194 model
= new DefaultTableModel();
195 jTable
= new JTable(model
);
196 jTable
.setRowHeight(20);
197 jTable
.setAutoResizeMode(javax
.swing
.JTable
.AUTO_RESIZE_OFF
);
198 model
.addColumn("Name");
199 model
.addColumn("The C Name");
200 model
.addColumn("GUID Value");
201 model
.addColumn("Help Text");
202 model
.addColumn("Supported Architectures");
203 model
.addColumn("Supported Module Types");
204 model
.addColumn("GuidTypes");
206 TableColumn column
= jTable
.getColumnModel().getColumn(0);
207 column
.setMinWidth(this.guidNameMinWidth
);
208 column
= jTable
.getColumnModel().getColumn(1);
209 column
.setMinWidth(this.guidCNameMinWidth
);
210 column
= jTable
.getColumnModel().getColumn(2);
211 column
.setMinWidth(this.guidValueMinWidth
);
212 column
= jTable
.getColumnModel().getColumn(3);
213 column
.setMinWidth(this.helpTextMinWidth
);
214 column
= jTable
.getColumnModel().getColumn(4);
215 column
.setMinWidth(this.supArchMinWidth
);
216 column
= jTable
.getColumnModel().getColumn(5);
217 column
.setMinWidth(this.supModMinWidth
);
218 column
= jTable
.getColumnModel().getColumn(6);
219 column
.setMinWidth(this.guidTypeMinWidth
);
221 jTable
.getColumnModel().getColumn(2).setCellEditor(new GuidEditor());
222 jTable
.getColumnModel().getColumn(3).setCellEditor(new LongTextEditor());
224 Vector
<String
> vArch
= new Vector
<String
>();
231 jTable
.getColumnModel().getColumn(4).setCellEditor(new ListEditor(vArch
));
233 Vector
<String
> vModule
= new Vector
<String
>();
236 vModule
.add("PEI_CORE");
238 vModule
.add("DXE_CORE");
239 vModule
.add("DXE_DRIVER");
240 vModule
.add("DXE_RUNTIME_DRIVER");
241 vModule
.add("DXE_SAL_DRIVER");
242 vModule
.add("DXE_SMM_DRIVER");
243 vModule
.add("UEFI_DRIVER");
244 vModule
.add("UEFI_APPLICATION");
245 vModule
.add("USER_DEFINED");
246 jTable
.getColumnModel().getColumn(5).setCellEditor(new ListEditor(vModule
));
248 Vector
<String
> vGuid
= new Vector
<String
>();
249 vGuid
.add("DATA_HUB_RECORD");
250 vGuid
.add("EFI_EVENT");
251 vGuid
.add("EFI_SYSTEM_CONFIGURATION_TABLE");
252 vGuid
.add("EFI_VARIABLE");
254 vGuid
.add("HII_PACKAGE_LIST");
256 vGuid
.add("TOKEN_SPACE_GUID");
257 ListEditor le
= new ListEditor(vGuid
);
258 le
.setCanNotBeEmpty(true);
259 jTable
.getColumnModel().getColumn(6).setCellEditor(le
);
261 jTable
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
262 jTable
.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
263 public void valueChanged(ListSelectionEvent e
) {
264 if (e
.getValueIsAdjusting()){
267 ListSelectionModel lsm
= (ListSelectionModel
)e
.getSource();
268 if (lsm
.isSelectionEmpty()) {
272 selectedRow
= lsm
.getMinSelectionIndex();
278 jTable
.getModel().addTableModelListener(this);
284 public void tableChanged(TableModelEvent arg0
) {
285 // TODO Auto-generated method stub
286 int row
= arg0
.getFirstRow();
287 int column
= arg0
.getColumn();
288 TableModel m
= (TableModel
)arg0
.getSource();
289 if (arg0
.getType() == TableModelEvent
.UPDATE
){
291 updateRow(row
, column
, m
);
295 protected void updateRow(int row
, int column
, TableModel m
){
296 String
[] sa
= new String
[7];
297 sfc
.getSpdGuidDeclaration(sa
, row
);
298 Object cellData
= m
.getValueAt(row
, column
);
299 if (cellData
== null) {
302 if (cellData
.equals(sa
[column
])) {
306 if (cellData
.toString().length() == 0 && sa
[column
] == null) {
310 String name
= m
.getValueAt(row
, 0) + "";
311 String cName
= m
.getValueAt(row
, 1) + "";
312 String guid
= m
.getValueAt(row
, 2) + "";
313 String help
= m
.getValueAt(row
, 3) + "";
314 String archList
= null;
315 if (m
.getValueAt(row
, 4) != null){
316 archList
= m
.getValueAt(row
, 4).toString();
318 String modTypeList
= null;
319 if (m
.getValueAt(row
, 5) != null) {
320 modTypeList
= m
.getValueAt(row
, 5).toString();
322 String guidTypeList
= null;
323 if (m
.getValueAt(row
, 6) != null){
324 guidTypeList
= m
.getValueAt(row
, 6).toString();
326 String
[] rowData
= {name
, cName
, guid
, help
};
327 if (!dataValidation(rowData
)){
330 if (docConsole
!= null) {
331 docConsole
.setSaved(false);
333 sfc
.updateSpdGuidDecl(row
, name
, cName
, guid
, help
, archList
, modTypeList
, guidTypeList
);
336 This method initializes jButtonAdd
338 @return javax.swing.JButton
340 protected JButton
getJButtonAdd() {
341 if (jButtonAdd
== null) {
342 jButtonAdd
= new JButton();
343 jButtonAdd
.setBounds(new java
.awt
.Rectangle(167,227,90,20));
344 jButtonAdd
.setText("Add");
345 jButtonAdd
.addActionListener(this);
351 This method initializes jButtonRemove
353 @return javax.swing.JButton
355 protected JButton
getJButtonRemove() {
356 if (jButtonRemove
== null) {
357 jButtonRemove
= new JButton();
358 jButtonRemove
.setBounds(new java
.awt
.Rectangle(270,227,90,20));
359 jButtonRemove
.setText("Remove");
360 jButtonRemove
.addActionListener(this);
362 return jButtonRemove
;
366 This method initializes jButtonRemoveAll
368 @return javax.swing.JButton
370 protected JButton
getJButtonClearAll() {
371 if (jButtonClearAll
== null) {
372 jButtonClearAll
= new JButton();
373 jButtonClearAll
.setBounds(new java
.awt
.Rectangle(380,227,90,20));
374 jButtonClearAll
.setText("Clear All");
375 jButtonClearAll
.addActionListener(this);
377 return jButtonClearAll
;
381 This method initializes jButtonCancel
383 @return javax.swing.JButton
385 protected JButton
getJButtonCancel() {
386 if (jButtonCancel
== null) {
387 jButtonCancel
= new JButton();
388 jButtonCancel
.setPreferredSize(new java
.awt
.Dimension(90, 20));
389 jButtonCancel
.setLocation(new java
.awt
.Point(390, 305));
390 jButtonCancel
.setText("Cancel");
391 jButtonCancel
.setSize(new java
.awt
.Dimension(90, 20));
392 jButtonCancel
.setVisible(false);
393 jButtonCancel
.addActionListener(this);
395 return jButtonCancel
;
399 This method initializes jButton
401 @return javax.swing.JButton
403 protected JButton
getJButtonOk() {
404 if (jButtonOk
== null) {
405 jButtonOk
= new JButton();
406 jButtonOk
.setSize(new java
.awt
.Dimension(90, 20));
407 jButtonOk
.setText("OK");
408 jButtonOk
.setLocation(new java
.awt
.Point(290, 305));
409 jButtonOk
.setVisible(false);
410 jButtonOk
.addActionListener(this);
416 This is the default constructor
418 public SpdGuidDecls() {
425 public SpdGuidDecls(PackageSurfaceAreaDocument
.PackageSurfaceArea inPsa
){
427 sfc
= new SpdFileContents(inPsa
);
431 public SpdGuidDecls(OpeningPackageType opt
) {
432 this(opt
.getXmlSpd());
436 This method initializes this
440 protected void init() {
441 this.setContentPane(getJContentPane());
442 this.addInternalFrameListener(new InternalFrameAdapter(){
443 public void internalFrameDeactivated(InternalFrameEvent e
){
444 if (jTable
.isEditing()) {
445 jTable
.getCellEditor().stopCellEditing();
449 this.setBounds(new java
.awt
.Rectangle(0, 0, 500, 370));
450 this.setVisible(true);
454 protected void init(SpdFileContents sfc
){
455 if (sfc
.getSpdGuidDeclarationCount() == 0) {
459 // initialize table using SpdFileContents object
461 saa
= new String
[sfc
.getSpdGuidDeclarationCount()][7];
462 sfc
.getSpdGuidDeclarations(saa
);
464 while (i
< saa
.length
) {
465 model
.addRow(saa
[i
]);
470 protected JScrollPane
getJContentPane(){
471 if (topScrollPane
== null){
472 topScrollPane
= new JScrollPane();
473 topScrollPane
.setSize(new java
.awt
.Dimension(617,500));
474 topScrollPane
.setPreferredSize(new java
.awt
.Dimension(498,500));
475 topScrollPane
.setViewportView(getJContentPane1());
477 return topScrollPane
;
481 This method initializes jContentPane
483 @return javax.swing.JPanel
485 protected JPanel
getJContentPane1() {
486 if (jContentPane
== null) {
488 jLabelGuidType
= new JLabel();
489 jLabelGuidType
.setBounds(new java
.awt
.Rectangle(420,122,103,16));
490 jLabelGuidType
.setText("GUID Type List");
491 jLabelGuidType
.setEnabled(true);
492 starLabel
= new StarLabel();
493 starLabel
.setLocation(new Point(jLabelGuidType
.getX() - 20, jLabelGuidType
.getY()));
494 starLabel
.setVisible(true);
495 jLabelSupArch
= new JLabel();
496 jLabelSupArch
.setBounds(new java
.awt
.Rectangle(197,122,108,16));
497 jLabelSupArch
.setText("Supported Arch");
498 jLabelSupArch
.setEnabled(true);
499 jLabelSupMod
= new JLabel();
500 jLabelSupMod
.setBounds(new java
.awt
.Rectangle(14,120,110,16));
501 jLabelSupMod
.setText("Supported Module");
502 jLabelSupMod
.setEnabled(true);
503 jLabelHelp
= new JLabel();
504 jLabelHelp
.setText("HelpText");
505 jLabelHelp
.setSize(new java
.awt
.Dimension(109,20));
506 jLabelHelp
.setLocation(new java
.awt
.Point(14,85));
507 jLabelCName
= new JLabel();
508 jLabelCName
.setBounds(new java
.awt
.Rectangle(14,35,111,20));
509 jLabelCName
.setText("C Name");
510 jLabelGuid
= new JLabel();
511 jLabelGuid
.setBounds(new java
.awt
.Rectangle(15,60,112,20));
512 jLabelGuid
.setText("Guid Value");
513 jLabelName
= new JLabel();
514 jLabelName
.setBounds(new java
.awt
.Rectangle(15,10,113,20));
515 jLabelName
.setText("Name");
516 jStarLabel1
= new StarLabel();
517 jStarLabel1
.setLocation(new java
.awt
.Point(0, 10));
518 jStarLabel3
= new StarLabel();
519 jStarLabel3
.setLocation(new java
.awt
.Point(0, 35));
520 jStarLabel4
= new StarLabel();
521 jStarLabel4
.setLocation(new java
.awt
.Point(0, 60));
522 jStarLabel2
= new StarLabel();
523 jStarLabel2
.setLocation(new java
.awt
.Point(0, 85));
524 jStarLabel2
.setVisible(true);
525 jContentPane
= new JPanel();
526 jContentPane
.setLayout(null);
527 jContentPane
.setPreferredSize(new Dimension(480, 375));
528 jContentPane
.add(jStarLabel1
, null);
529 jContentPane
.add(jStarLabel2
, null);
530 jContentPane
.add(jStarLabel3
, null);
531 jContentPane
.add(jStarLabel4
, null);
532 jContentPane
.add(jLabelCName
, null);
533 jContentPane
.add(getJTextFieldCName(), null);
534 jContentPane
.add(getJTextFieldGuid(), null);
535 jContentPane
.add(getJScrollPane(), null);
536 jContentPane
.add(getJButtonAdd(), null);
537 jContentPane
.add(getJButtonRemove(), null);
538 jContentPane
.add(getJButtonClearAll(), null);
539 jContentPane
.add(getJButtonCancel(), null);
540 jContentPane
.add(getJButtonOk(), null);
542 jContentPane
.add(getJButtonGen(), null);
543 jContentPane
.add(jLabelName
, null);
544 jContentPane
.add(getJTextFieldName(), null);
545 jContentPane
.add(jLabelGuid
, null);
546 jContentPane
.add(jLabelHelp
, null);
547 jContentPane
.add(getJTextFieldHelp(), null);
548 jContentPane
.add(jLabelSupMod
, null);
549 jContentPane
.add(jLabelSupArch
, null);
550 jContentPane
.add(getJScrollPaneArch(), null);
551 jContentPane
.add(getJScrollPaneGuid(), null);
552 jContentPane
.add(getJScrollPaneModule(), null);
553 jContentPane
.add(jLabelGuidType
, null);
554 jContentPane
.add(starLabel
, null);
560 fill ComboBoxes with pre-defined contents
562 protected void initFrame() {
564 this.setTitle("GUID Declarations");
569 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
571 public void actionPerformed(ActionEvent arg0
) {
573 if (arg0
.getSource() == jButtonOk
) {
578 if (arg0
.getSource() == jButtonCancel
) {
582 if (arg0
.getSource() == jButtonAdd
) {
584 //ToDo: check before add
585 String
[] row
= {"", "", "", "", "", "", ""};
586 row
[3] = jTextFieldHelp
.getText();
587 row
[2] = jTextFieldGuid
.getText();
588 row
[1] = jTextFieldCName
.getText();
589 row
[0] = jTextFieldName
.getText();
590 row
[4] = vectorToString(iCheckBoxListArch
.getAllCheckedItemsString());
591 if (row
[4].length() == 0) {
594 row
[5] = vectorToString(iCheckBoxListMod
.getAllCheckedItemsString());
595 if (row
[5].length() == 0) {
598 row
[6] = vectorToString(iCheckBoxListGuid
.getAllCheckedItemsString());
599 if (row
[6].length() == 0) {
603 if (!dataValidation(row
)) {
607 if (addRow(row
) == -1) {
611 jTable
.changeSelection(model
.getRowCount()-1, 0, false, false);
615 // remove selected line
617 if (arg0
.getSource() == jButtonRemove
) {
618 if (jTable
.isEditing()){
619 jTable
.getCellEditor().stopCellEditing();
621 int rowSelected
= selectedRow
;
622 if (rowSelected
>= 0) {
623 model
.removeRow(rowSelected
);
624 removeRow(rowSelected
);
628 if (arg0
.getSource() == jButtonClearAll
) {
629 if (model
.getRowCount() == 0) {
632 model
.setRowCount(0);
636 if (arg0
.getSource() == jButtonGen
) {
637 jTextFieldGuid
.setText(Tools
.generateUuidString());
640 if (arg0
.getActionCommand().equals("GenGuidValue")) {
641 jTextFieldGuid
.setText(guidDialog
.getGuid());
646 protected boolean dataValidation(String
[] row
){
647 if (!DataValidation
.isUiNameType(row
[0])) {
648 JOptionPane
.showMessageDialog(this, "Name must start with an alpha character.");
651 if (!DataValidation
.isGuid(row
[2])) {
652 JOptionPane
.showMessageDialog(this, "Guid Value must be in registry format, 8-4-4-4-12.");
655 if (!DataValidation
.isC_NameType(row
[1])) {
656 JOptionPane
.showMessageDialog(this, "C Name does not match C Name datatype.");
659 if (row
[3].length() == 0) {
660 JOptionPane
.showMessageDialog(this, "Help Text must be entered!");
666 protected int addRow(String
[] row
) {
667 Vector
<String
> vArch
= iCheckBoxListArch
.getAllCheckedItemsString();
668 if (vArch
.size() == 0) {
671 Vector
<String
> vModType
= iCheckBoxListMod
.getAllCheckedItemsString();
672 if (vModType
.size() == 0) {
675 Vector
<String
> vguidType
= iCheckBoxListGuid
.getAllCheckedItemsString();
676 if (vguidType
.size() == 0) {
679 if (vguidType
== null) {
680 JOptionPane
.showMessageDialog(this, "You must select at least one GUID type.");
683 if (docConsole
!= null) {
684 docConsole
.setSaved(false);
686 sfc
.genSpdGuidDeclarations(row
[0], row
[1], row
[2], row
[3], vArch
, vModType
, vguidType
);
690 protected void removeRow(int i
){
691 sfc
.removeSpdGuidDeclaration(i
);
692 if (docConsole
!= null) {
693 docConsole
.setSaved(false);
697 protected void clearAllRow(){
698 sfc
.removeSpdGuidDeclaration();
699 if (docConsole
!= null) {
700 docConsole
.setSaved(false);
705 Add contents in list to sfc
707 protected void save() {
712 This method initializes jButtonBrowse
714 @return javax.swing.JButton
716 protected JButton
getJButtonGen() {
717 if (jButtonGen
== null) {
718 jButtonGen
= new JButton();
719 jButtonGen
.setBounds(new java
.awt
.Rectangle(379,58,92,21));
720 jButtonGen
.setText("Gen GUID");
721 jButtonGen
.setPreferredSize(new java
.awt
.Dimension(80,20));
722 jButtonGen
.addActionListener(this);
728 * This method initializes jTextFieldName
730 * @return javax.swing.JTextField
732 protected JTextField
getJTextFieldName() {
733 if (jTextFieldName
== null) {
734 jTextFieldName
= new JTextField();
735 jTextFieldName
.setBounds(new java
.awt
.Rectangle(138,10,337,20));
736 jTextFieldName
.setPreferredSize(new java
.awt
.Dimension(335,20));
738 return jTextFieldName
;
742 * This method initializes jTextFieldCName
744 * @return javax.swing.JTextField
746 protected JTextField
getJTextFieldCName() {
747 if (jTextFieldCName
== null) {
748 jTextFieldCName
= new JTextField();
749 jTextFieldCName
.setBounds(new java
.awt
.Rectangle(137,35,337,20));
750 jTextFieldCName
.setPreferredSize(new java
.awt
.Dimension(335,20));
752 return jTextFieldCName
;
755 public void componentResized(ComponentEvent arg0
) {
756 int intPreferredWidth
= 500;
758 Tools
.resizeComponentWidth(this.jTextFieldName
, this.getWidth(), intPreferredWidth
);
760 Tools
.resizeComponentWidth(this.jTextFieldCName
, this.getWidth(), intPreferredWidth
);
761 Tools
.resizeComponentWidth(this.jTextFieldHelp
, this.getWidth(), intPreferredWidth
);
762 Tools
.resizeComponentWidth(this.jScrollPane
, this.getWidth(), intPreferredWidth
);
763 Tools
.relocateComponentX(this.jButtonGen
, this.getWidth(), this.getPreferredSize().width
, 40);
768 * This method initializes jTextField
770 * @return javax.swing.JTextField
772 private JTextField
getJTextFieldHelp() {
773 if (jTextFieldHelp
== null) {
774 jTextFieldHelp
= new JTextField();
775 jTextFieldHelp
.setBounds(new java
.awt
.Rectangle(136,85,337,20));
776 jTextFieldHelp
.setPreferredSize(new Dimension(335, 20));
778 return jTextFieldHelp
;
781 private JScrollPane
getJScrollPaneArch() {
782 if (jScrollPaneArch
== null) {
783 jScrollPaneArch
= new JScrollPane();
784 jScrollPaneArch
.setBounds(new java
.awt
.Rectangle(197,142,188,74));
785 jScrollPaneArch
.setPreferredSize(new java
.awt
.Dimension(188, 74));
786 jScrollPaneArch
.setViewportView(getICheckBoxListArch());
788 return jScrollPaneArch
;
791 * This method initializes iCheckBoxList
793 * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
795 private ICheckBoxList
getICheckBoxListArch() {
796 if (iCheckBoxListArch
== null) {
797 iCheckBoxListArch
= new ICheckBoxList();
798 iCheckBoxListArch
.setBounds(new java
.awt
.Rectangle(197,142,188,74));
799 Vector
<String
> v
= new Vector
<String
>();
806 iCheckBoxListArch
.setAllItems(v
);
808 return iCheckBoxListArch
;
811 protected JScrollPane
getJScrollPaneGuid() {
812 if (jScrollPaneGuid
== null) {
813 jScrollPaneGuid
= new JScrollPane();
814 jScrollPaneGuid
.setPreferredSize(new java
.awt
.Dimension(190,74));
815 jScrollPaneGuid
.setLocation(new java
.awt
.Point(400,142));
816 jScrollPaneGuid
.setSize(new java
.awt
.Dimension(260,74));
817 jScrollPaneGuid
.setViewportView(getICheckBoxListGuid());
819 return jScrollPaneGuid
;
822 * This method initializes iCheckBoxList1
824 * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
826 private ICheckBoxList
getICheckBoxListGuid() {
827 if (iCheckBoxListGuid
== null) {
828 iCheckBoxListGuid
= new ICheckBoxList();
829 iCheckBoxListGuid
.setBounds(new java
.awt
.Rectangle(400,142,177,74));
830 Vector
<String
> v
= new Vector
<String
>();
831 v
.add("DATA_HUB_RECORD");
833 v
.add("EFI_SYSTEM_CONFIGURATION_TABLE");
834 v
.add("EFI_VARIABLE");
836 v
.add("HII_PACKAGE_LIST");
838 v
.add("TOKEN_SPACE_GUID");
840 iCheckBoxListGuid
.setAllItems(v
);
842 return iCheckBoxListGuid
;
845 private JScrollPane
getJScrollPaneModule() {
846 if (jScrollPaneModule
== null) {
847 jScrollPaneModule
= new JScrollPane();
848 jScrollPaneModule
.setBounds(new java
.awt
.Rectangle(14,142,170,74));
849 jScrollPaneModule
.setPreferredSize(new java
.awt
.Dimension(170, 74));
850 jScrollPaneModule
.setViewportView(getICheckBoxListMod());
852 return jScrollPaneModule
;
855 * This method initializes iCheckBoxList2
857 * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
859 private ICheckBoxList
getICheckBoxListMod() {
860 if (iCheckBoxListMod
== null) {
861 iCheckBoxListMod
= new ICheckBoxList();
862 iCheckBoxListMod
.setBounds(new java
.awt
.Rectangle(14,142,170,74));
863 Vector
<String
> v
= new Vector
<String
>();
870 v
.add("DXE_RUNTIME_DRIVER");
871 v
.add("DXE_SAL_DRIVER");
872 v
.add("DXE_SMM_DRIVER");
873 v
.add("UEFI_DRIVER");
874 v
.add("UEFI_APPLICATION");
875 v
.add("USER_DEFINED");
876 iCheckBoxListMod
.setAllItems(v
);
878 return iCheckBoxListMod
;
881 public static void main(String
[] args
){
882 new SpdGuidDecls().setVisible(true);
885 protected DefaultTableModel
getModel() {
889 protected void setModel(DefaultTableModel model
) {
893 protected String
vectorToString(Vector
<String
> v
) {
895 for (int i
= 0; i
< v
.size(); ++i
) {
902 protected Vector
<String
> stringToVector(String s
){
906 String
[] sArray
= s
.split(" ");
907 Vector
<String
> v
= new Vector
<String
>();
908 for (int i
= 0; i
< sArray
.length
; ++i
) {
914 protected JLabel
getJLabelGuidType() {
915 return jLabelGuidType
;