3 The file is used to create, update spdHeader of Spd file
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 package org
.tianocore
.frameworkwizard
.packaging
.ui
;
18 import java
.awt
.event
.ActionEvent
;
19 import java
.awt
.event
.ComponentEvent
;
20 import java
.awt
.event
.FocusAdapter
;
21 import java
.awt
.event
.FocusEvent
;
23 import javax
.swing
.JButton
;
24 import javax
.swing
.JFrame
;
25 import javax
.swing
.JLabel
;
26 import javax
.swing
.JOptionPane
;
27 import javax
.swing
.JPanel
;
28 import javax
.swing
.JScrollPane
;
29 import javax
.swing
.JTextArea
;
30 import javax
.swing
.JTextField
;
32 import org
.tianocore
.PackageSurfaceAreaDocument
;
33 import org
.tianocore
.frameworkwizard
.common
.DataValidation
;
34 import org
.tianocore
.frameworkwizard
.common
.Tools
;
35 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningPackageType
;
36 import org
.tianocore
.frameworkwizard
.common
.ui
.IInternalFrame
;
37 import org
.tianocore
.frameworkwizard
.common
.ui
.StarLabel
;
38 import javax
.swing
.JCheckBox
;
41 The class is used to create, update spdHeader of Spd file
42 It extends IInternalFrame
44 @since PackageEditor 1.0
47 public class SpdHeader
extends IInternalFrame
{
49 private int dialogWidth
= 560;
51 private int labelColumn
= 12;
53 private int labelWidth
= 155;
55 private int buttonWidth
= 60;
57 private final int valueColumn
= 168;
59 private final int valueWidth
= 320;
61 private final int specWidth
= 420;
63 private int shortValueWidth
= valueWidth
- (buttonWidth
+ 5);
65 private final int oneRowHeight
= 20;
67 private final int threeRowHeight
= 60;
69 private final int fourRowHeight
= 80;
71 private final int rowSep
= 5;
73 private final int rowOne
= 12;
75 private final int rowTwo
= rowOne
+ oneRowHeight
+ rowSep
;
77 private final int rowThree
= rowTwo
+ oneRowHeight
+ rowSep
;
79 private final int rowFour
= rowThree
+ oneRowHeight
+ rowSep
;
81 private final int rowFive
= rowFour
+ threeRowHeight
+ rowSep
;
83 private final int rowSix
= rowFive
+ fourRowHeight
+ rowSep
;
85 private final int rowSeven
= rowSix
+ oneRowHeight
+ rowSep
;
87 private final int rowEight
= rowSeven
+ oneRowHeight
+ rowSep
;
89 private final int rowNine
= rowEight
+ fourRowHeight
+ rowSep
;
91 private final int rowTen
= rowNine
+ oneRowHeight
+ rowSep
;
93 private int dialogHeight
= rowTen
+ threeRowHeight
;
96 /// Define class Serial Version UID
98 private static final long serialVersionUID
= -8152099582923006900L;
101 //Define class members
105 private JPanel jContentPane
= null;
107 private JLabel jPackageNameLabel
= null;
109 private JTextField jPackageNameTextField
= null;
111 private JLabel jGuidLabel
= null;
113 private JTextField jGuidTextField
= null;
115 private JLabel jVersionLabel
= null;
117 private JTextField jVersionTextField
= null;
119 private JButton jGenerateGuidButton
= null;
121 private JLabel jLicenseLabel
= null;
123 private JTextArea jLicenseTextArea
= null;
125 private JLabel jLabelCopyright
= null;
127 private JLabel jDescriptionLabel
= null;
129 private JTextArea jDescriptionTextArea
= null;
131 private JTextField jSpecificationTextField
= null;
133 private JScrollPane jLicenseScrollPane
= null;
135 private JScrollPane jDescriptionScrollPane
= null;
137 private JScrollPane jCopyrightScrollPane
= null;
139 private JLabel jAbstractLabel
= null;
141 private JTextField jAbstractTextField
= null;
143 private StarLabel jStarLabel1
= null;
145 private StarLabel jStarLabel2
= null;
147 private StarLabel jStarLabel3
= null;
149 private StarLabel jStarLabel4
= null;
151 private StarLabel jStarLabel5
= null;
153 private StarLabel jStarLabel6
= null;
155 private StarLabel jStarLabel7
= null;
157 private StarLabel jStarLabel8
= null;
159 private StarLabel jStarLabel9
= null;
161 private SpdFileContents sfc
= null;
163 private OpeningPackageType docConsole
= null;
165 private JTextArea jCopyrightTextArea
= null;
167 private JScrollPane topScrollPane
= null;
169 private JLabel jUrlLabel
= null;
171 private JTextField jUrlTextField
= null;
173 private JCheckBox jCheckBoxRdOnly
= null;
175 private JCheckBox jCheckBoxRePkg
= null;
178 This method initializes jPackageNameTextField
180 @return javax.swing.JTextField jPackageNameTextField
183 private JTextField
getJPackageNameTextField() {
184 if (jPackageNameTextField
== null) {
185 jPackageNameTextField
= new JTextField();
186 jPackageNameTextField
.setBounds(new java
.awt
.Rectangle(valueColumn
, rowOne
, valueWidth
, oneRowHeight
));
187 jPackageNameTextField
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, oneRowHeight
));
188 jPackageNameTextField
.addFocusListener(new FocusAdapter() {
189 public void focusLost(FocusEvent e
) {
190 if (!DataValidation
.isUiNameType(jPackageNameTextField
.getText())) {
191 JOptionPane
.showMessageDialog(frame
, "Package Name must start with a letter.");
194 if (jPackageNameTextField
.getText().equals(sfc
.getSpdHdrPkgName())) {
197 docConsole
.setSaved(false);
198 sfc
.setSpdHdrPkgName(jPackageNameTextField
.getText());
202 return jPackageNameTextField
;
206 This method initializes jGuidTextField
208 @return javax.swing.JTextField jGuidTextField
211 private JTextField
getJGuidTextField() {
212 if (jGuidTextField
== null) {
213 jGuidTextField
= new JTextField();
214 jGuidTextField
.setBounds(new java
.awt
.Rectangle(valueColumn
, rowTwo
, shortValueWidth
, oneRowHeight
));
215 jGuidTextField
.setPreferredSize(new java
.awt
.Dimension(shortValueWidth
, oneRowHeight
));
216 jGuidTextField
.addFocusListener(new FocusAdapter() {
217 public void focusLost(FocusEvent e
) {
218 if (!DataValidation
.isGuid(jGuidTextField
.getText())) {
219 JOptionPane
.showMessageDialog(frame
, "Guid must be in registry (8-4-4-4-12) format.");
222 if (jGuidTextField
.getText().equals(sfc
.getSpdHdrGuidValue())) {
225 docConsole
.setSaved(false);
226 sfc
.setSpdHdrGuidValue(jGuidTextField
.getText());
230 return jGuidTextField
;
234 This method initializes jVersionTextField
236 @return javax.swing.JTextField jVersionTextField
239 private JTextField
getJVersionTextField() {
240 if (jVersionTextField
== null) {
241 jVersionTextField
= new JTextField();
242 jVersionTextField
.setBounds(new java
.awt
.Rectangle(valueColumn
, rowThree
, valueWidth
, oneRowHeight
));
243 jVersionTextField
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, oneRowHeight
));
244 jVersionTextField
.addFocusListener(new FocusAdapter() {
245 public void focusLost(FocusEvent e
) {
246 if (!DataValidation
.isVersion(jVersionTextField
.getText())) {
247 JOptionPane
.showMessageDialog(frame
, "Version must start with a number.");
250 if (jVersionTextField
.getText().equals(sfc
.getSpdHdrVer())) {
253 docConsole
.setSaved(false);
254 sfc
.setSpdHdrVer(jVersionTextField
.getText());
258 return jVersionTextField
;
262 This method initializes jGenerateGuidButton
264 @return javax.swing.JButton jGenerateGuidButton
267 private JButton
getJGenerateGuidButton() {
268 if (jGenerateGuidButton
== null) {
269 jGenerateGuidButton
= new JButton();
270 jGenerateGuidButton
.setBounds(new java
.awt
.Rectangle(valueColumn
+ shortValueWidth
+ 5, rowTwo
, buttonWidth
, oneRowHeight
));
271 jGenerateGuidButton
.setText("GEN");
272 jGenerateGuidButton
.addActionListener(this);
274 return jGenerateGuidButton
;
278 This method initializes jLicenseTextArea
280 @return javax.swing.JTextArea jLicenseTextArea
283 private JTextArea
getJLicenseTextArea() {
284 if (jLicenseTextArea
== null) {
285 jLicenseTextArea
= new JTextArea();
286 // jLicenseTextArea.setText("");
287 jLicenseTextArea
.setLineWrap(true);
288 jLicenseTextArea
.addFocusListener(new FocusAdapter() {
289 public void focusLost(FocusEvent e
) {
290 if (jLicenseTextArea
.getText().length() == 0) {
291 JOptionPane
.showMessageDialog(frame
, "License is a required field.");
294 if (jLicenseTextArea
.getText().equals(sfc
.getSpdHdrLicense())) {
297 docConsole
.setSaved(false);
298 sfc
.setSpdHdrLicense(jLicenseTextArea
.getText());
302 return jLicenseTextArea
;
306 This method initializes jDescriptionTextArea
308 @return javax.swing.JTextArea jDescriptionTextArea
311 private JTextArea
getJDescriptionTextArea() {
312 if (jDescriptionTextArea
== null) {
313 jDescriptionTextArea
= new JTextArea();
314 jDescriptionTextArea
.setLineWrap(true);
315 jDescriptionTextArea
.addFocusListener(new FocusAdapter() {
316 public void focusLost(FocusEvent e
) {
317 if (jDescriptionTextArea
.getText().length() == 0) {
319 .showMessageDialog(frame
,
320 "Description is a required field, and should reflect the contents of the package.");
323 if (jDescriptionTextArea
.getText().equals(sfc
.getSpdHdrDescription())) {
326 docConsole
.setSaved(false);
327 sfc
.setSpdHdrDescription(jDescriptionTextArea
.getText());
331 return jDescriptionTextArea
;
335 This method initializes jSpecificationTextField
337 @return javax.swing.JTextField jSpecificationTextField
340 private JTextField
getJSpecificationTextField() {
341 if (jSpecificationTextField
== null) {
342 jSpecificationTextField
= new JTextField();
343 jSpecificationTextField
.setBounds(new java
.awt
.Rectangle(labelColumn
, dialogHeight
- 40, specWidth
, oneRowHeight
));
344 jSpecificationTextField
.setEditable(false);
345 jSpecificationTextField
.setPreferredSize(new java
.awt
.Dimension(specWidth
, oneRowHeight
));
346 jSpecificationTextField
.setLocation(new java
.awt
.Point(2, dialogHeight
- oneRowHeight
));
347 jSpecificationTextField
.setBorder(null);
349 // jSpecificationTextField.addFocusListener(new FocusAdapter(){
350 // public void focusLost(FocusEvent e){
351 // sfc.setSpdHdrSpec(jSpecificationTextField.getText());
355 return jSpecificationTextField
;
359 This method initializes jLicenseScrollPane
361 @return javax.swing.JScrollPane jLicenseScrollPane
364 private JScrollPane
getJLicenseScrollPane() {
365 if (jLicenseScrollPane
== null) {
366 jLicenseScrollPane
= new JScrollPane();
367 jLicenseScrollPane
.setBounds(new java
.awt
.Rectangle(valueColumn
, rowFive
, valueWidth
, fourRowHeight
));
368 jLicenseScrollPane
.setHorizontalScrollBarPolicy(javax
.swing
.JScrollPane
.HORIZONTAL_SCROLLBAR_NEVER
);
369 jLicenseScrollPane
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, fourRowHeight
));
370 jLicenseScrollPane
.setViewportView(getJLicenseTextArea());
372 return jLicenseScrollPane
;
376 This method initializes jDescriptionScrollPane
378 @return javax.swing.JScrollPane jDescriptionScrollPane
381 private JScrollPane
getJDescriptionScrollPane() {
382 if (jDescriptionScrollPane
== null) {
383 jDescriptionScrollPane
= new JScrollPane();
384 jDescriptionScrollPane
.setBounds(new java
.awt
.Rectangle(valueColumn
, rowEight
, valueWidth
, fourRowHeight
));
385 jDescriptionScrollPane
.setHorizontalScrollBarPolicy(javax
.swing
.JScrollPane
.HORIZONTAL_SCROLLBAR_NEVER
);
386 jDescriptionScrollPane
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, fourRowHeight
));
387 jDescriptionScrollPane
.setViewportView(getJDescriptionTextArea());
389 return jDescriptionScrollPane
;
393 This method initializes jAbstractTextField
395 @return javax.swing.JTextField jAbstractTextField
398 private JTextField
getJAbstractTextField() {
399 if (jAbstractTextField
== null) {
400 jAbstractTextField
= new JTextField();
401 jAbstractTextField
.setBounds(new java
.awt
.Rectangle(valueColumn
, rowSeven
, valueWidth
, oneRowHeight
));
402 jAbstractTextField
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, oneRowHeight
));
403 jAbstractTextField
.addFocusListener(new FocusAdapter() {
404 public void focusLost(FocusEvent e
) {
405 if (!DataValidation
.isAbstract(jAbstractTextField
.getText())) {
406 JOptionPane
.showMessageDialog(frame
, "Abstract could NOT be empty.");
409 if (jAbstractTextField
.getText().equals(sfc
.getSpdHdrAbs())) {
412 docConsole
.setSaved(false);
413 sfc
.setSpdHdrAbs(jAbstractTextField
.getText());
417 return jAbstractTextField
;
420 private JScrollPane
getCopyrightScrollPane() {
421 if (jCopyrightScrollPane
== null) {
422 jCopyrightScrollPane
= new JScrollPane();
423 jCopyrightScrollPane
.setBounds(new java
.awt
.Rectangle(valueColumn
, rowFour
, valueWidth
, threeRowHeight
));
424 jCopyrightScrollPane
.setHorizontalScrollBarPolicy(javax
.swing
.JScrollPane
.HORIZONTAL_SCROLLBAR_NEVER
);
425 jCopyrightScrollPane
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, threeRowHeight
));
426 jCopyrightScrollPane
.setViewportView(getJCopyrightTextArea());
428 return jCopyrightScrollPane
;
431 This method initializes jTextFieldCopyright
433 @return javax.swing.JTextField jTextFieldCopyright
436 private JTextArea
getJCopyrightTextArea() {
437 if (jCopyrightTextArea
== null) {
438 jCopyrightTextArea
= new JTextArea();
439 jCopyrightTextArea
.setWrapStyleWord(true);
440 jCopyrightTextArea
.setLineWrap(true);
441 jCopyrightTextArea
.addFocusListener(new FocusAdapter() {
442 public void focusLost(FocusEvent e
) {
443 if (!DataValidation
.isCopyright(jCopyrightTextArea
.getText())) {
444 JOptionPane
.showMessageDialog(frame
, "Copyright must be entered.");
447 if (jCopyrightTextArea
.getText().equals(sfc
.getSpdHdrCopyright())) {
450 docConsole
.setSaved(false);
451 sfc
.setSpdHdrCopyright(jCopyrightTextArea
.getText());
455 return jCopyrightTextArea
;
459 * This method initializes jTextField
461 * @return javax.swing.JTextField
463 private JTextField
getJUrlTextField() {
464 if (jUrlTextField
== null) {
465 jUrlTextField
= new JTextField();
466 jUrlTextField
.setBounds(new java
.awt
.Rectangle(valueColumn
, rowSix
, valueWidth
, oneRowHeight
));
467 jUrlTextField
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, oneRowHeight
));
468 jUrlTextField
.addFocusListener(new FocusAdapter() {
469 public void focusLost(FocusEvent e
) {
470 if (jUrlTextField
.getText().length() == 0 && sfc
.getSpdHdrUrl() == null) {
473 if (jUrlTextField
.getText().equals(sfc
.getSpdHdrUrl())) {
476 sfc
.setSpdHdrLicense(jLicenseTextArea
.getText());
477 sfc
.setSpdHdrUrl(jUrlTextField
.getText());
478 docConsole
.setSaved(false);
482 return jUrlTextField
;
486 * This method initializes jCheckBoxRdOnly
488 * @return javax.swing.JCheckBox
490 private JCheckBox
getJCheckBoxRdOnly() {
491 if (jCheckBoxRdOnly
== null) {
492 jCheckBoxRdOnly
= new JCheckBox();
493 jCheckBoxRdOnly
.setText("Read Only");
494 jCheckBoxRdOnly
.setLocation(new java
.awt
.Point(labelColumn
, rowNine
));
495 jCheckBoxRdOnly
.setSize(new java
.awt
.Dimension(labelWidth
, oneRowHeight
));
496 // jCheckBoxRdOnly.setPreferredSize(new java.awt.Dimension(150, oneRowHeight));
497 jCheckBoxRdOnly
.addItemListener(new java
.awt
.event
.ItemListener() {
498 public void itemStateChanged(java
.awt
.event
.ItemEvent e
) {
499 if (docConsole
!= null) {
500 docConsole
.setSaved(false);
502 sfc
.setSpdPkgDefsRdOnly(jCheckBoxRdOnly
.isSelected() + "");
506 return jCheckBoxRdOnly
;
510 * This method initializes jCheckBoxRePkg
512 * @return javax.swing.JCheckBox
514 private JCheckBox
getJCheckBoxRePkg() {
515 if (jCheckBoxRePkg
== null) {
516 jCheckBoxRePkg
= new JCheckBox();
517 jCheckBoxRePkg
.setLocation(new java
.awt
.Point(labelColumn
, rowTen
));
518 jCheckBoxRePkg
.setText("RePackagable");
519 jCheckBoxRePkg
.setSize(new java
.awt
.Dimension(labelWidth
, oneRowHeight
));
520 jCheckBoxRePkg
.addItemListener(new java
.awt
.event
.ItemListener() {
521 public void itemStateChanged(java
.awt
.event
.ItemEvent e
) {
522 if (docConsole
!= null) {
523 docConsole
.setSaved(false);
525 sfc
.setSpdPkgDefsRePkg(jCheckBoxRePkg
.isSelected() + "");
529 return jCheckBoxRePkg
;
532 public static void main(String
[] args
) {
533 new SpdHeader().setVisible(true);
537 This is the default constructor
543 this.setVisible(true);
547 This is the override edit constructor
549 @param inspdHeader The input data of spdHeaderDocument.spdHeader
552 public SpdHeader(PackageSurfaceAreaDocument
.PackageSurfaceArea inPsa
) {
554 sfc
= new SpdFileContents(inPsa
);
558 public SpdHeader(OpeningPackageType opt
) {
559 this(opt
.getXmlSpd());
564 This method initializes this
567 private void init() {
568 this.setContentPane(getTopScrollPane());
569 this.setTitle("Package Surface Area Header");
574 This method initializes this
575 Fill values to all fields if these values are not empty
577 @param inspdHeader The input data of spdHeaderDocument.spdHeader
580 private void init(SpdFileContents sfc
) {
581 if (sfc
.getSpdHdrPkgName() != null) {
582 jPackageNameTextField
.setText(sfc
.getSpdHdrPkgName());
584 if (sfc
.getSpdHdrGuidValue() != null) {
585 jGuidTextField
.setText(sfc
.getSpdHdrGuidValue());
587 if (sfc
.getSpdHdrVer() != null) {
588 jVersionTextField
.setText(sfc
.getSpdHdrVer());
590 if (sfc
.getSpdHdrLicense() != null) {
591 jLicenseTextArea
.setText(sfc
.getSpdHdrLicense());
593 if (sfc
.getSpdHdrUrl() != null) {
594 jUrlTextField
.setText(sfc
.getSpdHdrUrl());
596 if (sfc
.getSpdHdrCopyright() != null) {
597 jCopyrightTextArea
.setText(sfc
.getSpdHdrCopyright());
599 if (sfc
.getSpdHdrAbs() != null) {
600 jAbstractTextField
.setText(sfc
.getSpdHdrAbs());
602 if (sfc
.getSpdHdrDescription() != null) {
603 jDescriptionTextArea
.setText(sfc
.getSpdHdrDescription());
605 if (sfc
.getSpdHdrSpec() != null) {
606 jSpecificationTextField
.setText(sfc
.getSpdHdrSpec());
608 sfc
.setSpdHdrSpec(jSpecificationTextField
.getText());
610 if (!sfc
.getSpdPkgDefsRdOnly().equals("true")) {
611 sfc
.setSpdPkgDefsRdOnly("false");
612 jCheckBoxRdOnly
.setSelected(false);
614 jCheckBoxRdOnly
.setSelected(true);
616 if (!sfc
.getSpdPkgDefsRePkg().equals("true")) {
617 sfc
.setSpdPkgDefsRePkg("false");
618 jCheckBoxRePkg
.setSelected(false);
620 jCheckBoxRePkg
.setSelected(true);
626 This method initializes jContentPane
628 @return javax.swing.JPanel jContentPane
631 private JPanel
getJContentPane() {
632 if (jContentPane
== null) {
633 jStarLabel1
= new StarLabel();
634 jStarLabel1
.setLocation(new java
.awt
.Point(2, rowOne
));
635 jStarLabel2
= new StarLabel();
636 jStarLabel2
.setLocation(new java
.awt
.Point(2, rowTwo
));
637 jStarLabel3
= new StarLabel();
638 jStarLabel3
.setLocation(new java
.awt
.Point(2, rowThree
));
639 jStarLabel4
= new StarLabel();
640 jStarLabel4
.setLocation(new java
.awt
.Point(2, rowFour
));
641 jStarLabel5
= new StarLabel();
642 jStarLabel5
.setLocation(new java
.awt
.Point(2, rowFive
));
643 jStarLabel6
= new StarLabel();
644 jStarLabel6
.setLocation(new java
.awt
.Point(2, rowSeven
));
645 jStarLabel7
= new StarLabel();
646 jStarLabel7
.setLocation(new java
.awt
.Point(2, rowEight
));
647 jStarLabel8
= new StarLabel();
648 jStarLabel8
.setLocation(new java
.awt
.Point(2, rowNine
));
649 jStarLabel9
= new StarLabel();
650 jStarLabel9
.setLocation(new java
.awt
.Point(2, rowTen
));
652 jPackageNameLabel
= new JLabel();
653 jPackageNameLabel
.setText("Package Name");
654 jPackageNameLabel
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowOne
, labelWidth
, oneRowHeight
));
655 jGuidLabel
= new JLabel();
656 jGuidLabel
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowTwo
, labelWidth
, oneRowHeight
));
657 jGuidLabel
.setText("Guid");
658 jVersionLabel
= new JLabel();
659 jVersionLabel
.setText("Version");
660 jVersionLabel
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowThree
, labelWidth
, oneRowHeight
));
661 jLabelCopyright
= new JLabel();
662 jLabelCopyright
.setText("Copyright");
663 jLabelCopyright
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowFour
, labelWidth
, oneRowHeight
));
664 jLicenseLabel
= new JLabel();
665 jLicenseLabel
.setText("License");
666 jLicenseLabel
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowFive
, labelWidth
, oneRowHeight
));
667 jUrlLabel
= new JLabel();
668 jUrlLabel
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowSix
, labelWidth
, oneRowHeight
));
669 jUrlLabel
.setText("URL");
670 jAbstractLabel
= new JLabel();
671 jAbstractLabel
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowSeven
, labelWidth
, oneRowHeight
));
672 jAbstractLabel
.setText("Abstract");
673 jDescriptionLabel
= new JLabel();
674 jDescriptionLabel
.setText("Description");
675 jDescriptionLabel
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowEight
, labelWidth
, oneRowHeight
));
677 jContentPane
= new JPanel();
678 jContentPane
.setLayout(null);
679 jContentPane
.setLocation(new java
.awt
.Point(0, 0));
680 jContentPane
.setPreferredSize(new java
.awt
.Dimension(dialogWidth
- 20, dialogHeight
- 20));
682 jContentPane
.add(jStarLabel1
, null);
683 jContentPane
.add(jStarLabel2
, null);
684 jContentPane
.add(jStarLabel3
, null);
685 jContentPane
.add(jStarLabel4
, null);
686 jContentPane
.add(jStarLabel5
, null);
687 jContentPane
.add(jStarLabel6
, null);
688 jContentPane
.add(jStarLabel7
, null);
689 jContentPane
.add(jStarLabel8
, null);
690 jContentPane
.add(jStarLabel9
, null);
692 jContentPane
.add(jPackageNameLabel
, null);
693 jContentPane
.add(getJPackageNameTextField(), null);
694 jContentPane
.add(jGuidLabel
, null);
695 jContentPane
.add(getJGuidTextField(), null);
696 jContentPane
.add(jVersionLabel
, null);
697 jContentPane
.add(getJVersionTextField(), null);
698 jContentPane
.add(getJGenerateGuidButton(), null);
699 jContentPane
.add(jLabelCopyright
, null);
700 jContentPane
.add(getCopyrightScrollPane(), null);
701 jContentPane
.add(jLicenseLabel
, null);
702 jContentPane
.add(getJLicenseScrollPane(), null);
703 jContentPane
.add(jUrlLabel
, null);
704 jContentPane
.add(getJUrlTextField(), null);
705 jContentPane
.add(jAbstractLabel
, null);
706 jContentPane
.add(getJAbstractTextField(), null);
707 jContentPane
.add(jDescriptionLabel
, null);
708 jContentPane
.add(getJDescriptionScrollPane(), null);
710 // jContentPane.add(getJButtonOk(), null);
711 // jContentPane.add(getJButtonCancel(), null);
713 jContentPane
.add(getJCheckBoxRdOnly(), null);
714 jContentPane
.add(getJCheckBoxRePkg(), null);
715 jContentPane
.add(getJSpecificationTextField(), null);
722 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
724 * Override actionPerformed to listen all actions
727 public void actionPerformed(ActionEvent arg0
) {
729 if (arg0
.getSource() == jGenerateGuidButton
) {
730 //ToDo: invoke GuidValueEditor
731 jGuidTextField
.setText(Tools
.generateUuidString());
732 docConsole
.setSaved(false);
733 sfc
.setSpdHdrGuidValue(jGuidTextField
.getText());
738 This method initializes Package type and Compontent type
741 private void initFrame() {
746 * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
748 * Override componentResized to resize all components when frame's size is changed
750 public void componentResized(ComponentEvent arg0
) {
751 int intPreferredWidth
= dialogWidth
;
752 int intCurrentWidth
= this.getJContentPane().getWidth();
754 // Tools.resizeComponentWidth(this.jPackageNameTextField, intCurrentWidth, intPreferredWidth);
755 // Tools.resizeComponentWidth(this.jGuidTextField, intCurrentWidth, intPreferredWidth);
756 // Tools.resizeComponentWidth(this.jVersionTextField, intCurrentWidth, intPreferredWidth);
757 Tools
.resizeComponentWidth(this.jUrlTextField
, intCurrentWidth
, intPreferredWidth
);
758 Tools
.resizeComponentWidth(this.jLicenseScrollPane
, intCurrentWidth
, intPreferredWidth
);
759 Tools
.resizeComponentWidth(this.jCopyrightTextArea
, intCurrentWidth
, intPreferredWidth
);
760 Tools
.resizeComponentWidth(this.jDescriptionScrollPane
, intCurrentWidth
, intPreferredWidth
);
761 // Tools.resizeComponentWidth(this.jSpecificationTextField, intCurrentWidth,intPreferredWidth);
762 Tools
.resizeComponentWidth(this.jAbstractTextField
, intCurrentWidth
, intPreferredWidth
);
763 // Tools.relocateComponentX(this.jGenerateGuidButton, intCurrentWidth, jGenerateGuidButton.getWidth(), 30);
766 private JScrollPane
getTopScrollPane() {
767 if (topScrollPane
== null) {
768 topScrollPane
= new JScrollPane();
769 topScrollPane
.setViewportView(getJContentPane());
771 return topScrollPane
;