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
.addFocusListener(new FocusAdapter() {
441 public void focusLost(FocusEvent e
) {
442 if (!DataValidation
.isCopyright(jCopyrightTextArea
.getText())) {
443 JOptionPane
.showMessageDialog(frame
, "Copyright must be entered.");
446 if (jCopyrightTextArea
.getText().equals(sfc
.getSpdHdrCopyright())) {
449 docConsole
.setSaved(false);
450 sfc
.setSpdHdrCopyright(jCopyrightTextArea
.getText());
454 return jCopyrightTextArea
;
458 * This method initializes jTextField
460 * @return javax.swing.JTextField
462 private JTextField
getJUrlTextField() {
463 if (jUrlTextField
== null) {
464 jUrlTextField
= new JTextField();
465 jUrlTextField
.setBounds(new java
.awt
.Rectangle(valueColumn
, rowSix
, valueWidth
, oneRowHeight
));
466 jUrlTextField
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, oneRowHeight
));
467 jUrlTextField
.addFocusListener(new FocusAdapter() {
468 public void focusLost(FocusEvent e
) {
469 if (jUrlTextField
.getText().length() == 0 && sfc
.getSpdHdrUrl() == null) {
472 if (jUrlTextField
.getText().equals(sfc
.getSpdHdrUrl())) {
475 sfc
.setSpdHdrLicense(jLicenseTextArea
.getText());
476 sfc
.setSpdHdrUrl(jUrlTextField
.getText());
477 docConsole
.setSaved(false);
481 return jUrlTextField
;
485 * This method initializes jCheckBoxRdOnly
487 * @return javax.swing.JCheckBox
489 private JCheckBox
getJCheckBoxRdOnly() {
490 if (jCheckBoxRdOnly
== null) {
491 jCheckBoxRdOnly
= new JCheckBox();
492 jCheckBoxRdOnly
.setText("Read Only");
493 jCheckBoxRdOnly
.setLocation(new java
.awt
.Point(labelColumn
, rowNine
));
494 jCheckBoxRdOnly
.setSize(new java
.awt
.Dimension(labelWidth
, oneRowHeight
));
495 // jCheckBoxRdOnly.setPreferredSize(new java.awt.Dimension(150, oneRowHeight));
496 jCheckBoxRdOnly
.addItemListener(new java
.awt
.event
.ItemListener() {
497 public void itemStateChanged(java
.awt
.event
.ItemEvent e
) {
498 if (docConsole
!= null) {
499 docConsole
.setSaved(false);
501 sfc
.setSpdPkgDefsRdOnly(jCheckBoxRdOnly
.isSelected() + "");
505 return jCheckBoxRdOnly
;
509 * This method initializes jCheckBoxRePkg
511 * @return javax.swing.JCheckBox
513 private JCheckBox
getJCheckBoxRePkg() {
514 if (jCheckBoxRePkg
== null) {
515 jCheckBoxRePkg
= new JCheckBox();
516 jCheckBoxRePkg
.setLocation(new java
.awt
.Point(labelColumn
, rowTen
));
517 jCheckBoxRePkg
.setText("RePackagable");
518 jCheckBoxRePkg
.setSize(new java
.awt
.Dimension(labelWidth
, oneRowHeight
));
519 jCheckBoxRePkg
.addItemListener(new java
.awt
.event
.ItemListener() {
520 public void itemStateChanged(java
.awt
.event
.ItemEvent e
) {
521 if (docConsole
!= null) {
522 docConsole
.setSaved(false);
524 sfc
.setSpdPkgDefsRePkg(jCheckBoxRePkg
.isSelected() + "");
528 return jCheckBoxRePkg
;
531 public static void main(String
[] args
) {
532 new SpdHeader().setVisible(true);
536 This is the default constructor
542 this.setVisible(true);
546 This is the override edit constructor
548 @param inspdHeader The input data of spdHeaderDocument.spdHeader
551 public SpdHeader(PackageSurfaceAreaDocument
.PackageSurfaceArea inPsa
) {
553 sfc
= new SpdFileContents(inPsa
);
557 public SpdHeader(OpeningPackageType opt
) {
558 this(opt
.getXmlSpd());
563 This method initializes this
566 private void init() {
567 this.setContentPane(getTopScrollPane());
568 this.setTitle("Package Surface Area Header");
573 This method initializes this
574 Fill values to all fields if these values are not empty
576 @param inspdHeader The input data of spdHeaderDocument.spdHeader
579 private void init(SpdFileContents sfc
) {
580 if (sfc
.getSpdHdrPkgName() != null) {
581 jPackageNameTextField
.setText(sfc
.getSpdHdrPkgName());
583 if (sfc
.getSpdHdrGuidValue() != null) {
584 jGuidTextField
.setText(sfc
.getSpdHdrGuidValue());
586 if (sfc
.getSpdHdrVer() != null) {
587 jVersionTextField
.setText(sfc
.getSpdHdrVer());
589 if (sfc
.getSpdHdrLicense() != null) {
590 jLicenseTextArea
.setText(sfc
.getSpdHdrLicense());
592 if (sfc
.getSpdHdrUrl() != null) {
593 jUrlTextField
.setText(sfc
.getSpdHdrUrl());
595 if (sfc
.getSpdHdrCopyright() != null) {
596 jCopyrightTextArea
.setText(sfc
.getSpdHdrCopyright());
598 if (sfc
.getSpdHdrAbs() != null) {
599 jAbstractTextField
.setText(sfc
.getSpdHdrAbs());
601 if (sfc
.getSpdHdrDescription() != null) {
602 jDescriptionTextArea
.setText(sfc
.getSpdHdrDescription());
604 if (sfc
.getSpdHdrSpec() != null) {
605 jSpecificationTextField
.setText(sfc
.getSpdHdrSpec());
607 sfc
.setSpdHdrSpec(jSpecificationTextField
.getText());
609 if (!sfc
.getSpdPkgDefsRdOnly().equals("true")) {
610 sfc
.setSpdPkgDefsRdOnly("false");
611 jCheckBoxRdOnly
.setSelected(false);
613 jCheckBoxRdOnly
.setSelected(true);
615 if (!sfc
.getSpdPkgDefsRePkg().equals("true")) {
616 sfc
.setSpdPkgDefsRePkg("false");
617 jCheckBoxRePkg
.setSelected(false);
619 jCheckBoxRePkg
.setSelected(true);
625 This method initializes jContentPane
627 @return javax.swing.JPanel jContentPane
630 private JPanel
getJContentPane() {
631 if (jContentPane
== null) {
632 jStarLabel1
= new StarLabel();
633 jStarLabel1
.setLocation(new java
.awt
.Point(2, rowOne
));
634 jStarLabel2
= new StarLabel();
635 jStarLabel2
.setLocation(new java
.awt
.Point(2, rowTwo
));
636 jStarLabel3
= new StarLabel();
637 jStarLabel3
.setLocation(new java
.awt
.Point(2, rowThree
));
638 jStarLabel4
= new StarLabel();
639 jStarLabel4
.setLocation(new java
.awt
.Point(2, rowFour
));
640 jStarLabel5
= new StarLabel();
641 jStarLabel5
.setLocation(new java
.awt
.Point(2, rowFive
));
642 jStarLabel6
= new StarLabel();
643 jStarLabel6
.setLocation(new java
.awt
.Point(2, rowSeven
));
644 jStarLabel7
= new StarLabel();
645 jStarLabel7
.setLocation(new java
.awt
.Point(2, rowEight
));
646 jStarLabel8
= new StarLabel();
647 jStarLabel8
.setLocation(new java
.awt
.Point(2, rowNine
));
648 jStarLabel9
= new StarLabel();
649 jStarLabel9
.setLocation(new java
.awt
.Point(2, rowTen
));
651 jPackageNameLabel
= new JLabel();
652 jPackageNameLabel
.setText("Package Name");
653 jPackageNameLabel
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowOne
, labelWidth
, oneRowHeight
));
654 jGuidLabel
= new JLabel();
655 jGuidLabel
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowTwo
, labelWidth
, oneRowHeight
));
656 jGuidLabel
.setText("Guid");
657 jVersionLabel
= new JLabel();
658 jVersionLabel
.setText("Version");
659 jVersionLabel
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowThree
, labelWidth
, oneRowHeight
));
660 jLabelCopyright
= new JLabel();
661 jLabelCopyright
.setText("Copyright");
662 jLabelCopyright
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowFour
, labelWidth
, oneRowHeight
));
663 jLicenseLabel
= new JLabel();
664 jLicenseLabel
.setText("License");
665 jLicenseLabel
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowFive
, labelWidth
, oneRowHeight
));
666 jUrlLabel
= new JLabel();
667 jUrlLabel
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowSix
, labelWidth
, oneRowHeight
));
668 jUrlLabel
.setText("URL");
669 jAbstractLabel
= new JLabel();
670 jAbstractLabel
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowSeven
, labelWidth
, oneRowHeight
));
671 jAbstractLabel
.setText("Abstract");
672 jDescriptionLabel
= new JLabel();
673 jDescriptionLabel
.setText("Description");
674 jDescriptionLabel
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowEight
, labelWidth
, oneRowHeight
));
676 jContentPane
= new JPanel();
677 jContentPane
.setLayout(null);
678 jContentPane
.setLocation(new java
.awt
.Point(0, 0));
679 jContentPane
.setPreferredSize(new java
.awt
.Dimension(dialogWidth
- 20, dialogHeight
- 20));
681 jContentPane
.add(jStarLabel1
, null);
682 jContentPane
.add(jStarLabel2
, null);
683 jContentPane
.add(jStarLabel3
, null);
684 jContentPane
.add(jStarLabel4
, null);
685 jContentPane
.add(jStarLabel5
, null);
686 jContentPane
.add(jStarLabel6
, null);
687 jContentPane
.add(jStarLabel7
, null);
688 jContentPane
.add(jStarLabel8
, null);
689 jContentPane
.add(jStarLabel9
, null);
691 jContentPane
.add(jPackageNameLabel
, null);
692 jContentPane
.add(getJPackageNameTextField(), null);
693 jContentPane
.add(jGuidLabel
, null);
694 jContentPane
.add(getJGuidTextField(), null);
695 jContentPane
.add(jVersionLabel
, null);
696 jContentPane
.add(getJVersionTextField(), null);
697 jContentPane
.add(getJGenerateGuidButton(), null);
698 jContentPane
.add(jLabelCopyright
, null);
699 jContentPane
.add(getCopyrightScrollPane(), null);
700 jContentPane
.add(jLicenseLabel
, null);
701 jContentPane
.add(getJLicenseScrollPane(), null);
702 jContentPane
.add(jUrlLabel
, null);
703 jContentPane
.add(getJUrlTextField(), null);
704 jContentPane
.add(jAbstractLabel
, null);
705 jContentPane
.add(getJAbstractTextField(), null);
706 jContentPane
.add(jDescriptionLabel
, null);
707 jContentPane
.add(getJDescriptionScrollPane(), null);
709 // jContentPane.add(getJButtonOk(), null);
710 // jContentPane.add(getJButtonCancel(), null);
712 jContentPane
.add(getJCheckBoxRdOnly(), null);
713 jContentPane
.add(getJCheckBoxRePkg(), null);
714 jContentPane
.add(getJSpecificationTextField(), null);
721 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
723 * Override actionPerformed to listen all actions
726 public void actionPerformed(ActionEvent arg0
) {
728 if (arg0
.getSource() == jGenerateGuidButton
) {
729 //ToDo: invoke GuidValueEditor
730 jGuidTextField
.setText(Tools
.generateUuidString());
731 docConsole
.setSaved(false);
732 sfc
.setSpdHdrGuidValue(jGuidTextField
.getText());
737 This method initializes Package type and Compontent type
740 private void initFrame() {
745 * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
747 * Override componentResized to resize all components when frame's size is changed
749 public void componentResized(ComponentEvent arg0
) {
750 int intPreferredWidth
= dialogWidth
;
751 int intCurrentWidth
= this.getJContentPane().getWidth();
753 // Tools.resizeComponentWidth(this.jPackageNameTextField, intCurrentWidth, intPreferredWidth);
754 // Tools.resizeComponentWidth(this.jGuidTextField, intCurrentWidth, intPreferredWidth);
755 // Tools.resizeComponentWidth(this.jVersionTextField, intCurrentWidth, intPreferredWidth);
756 Tools
.resizeComponentWidth(this.jUrlTextField
, intCurrentWidth
, intPreferredWidth
);
757 Tools
.resizeComponentWidth(this.jLicenseScrollPane
, intCurrentWidth
, intPreferredWidth
);
758 Tools
.resizeComponentWidth(this.jCopyrightTextArea
, intCurrentWidth
, intPreferredWidth
);
759 Tools
.resizeComponentWidth(this.jDescriptionScrollPane
, intCurrentWidth
, intPreferredWidth
);
760 // Tools.resizeComponentWidth(this.jSpecificationTextField, intCurrentWidth,intPreferredWidth);
761 Tools
.resizeComponentWidth(this.jAbstractTextField
, intCurrentWidth
, intPreferredWidth
);
762 // Tools.relocateComponentX(this.jGenerateGuidButton, intCurrentWidth, jGenerateGuidButton.getWidth(), 30);
765 private JScrollPane
getTopScrollPane() {
766 if (topScrollPane
== null) {
767 topScrollPane
= new JScrollPane();
768 topScrollPane
.setViewportView(getJContentPane());
770 return topScrollPane
;