comment out item type checking temporarily when adding module to fpd file.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdHeader.java
1 /** @file
2
3 The file is used to create, update FpdHeader of Fpd file
4
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
10
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.
13
14 **/
15
16 package org.tianocore.frameworkwizard.platform.ui;
17
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;
24
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
34
35
36 import org.tianocore.PlatformSurfaceAreaDocument;
37
38 import org.tianocore.frameworkwizard.common.DataValidation;
39 import org.tianocore.frameworkwizard.common.Tools;
40 import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
41 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
42 import org.tianocore.frameworkwizard.common.ui.StarLabel;
43
44 /**
45 The class is used to create, update FpdHeader of Fpd file
46 It extends IInternalFrame
47
48 @since PackageEditor 1.0
49
50 **/
51 public class FpdHeader extends IInternalFrame {
52
53 ///
54 /// Define class Serial Version UID
55 ///
56 private static final long serialVersionUID = -8152099582923006900L;
57
58 static JFrame frame;
59 //
60 //Define class members
61 //
62 private JPanel jContentPane = null; // @jve:decl-index=0:visual-constraint="10,53"
63
64 private JLabel jLabelBaseName = null;
65
66 private JTextField jTextFieldBaseName = null;
67
68 private JLabel jLabelGuid = null;
69
70 private JTextField jTextFieldGuid = null;
71
72 private JLabel jLabelVersion = null;
73
74 private JTextField jTextFieldVersion = null;
75
76 private JButton jButtonGenerateGuid = null;
77
78 private JLabel jLabelLicense = null;
79
80 private JTextArea jTextAreaLicense = null;
81
82 private JLabel jLabelCopyright = null;
83
84 private JLabel jLabelDescription = null;
85
86 private JTextArea jTextAreaDescription = null;
87
88 private JLabel jLabelSpecification = null;
89
90 private JTextField jTextFieldSpecification = null;
91
92 private JButton jButtonOk = null;
93
94 private JButton jButtonCancel = null;
95
96 private JScrollPane jScrollPaneLicense = null;
97
98 private JScrollPane jScrollPaneDescription = null;
99
100 private JLabel jLabelAbstract = null;
101
102 private JTextField jTextFieldAbstract = null;
103
104 private StarLabel jStarLabel1 = null;
105
106 private StarLabel jStarLabel2 = null;
107
108 private StarLabel jStarLabel3 = null;
109
110 private StarLabel jStarLabel4 = null;
111
112 private StarLabel jStarLabel5 = null;
113
114 private StarLabel jStarLabel6 = null;
115
116 private StarLabel jStarLabel7 = null;
117
118 private StarLabel jStarLabel8 = null;
119
120 private StarLabel jStarLabel9 = null;
121
122 private JTextField jTextFieldCopyright = null;
123
124 private JLabel jLabel = null;
125
126 private JTextField jTextFieldUrl = null;
127
128 private FpdFileContents ffc = null;
129
130 private OpeningPlatformType docConsole = null;
131
132 /**
133 This method initializes jTextFieldBaseName
134
135 @return javax.swing.JTextField jTextFieldBaseName
136
137 **/
138 private JTextField getJTextFieldBaseName() {
139 if (jTextFieldBaseName == null) {
140 jTextFieldBaseName = new JTextField();
141 jTextFieldBaseName.setBounds(new java.awt.Rectangle(160, 10, 320, 20));
142 jTextFieldBaseName.setPreferredSize(new java.awt.Dimension(320,20));
143 jTextFieldBaseName.addFocusListener(new FocusAdapter(){
144 public void focusLost(FocusEvent e) {
145 if (!DataValidation.isUiNameType(jTextFieldBaseName.getText())) {
146 JOptionPane.showMessageDialog(frame, "Package Name is NOT UiNameType.");
147 return;
148 }
149 if (jTextFieldBaseName.getText().equals(ffc.getFpdHdrPlatformName())) {
150 return;
151 }
152 docConsole.setSaved(false);
153 ffc.setFpdHdrPlatformName(jTextFieldBaseName.getText());
154 }
155 });
156 }
157 return jTextFieldBaseName;
158 }
159
160 /**
161 This method initializes jTextFieldGuid
162
163 @return javax.swing.JTextField jTextFieldGuid
164
165 **/
166 private JTextField getJTextFieldGuid() {
167 if (jTextFieldGuid == null) {
168 jTextFieldGuid = new JTextField();
169 jTextFieldGuid.setBounds(new java.awt.Rectangle(160, 35, 250, 20));
170 jTextFieldGuid.setPreferredSize(new java.awt.Dimension(250,20));
171 jTextFieldGuid.addFocusListener(new FocusAdapter(){
172 public void focusLost(FocusEvent e) {
173 if (!DataValidation.isGuid(jTextFieldGuid.getText())) {
174 JOptionPane.showMessageDialog(frame, "Guid is NOT GuidType.");
175 return;
176 }
177 if (jTextFieldGuid.getText().equals(ffc.getFpdHdrGuidValue())) {
178 return;
179 }
180 docConsole.setSaved(false);
181 ffc.setFpdHdrGuidValue(jTextFieldGuid.getText());
182 }
183 });
184 }
185 return jTextFieldGuid;
186 }
187
188 /**
189 This method initializes jTextFieldVersion
190
191 @return javax.swing.JTextField jTextFieldVersion
192
193 **/
194 private JTextField getJTextFieldVersion() {
195 if (jTextFieldVersion == null) {
196 jTextFieldVersion = new JTextField();
197 jTextFieldVersion.setBounds(new java.awt.Rectangle(160, 60, 320, 20));
198 jTextFieldVersion.setPreferredSize(new java.awt.Dimension(320,20));
199 jTextFieldVersion.addFocusListener(new FocusAdapter(){
200 public void focusLost(FocusEvent e) {
201 if (!DataValidation.isVersion(jTextFieldVersion.getText())) {
202 JOptionPane.showMessageDialog(frame, "Version is NOT version type.");
203 return;
204 }
205 if (jTextFieldVersion.getText().equals(ffc.getFpdHdrVer())) {
206 return;
207 }
208 docConsole.setSaved(false);
209 ffc.setFpdHdrVer(jTextFieldVersion.getText());
210 }
211 });
212 }
213 return jTextFieldVersion;
214 }
215
216 /**
217 This method initializes jButtonGenerateGuid
218
219 @return javax.swing.JButton jButtonGenerateGuid
220
221 **/
222 private JButton getJButtonGenerateGuid() {
223 if (jButtonGenerateGuid == null) {
224 jButtonGenerateGuid = new JButton();
225 jButtonGenerateGuid.setBounds(new java.awt.Rectangle(415, 35, 65, 20));
226 jButtonGenerateGuid.setText("GEN");
227 jButtonGenerateGuid.addActionListener(this);
228 }
229 return jButtonGenerateGuid;
230 }
231
232 /**
233 This method initializes jTextAreaLicense
234
235 @return javax.swing.JTextArea jTextAreaLicense
236
237 **/
238 private JTextArea getJTextAreaLicense() {
239 if (jTextAreaLicense == null) {
240 jTextAreaLicense = new JTextArea();
241 jTextAreaLicense.setText("");
242 jTextAreaLicense.setLineWrap(true);
243 jTextAreaLicense.addFocusListener(new FocusAdapter(){
244 public void focusLost(FocusEvent e) {
245 if (jTextAreaLicense.getText().length() == 0) {
246 JOptionPane.showMessageDialog(frame, "License contents could NOT be empty.");
247 return;
248 }
249 if (jTextAreaLicense.getText().equals(ffc.getFpdHdrLicense())) {
250 return;
251 }
252 docConsole.setSaved(false);
253 ffc.setFpdHdrLicense(jTextAreaLicense.getText());
254 }
255 });
256 }
257 return jTextAreaLicense;
258 }
259
260 /**
261 This method initializes jTextAreaDescription
262
263 @return javax.swing.JTextArea jTextAreaDescription
264
265 **/
266 private JTextArea getJTextAreaDescription() {
267 if (jTextAreaDescription == null) {
268 jTextAreaDescription = new JTextArea();
269 jTextAreaDescription.setLineWrap(true);
270 jTextAreaDescription.addFocusListener(new FocusAdapter(){
271 public void focusLost(FocusEvent e) {
272 if (jTextAreaDescription.getText().length() == 0) {
273 JOptionPane.showMessageDialog(frame, "Description contents could NOT be empty.");
274 return;
275 }
276 if (jTextAreaDescription.getText().equals(ffc.getFpdHdrDescription())) {
277 return;
278 }
279 docConsole.setSaved(false);
280 ffc.setFpdHdrDescription(jTextAreaDescription.getText());
281 }
282 });
283 }
284 return jTextAreaDescription;
285 }
286
287 /**
288 This method initializes jTextFieldSpecification
289
290 @return javax.swing.JTextField jTextFieldSpecification
291
292 **/
293 private JTextField getJTextFieldSpecification() {
294 if (jTextFieldSpecification == null) {
295 jTextFieldSpecification = new JTextField();
296 jTextFieldSpecification.setBounds(new java.awt.Rectangle(160,328,320,20));
297 jTextFieldSpecification.setEditable(false);
298 jTextFieldSpecification.setPreferredSize(new java.awt.Dimension(320,20));
299 jTextFieldSpecification.addFocusListener(new FocusAdapter(){
300 public void focusLost(FocusEvent e) {
301 ffc.setFpdHdrSpec(jTextFieldSpecification.getText());
302 }
303 });
304 }
305 return jTextFieldSpecification;
306 }
307
308 /**
309 This method initializes jButtonOk
310
311 @return javax.swing.JButton jButtonOk
312
313 **/
314 private JButton getJButtonOk() {
315 if (jButtonOk == null) {
316 jButtonOk = new JButton();
317 jButtonOk.setText("OK");
318 jButtonOk.setBounds(new java.awt.Rectangle(290,351,90,20));
319 jButtonOk.setVisible(false);
320 jButtonOk.addActionListener(this);
321 }
322 return jButtonOk;
323 }
324
325 /**
326 This method initializes jButtonCancel
327
328 @return javax.swing.JButton jButtonCancel
329
330 **/
331 private JButton getJButtonCancel() {
332 if (jButtonCancel == null) {
333 jButtonCancel = new JButton();
334 jButtonCancel.setText("Cancel");
335 jButtonCancel.setBounds(new java.awt.Rectangle(390,351,90,20));
336 jButtonCancel.setVisible(false);
337 jButtonCancel.addActionListener(this);
338 }
339 return jButtonCancel;
340 }
341
342 /**
343 This method initializes jScrollPaneLicense
344
345 @return javax.swing.JScrollPane jScrollPaneLicense
346
347 **/
348 private JScrollPane getJScrollPaneLicense() {
349 if (jScrollPaneLicense == null) {
350 jScrollPaneLicense = new JScrollPane();
351 jScrollPaneLicense.setBounds(new java.awt.Rectangle(160,107,320,80));
352 jScrollPaneLicense.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
353 jScrollPaneLicense.setPreferredSize(new java.awt.Dimension(320,80));
354 jScrollPaneLicense.setViewportView(getJTextAreaLicense());
355 }
356 return jScrollPaneLicense;
357 }
358
359 /**
360 This method initializes jScrollPaneDescription
361
362 @return javax.swing.JScrollPane jScrollPaneDescription
363
364 **/
365 private JScrollPane getJScrollPaneDescription() {
366 if (jScrollPaneDescription == null) {
367 jScrollPaneDescription = new JScrollPane();
368 jScrollPaneDescription.setBounds(new java.awt.Rectangle(160,243,320,80));
369 jScrollPaneDescription.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
370 jScrollPaneDescription.setViewportView(getJTextAreaDescription());
371 }
372 return jScrollPaneDescription;
373 }
374
375 /**
376 This method initializes jTextFieldAbstract
377
378 @return javax.swing.JTextField jTextFieldAbstract
379
380 **/
381 private JTextField getJTextFieldAbstract() {
382 if (jTextFieldAbstract == null) {
383 jTextFieldAbstract = new JTextField();
384 jTextFieldAbstract.setBounds(new java.awt.Rectangle(160,218,320,20));
385 jTextFieldAbstract.setPreferredSize(new java.awt.Dimension(320, 20));
386 jTextFieldAbstract.addFocusListener(new FocusAdapter(){
387 public void focusLost(FocusEvent e) {
388 if (!DataValidation.isAbstract(jTextFieldAbstract.getText())) {
389 JOptionPane.showMessageDialog(frame, "Abstract could NOT be empty.");
390 return;
391 }
392 if (jTextFieldAbstract.getText().equals(ffc.getFpdHdrAbs())) {
393 return;
394 }
395 docConsole.setSaved(false);
396 ffc.setFpdHdrAbs(jTextFieldAbstract.getText());
397 }
398 });
399 }
400 return jTextFieldAbstract;
401 }
402
403 /**
404 This method initializes jTextFieldCopyright
405
406 @return javax.swing.JTextField jTextFieldCopyright
407
408 **/
409 private JTextField getJTextFieldCopyright() {
410 if (jTextFieldCopyright == null) {
411 jTextFieldCopyright = new JTextField();
412 jTextFieldCopyright.setBounds(new java.awt.Rectangle(160,85,320,20));
413 jTextFieldCopyright.setPreferredSize(new java.awt.Dimension(320,20));
414 jTextFieldCopyright.addFocusListener(new FocusAdapter(){
415 public void focusLost(FocusEvent e) {
416 if (!DataValidation.isCopyright(jTextFieldCopyright.getText())) {
417 JOptionPane.showMessageDialog(frame, "Copyright contents could not be empty.");
418 return;
419 }
420 if (jTextFieldCopyright.getText().equals(ffc.getFpdHdrCopyright())) {
421 return;
422 }
423 docConsole.setSaved(false);
424 ffc.setFpdHdrCopyright(jTextFieldCopyright.getText());
425 }
426 });
427 }
428 return jTextFieldCopyright;
429 }
430
431 /**
432 * This method initializes jTextField
433 *
434 * @return javax.swing.JTextField
435 */
436 private JTextField getJTextFieldUrl() {
437 if (jTextFieldUrl == null) {
438 jTextFieldUrl = new JTextField();
439 jTextFieldUrl.setBounds(new java.awt.Rectangle(160,193,320,20));
440 jTextFieldUrl.setPreferredSize(new Dimension(320, 20));
441 jTextFieldUrl.addFocusListener(new FocusAdapter(){
442 public void focusLost(FocusEvent e){
443 if (jTextFieldUrl.getText().length() == 0 && ffc.getFpdHdrUrl() == null) {
444 return;
445 }
446 if (jTextFieldUrl.getText().equals(ffc.getFpdHdrUrl())) {
447 return;
448 }
449 ffc.setFpdHdrLicense(jTextAreaLicense.getText());
450 ffc.setFpdHdrUrl(jTextFieldUrl.getText());
451 docConsole.setSaved(false);
452 }
453 });
454 }
455 return jTextFieldUrl;
456 }
457
458 public static void main(String[] args) {
459 new FpdHeader().setVisible(true);
460 }
461
462 /**
463 This is the default constructor
464
465 **/
466 public FpdHeader() {
467 super();
468 init();
469 this.setVisible(true);
470 }
471
472 /**
473 This is the override edit constructor
474
475 @param inFpdHeader The input data of FpdHeaderDocument.FpdHeader
476
477 **/
478 public FpdHeader(PlatformSurfaceAreaDocument.PlatformSurfaceArea inFpd) {
479 this();
480 ffc = new FpdFileContents(inFpd);
481 init(ffc);
482
483 }
484
485 public FpdHeader(OpeningPlatformType opt) {
486 this(opt.getXmlFpd());
487 docConsole = opt;
488 }
489
490 /**
491 This method initializes this
492
493 **/
494 private void init() {
495 //this.setSize(500, 515);
496 this.setContentPane(getJContentPane());
497 this.setTitle("Package Surface Area Header");
498 initFrame();
499
500 }
501
502 /**
503 This method initializes this
504 Fill values to all fields if these values are not empty
505
506 @param inFpdHeader The input data of FpdHeaderDocument.FpdHeader
507
508 **/
509 private void init(FpdFileContents ffc) {
510
511 if (ffc.getFpdHdrPlatformName() != null) {
512 jTextFieldBaseName.setText(ffc.getFpdHdrPlatformName());
513 }
514 if (ffc.getFpdHdrGuidValue() != null) {
515 jTextFieldGuid.setText(ffc.getFpdHdrGuidValue());
516 }
517 if (ffc.getFpdHdrVer() != null) {
518 jTextFieldVersion.setText(ffc.getFpdHdrVer());
519 }
520 if (ffc.getFpdHdrLicense() != null) {
521 jTextAreaLicense.setText(ffc.getFpdHdrLicense());
522 }
523 if (ffc.getFpdHdrAbs() != null) {
524 jTextFieldAbstract.setText(ffc.getFpdHdrAbs());
525 }
526 if (ffc.getFpdHdrUrl() != null) {
527 jTextFieldUrl.setText(ffc.getFpdHdrUrl());
528 }
529 if (ffc.getFpdHdrCopyright() != null) {
530 jTextFieldCopyright.setText(ffc.getFpdHdrCopyright());
531 }
532 if (ffc.getFpdHdrDescription() != null) {
533 jTextAreaDescription.setText(ffc.getFpdHdrDescription());
534 }
535 if (ffc.getFpdHdrSpec() != null) {
536 jTextFieldSpecification.setText(ffc.getFpdHdrSpec());
537 }
538 ffc.setFpdHdrSpec(jTextFieldSpecification.getText());
539
540 ffc.genPlatformDefsSkuInfo("0", "DEFAULT");
541 Vector<Object> v = new Vector<Object>();
542 ffc.getPlatformDefsSupportedArchs(v);
543 if (v.size() == 0) {
544 v.add("IA32");
545 ffc.setPlatformDefsSupportedArchs(v);
546 }
547 v.removeAllElements();
548 ffc.getPlatformDefsBuildTargets(v);
549 if (v.size() == 0) {
550 v.add("DEBUG");
551 ffc.setPlatformDefsBuildTargets(v);
552 }
553 if (ffc.getPlatformDefsInterDir() == null) {
554 ffc.setPlatformDefsInterDir("UNIFIED");
555 }
556 }
557
558 /**
559 This method initializes jContentPane
560
561 @return javax.swing.JPanel jContentPane
562
563 **/
564 private JPanel getJContentPane() {
565 if (jContentPane == null) {
566 jLabel = new JLabel();
567 jLabel.setBounds(new java.awt.Rectangle(15,193,140,20));
568 jLabel.setText("URL");
569 jContentPane = new JPanel();
570 jContentPane.setLayout(null);
571 jContentPane.setLocation(new java.awt.Point(0, 0));
572 jContentPane.setSize(new java.awt.Dimension(500,423));
573 jLabelAbstract = new JLabel();
574 jLabelAbstract.setBounds(new java.awt.Rectangle(15,218,140,20));
575 jLabelAbstract.setText("Abstract");
576 jLabelSpecification = new JLabel();
577 jLabelSpecification.setText("Specification");
578 jLabelSpecification.setBounds(new java.awt.Rectangle(15,328,140,20));
579 jLabelDescription = new JLabel();
580 jLabelDescription.setText("Description");
581 jLabelDescription.setBounds(new java.awt.Rectangle(15,243,140,20));
582 jLabelCopyright = new JLabel();
583 jLabelCopyright.setText("Copyright");
584 jLabelCopyright.setBounds(new java.awt.Rectangle(15,85,140,20));
585 jLabelLicense = new JLabel();
586 jLabelLicense.setText("License");
587 jLabelLicense.setBounds(new java.awt.Rectangle(15,108,140,20));
588 jLabelVersion = new JLabel();
589 jLabelVersion.setText("Version");
590 jLabelVersion.setBounds(new java.awt.Rectangle(15, 60, 140, 20));
591 jLabelGuid = new JLabel();
592 jLabelGuid.setPreferredSize(new java.awt.Dimension(25, 15));
593 jLabelGuid.setBounds(new java.awt.Rectangle(15, 35, 140, 20));
594 jLabelGuid.setText("Guid");
595 jLabelBaseName = new JLabel();
596 jLabelBaseName.setText("Platform Name");
597 jLabelBaseName.setBounds(new java.awt.Rectangle(15, 10, 140, 20));
598 jContentPane.add(jLabelBaseName, null);
599 jContentPane.add(getJTextFieldBaseName(), null);
600 jContentPane.add(jLabelGuid, null);
601 jContentPane.add(getJTextFieldGuid(), null);
602 jContentPane.add(jLabelVersion, null);
603 jContentPane.add(getJTextFieldVersion(), null);
604 jContentPane.add(getJButtonGenerateGuid(), null);
605 jContentPane.add(jLabelLicense, null);
606 jContentPane.add(jLabelCopyright, null);
607 jContentPane.add(jLabelDescription, null);
608 jContentPane.add(jLabelSpecification, null);
609 jContentPane.add(getJTextFieldSpecification(), null);
610 jContentPane.add(getJButtonOk(), null);
611 jContentPane.add(getJButtonCancel(), null);
612 jContentPane.add(getJScrollPaneLicense(), null);
613 jContentPane.add(getJScrollPaneDescription(), null);
614 jContentPane.add(jLabelAbstract, null);
615 jContentPane.add(getJTextFieldAbstract(), null);
616 jStarLabel1 = new StarLabel();
617 jStarLabel1.setLocation(new java.awt.Point(0, 10));
618 jStarLabel2 = new StarLabel();
619 jStarLabel2.setLocation(new java.awt.Point(0, 35));
620 jStarLabel3 = new StarLabel();
621 jStarLabel3.setLocation(new java.awt.Point(0, 60));
622 jStarLabel4 = new StarLabel();
623 jStarLabel4.setLocation(new java.awt.Point(0,108));
624 jStarLabel5 = new StarLabel();
625 jStarLabel5.setLocation(new java.awt.Point(0,85));
626 jStarLabel6 = new StarLabel();
627 jStarLabel6.setLocation(new java.awt.Point(0,218));
628 jStarLabel7 = new StarLabel();
629 jStarLabel7.setLocation(new java.awt.Point(0,328));
630 jStarLabel7.setEnabled(false);
631 jStarLabel8 = new StarLabel();
632 jStarLabel8.setLocation(new java.awt.Point(0,243));
633 jStarLabel9 = new StarLabel();
634 jStarLabel9.setLocation(new java.awt.Point(0,303));
635 jStarLabel9.setVisible(false);
636 jContentPane.add(jStarLabel1, null);
637 jContentPane.add(jStarLabel2, null);
638 jContentPane.add(jStarLabel3, null);
639 jContentPane.add(jStarLabel4, null);
640 jContentPane.add(jStarLabel5, null);
641 jContentPane.add(jStarLabel6, null);
642 jContentPane.add(jStarLabel7, null);
643 jContentPane.add(jStarLabel8, null);
644 jContentPane.add(jStarLabel9, null);
645 jContentPane.add(getJTextFieldCopyright(), null);
646
647 jContentPane.add(jLabel, null);
648 jContentPane.add(getJTextFieldUrl(), null);
649 }
650 return jContentPane;
651 }
652
653 /* (non-Javadoc)
654 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
655 *
656 * Override actionPerformed to listen all actions
657 *
658 */
659 public void actionPerformed(ActionEvent arg0) {
660
661 if (arg0.getSource() == jButtonGenerateGuid) {
662 docConsole.setSaved(false);
663 jTextFieldGuid.setText(Tools.generateUuidString());
664 ffc.setFpdHdrGuidValue(jTextFieldGuid.getText());
665 }
666 }
667
668
669 /**
670 This method initializes Package type and Compontent type
671
672 **/
673 private void initFrame() {
674
675
676 }
677
678 /* (non-Javadoc)
679 * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
680 *
681 * Override componentResized to resize all components when frame's size is changed
682 */
683 public void componentResized(ComponentEvent arg0) {
684 int intPreferredWidth = 500;
685
686 resizeComponentWidth(this.jTextFieldBaseName, this.getWidth(), intPreferredWidth);
687 resizeComponentWidth(this.jTextFieldGuid, this.getWidth(), intPreferredWidth);
688 resizeComponentWidth(this.jTextFieldVersion, this.getWidth(), intPreferredWidth);
689 resizeComponentWidth(this.jTextFieldUrl, this.getWidth(), intPreferredWidth);
690 resizeComponentWidth(this.jScrollPaneLicense, this.getWidth(), intPreferredWidth);
691 resizeComponentWidth(this.jTextFieldCopyright, this.getWidth(), intPreferredWidth);
692 resizeComponentWidth(this.jScrollPaneDescription, this.getWidth(), intPreferredWidth);
693 resizeComponentWidth(this.jTextFieldSpecification, this.getWidth(), intPreferredWidth);
694 resizeComponentWidth(this.jTextFieldAbstract, this.getWidth(), intPreferredWidth);
695
696 relocateComponentX(this.jButtonGenerateGuid, this.getWidth(), jButtonGenerateGuid.getWidth(), 25);
697 }
698 }