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
.FontMetrics
;
17 import java
.awt
.Point
;
18 import java
.awt
.event
.ActionEvent
;
19 import java
.awt
.event
.ComponentEvent
;
20 import java
.util
.Vector
;
22 import javax
.swing
.JOptionPane
;
23 import javax
.swing
.JPanel
;
24 import javax
.swing
.JTable
;
25 import javax
.swing
.JTextField
;
26 import javax
.swing
.JLabel
;
27 import javax
.swing
.JScrollPane
;
28 import javax
.swing
.JButton
;
29 import javax
.swing
.JFrame
;
30 import javax
.swing
.ListSelectionModel
;
31 import javax
.swing
.event
.InternalFrameAdapter
;
32 import javax
.swing
.event
.InternalFrameEvent
;
33 import javax
.swing
.event
.ListSelectionEvent
;
34 import javax
.swing
.event
.ListSelectionListener
;
35 import javax
.swing
.event
.TableModelEvent
;
36 import javax
.swing
.event
.TableModelListener
;
37 import javax
.swing
.table
.DefaultTableModel
;
38 import javax
.swing
.table
.TableColumn
;
39 import javax
.swing
.table
.TableModel
;
41 import org
.tianocore
.PackageSurfaceAreaDocument
;
42 import org
.tianocore
.frameworkwizard
.common
.DataValidation
;
43 import org
.tianocore
.frameworkwizard
.common
.Tools
;
44 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningPackageType
;
45 import org
.tianocore
.frameworkwizard
.common
.ui
.IInternalFrame
;
46 import org
.tianocore
.frameworkwizard
.common
.ui
.StarLabel
;
47 import org
.tianocore
.frameworkwizard
.common
.ui
.iCheckBoxList
.ICheckBoxList
;
48 import org
.tianocore
.frameworkwizard
.platform
.ui
.ListEditor
;
49 import org
.tianocore
.frameworkwizard
.platform
.ui
.LongTextEditor
;
52 GUI for create library definition elements of spd file.
54 @since PackageEditor 1.0
56 public class SpdGuidDecls
extends IInternalFrame
implements TableModelListener
{
60 private static final long serialVersionUID
= 1L;
64 private SpdFileContents sfc
= null;
66 private OpeningPackageType docConsole
= null;
68 private JTable jTable
= null;
70 private DefaultTableModel model
= null;
72 private JPanel jContentPane
= null;
74 private JTextField jTextFieldGuid
= null;
76 private JScrollPane jScrollPane
= null;
78 private JButton jButtonAdd
= null;
80 private JButton jButtonRemove
= null;
82 private JButton jButtonClearAll
= null;
84 private JButton jButtonCancel
= null;
86 private JButton jButtonOk
= null;
88 private JButton jButtonGen
= null;
90 private StarLabel jStarLabel1
= null;
92 private StarLabel jStarLabel2
= null;
94 private StarLabel jStarLabel3
= null;
96 private StarLabel jStarLabel4
= null;
98 protected int selectedRow
= -1;
100 private JLabel jLabelName
= null;
102 private JScrollPane jScrollPaneModule
= null;
104 private JTextField jTextFieldName
= null;
106 private JScrollPane jScrollPaneArch
= null;
108 private JScrollPane jScrollPaneGuid
= null;
110 private JLabel jLabelGuid
= null;
112 private JScrollPane topScrollPane
= null; // @jve:decl-index=0:visual-constraint="10,213"
114 private JLabel jLabelCName
= null;
116 private GenGuidDialog guidDialog
= null;
118 private JTextField jTextFieldCName
= null;
120 private JLabel jLabelHelp
= null;
122 private JTextField jTextFieldHelp
= null;
124 private JLabel jLabelSupMod
= null;
126 private JLabel jLabelSupArch
= null;
128 private ICheckBoxList iCheckBoxListArch
= null;
130 private ICheckBoxList iCheckBoxListGuid
= null;
132 private ICheckBoxList iCheckBoxListMod
= null;
134 private JLabel jLabelGuidType
= null;
136 protected String
[][] saa
= null;
138 protected StarLabel starLabel
= null;
140 private final int guidNameMinWidth
= 200;
141 private final int guidCNameMinWidth
= 200;
142 private final int guidValueMinWidth
= 300;
143 private final int helpTextMinWidth
= 300;
144 private final int supArchMinWidth
= 200;
145 private final int supModMinWidth
= 200;
146 private final int guidTypeMinWidth
= 200;
150 This method initializes this
153 protected void initialize() {
155 this.setDefaultCloseOperation(javax
.swing
.WindowConstants
.DISPOSE_ON_CLOSE
);
160 This method initializes jTextFieldGuid
162 @return javax.swing.JTextField
164 protected JTextField
getJTextFieldGuid() {
165 if (jTextFieldGuid
== null) {
166 jTextFieldGuid
= new JTextField();
167 jTextFieldGuid
.setBounds(new java
.awt
.Rectangle(137,60,336,20));
168 jTextFieldGuid
.setPreferredSize(new java
.awt
.Dimension(200,20));
171 return jTextFieldGuid
;
175 This method initializes jScrollPane
177 @return javax.swing.JScrollPane
179 protected JScrollPane
getJScrollPane() {
180 if (jScrollPane
== null) {
181 jScrollPane
= new JScrollPane();
182 jScrollPane
.setBounds(new java
.awt
.Rectangle(5,256,472,292));
183 jScrollPane
.setViewportView(getJTable());
189 This method initializes jTable
191 @return javax.swing.JTable
193 protected JTable
getJTable() {
194 if (jTable
== null) {
195 model
= new DefaultTableModel();
196 jTable
= new JTable(model
);
197 jTable
.setRowHeight(20);
198 jTable
.setAutoResizeMode(javax
.swing
.JTable
.AUTO_RESIZE_OFF
);
199 model
.addColumn("Name");
200 model
.addColumn("The C Name");
201 model
.addColumn("GUID Value");
202 model
.addColumn("Help Text");
203 model
.addColumn("Supported Architectures");
204 model
.addColumn("Supported Module Types");
205 model
.addColumn("GuidTypes");
207 TableColumn column
= jTable
.getColumnModel().getColumn(0);
208 column
.setMinWidth(this.guidNameMinWidth
);
209 column
= jTable
.getColumnModel().getColumn(1);
210 column
.setMinWidth(this.guidCNameMinWidth
);
211 column
= jTable
.getColumnModel().getColumn(2);
212 column
.setMinWidth(this.guidValueMinWidth
);
213 column
= jTable
.getColumnModel().getColumn(3);
214 column
.setMinWidth(this.helpTextMinWidth
);
215 column
= jTable
.getColumnModel().getColumn(4);
216 column
.setMinWidth(this.supArchMinWidth
);
217 column
= jTable
.getColumnModel().getColumn(5);
218 column
.setMinWidth(this.supModMinWidth
);
219 column
= jTable
.getColumnModel().getColumn(6);
220 column
.setMinWidth(this.guidTypeMinWidth
);
222 jTable
.getColumnModel().getColumn(2).setCellEditor(new GuidEditor());
223 jTable
.getColumnModel().getColumn(3).setCellEditor(new LongTextEditor());
225 Vector
<String
> vArch
= new Vector
<String
>();
232 jTable
.getColumnModel().getColumn(4).setCellEditor(new ListEditor(vArch
));
234 Vector
<String
> vModule
= new Vector
<String
>();
237 vModule
.add("PEI_CORE");
239 vModule
.add("DXE_CORE");
240 vModule
.add("DXE_DRIVER");
241 vModule
.add("DXE_RUNTIME_DRIVER");
242 vModule
.add("DXE_SAL_DRIVER");
243 vModule
.add("DXE_SMM_DRIVER");
244 vModule
.add("UEFI_DRIVER");
245 vModule
.add("UEFI_APPLICATION");
246 vModule
.add("USER_DEFINED");
247 jTable
.getColumnModel().getColumn(5).setCellEditor(new ListEditor(vModule
));
249 Vector
<String
> vGuid
= new Vector
<String
>();
250 vGuid
.add("DATA_HUB_RECORD");
251 vGuid
.add("EFI_EVENT");
252 vGuid
.add("EFI_SYSTEM_CONFIGURATION_TABLE");
253 vGuid
.add("EFI_VARIABLE");
255 vGuid
.add("HII_PACKAGE_LIST");
257 vGuid
.add("TOKEN_SPACE_GUID");
258 ListEditor le
= new ListEditor(vGuid
);
259 le
.setCanNotBeEmpty(true);
260 jTable
.getColumnModel().getColumn(6).setCellEditor(le
);
262 jTable
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
263 jTable
.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
264 public void valueChanged(ListSelectionEvent e
) {
265 if (e
.getValueIsAdjusting()){
268 ListSelectionModel lsm
= (ListSelectionModel
)e
.getSource();
269 if (lsm
.isSelectionEmpty()) {
273 selectedRow
= lsm
.getMinSelectionIndex();
279 jTable
.getModel().addTableModelListener(this);
285 public void tableChanged(TableModelEvent arg0
) {
286 // TODO Auto-generated method stub
287 int row
= arg0
.getFirstRow();
288 int column
= arg0
.getColumn();
289 TableModel m
= (TableModel
)arg0
.getSource();
290 if (arg0
.getType() == TableModelEvent
.UPDATE
){
292 updateRow(row
, column
, m
);
296 protected void updateRow(int row
, int column
, TableModel m
){
297 String
[] sa
= new String
[7];
298 sfc
.getSpdGuidDeclaration(sa
, row
);
299 Object cellData
= m
.getValueAt(row
, column
);
300 if (cellData
== null) {
303 if (cellData
.equals(sa
[column
])) {
307 if (cellData
.toString().length() == 0 && sa
[column
] == null) {
311 String name
= m
.getValueAt(row
, 0) + "";
312 String cName
= m
.getValueAt(row
, 1) + "";
313 String guid
= m
.getValueAt(row
, 2) + "";
314 String help
= m
.getValueAt(row
, 3) + "";
315 String archList
= null;
316 if (m
.getValueAt(row
, 4) != null){
317 archList
= m
.getValueAt(row
, 4).toString();
319 String modTypeList
= null;
320 if (m
.getValueAt(row
, 5) != null) {
321 modTypeList
= m
.getValueAt(row
, 5).toString();
323 String guidTypeList
= null;
324 if (m
.getValueAt(row
, 6) != null){
325 guidTypeList
= m
.getValueAt(row
, 6).toString();
327 String
[] rowData
= {name
, cName
, guid
, help
};
328 if (!dataValidation(rowData
)){
331 if (docConsole
!= null) {
332 docConsole
.setSaved(false);
334 sfc
.updateSpdGuidDecl(row
, name
, cName
, guid
, help
, archList
, modTypeList
, guidTypeList
);
337 This method initializes jButtonAdd
339 @return javax.swing.JButton
341 protected JButton
getJButtonAdd() {
342 if (jButtonAdd
== null) {
343 jButtonAdd
= new JButton();
344 jButtonAdd
.setBounds(new java
.awt
.Rectangle(167,227,90,20));
345 jButtonAdd
.setText("Add");
346 jButtonAdd
.addActionListener(this);
352 This method initializes jButtonRemove
354 @return javax.swing.JButton
356 protected JButton
getJButtonRemove() {
357 if (jButtonRemove
== null) {
358 jButtonRemove
= new JButton();
359 jButtonRemove
.setBounds(new java
.awt
.Rectangle(270,227,90,20));
360 jButtonRemove
.setText("Remove");
361 jButtonRemove
.addActionListener(this);
363 return jButtonRemove
;
367 This method initializes jButtonRemoveAll
369 @return javax.swing.JButton
371 protected JButton
getJButtonClearAll() {
372 if (jButtonClearAll
== null) {
373 jButtonClearAll
= new JButton();
374 jButtonClearAll
.setBounds(new java
.awt
.Rectangle(380,227,90,20));
375 jButtonClearAll
.setText("Clear All");
376 jButtonClearAll
.addActionListener(this);
378 return jButtonClearAll
;
382 This method initializes jButtonCancel
384 @return javax.swing.JButton
386 protected JButton
getJButtonCancel() {
387 if (jButtonCancel
== null) {
388 jButtonCancel
= new JButton();
389 jButtonCancel
.setPreferredSize(new java
.awt
.Dimension(90, 20));
390 jButtonCancel
.setLocation(new java
.awt
.Point(390, 305));
391 jButtonCancel
.setText("Cancel");
392 jButtonCancel
.setSize(new java
.awt
.Dimension(90, 20));
393 jButtonCancel
.setVisible(false);
394 jButtonCancel
.addActionListener(this);
396 return jButtonCancel
;
400 This method initializes jButton
402 @return javax.swing.JButton
404 protected JButton
getJButtonOk() {
405 if (jButtonOk
== null) {
406 jButtonOk
= new JButton();
407 jButtonOk
.setSize(new java
.awt
.Dimension(90, 20));
408 jButtonOk
.setText("OK");
409 jButtonOk
.setLocation(new java
.awt
.Point(290, 305));
410 jButtonOk
.setVisible(false);
411 jButtonOk
.addActionListener(this);
417 This is the default constructor
419 public SpdGuidDecls() {
426 public SpdGuidDecls(PackageSurfaceAreaDocument
.PackageSurfaceArea inPsa
){
428 sfc
= new SpdFileContents(inPsa
);
432 public SpdGuidDecls(OpeningPackageType opt
) {
433 this(opt
.getXmlSpd());
437 This method initializes this
441 protected void init() {
442 this.setContentPane(getJContentPane());
443 this.addInternalFrameListener(new InternalFrameAdapter(){
444 public void internalFrameDeactivated(InternalFrameEvent e
){
445 if (jTable
.isEditing()) {
446 jTable
.getCellEditor().stopCellEditing();
450 this.setBounds(new java
.awt
.Rectangle(0, 0, 500, 370));
451 this.setVisible(true);
455 protected void init(SpdFileContents sfc
){
456 if (sfc
.getSpdGuidDeclarationCount() == 0) {
460 // initialize table using SpdFileContents object
462 saa
= new String
[sfc
.getSpdGuidDeclarationCount()][7];
463 sfc
.getSpdGuidDeclarations(saa
);
465 while (i
< saa
.length
) {
466 model
.addRow(saa
[i
]);
471 protected JScrollPane
getJContentPane(){
472 if (topScrollPane
== null){
473 topScrollPane
= new JScrollPane();
474 topScrollPane
.setSize(new java
.awt
.Dimension(617,500));
475 topScrollPane
.setPreferredSize(new java
.awt
.Dimension(498,500));
476 topScrollPane
.setViewportView(getJContentPane1());
478 return topScrollPane
;
482 This method initializes jContentPane
484 @return javax.swing.JPanel
486 protected JPanel
getJContentPane1() {
487 if (jContentPane
== null) {
489 jLabelGuidType
= new JLabel();
490 jLabelGuidType
.setBounds(new java
.awt
.Rectangle(420,122,103,16));
491 jLabelGuidType
.setText("GUID Type List");
492 jLabelGuidType
.setEnabled(true);
493 starLabel
= new StarLabel();
494 starLabel
.setLocation(new Point(jLabelGuidType
.getX() - 10, jLabelGuidType
.getY()));
495 starLabel
.setVisible(true);
496 jLabelSupArch
= new JLabel();
497 jLabelSupArch
.setBounds(new java
.awt
.Rectangle(197,122,108,16));
498 jLabelSupArch
.setText("Supported Architectures");
499 jLabelSupArch
.setEnabled(true);
500 FontMetrics fm
= jLabelSupArch
.getFontMetrics(jLabelSupArch
.getFont());
501 jLabelSupArch
.setSize(fm
.stringWidth(jLabelSupArch
.getText()) + 10, 20);
502 jLabelSupMod
= new JLabel();
503 jLabelSupMod
.setBounds(new java
.awt
.Rectangle(14,120,110,16));
504 jLabelSupMod
.setText("Supported Module Types");
505 jLabelSupMod
.setEnabled(true);
506 fm
= jLabelSupMod
.getFontMetrics(jLabelSupMod
.getFont());
507 jLabelSupMod
.setSize(fm
.stringWidth(jLabelSupMod
.getText()) + 10, 20);
508 jLabelHelp
= new JLabel();
509 jLabelHelp
.setText("HelpText");
510 jLabelHelp
.setSize(new java
.awt
.Dimension(109,20));
511 jLabelHelp
.setLocation(new java
.awt
.Point(14,85));
512 jLabelCName
= new JLabel();
513 jLabelCName
.setBounds(new java
.awt
.Rectangle(14,35,111,20));
514 jLabelCName
.setText("C Name");
515 jLabelGuid
= new JLabel();
516 jLabelGuid
.setBounds(new java
.awt
.Rectangle(15,60,112,20));
517 jLabelGuid
.setText("Guid Value");
518 jLabelName
= new JLabel();
519 jLabelName
.setBounds(new java
.awt
.Rectangle(15,10,113,20));
520 jLabelName
.setText("Name");
521 jStarLabel1
= new StarLabel();
522 jStarLabel1
.setLocation(new java
.awt
.Point(0, 10));
523 jStarLabel3
= new StarLabel();
524 jStarLabel3
.setLocation(new java
.awt
.Point(0, 35));
525 jStarLabel4
= new StarLabel();
526 jStarLabel4
.setLocation(new java
.awt
.Point(0, 60));
527 jStarLabel2
= new StarLabel();
528 jStarLabel2
.setLocation(new java
.awt
.Point(0, 85));
529 jStarLabel2
.setVisible(true);
530 jContentPane
= new JPanel();
531 jContentPane
.setLayout(null);
532 jContentPane
.setPreferredSize(new Dimension(480, 375));
533 jContentPane
.add(jStarLabel1
, null);
534 jContentPane
.add(jStarLabel2
, null);
535 jContentPane
.add(jStarLabel3
, null);
536 jContentPane
.add(jStarLabel4
, null);
537 jContentPane
.add(jLabelCName
, null);
538 jContentPane
.add(getJTextFieldCName(), null);
539 jContentPane
.add(getJTextFieldGuid(), null);
540 jContentPane
.add(getJScrollPane(), null);
541 jContentPane
.add(getJButtonAdd(), null);
542 jContentPane
.add(getJButtonRemove(), null);
543 jContentPane
.add(getJButtonClearAll(), null);
544 jContentPane
.add(getJButtonCancel(), null);
545 jContentPane
.add(getJButtonOk(), null);
547 jContentPane
.add(getJButtonGen(), null);
548 jContentPane
.add(jLabelName
, null);
549 jContentPane
.add(getJTextFieldName(), null);
550 jContentPane
.add(jLabelGuid
, null);
551 jContentPane
.add(jLabelHelp
, null);
552 jContentPane
.add(getJTextFieldHelp(), null);
553 jContentPane
.add(jLabelSupMod
, null);
554 jContentPane
.add(jLabelSupArch
, null);
555 jContentPane
.add(getJScrollPaneArch(), null);
556 jContentPane
.add(getJScrollPaneGuid(), null);
557 jContentPane
.add(getJScrollPaneModule(), null);
558 jContentPane
.add(jLabelGuidType
, null);
559 jContentPane
.add(starLabel
, null);
565 fill ComboBoxes with pre-defined contents
567 protected void initFrame() {
569 this.setTitle("GUID Declarations");
574 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
576 public void actionPerformed(ActionEvent arg0
) {
578 if (arg0
.getSource() == jButtonOk
) {
583 if (arg0
.getSource() == jButtonCancel
) {
587 if (arg0
.getSource() == jButtonAdd
) {
589 //ToDo: check before add
590 String
[] row
= {"", "", "", "", "", "", ""};
591 row
[3] = jTextFieldHelp
.getText();
592 row
[2] = jTextFieldGuid
.getText();
593 row
[1] = jTextFieldCName
.getText();
594 row
[0] = jTextFieldName
.getText();
595 row
[4] = vectorToString(iCheckBoxListArch
.getAllCheckedItemsString());
596 if (row
[4].length() == 0) {
599 row
[5] = vectorToString(iCheckBoxListMod
.getAllCheckedItemsString());
600 if (row
[5].length() == 0) {
603 row
[6] = vectorToString(iCheckBoxListGuid
.getAllCheckedItemsString());
604 if (row
[6].length() == 0) {
608 if (!dataValidation(row
)) {
612 if (addRow(row
) == -1) {
616 jTable
.changeSelection(model
.getRowCount()-1, 0, false, false);
620 // remove selected line
622 if (arg0
.getSource() == jButtonRemove
) {
623 if (jTable
.isEditing()){
624 jTable
.getCellEditor().stopCellEditing();
626 int rowSelected
= selectedRow
;
627 if (rowSelected
>= 0) {
628 model
.removeRow(rowSelected
);
629 removeRow(rowSelected
);
633 if (arg0
.getSource() == jButtonClearAll
) {
634 if (model
.getRowCount() == 0) {
637 model
.setRowCount(0);
641 if (arg0
.getSource() == jButtonGen
) {
642 jTextFieldGuid
.setText(Tools
.generateUuidString());
645 if (arg0
.getActionCommand().equals("GenGuidValue")) {
646 jTextFieldGuid
.setText(guidDialog
.getGuid());
651 protected boolean dataValidation(String
[] row
){
652 if (!DataValidation
.isUiNameType(row
[0])) {
653 JOptionPane
.showMessageDialog(this, "Name must start with an alpha character.");
656 if (!DataValidation
.isGuid(row
[2])) {
657 JOptionPane
.showMessageDialog(this, "Guid Value must be in registry format, 8-4-4-4-12.");
660 if (!DataValidation
.isC_NameType(row
[1])) {
661 JOptionPane
.showMessageDialog(this, "C Name does not match C Name datatype.");
664 if (row
[3].length() == 0) {
665 JOptionPane
.showMessageDialog(this, "Help Text must be entered!");
671 protected int addRow(String
[] row
) {
672 Vector
<String
> vArch
= iCheckBoxListArch
.getAllCheckedItemsString();
673 if (vArch
.size() == 0) {
676 Vector
<String
> vModType
= iCheckBoxListMod
.getAllCheckedItemsString();
677 if (vModType
.size() == 0) {
680 Vector
<String
> vguidType
= iCheckBoxListGuid
.getAllCheckedItemsString();
681 if (vguidType
.size() == 0) {
684 if (vguidType
== null) {
685 JOptionPane
.showMessageDialog(this, "You must select at least one GUID type.");
688 if (docConsole
!= null) {
689 docConsole
.setSaved(false);
691 sfc
.genSpdGuidDeclarations(row
[0], row
[1], row
[2], row
[3], vArch
, vModType
, vguidType
);
695 protected void removeRow(int i
){
696 sfc
.removeSpdGuidDeclaration(i
);
697 if (docConsole
!= null) {
698 docConsole
.setSaved(false);
702 protected void clearAllRow(){
703 sfc
.removeSpdGuidDeclaration();
704 if (docConsole
!= null) {
705 docConsole
.setSaved(false);
710 Add contents in list to sfc
712 protected void save() {
717 This method initializes jButtonBrowse
719 @return javax.swing.JButton
721 protected JButton
getJButtonGen() {
722 if (jButtonGen
== null) {
723 jButtonGen
= new JButton();
724 jButtonGen
.setBounds(new java
.awt
.Rectangle(485,58,92,21));
725 jButtonGen
.setText("Gen GUID");
726 jButtonGen
.setPreferredSize(new java
.awt
.Dimension(80,20));
727 jButtonGen
.addActionListener(this);
733 * This method initializes jTextFieldName
735 * @return javax.swing.JTextField
737 protected JTextField
getJTextFieldName() {
738 if (jTextFieldName
== null) {
739 jTextFieldName
= new JTextField();
740 jTextFieldName
.setBounds(new java
.awt
.Rectangle(138,10,337,20));
741 jTextFieldName
.setPreferredSize(new java
.awt
.Dimension(335,20));
743 return jTextFieldName
;
747 * This method initializes jTextFieldCName
749 * @return javax.swing.JTextField
751 protected JTextField
getJTextFieldCName() {
752 if (jTextFieldCName
== null) {
753 jTextFieldCName
= new JTextField();
754 jTextFieldCName
.setBounds(new java
.awt
.Rectangle(137,35,337,20));
755 jTextFieldCName
.setPreferredSize(new java
.awt
.Dimension(335,20));
757 return jTextFieldCName
;
760 public void componentResized(ComponentEvent arg0
) {
761 int intPreferredWidth
= 500;
763 Tools
.resizeComponentWidth(this.jTextFieldName
, this.getWidth(), intPreferredWidth
);
765 Tools
.resizeComponentWidth(this.jTextFieldCName
, this.getWidth(), intPreferredWidth
);
766 Tools
.resizeComponentWidth(this.jTextFieldHelp
, this.getWidth(), intPreferredWidth
);
767 Tools
.resizeComponentWidth(this.jScrollPane
, this.getWidth(), intPreferredWidth
);
768 Tools
.relocateComponentX(this.jButtonGen
, this.getWidth(), this.getPreferredSize().width
, 40);
773 * This method initializes jTextField
775 * @return javax.swing.JTextField
777 private JTextField
getJTextFieldHelp() {
778 if (jTextFieldHelp
== null) {
779 jTextFieldHelp
= new JTextField();
780 jTextFieldHelp
.setBounds(new java
.awt
.Rectangle(136,85,337,20));
781 jTextFieldHelp
.setPreferredSize(new Dimension(335, 20));
783 return jTextFieldHelp
;
786 private JScrollPane
getJScrollPaneArch() {
787 if (jScrollPaneArch
== null) {
788 jScrollPaneArch
= new JScrollPane();
789 jScrollPaneArch
.setBounds(new java
.awt
.Rectangle(197,142,188,74));
790 jScrollPaneArch
.setPreferredSize(new java
.awt
.Dimension(188, 74));
791 jScrollPaneArch
.setViewportView(getICheckBoxListArch());
793 return jScrollPaneArch
;
796 * This method initializes iCheckBoxList
798 * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
800 private ICheckBoxList
getICheckBoxListArch() {
801 if (iCheckBoxListArch
== null) {
802 iCheckBoxListArch
= new ICheckBoxList();
803 iCheckBoxListArch
.setBounds(new java
.awt
.Rectangle(197,142,188,74));
804 Vector
<String
> v
= new Vector
<String
>();
811 iCheckBoxListArch
.setAllItems(v
);
813 return iCheckBoxListArch
;
816 protected JScrollPane
getJScrollPaneGuid() {
817 if (jScrollPaneGuid
== null) {
818 jScrollPaneGuid
= new JScrollPane();
819 jScrollPaneGuid
.setPreferredSize(new java
.awt
.Dimension(190,74));
820 jScrollPaneGuid
.setLocation(new java
.awt
.Point(400,142));
821 jScrollPaneGuid
.setSize(new java
.awt
.Dimension(260,74));
822 jScrollPaneGuid
.setViewportView(getICheckBoxListGuid());
824 return jScrollPaneGuid
;
827 * This method initializes iCheckBoxList1
829 * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
831 private ICheckBoxList
getICheckBoxListGuid() {
832 if (iCheckBoxListGuid
== null) {
833 iCheckBoxListGuid
= new ICheckBoxList();
834 iCheckBoxListGuid
.setBounds(new java
.awt
.Rectangle(400,142,177,74));
835 Vector
<String
> v
= new Vector
<String
>();
836 v
.add("DATA_HUB_RECORD");
838 v
.add("EFI_SYSTEM_CONFIGURATION_TABLE");
839 v
.add("EFI_VARIABLE");
841 v
.add("HII_PACKAGE_LIST");
843 v
.add("TOKEN_SPACE_GUID");
845 iCheckBoxListGuid
.setAllItems(v
);
847 return iCheckBoxListGuid
;
850 private JScrollPane
getJScrollPaneModule() {
851 if (jScrollPaneModule
== null) {
852 jScrollPaneModule
= new JScrollPane();
853 jScrollPaneModule
.setBounds(new java
.awt
.Rectangle(14,142,170,74));
854 jScrollPaneModule
.setPreferredSize(new java
.awt
.Dimension(170, 74));
855 jScrollPaneModule
.setViewportView(getICheckBoxListMod());
857 return jScrollPaneModule
;
860 * This method initializes iCheckBoxList2
862 * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
864 private ICheckBoxList
getICheckBoxListMod() {
865 if (iCheckBoxListMod
== null) {
866 iCheckBoxListMod
= new ICheckBoxList();
867 iCheckBoxListMod
.setBounds(new java
.awt
.Rectangle(14,142,170,74));
868 Vector
<String
> v
= new Vector
<String
>();
875 v
.add("DXE_RUNTIME_DRIVER");
876 v
.add("DXE_SAL_DRIVER");
877 v
.add("DXE_SMM_DRIVER");
878 v
.add("UEFI_DRIVER");
879 v
.add("UEFI_APPLICATION");
880 v
.add("USER_DEFINED");
881 iCheckBoxListMod
.setAllItems(v
);
883 return iCheckBoxListMod
;
886 public static void main(String
[] args
){
887 new SpdGuidDecls().setVisible(true);
890 protected DefaultTableModel
getModel() {
894 protected void setModel(DefaultTableModel model
) {
898 protected String
vectorToString(Vector
<String
> v
) {
900 for (int i
= 0; i
< v
.size(); ++i
) {
907 protected Vector
<String
> stringToVector(String s
){
911 String
[] sArray
= s
.split(" ");
912 Vector
<String
> v
= new Vector
<String
>();
913 for (int i
= 0; i
< sArray
.length
; ++i
) {
919 protected JLabel
getJLabelGuidType() {
920 return jLabelGuidType
;