]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /** @file\r |
2 | \r | |
3 | The file is used to create, update MbdLibHeader of a MBD 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 | package org.tianocore.packaging.module.ui;\r | |
16 | \r | |
17 | import java.awt.event.ActionEvent;\r | |
18 | \r | |
19 | import javax.swing.JButton;\r | |
20 | import javax.swing.JLabel;\r | |
21 | import javax.swing.JPanel;\r | |
22 | import javax.swing.JScrollPane;\r | |
23 | import javax.swing.JTextArea;\r | |
24 | import javax.swing.JTextField;\r | |
25 | \r | |
26 | import org.tianocore.BaseNameDocument;\r | |
27 | import org.tianocore.GuidDocument;\r | |
28 | import org.tianocore.LicenseDocument;\r | |
29 | import org.tianocore.MbdLibHeaderDocument;\r | |
30 | import org.tianocore.common.DataValidation;\r | |
31 | import org.tianocore.common.Log;\r | |
32 | import org.tianocore.common.Tools;\r | |
33 | import org.tianocore.packaging.common.ui.IInternalFrame;\r | |
34 | import org.tianocore.packaging.common.ui.StarLabel;\r | |
35 | \r | |
36 | /**\r | |
37 | The class is used to create, update MbdLibHeader of a MBD file\r | |
38 | It extends IInternalFrame\r | |
39 | \r | |
40 | @since ModuleEditor 1.0\r | |
41 | \r | |
42 | **/\r | |
43 | public class MbdLibHeader extends IInternalFrame {\r | |
44 | \r | |
45 | ///\r | |
46 | /// Define class Serial Version UID\r | |
47 | ///\r | |
48 | private static final long serialVersionUID = -4881447351274201866L;\r | |
49 | \r | |
50 | //\r | |
51 | //Define class members\r | |
52 | //\r | |
53 | private JPanel jContentPane = null;\r | |
54 | \r | |
55 | private JLabel jLabelBaseName = null;\r | |
56 | \r | |
57 | private JTextField jTextFieldBaseName = null;\r | |
58 | \r | |
59 | private JLabel jLabelGuid = null;\r | |
60 | \r | |
61 | private JTextField jTextFieldGuid = null;\r | |
62 | \r | |
63 | private JLabel jLabelVersion = null;\r | |
64 | \r | |
65 | private JTextField jTextFieldVersion = null;\r | |
66 | \r | |
67 | private JButton jButtonGenerateGuid = null;\r | |
68 | \r | |
69 | private JLabel jLabelLicense = null;\r | |
70 | \r | |
71 | private JTextArea jTextAreaLicense = null;\r | |
72 | \r | |
73 | private JLabel jLabelCopyright = null;\r | |
74 | \r | |
878ddf1f | 75 | private JLabel jLabelDescription = null;\r |
76 | \r | |
77 | private JTextArea jTextAreaDescription = null;\r | |
78 | \r | |
79 | private JButton jButtonOk = null;\r | |
80 | \r | |
81 | private JButton jButtonCancel = null;\r | |
82 | \r | |
83 | private JScrollPane jScrollPaneLicense = null;\r | |
84 | \r | |
878ddf1f | 85 | private JScrollPane jScrollPaneDescription = null;\r |
86 | \r | |
87 | private StarLabel jStarLabel1 = null;\r | |
88 | \r | |
89 | private StarLabel jStarLabel2 = null;\r | |
90 | \r | |
91 | private StarLabel jStarLabel3 = null;\r | |
92 | \r | |
93 | private StarLabel jStarLabel4 = null;\r | |
94 | \r | |
95 | private StarLabel jStarLabel5 = null;\r | |
96 | \r | |
97 | private StarLabel jStarLabel6 = null;\r | |
98 | \r | |
99 | private MbdLibHeaderDocument.MbdLibHeader mbdLibHeader = null;\r | |
100 | \r | |
2a8b1c0a | 101 | private JTextField jTextFieldCopyright = null;\r |
102 | \r | |
878ddf1f | 103 | /**\r |
104 | This method initializes jTextFieldBaseName \r | |
105 | \r | |
106 | @return javax.swing.JTextField jTextFieldBaseName\r | |
107 | \r | |
108 | **/\r | |
109 | private JTextField getJTextFieldBaseName() {\r | |
110 | if (jTextFieldBaseName == null) {\r | |
111 | jTextFieldBaseName = new JTextField();\r | |
112 | jTextFieldBaseName.setBounds(new java.awt.Rectangle(160, 10, 320, 20));\r | |
113 | }\r | |
114 | return jTextFieldBaseName;\r | |
115 | }\r | |
116 | \r | |
117 | /**\r | |
118 | This method initializes jTextFieldGuid \r | |
119 | \r | |
120 | @return javax.swing.JTextField jTextFieldGuid\r | |
121 | \r | |
122 | **/\r | |
123 | private JTextField getJTextFieldGuid() {\r | |
124 | if (jTextFieldGuid == null) {\r | |
125 | jTextFieldGuid = new JTextField();\r | |
2a8b1c0a | 126 | jTextFieldGuid.setBounds(new java.awt.Rectangle(160, 35, 250, 20));\r |
878ddf1f | 127 | }\r |
128 | return jTextFieldGuid;\r | |
129 | }\r | |
130 | \r | |
131 | /**\r | |
132 | This method initializes jTextFieldVersion \r | |
133 | \r | |
134 | @return javax.swing.JTextField jTextFieldVersion\r | |
135 | \r | |
136 | **/\r | |
137 | private JTextField getJTextFieldVersion() {\r | |
138 | if (jTextFieldVersion == null) {\r | |
139 | jTextFieldVersion = new JTextField();\r | |
140 | jTextFieldVersion.setBounds(new java.awt.Rectangle(160, 60, 320, 20));\r | |
141 | }\r | |
142 | return jTextFieldVersion;\r | |
143 | }\r | |
144 | \r | |
145 | /**\r | |
146 | This method initializes jButtonGenerateGuid \r | |
147 | \r | |
148 | @return javax.swing.JButton jButtonGenerateGuid\r | |
149 | \r | |
150 | **/\r | |
151 | private JButton getJButtonGenerateGuid() {\r | |
152 | if (jButtonGenerateGuid == null) {\r | |
153 | jButtonGenerateGuid = new JButton();\r | |
2a8b1c0a | 154 | jButtonGenerateGuid.setBounds(new java.awt.Rectangle(415, 35, 65, 20));\r |
878ddf1f | 155 | jButtonGenerateGuid.setText("GEN");\r |
156 | jButtonGenerateGuid.addActionListener(this);\r | |
157 | }\r | |
158 | return jButtonGenerateGuid;\r | |
159 | }\r | |
160 | \r | |
161 | /**\r | |
162 | This method initializes jTextAreaLicense \r | |
163 | \r | |
164 | @return javax.swing.JTextArea jTextAreaLicense\r | |
165 | \r | |
166 | **/\r | |
167 | private JTextArea getJTextAreaLicense() {\r | |
168 | if (jTextAreaLicense == null) {\r | |
169 | jTextAreaLicense = new JTextArea();\r | |
170 | jTextAreaLicense.setText("");\r | |
171 | jTextAreaLicense.setLineWrap(true);\r | |
172 | }\r | |
173 | return jTextAreaLicense;\r | |
174 | }\r | |
175 | \r | |
878ddf1f | 176 | /**\r |
177 | This method initializes jTextAreaDescription \r | |
178 | \r | |
179 | @return javax.swing.JTextArea jTextAreaDescription\r | |
180 | \r | |
181 | **/\r | |
182 | private JTextArea getJTextAreaDescription() {\r | |
183 | if (jTextAreaDescription == null) {\r | |
184 | jTextAreaDescription = new JTextArea();\r | |
185 | jTextAreaDescription.setLineWrap(true);\r | |
186 | }\r | |
187 | return jTextAreaDescription;\r | |
188 | }\r | |
189 | \r | |
190 | /**\r | |
191 | This method initializes jButtonOk \r | |
192 | \r | |
193 | @return javax.swing.JButton jButtonOk\r | |
194 | \r | |
195 | **/\r | |
196 | private JButton getJButtonOk() {\r | |
197 | if (jButtonOk == null) {\r | |
198 | jButtonOk = new JButton();\r | |
199 | jButtonOk.setText("OK");\r | |
200 | jButtonOk.setBounds(new java.awt.Rectangle(290, 345, 90, 20));\r | |
201 | jButtonOk.addActionListener(this);\r | |
202 | }\r | |
203 | return jButtonOk;\r | |
204 | }\r | |
205 | \r | |
206 | /**\r | |
207 | This method initializes jButtonCancel \r | |
208 | \r | |
209 | @return javax.swing.JButton jButtonCancel\r | |
210 | \r | |
211 | **/\r | |
212 | private JButton getJButtonCancel() {\r | |
213 | if (jButtonCancel == null) {\r | |
214 | jButtonCancel = new JButton();\r | |
215 | jButtonCancel.setText("Cancel");\r | |
216 | jButtonCancel.setBounds(new java.awt.Rectangle(390, 345, 90, 20));\r | |
217 | jButtonCancel.addActionListener(this);\r | |
218 | }\r | |
219 | return jButtonCancel;\r | |
220 | }\r | |
221 | \r | |
222 | /**\r | |
223 | This method initializes jScrollPaneLicense \r | |
224 | \r | |
225 | @return javax.swing.JScrollPane jScrollPaneLicense \r | |
226 | \r | |
227 | **/\r | |
228 | private JScrollPane getJScrollPaneLicense() {\r | |
229 | if (jScrollPaneLicense == null) {\r | |
230 | jScrollPaneLicense = new JScrollPane();\r | |
231 | jScrollPaneLicense.setBounds(new java.awt.Rectangle(160, 85, 320, 80));\r | |
232 | jScrollPaneLicense.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);\r | |
233 | jScrollPaneLicense.setViewportView(getJTextAreaLicense());\r | |
234 | }\r | |
235 | return jScrollPaneLicense;\r | |
236 | }\r | |
237 | \r | |
878ddf1f | 238 | /**\r |
239 | This method initializes jScrollPaneDescription \r | |
240 | \r | |
241 | @return javax.swing.JScrollPane jScrollPaneDescription\r | |
242 | \r | |
243 | **/\r | |
244 | private JScrollPane getJScrollPaneDescription() {\r | |
245 | if (jScrollPaneDescription == null) {\r | |
246 | jScrollPaneDescription = new JScrollPane();\r | |
2a8b1c0a | 247 | jScrollPaneDescription.setBounds(new java.awt.Rectangle(160, 195, 320, 80));\r |
878ddf1f | 248 | jScrollPaneDescription.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);\r |
249 | jScrollPaneDescription.setViewportView(getJTextAreaDescription());\r | |
250 | }\r | |
251 | return jScrollPaneDescription;\r | |
252 | }\r | |
253 | \r | |
2a8b1c0a | 254 | /**\r |
255 | This method initializes jTextFieldCopyright \r | |
256 | \r | |
257 | @return javax.swing.JTextField jTextFieldCopyright\r | |
258 | \r | |
259 | **/\r | |
260 | private JTextField getJTextFieldCopyright() {\r | |
261 | if (jTextFieldCopyright == null) {\r | |
262 | jTextFieldCopyright = new JTextField();\r | |
263 | jTextFieldCopyright.setBounds(new java.awt.Rectangle(160,170,320,20));\r | |
264 | }\r | |
265 | return jTextFieldCopyright;\r | |
266 | }\r | |
267 | \r | |
878ddf1f | 268 | public static void main(String[] args) {\r |
269 | \r | |
270 | }\r | |
271 | \r | |
272 | /**\r | |
273 | This is the default constructor\r | |
274 | \r | |
275 | **/\r | |
276 | public MbdLibHeader() {\r | |
277 | super();\r | |
278 | init();\r | |
279 | this.setVisible(true);\r | |
280 | }\r | |
281 | \r | |
282 | /**\r | |
283 | This is the override edit constructor\r | |
284 | \r | |
285 | @param inMbdLibHeader The input MbdLibHeaderDocument.MbdLibHeader\r | |
286 | \r | |
287 | **/\r | |
288 | public MbdLibHeader(MbdLibHeaderDocument.MbdLibHeader inMbdLibHeader) {\r | |
289 | super();\r | |
290 | init(inMbdLibHeader);\r | |
291 | this.setVisible(true);\r | |
292 | this.setViewMode(false);\r | |
293 | }\r | |
294 | \r | |
295 | /**\r | |
296 | This method initializes this\r | |
297 | \r | |
298 | **/\r | |
299 | private void init() {\r | |
300 | this.setSize(500, 515);\r | |
301 | this.setContentPane(getJContentPane());\r | |
302 | this.setTitle("Library Module Build Description Header");\r | |
303 | initFrame();\r | |
304 | }\r | |
305 | \r | |
306 | /**\r | |
307 | This method initializes this\r | |
308 | Fill values to all fields if these values are not empty\r | |
309 | \r | |
310 | @param inMbdLibHeader The input MbdLibHeaderDocument.MbdLibHeader\r | |
311 | \r | |
312 | **/\r | |
313 | private void init(MbdLibHeaderDocument.MbdLibHeader inMbdLibHeader) {\r | |
314 | init();\r | |
315 | setMbdLibHeader(inMbdLibHeader);\r | |
316 | if (inMbdLibHeader != null) {\r | |
317 | if (this.mbdLibHeader.getBaseName() != null) {\r | |
318 | this.jTextFieldBaseName.setText(this.mbdLibHeader.getBaseName().getStringValue());\r | |
319 | }\r | |
320 | if (this.mbdLibHeader.getGuid() != null) {\r | |
321 | this.jTextFieldGuid.setText(this.mbdLibHeader.getGuid().getStringValue());\r | |
322 | }\r | |
323 | if (this.mbdLibHeader.getVersion() != null) {\r | |
324 | this.jTextFieldVersion.setText(this.mbdLibHeader.getVersion());\r | |
325 | }\r | |
326 | if (this.mbdLibHeader.getLicense() != null) {\r | |
327 | this.jTextAreaLicense.setText(this.mbdLibHeader.getLicense().getStringValue());\r | |
328 | }\r | |
329 | if (this.mbdLibHeader.getCopyright() != null) {\r | |
2a8b1c0a | 330 | this.jTextFieldCopyright.setText(this.mbdLibHeader.getCopyright());\r |
878ddf1f | 331 | }\r |
332 | if (this.mbdLibHeader.getDescription() != null) {\r | |
333 | this.jTextAreaDescription.setText(this.mbdLibHeader.getDescription());\r | |
334 | }\r | |
335 | }\r | |
336 | }\r | |
337 | \r | |
338 | /**\r | |
339 | Disable all components when the mode is view\r | |
340 | \r | |
341 | @param isView true - The view mode; false - The non-view mode\r | |
342 | \r | |
343 | **/\r | |
344 | public void setViewMode(boolean isView) {\r | |
345 | this.jButtonOk.setVisible(false);\r | |
346 | this.jButtonCancel.setVisible(false);\r | |
347 | if (isView) {\r | |
348 | this.jTextFieldBaseName.setEnabled(!isView);\r | |
349 | this.jTextFieldGuid.setEnabled(!isView);\r | |
350 | this.jTextFieldVersion.setEnabled(!isView);\r | |
351 | this.jTextAreaLicense.setEnabled(!isView);\r | |
2a8b1c0a | 352 | this.jTextFieldCopyright.setEnabled(!isView);\r |
878ddf1f | 353 | this.jTextAreaDescription.setEnabled(!isView);\r |
354 | this.jButtonCancel.setEnabled(!isView);\r | |
355 | this.jButtonGenerateGuid.setEnabled(!isView);\r | |
356 | this.jButtonOk.setEnabled(!isView);\r | |
357 | }\r | |
358 | }\r | |
359 | \r | |
360 | /**\r | |
361 | This method initializes jContentPane\r | |
362 | \r | |
363 | @return javax.swing.JPanel jContentPane\r | |
364 | \r | |
365 | **/\r | |
366 | private JPanel getJContentPane() {\r | |
367 | if (jContentPane == null) {\r | |
368 | jLabelDescription = new JLabel();\r | |
369 | jLabelDescription.setText("Description");\r | |
2a8b1c0a | 370 | jLabelDescription.setBounds(new java.awt.Rectangle(15, 195, 140, 20));\r |
878ddf1f | 371 | jLabelCopyright = new JLabel();\r |
372 | jLabelCopyright.setText("Copyright");\r | |
373 | jLabelCopyright.setBounds(new java.awt.Rectangle(15, 170, 140, 20));\r | |
374 | jLabelLicense = new JLabel();\r | |
375 | jLabelLicense.setText("License");\r | |
376 | jLabelLicense.setBounds(new java.awt.Rectangle(15, 85, 140, 20));\r | |
377 | jLabelVersion = new JLabel();\r | |
378 | jLabelVersion.setText("Version");\r | |
379 | jLabelVersion.setBounds(new java.awt.Rectangle(15, 60, 140, 20));\r | |
380 | jLabelGuid = new JLabel();\r | |
381 | jLabelGuid.setPreferredSize(new java.awt.Dimension(25, 15));\r | |
382 | jLabelGuid.setBounds(new java.awt.Rectangle(15, 35, 140, 20));\r | |
383 | jLabelGuid.setText("Guid");\r | |
384 | jLabelBaseName = new JLabel();\r | |
385 | jLabelBaseName.setText("Base Name");\r | |
386 | jLabelBaseName.setBounds(new java.awt.Rectangle(15, 10, 140, 20));\r | |
387 | jContentPane = new JPanel();\r | |
388 | jContentPane.setLayout(null);\r | |
389 | jContentPane.setLocation(new java.awt.Point(0, 0));\r | |
390 | jContentPane.setSize(new java.awt.Dimension(500, 524));\r | |
391 | jContentPane.add(jLabelBaseName, null);\r | |
392 | jContentPane.add(getJTextFieldBaseName(), null);\r | |
393 | jContentPane.add(jLabelGuid, null);\r | |
394 | jContentPane.add(getJTextFieldGuid(), null);\r | |
395 | jContentPane.add(jLabelVersion, null);\r | |
396 | jContentPane.add(getJTextFieldVersion(), null);\r | |
397 | jContentPane.add(getJButtonGenerateGuid(), null);\r | |
398 | jContentPane.add(jLabelLicense, null);\r | |
399 | jContentPane.add(jLabelCopyright, null);\r | |
400 | jContentPane.add(jLabelDescription, null);\r | |
401 | jContentPane.add(getJButtonOk(), null);\r | |
402 | jContentPane.add(getJButtonCancel(), null);\r | |
403 | jContentPane.add(getJScrollPaneLicense(), null);\r | |
878ddf1f | 404 | jContentPane.add(getJScrollPaneDescription(), null);\r |
405 | \r | |
406 | jStarLabel1 = new StarLabel();\r | |
407 | jStarLabel1.setLocation(new java.awt.Point(0, 10));\r | |
408 | jStarLabel2 = new StarLabel();\r | |
409 | jStarLabel2.setLocation(new java.awt.Point(0, 35));\r | |
410 | jStarLabel3 = new StarLabel();\r | |
411 | jStarLabel3.setLocation(new java.awt.Point(0, 60));\r | |
412 | jStarLabel4 = new StarLabel();\r | |
413 | jStarLabel4.setLocation(new java.awt.Point(0, 85));\r | |
414 | jStarLabel5 = new StarLabel();\r | |
415 | jStarLabel5.setLocation(new java.awt.Point(0, 170));\r | |
416 | jStarLabel6 = new StarLabel();\r | |
2a8b1c0a | 417 | jStarLabel6.setLocation(new java.awt.Point(0, 195));\r |
878ddf1f | 418 | \r |
419 | jContentPane.add(jStarLabel1, null);\r | |
420 | jContentPane.add(jStarLabel2, null);\r | |
421 | jContentPane.add(jStarLabel3, null);\r | |
422 | jContentPane.add(jStarLabel4, null);\r | |
423 | jContentPane.add(jStarLabel5, null);\r | |
424 | jContentPane.add(jStarLabel6, null);\r | |
2a8b1c0a | 425 | jContentPane.add(getJTextFieldCopyright(), null);\r |
878ddf1f | 426 | }\r |
427 | return jContentPane;\r | |
428 | }\r | |
429 | \r | |
430 | /* (non-Javadoc)\r | |
431 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r | |
432 | *\r | |
433 | * Override actionPerformed to listen all actions\r | |
434 | * \r | |
435 | */\r | |
436 | public void actionPerformed(ActionEvent arg0) {\r | |
437 | if (arg0.getSource() == jButtonOk) {\r | |
438 | this.dispose();\r | |
439 | this.save();\r | |
440 | this.setEdited(true);\r | |
441 | }\r | |
442 | if (arg0.getSource() == jButtonCancel) {\r | |
443 | this.dispose();\r | |
444 | this.setEdited(false);\r | |
445 | }\r | |
446 | if (arg0.getSource() == jButtonGenerateGuid) {\r | |
447 | jTextFieldGuid.setText(Tools.generateUuidString());\r | |
448 | }\r | |
449 | }\r | |
450 | \r | |
451 | /**\r | |
452 | Data validation for all fields\r | |
453 | \r | |
454 | @retval true - All datas are valid\r | |
455 | @retval false - At least one data is invalid\r | |
456 | \r | |
457 | **/\r | |
458 | public boolean check() {\r | |
459 | //\r | |
460 | // Check if all required fields are not empty\r | |
461 | //\r | |
462 | if (isEmpty(this.jTextFieldBaseName.getText())) {\r | |
463 | Log.err("Base Name couldn't be empty");\r | |
464 | return false;\r | |
465 | }\r | |
466 | if (isEmpty(this.jTextFieldGuid.getText())) {\r | |
467 | Log.err("Guid couldn't be empty");\r | |
468 | return false;\r | |
469 | }\r | |
470 | if (isEmpty(this.jTextFieldVersion.getText())) {\r | |
471 | Log.err("Version couldn't be empty");\r | |
472 | return false;\r | |
473 | }\r | |
474 | if (isEmpty(this.jTextAreaLicense.getText())) {\r | |
475 | Log.err("License couldn't be empty");\r | |
476 | return false;\r | |
477 | }\r | |
2a8b1c0a | 478 | if (isEmpty(this.jTextFieldCopyright.getText())) {\r |
878ddf1f | 479 | Log.err("Copyright couldn't be empty");\r |
480 | return false;\r | |
481 | }\r | |
482 | if (isEmpty(this.jTextAreaDescription.getText())) {\r | |
483 | Log.err("Description couldn't be empty");\r | |
484 | return false;\r | |
485 | }\r | |
486 | \r | |
487 | //\r | |
488 | // Check if all fields have correct data types \r | |
489 | //\r | |
490 | if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {\r | |
491 | Log.err("Incorrect data type for Base Name");\r | |
492 | return false;\r | |
493 | }\r | |
494 | if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {\r | |
495 | Log.err("Incorrect data type for Guid");\r | |
496 | return false;\r | |
497 | }\r | |
2a8b1c0a | 498 | if (!DataValidation.isCopyright(this.jTextFieldCopyright.getText())) {\r |
878ddf1f | 499 | Log.err("Incorrect data type for Copyright");\r |
500 | return false;\r | |
501 | }\r | |
502 | return true;\r | |
503 | }\r | |
504 | \r | |
505 | /**\r | |
506 | Save all components of Mbd Lib Header\r | |
507 | if exists mbdLibHeader, set the value directly\r | |
508 | if not exists mbdLibHeader, new an instance first\r | |
509 | \r | |
510 | **/\r | |
511 | public void save() {\r | |
512 | try {\r | |
513 | if (this.mbdLibHeader == null) {\r | |
514 | mbdLibHeader = MbdLibHeaderDocument.MbdLibHeader.Factory.newInstance();\r | |
515 | }\r | |
516 | if (this.mbdLibHeader.getBaseName() != null) {\r | |
517 | this.mbdLibHeader.getBaseName().setStringValue(this.jTextFieldBaseName.getText());\r | |
518 | } else {\r | |
519 | BaseNameDocument.BaseName mBaseName = BaseNameDocument.BaseName.Factory.newInstance();\r | |
520 | mBaseName.setStringValue(this.jTextFieldBaseName.getText());\r | |
521 | this.mbdLibHeader.setBaseName(mBaseName);\r | |
522 | }\r | |
523 | \r | |
524 | if (this.mbdLibHeader.getGuid() != null) {\r | |
525 | this.mbdLibHeader.getGuid().setStringValue(this.jTextFieldGuid.getText());\r | |
526 | } else {\r | |
527 | GuidDocument.Guid mGuid = GuidDocument.Guid.Factory.newInstance();\r | |
528 | mGuid.setStringValue(this.jTextFieldGuid.getText());\r | |
529 | this.mbdLibHeader.setGuid(mGuid);\r | |
530 | }\r | |
531 | \r | |
532 | this.mbdLibHeader.setVersion(this.jTextFieldVersion.getText());\r | |
533 | \r | |
534 | if (this.mbdLibHeader.getLicense() != null) {\r | |
535 | this.mbdLibHeader.getLicense().setStringValue(this.jTextAreaLicense.getText());\r | |
536 | } else {\r | |
537 | LicenseDocument.License mLicense = LicenseDocument.License.Factory.newInstance();\r | |
538 | mLicense.setStringValue(this.jTextAreaLicense.getText());\r | |
539 | this.mbdLibHeader.setLicense(mLicense);\r | |
540 | }\r | |
541 | \r | |
2a8b1c0a | 542 | this.mbdLibHeader.setCopyright(this.jTextFieldCopyright.getText());\r |
878ddf1f | 543 | this.mbdLibHeader.setDescription(this.jTextAreaDescription.getText());\r |
544 | \r | |
545 | if (this.mbdLibHeader.getCreated() == null) {\r | |
546 | this.mbdLibHeader.setCreated(Tools.getCurrentDateTime());\r | |
547 | } else {\r | |
548 | this.mbdLibHeader.setModified(Tools.getCurrentDateTime());\r | |
549 | }\r | |
550 | } catch (Exception e) {\r | |
551 | Log.err("Save Module Buid Description", e.getMessage());\r | |
552 | }\r | |
553 | }\r | |
554 | \r | |
555 | /**\r | |
556 | This method initializes module type and compontent type\r | |
557 | \r | |
558 | **/\r | |
559 | private void initFrame() {\r | |
560 | }\r | |
561 | \r | |
562 | /**\r | |
563 | Get MbdLibHeaderDocument.MbdLibHeader\r | |
564 | \r | |
565 | @return MbdLibHeaderDocument.MbdLibHeader\r | |
566 | \r | |
567 | **/\r | |
568 | public MbdLibHeaderDocument.MbdLibHeader getMbdLibHeader() {\r | |
569 | return mbdLibHeader;\r | |
570 | }\r | |
571 | \r | |
572 | /**\r | |
573 | Set MbdLibHeaderDocument.MbdLibHeader\r | |
574 | \r | |
575 | @param mbdLibHeader The input MbdLibHeaderDocument.MbdLibHeader\r | |
576 | \r | |
577 | **/\r | |
578 | public void setMbdLibHeader(MbdLibHeaderDocument.MbdLibHeader mbdLibHeader) {\r | |
579 | this.mbdLibHeader = mbdLibHeader;\r | |
580 | }\r | |
581 | }\r |