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