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