3 The file is used to create, update FpdHeader of Fpd 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
.platform
.ui
;
18 import java
.awt
.Dimension
;
19 import java
.awt
.event
.ActionEvent
;
20 import java
.awt
.event
.ComponentEvent
;
21 import java
.awt
.event
.FocusAdapter
;
22 import java
.awt
.event
.FocusEvent
;
23 import java
.util
.Vector
;
25 import javax
.swing
.JButton
;
26 import javax
.swing
.JFrame
;
27 import javax
.swing
.JLabel
;
28 import javax
.swing
.JOptionPane
;
29 import javax
.swing
.JPanel
;
30 import javax
.swing
.JScrollPane
;
31 import javax
.swing
.JTextArea
;
32 import javax
.swing
.JTextField
;
33 import javax
.swing
.event
.DocumentEvent
;
34 import javax
.swing
.event
.DocumentListener
;
38 import org
.tianocore
.PlatformSurfaceAreaDocument
;
40 import org
.tianocore
.frameworkwizard
.common
.DataValidation
;
41 import org
.tianocore
.frameworkwizard
.common
.Tools
;
42 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningPlatformType
;
43 import org
.tianocore
.frameworkwizard
.common
.ui
.IInternalFrame
;
44 import org
.tianocore
.frameworkwizard
.common
.ui
.StarLabel
;
47 The class is used to create, update FpdHeader of Fpd file
48 It extends IInternalFrame
50 @since PackageEditor 1.0
53 public class FpdHeader
extends IInternalFrame
implements DocumentListener
{
55 private int dialogWidth
= 560;
57 private int labelColumn
= 12;
59 private int labelWidth
= 155;
61 private int buttonWidth
= 60;
63 private final int valueColumn
= 168;
65 private final int valueWidth
= 320;
67 private final int specWidth
= 420;
69 private int shortValueWidth
= valueWidth
- (buttonWidth
+ 5);
71 private final int oneRowHeight
= 20;
73 private final int threeRowHeight
= 60;
75 private final int fourRowHeight
= 80;
77 private final int rowSep
= 5;
79 private final int rowOne
= 12;
81 private final int rowTwo
= rowOne
+ oneRowHeight
+ rowSep
;
83 private final int rowThree
= rowTwo
+ oneRowHeight
+ rowSep
;
85 private final int rowFour
= rowThree
+ oneRowHeight
+ rowSep
;
87 private final int rowFive
= rowFour
+ threeRowHeight
+ rowSep
;
89 private final int rowSix
= rowFive
+ fourRowHeight
+ rowSep
;
91 private final int rowSeven
= rowSix
+ oneRowHeight
+ rowSep
;
93 private final int rowEight
= rowSeven
+ oneRowHeight
+ rowSep
;
95 private final int rowNine
= rowEight
+ fourRowHeight
+ threeRowHeight
+rowSep
;
97 private int dialogHeight
= rowNine
+ threeRowHeight
;
99 /// Define class Serial Version UID
101 private static final long serialVersionUID
= -8152099582923006900L;
105 //Define class members
107 private JPanel jContentPane
= null; // @jve:decl-index=0:visual-constraint="10,53"
109 private JLabel jLabelBaseName
= null;
111 private JTextField jTextFieldBaseName
= null;
113 private JLabel jLabelGuid
= null;
115 private JTextField jTextFieldGuid
= null;
117 private JLabel jLabelVersion
= null;
119 private JTextField jTextFieldVersion
= null;
121 private JButton jButtonGenerateGuid
= null;
123 private JLabel jLabelLicense
= null;
125 private JTextArea jTextAreaLicense
= null;
127 private JLabel jLabelCopyright
= null;
129 private JLabel jLabelDescription
= null;
131 private JTextArea jTextAreaDescription
= null;
133 private JTextField jTextFieldSpecification
= null;
135 private JButton jButtonOk
= null;
137 private JButton jButtonCancel
= null;
139 private JScrollPane jScrollPaneLicense
= null;
141 private JScrollPane jScrollPaneDescription
= null;
143 private JScrollPane jCopyrightScrollPane
= null;
145 private JLabel jLabelAbstract
= null;
147 private JTextField jTextFieldAbstract
= null;
149 private StarLabel jStarLabel1
= null;
151 private StarLabel jStarLabel2
= null;
153 private StarLabel jStarLabel3
= null;
155 private StarLabel jStarLabel4
= null;
157 private StarLabel jStarLabel5
= null;
159 private StarLabel jStarLabel7
= null;
161 private StarLabel jStarLabel8
= null;
163 private JTextArea jCopyrightTextArea
= null;
165 private JLabel jLabel
= null;
167 private JTextField jTextFieldUrl
= null;
169 private FpdFileContents ffc
= null;
171 private OpeningPlatformType docConsole
= null;
173 private boolean amended
= false;
176 This method initializes jTextFieldBaseName
178 @return javax.swing.JTextField jTextFieldBaseName
181 private JTextField
getJTextFieldBaseName() {
182 if (jTextFieldBaseName
== null) {
183 jTextFieldBaseName
= new JTextField();
184 jTextFieldBaseName
.setBounds(new java
.awt
.Rectangle(valueColumn
, rowOne
, valueWidth
, oneRowHeight
));
185 jTextFieldBaseName
.setPreferredSize(new java
.awt
.Dimension(valueWidth
,oneRowHeight
));
186 jTextFieldBaseName
.getDocument().addDocumentListener(this);
187 jTextFieldBaseName
.addFocusListener(new FocusAdapter(){
188 public void focusLost(FocusEvent e
) {
189 if (!DataValidation
.isUiNameType(jTextFieldBaseName
.getText())) {
190 JOptionPane
.showMessageDialog(frame
, "Package Name does not match the UiNameType datatype.");
193 if (jTextFieldBaseName
.getText().equals(ffc
.getFpdHdrPlatformName())) {
196 ffc
.setFpdHdrPlatformName(jTextFieldBaseName
.getText());
200 return jTextFieldBaseName
;
204 This method initializes jTextFieldGuid
206 @return javax.swing.JTextField jTextFieldGuid
209 private JTextField
getJTextFieldGuid() {
210 if (jTextFieldGuid
== null) {
211 jTextFieldGuid
= new JTextField();
212 jTextFieldGuid
.setBounds(new java
.awt
.Rectangle(valueColumn
, rowTwo
, shortValueWidth
, oneRowHeight
));
213 jTextFieldGuid
.setPreferredSize(new java
.awt
.Dimension(shortValueWidth
,oneRowHeight
));
214 jTextFieldGuid
.getDocument().addDocumentListener(this);
215 jTextFieldGuid
.addFocusListener(new FocusAdapter(){
216 public void focusLost(FocusEvent e
) {
217 if (!DataValidation
.isGuid(jTextFieldGuid
.getText())) {
218 JOptionPane
.showMessageDialog(frame
, "Guid must be in registry (8-4-4-4-12) format.");
221 if (jTextFieldGuid
.getText().equals(ffc
.getFpdHdrGuidValue())) {
224 ffc
.setFpdHdrGuidValue(jTextFieldGuid
.getText());
228 return jTextFieldGuid
;
232 This method initializes jTextFieldVersion
234 @return javax.swing.JTextField jTextFieldVersion
237 private JTextField
getJTextFieldVersion() {
238 if (jTextFieldVersion
== null) {
239 jTextFieldVersion
= new JTextField();
240 jTextFieldVersion
.setBounds(new java
.awt
.Rectangle(valueColumn
, rowThree
, valueWidth
, oneRowHeight
));
241 jTextFieldVersion
.setPreferredSize(new java
.awt
.Dimension(valueWidth
,oneRowHeight
));
242 jTextFieldVersion
.getDocument().addDocumentListener(this);
243 jTextFieldVersion
.addFocusListener(new FocusAdapter(){
244 public void focusLost(FocusEvent e
) {
245 if (!DataValidation
.isVersion(jTextFieldVersion
.getText())) {
246 JOptionPane
.showMessageDialog(frame
, "Version does not match the Version datatype.");
249 if (jTextFieldVersion
.getText().equals(ffc
.getFpdHdrVer())) {
252 ffc
.setFpdHdrVer(jTextFieldVersion
.getText());
256 return jTextFieldVersion
;
260 This method initializes jButtonGenerateGuid
262 @return javax.swing.JButton jButtonGenerateGuid
265 private JButton
getJButtonGenerateGuid() {
266 if (jButtonGenerateGuid
== null) {
267 jButtonGenerateGuid
= new JButton();
268 jButtonGenerateGuid
.setBounds(new java
.awt
.Rectangle(valueColumn
+ shortValueWidth
+ 5, rowTwo
, buttonWidth
, oneRowHeight
));
269 jButtonGenerateGuid
.setText("GEN");
270 jButtonGenerateGuid
.addActionListener(this);
272 return jButtonGenerateGuid
;
276 This method initializes jTextAreaLicense
278 @return javax.swing.JTextArea jTextAreaLicense
281 private JTextArea
getJTextAreaLicense() {
282 if (jTextAreaLicense
== null) {
283 jTextAreaLicense
= new JTextArea();
284 jTextAreaLicense
.setText("");
285 jTextAreaLicense
.setLineWrap(true);
286 jTextAreaLicense
.getDocument().addDocumentListener(this);
287 jTextAreaLicense
.addFocusListener(new FocusAdapter(){
288 public void focusLost(FocusEvent e
) {
289 if (jTextAreaLicense
.getText().length() == 0) {
290 JOptionPane
.showMessageDialog(frame
, "License must be entered!");
293 if (jTextAreaLicense
.getText().equals(ffc
.getFpdHdrLicense())) {
296 ffc
.setFpdHdrLicense(jTextAreaLicense
.getText());
300 return jTextAreaLicense
;
304 This method initializes jTextAreaDescription
306 @return javax.swing.JTextArea jTextAreaDescription
309 private JTextArea
getJTextAreaDescription() {
310 if (jTextAreaDescription
== null) {
311 jTextAreaDescription
= new JTextArea();
312 jTextAreaDescription
.setLineWrap(true);
313 jTextAreaDescription
.getDocument().addDocumentListener(this);
314 jTextAreaDescription
.addFocusListener(new FocusAdapter(){
315 public void focusLost(FocusEvent e
) {
316 if (jTextAreaDescription
.getText().length() == 0) {
317 JOptionPane
.showMessageDialog(frame
, "Description must be entered.");
320 if (jTextAreaDescription
.getText().equals(ffc
.getFpdHdrDescription())) {
323 ffc
.setFpdHdrDescription(jTextAreaDescription
.getText());
327 return jTextAreaDescription
;
331 This method initializes jTextFieldSpecification
333 @return javax.swing.JTextField jTextFieldSpecification
336 private JTextField
getJTextFieldSpecification() {
337 if (jTextFieldSpecification
== null) {
338 jTextFieldSpecification
= new JTextField();
339 jTextFieldSpecification
.setBounds(new java
.awt
.Rectangle(labelColumn
,rowNine
,specWidth
,oneRowHeight
));
340 jTextFieldSpecification
.setEditable(false);
341 jTextFieldSpecification
.setPreferredSize(new java
.awt
.Dimension(specWidth
,oneRowHeight
));
342 jTextFieldSpecification
.setBorder(null);
343 // jTextFieldSpecification.addFocusListener(new FocusAdapter(){
344 // public void focusLost(FocusEvent e) {
345 // ffc.setFpdHdrSpec(jTextFieldSpecification.getText());
349 return jTextFieldSpecification
;
353 This method initializes jButtonOk
355 @return javax.swing.JButton jButtonOk
358 private JButton
getJButtonOk() {
359 if (jButtonOk
== null) {
360 jButtonOk
= new JButton();
361 jButtonOk
.setText("OK");
362 jButtonOk
.setBounds(new java
.awt
.Rectangle(290,351,90,20));
363 jButtonOk
.setVisible(false);
364 jButtonOk
.addActionListener(this);
370 This method initializes jButtonCancel
372 @return javax.swing.JButton jButtonCancel
375 private JButton
getJButtonCancel() {
376 if (jButtonCancel
== null) {
377 jButtonCancel
= new JButton();
378 jButtonCancel
.setText("Cancel");
379 jButtonCancel
.setBounds(new java
.awt
.Rectangle(390,351,90,20));
380 jButtonCancel
.setVisible(false);
381 jButtonCancel
.addActionListener(this);
383 return jButtonCancel
;
387 This method initializes jScrollPaneLicense
389 @return javax.swing.JScrollPane jScrollPaneLicense
392 private JScrollPane
getJScrollPaneLicense() {
393 if (jScrollPaneLicense
== null) {
394 jScrollPaneLicense
= new JScrollPane();
395 jScrollPaneLicense
.setBounds(new java
.awt
.Rectangle(valueColumn
,rowFive
,valueWidth
,fourRowHeight
));
396 jScrollPaneLicense
.setHorizontalScrollBarPolicy(javax
.swing
.JScrollPane
.HORIZONTAL_SCROLLBAR_NEVER
);
397 jScrollPaneLicense
.setPreferredSize(new java
.awt
.Dimension(valueWidth
,fourRowHeight
));
398 jScrollPaneLicense
.setViewportView(getJTextAreaLicense());
400 return jScrollPaneLicense
;
404 This method initializes jScrollPaneDescription
406 @return javax.swing.JScrollPane jScrollPaneDescription
409 private JScrollPane
getJScrollPaneDescription() {
410 if (jScrollPaneDescription
== null) {
411 jScrollPaneDescription
= new JScrollPane();
412 jScrollPaneDescription
.setBounds(new java
.awt
.Rectangle(valueColumn
,rowEight
,valueWidth
,fourRowHeight
));
413 jScrollPaneDescription
.setHorizontalScrollBarPolicy(javax
.swing
.JScrollPane
.HORIZONTAL_SCROLLBAR_NEVER
);
414 jScrollPaneDescription
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, fourRowHeight
));
415 jScrollPaneDescription
.setViewportView(getJTextAreaDescription());
417 return jScrollPaneDescription
;
421 This method initializes jTextFieldAbstract
423 @return javax.swing.JTextField jTextFieldAbstract
426 private JTextField
getJTextFieldAbstract() {
427 if (jTextFieldAbstract
== null) {
428 jTextFieldAbstract
= new JTextField();
429 jTextFieldAbstract
.setBounds(new java
.awt
.Rectangle(valueColumn
,rowSeven
,valueWidth
,oneRowHeight
));
430 jTextFieldAbstract
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, oneRowHeight
));
431 jTextFieldAbstract
.getDocument().addDocumentListener(this);
432 jTextFieldAbstract
.addFocusListener(new FocusAdapter(){
433 public void focusLost(FocusEvent e
) {
434 if (!DataValidation
.isAbstract(jTextFieldAbstract
.getText())) {
435 JOptionPane
.showMessageDialog(frame
, "Abstract must be entered.");
438 if (jTextFieldAbstract
.getText().equals(ffc
.getFpdHdrAbs())) {
441 ffc
.setFpdHdrAbs(jTextFieldAbstract
.getText());
445 return jTextFieldAbstract
;
448 private JScrollPane
getCopyrightScrollPane() {
449 if (jCopyrightScrollPane
== null) {
450 jCopyrightScrollPane
= new JScrollPane();
451 jCopyrightScrollPane
.setBounds(new java
.awt
.Rectangle(valueColumn
, rowFour
, valueWidth
, threeRowHeight
));
452 jCopyrightScrollPane
.setHorizontalScrollBarPolicy(javax
.swing
.JScrollPane
.HORIZONTAL_SCROLLBAR_NEVER
);
453 jCopyrightScrollPane
.setPreferredSize(new java
.awt
.Dimension(valueWidth
, threeRowHeight
));
454 jCopyrightScrollPane
.setViewportView(getJCopyrightTextArea());
456 return jCopyrightScrollPane
;
459 This method initializes jTextFieldCopyright
461 @return javax.swing.JTextField jTextFieldCopyright
464 private JTextArea
getJCopyrightTextArea() {
465 if (jCopyrightTextArea
== null) {
466 jCopyrightTextArea
= new JTextArea();
467 jCopyrightTextArea
.setWrapStyleWord(true);
468 jCopyrightTextArea
.setLineWrap(true);
469 jCopyrightTextArea
.getDocument().addDocumentListener(this);
470 jCopyrightTextArea
.addFocusListener(new FocusAdapter(){
471 public void focusLost(FocusEvent e
) {
472 if (!DataValidation
.isCopyright(jCopyrightTextArea
.getText())) {
473 JOptionPane
.showMessageDialog(frame
, "Copyright must be entered.");
476 if (jCopyrightTextArea
.getText().equals(ffc
.getFpdHdrCopyright())) {
479 ffc
.setFpdHdrCopyright(jCopyrightTextArea
.getText());
483 return jCopyrightTextArea
;
487 * This method initializes jTextField
489 * @return javax.swing.JTextField
491 private JTextField
getJTextFieldUrl() {
492 if (jTextFieldUrl
== null) {
493 jTextFieldUrl
= new JTextField();
494 jTextFieldUrl
.setBounds(new java
.awt
.Rectangle(valueColumn
,rowSix
,valueWidth
,oneRowHeight
));
495 jTextFieldUrl
.setPreferredSize(new Dimension(valueWidth
, oneRowHeight
));
496 jTextFieldUrl
.getDocument().addDocumentListener(this);
497 jTextFieldUrl
.addFocusListener(new FocusAdapter(){
498 public void focusLost(FocusEvent e
){
499 if (jTextFieldUrl
.getText().length() == 0 && ffc
.getFpdHdrUrl() == null) {
502 if (jTextFieldUrl
.getText().equals(ffc
.getFpdHdrUrl())) {
505 ffc
.setFpdHdrLicense(jTextAreaLicense
.getText());
506 ffc
.setFpdHdrUrl(jTextFieldUrl
.getText());
510 return jTextFieldUrl
;
513 public static void main(String
[] args
) {
514 new FpdHeader().setVisible(true);
518 This is the default constructor
524 this.setVisible(true);
528 This is the override edit constructor
530 @param inFpdHeader The input data of FpdHeaderDocument.FpdHeader
533 public FpdHeader(PlatformSurfaceAreaDocument
.PlatformSurfaceArea inFpd
) {
535 ffc
= new FpdFileContents(inFpd
);
540 public FpdHeader(OpeningPlatformType opt
) {
541 this(opt
.getXmlFpd());
544 docConsole
.setSaved(false);
550 This method initializes this
553 private void init() {
554 //this.setSize(500, 515);
555 this.setContentPane(getJContentPane());
556 this.setTitle("Platform Surface Area Header");
562 This method initializes this
563 Fill values to all fields if these values are not empty
565 @param inFpdHeader The input data of FpdHeaderDocument.FpdHeader
568 private void init(FpdFileContents ffc
) {
570 if (ffc
.getFpdHdrPlatformName() != null) {
571 jTextFieldBaseName
.setText(ffc
.getFpdHdrPlatformName());
573 if (ffc
.getFpdHdrGuidValue() != null) {
574 jTextFieldGuid
.setText(ffc
.getFpdHdrGuidValue());
576 if (ffc
.getFpdHdrVer() != null) {
577 jTextFieldVersion
.setText(ffc
.getFpdHdrVer());
579 if (ffc
.getFpdHdrLicense() != null) {
580 jTextAreaLicense
.setText(ffc
.getFpdHdrLicense());
582 if (ffc
.getFpdHdrAbs() != null) {
583 jTextFieldAbstract
.setText(ffc
.getFpdHdrAbs());
585 if (ffc
.getFpdHdrUrl() != null) {
586 jTextFieldUrl
.setText(ffc
.getFpdHdrUrl());
588 if (ffc
.getFpdHdrCopyright() != null) {
589 jCopyrightTextArea
.setText(ffc
.getFpdHdrCopyright());
591 if (ffc
.getFpdHdrDescription() != null) {
592 jTextAreaDescription
.setText(ffc
.getFpdHdrDescription());
594 if (ffc
.getFpdHdrSpec() != null) {
595 jTextFieldSpecification
.setText(ffc
.getFpdHdrSpec());
597 ffc
.setFpdHdrSpec(jTextFieldSpecification
.getText());
599 if (ffc
.getPlatformDefsSkuInfoCount() == 0) {
600 ffc
.genPlatformDefsSkuInfo("0", "DEFAULT");
602 JOptionPane
.showMessageDialog(this, "Default SKU set for this platform.");
604 Vector
<Object
> v
= new Vector
<Object
>();
605 ffc
.getPlatformDefsSupportedArchs(v
);
608 ffc
.setPlatformDefsSupportedArchs(v
);
610 JOptionPane
.showMessageDialog(this, "Supported Arch. IA32 added for this platform.");
612 v
.removeAllElements();
613 ffc
.getPlatformDefsBuildTargets(v
);
616 ffc
.setPlatformDefsBuildTargets(v
);
618 JOptionPane
.showMessageDialog(this, "Build target IA32 added for this platform.");
620 if (ffc
.getPlatformDefsInterDir() == null) {
621 ffc
.setPlatformDefsInterDir("UNIFIED");
623 JOptionPane
.showMessageDialog(this, "UNIFIED Intermediate Directory set for this platform.");
628 This method initializes jContentPane
630 @return javax.swing.JPanel jContentPane
633 private JPanel
getJContentPane() {
634 if (jContentPane
== null) {
635 jContentPane
= new JPanel();
636 jContentPane
.setLayout(null);
637 jContentPane
.setLocation(new java
.awt
.Point(0, 0));
638 jContentPane
.setSize(new java
.awt
.Dimension(dialogWidth
- 20 ,dialogHeight
- 20));
640 jLabel
= new JLabel();
641 jLabel
.setBounds(new java
.awt
.Rectangle(labelColumn
,rowSix
,labelWidth
,oneRowHeight
));
642 jLabel
.setText("URL");
643 jLabelAbstract
= new JLabel();
644 jLabelAbstract
.setBounds(new java
.awt
.Rectangle(labelColumn
,rowSeven
,labelWidth
,oneRowHeight
));
645 jLabelAbstract
.setText("Abstract");
646 jLabelDescription
= new JLabel();
647 jLabelDescription
.setText("Description");
648 jLabelDescription
.setBounds(new java
.awt
.Rectangle(labelColumn
,rowEight
,labelWidth
,oneRowHeight
));
649 jLabelCopyright
= new JLabel();
650 jLabelCopyright
.setText("Copyright");
651 jLabelCopyright
.setBounds(new java
.awt
.Rectangle(labelColumn
,rowFour
,labelWidth
,oneRowHeight
));
652 jLabelLicense
= new JLabel();
653 jLabelLicense
.setText("License");
654 jLabelLicense
.setBounds(new java
.awt
.Rectangle(labelColumn
,rowFive
,labelWidth
,oneRowHeight
));
655 jLabelVersion
= new JLabel();
656 jLabelVersion
.setText("Version");
657 jLabelVersion
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowThree
, labelWidth
, oneRowHeight
));
658 jLabelGuid
= new JLabel();
659 jLabelGuid
.setPreferredSize(new java
.awt
.Dimension(labelWidth
, oneRowHeight
));
660 jLabelGuid
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowTwo
, labelWidth
, oneRowHeight
));
661 jLabelGuid
.setText("Guid");
662 jLabelBaseName
= new JLabel();
663 jLabelBaseName
.setText("Platform Name");
664 jLabelBaseName
.setBounds(new java
.awt
.Rectangle(labelColumn
, rowOne
, labelWidth
, oneRowHeight
));
665 jStarLabel1
= new StarLabel();
666 jStarLabel1
.setLocation(new java
.awt
.Point(0, rowOne
));
667 jStarLabel2
= new StarLabel();
668 jStarLabel2
.setLocation(new java
.awt
.Point(0, rowTwo
));
669 jStarLabel3
= new StarLabel();
670 jStarLabel3
.setLocation(new java
.awt
.Point(0, rowThree
));
671 jStarLabel4
= new StarLabel();
672 jStarLabel4
.setLocation(new java
.awt
.Point(0,rowFour
));
673 jStarLabel5
= new StarLabel();
674 jStarLabel5
.setLocation(new java
.awt
.Point(0,rowFive
));
675 jStarLabel7
= new StarLabel();
676 jStarLabel7
.setLocation(new java
.awt
.Point(0,rowSeven
));
677 jStarLabel8
= new StarLabel();
678 jStarLabel8
.setLocation(new java
.awt
.Point(0,rowEight
));
680 jContentPane
.add(jLabelBaseName
, null);
681 jContentPane
.add(getJTextFieldBaseName(), null);
682 jContentPane
.add(jLabelGuid
, null);
683 jContentPane
.add(getJTextFieldGuid(), null);
684 jContentPane
.add(jLabelVersion
, null);
685 jContentPane
.add(getJTextFieldVersion(), null);
686 jContentPane
.add(getJButtonGenerateGuid(), null);
687 jContentPane
.add(jLabelLicense
, null);
688 jContentPane
.add(jLabelCopyright
, null);
689 jContentPane
.add(jLabelDescription
, null);
690 jContentPane
.add(getJTextFieldSpecification(), null);
691 jContentPane
.add(getJButtonOk(), null);
692 jContentPane
.add(getJButtonCancel(), null);
693 jContentPane
.add(getJScrollPaneLicense(), null);
694 jContentPane
.add(getJScrollPaneDescription(), null);
695 jContentPane
.add(jLabelAbstract
, null);
696 jContentPane
.add(getJTextFieldAbstract(), null);
698 jContentPane
.add(jStarLabel1
, null);
699 jContentPane
.add(jStarLabel2
, null);
700 jContentPane
.add(jStarLabel3
, null);
701 jContentPane
.add(jStarLabel4
, null);
702 jContentPane
.add(jStarLabel5
, null);
703 jContentPane
.add(jStarLabel7
, null);
704 jContentPane
.add(jStarLabel8
, null);
705 jContentPane
.add(getCopyrightScrollPane(), null);
707 jContentPane
.add(jLabel
, null);
708 jContentPane
.add(getJTextFieldUrl(), null);
714 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
716 * Override actionPerformed to listen all actions
719 public void actionPerformed(ActionEvent arg0
) {
721 if (arg0
.getSource() == jButtonGenerateGuid
) {
722 jTextFieldGuid
.setText(Tools
.generateUuidString());
723 ffc
.setFpdHdrGuidValue(jTextFieldGuid
.getText());
729 This method initializes Package type and Compontent type
732 private void initFrame() {
738 * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
740 * Override componentResized to resize all components when frame's size is changed
742 public void componentResized(ComponentEvent arg0
) {
743 int intPreferredWidth
= dialogWidth
;
744 int intCurrentWidth
= this.getJContentPane().getWidth();
746 // Tools.resizeComponentWidth(this.jTextFieldBaseName, this.getWidth(), intPreferredWidth);
747 // Tools.resizeComponentWidth(this.jTextFieldGuid, this.getWidth(), intPreferredWidth);
748 // Tools.relocateComponentX(this.jButtonGenerateGuid, this.getWidth(), jButtonGenerateGuid.getWidth(), 25);
749 // Tools.resizeComponentWidth(this.jTextFieldVersion, this.getWidth(), intPreferredWidth);
750 // Tools.resizeComponentWidth(this.jTextFieldCopyright, this.getWidth(), intPreferredWidth);
751 Tools
.resizeComponentWidth(this.jScrollPaneLicense
, intCurrentWidth
, intPreferredWidth
);
752 Tools
.resizeComponentWidth(this.jTextFieldUrl
, intCurrentWidth
, intPreferredWidth
);
753 Tools
.resizeComponentWidth(this.jTextFieldAbstract
, intCurrentWidth
, intPreferredWidth
);
754 Tools
.resizeComponentWidth(this.jScrollPaneDescription
, intCurrentWidth
, intPreferredWidth
);
755 // Tools.resizeComponentWidth(this.jTextFieldSpecification, this.getWidth(), intPreferredWidth);
762 * @see javax.swing.event.DocumentListener#changedUpdate(javax.swing.event.DocumentEvent)
764 public void changedUpdate(DocumentEvent arg0
) {
765 // TODO Auto-generated method stub
770 * @see javax.swing.event.DocumentListener#insertUpdate(javax.swing.event.DocumentEvent)
772 public void insertUpdate(DocumentEvent arg0
) {
773 // TODO Auto-generated method stub
774 if (docConsole
!= null) {
775 docConsole
.setSaved(false);
780 * @see javax.swing.event.DocumentListener#removeUpdate(javax.swing.event.DocumentEvent)
782 public void removeUpdate(DocumentEvent arg0
) {
783 // TODO Auto-generated method stub
784 if (docConsole
!= null) {
785 docConsole
.setSaved(false);