06a19cee |
1 | /** @file\r |
2 | \r |
928b45fb |
3 | The file is used to create, update Library Class Definition section of the MSA file\r |
06a19cee |
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.frameworkwizard.module.ui.dialog;\r |
16 | \r |
17 | import java.awt.Dimension;\r |
18 | import java.awt.event.ActionEvent;\r |
19 | import java.util.Vector;\r |
20 | \r |
21 | import javax.swing.JButton;\r |
22 | import javax.swing.JComboBox;\r |
23 | import javax.swing.JLabel;\r |
24 | import javax.swing.JPanel;\r |
25 | import javax.swing.JScrollPane;\r |
26 | import javax.swing.JTextField;\r |
27 | \r |
28 | import org.tianocore.frameworkwizard.common.DataType;\r |
29 | import org.tianocore.frameworkwizard.common.DataValidation;\r |
30 | import org.tianocore.frameworkwizard.common.EnumerationData;\r |
31 | import org.tianocore.frameworkwizard.common.Log;\r |
32 | import org.tianocore.frameworkwizard.common.Tools;\r |
33 | import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;\r |
34 | import org.tianocore.frameworkwizard.common.ui.IDialog;\r |
35 | import org.tianocore.frameworkwizard.common.ui.IFrame;\r |
36 | import org.tianocore.frameworkwizard.common.ui.StarLabel;\r |
37 | import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;\r |
38 | import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification;\r |
39 | import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r |
40 | \r |
41 | /**\r |
928b45fb |
42 | * The class is used to create, update Library Class Definition of MSA/MBD file\r |
43 | * \r |
44 | * It extends IDialog\r |
45 | * \r |
06a19cee |
46 | **/\r |
47 | public class LibraryClassDefsDlg extends IDialog {\r |
48 | \r |
49 | ///\r |
50 | /// Define class Serial Version UID\r |
51 | ///\r |
52 | private static final long serialVersionUID = -1743248695411382857L;\r |
53 | \r |
54 | //\r |
55 | //Define class members\r |
56 | //\r |
57 | private JPanel jContentPane = null;\r |
58 | \r |
59 | private JComboBox jComboBoxLibraryClassName = null;\r |
60 | \r |
61 | private JLabel jLabelUsage = null;\r |
62 | \r |
63 | private JComboBox jComboBoxUsage = null;\r |
64 | \r |
65 | private JLabel jLabelLibraryClassName = null;\r |
66 | \r |
67 | private JScrollPane jScrollPane = null;\r |
68 | \r |
69 | private StarLabel jStarLabel1 = null;\r |
70 | \r |
71 | private StarLabel jStarLabel2 = null;\r |
72 | \r |
73 | private JLabel jLabelRecommendedInstanceVersion = null;\r |
74 | \r |
75 | private JTextField jTextFieldRecommendedInstanceVersion = null;\r |
76 | \r |
77 | private JLabel jLabelRecommendedInstanceGuid = null;\r |
78 | \r |
79 | private JTextField jTextFieldRecommendedInstanceGuid = null;\r |
80 | \r |
81 | private JButton jButtonGenerateGuid = null;\r |
82 | \r |
83 | private JLabel jLabelFeatureFlag = null;\r |
84 | \r |
85 | private JTextField jTextFieldFeatureFlag = null;\r |
86 | \r |
87 | private JLabel jLabelArch = null;\r |
88 | \r |
89 | private JLabel jLabelModuleList = null;\r |
90 | \r |
91 | private JScrollPane jScrollPaneModuleList = null;\r |
92 | \r |
93 | private ICheckBoxList iCheckBoxListModule = null;\r |
94 | \r |
95 | private JLabel jLabelHelpText = null;\r |
96 | \r |
97 | private JTextField jTextFieldHelpText = null;\r |
98 | \r |
99 | private ArchCheckBox jArchCheckBox = null;\r |
a929458e |
100 | \r |
06a19cee |
101 | private JButton jButtonOk = null;\r |
102 | \r |
103 | private JButton jButtonCancel = null;\r |
104 | \r |
105 | //\r |
106 | // Not for UI\r |
107 | //\r |
108 | private EnumerationData ed = new EnumerationData();\r |
109 | \r |
110 | private WorkspaceTools wt = new WorkspaceTools();\r |
111 | \r |
112 | private LibraryClassIdentification lcid = null;\r |
113 | \r |
114 | /**\r |
115 | This method initializes jComboBoxSelect \r |
116 | \r |
117 | @return javax.swing.JComboBox jComboBoxSelect\r |
118 | \r |
119 | **/\r |
120 | private JComboBox getJComboBoxLibraryClassName() {\r |
121 | if (jComboBoxLibraryClassName == null) {\r |
122 | jComboBoxLibraryClassName = new JComboBox();\r |
928b45fb |
123 | jComboBoxLibraryClassName.setBounds(new java.awt.Rectangle(168, 12, 320, 20));\r |
06a19cee |
124 | jComboBoxLibraryClassName.setPreferredSize(new Dimension(320, 20));\r |
125 | jComboBoxLibraryClassName.setEnabled(true);\r |
126 | }\r |
127 | return jComboBoxLibraryClassName;\r |
128 | }\r |
129 | \r |
130 | /**\r |
131 | This method initializes jComboBoxUsage \r |
132 | \r |
133 | @return javax.swing.JComboBox jComboBoxUsage\r |
134 | \r |
135 | **/\r |
136 | private JComboBox getJComboBoxUsage() {\r |
137 | if (jComboBoxUsage == null) {\r |
138 | jComboBoxUsage = new JComboBox();\r |
928b45fb |
139 | jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 37, 320, 20));\r |
06a19cee |
140 | jComboBoxUsage.setPreferredSize(new Dimension(320, 20));\r |
141 | }\r |
142 | return jComboBoxUsage;\r |
143 | }\r |
144 | \r |
145 | /**\r |
146 | This method initializes jScrollPane \r |
147 | \r |
148 | @return javax.swing.JScrollPane \r |
149 | */\r |
150 | private JScrollPane getJScrollPane() {\r |
151 | if (jScrollPane == null) {\r |
152 | jScrollPane = new JScrollPane();\r |
153 | jScrollPane.setViewportView(getJContentPane());\r |
154 | }\r |
155 | return jScrollPane;\r |
156 | }\r |
157 | \r |
158 | /**\r |
159 | * This method initializes jTextFieldRecommendedInstanceVersion \r |
160 | * \r |
161 | * @return javax.swing.JTextField \r |
162 | */\r |
163 | private JTextField getJTextFieldRecommendedInstanceVersion() {\r |
164 | if (jTextFieldRecommendedInstanceVersion == null) {\r |
165 | jTextFieldRecommendedInstanceVersion = new JTextField();\r |
166 | jTextFieldRecommendedInstanceVersion.setPreferredSize(new java.awt.Dimension(260, 20));\r |
167 | jTextFieldRecommendedInstanceVersion.setSize(new java.awt.Dimension(260, 20));\r |
168 | jTextFieldRecommendedInstanceVersion.setLocation(new java.awt.Point(220, 85));\r |
169 | jTextFieldRecommendedInstanceVersion.setVisible(false);\r |
170 | }\r |
171 | return jTextFieldRecommendedInstanceVersion;\r |
172 | }\r |
173 | \r |
174 | /**\r |
175 | * This method initializes jTextFieldRecommendedInstanceGuid \r |
176 | * \r |
177 | * @return javax.swing.JTextField \r |
178 | */\r |
179 | private JTextField getJTextFieldRecommendedInstanceGuid() {\r |
180 | if (jTextFieldRecommendedInstanceGuid == null) {\r |
181 | jTextFieldRecommendedInstanceGuid = new JTextField();\r |
182 | jTextFieldRecommendedInstanceGuid.setBounds(new java.awt.Rectangle(220, 110, 190, 20));\r |
183 | jTextFieldRecommendedInstanceGuid.setPreferredSize(new java.awt.Dimension(190, 20));\r |
184 | jTextFieldRecommendedInstanceGuid.setVisible(false);\r |
185 | }\r |
186 | return jTextFieldRecommendedInstanceGuid;\r |
187 | }\r |
188 | \r |
189 | /**\r |
190 | * This method initializes jButtonGenerateGuid \r |
191 | * \r |
192 | * @return javax.swing.JButton \r |
193 | */\r |
194 | private JButton getJButtonGenerateGuid() {\r |
195 | if (jButtonGenerateGuid == null) {\r |
196 | jButtonGenerateGuid = new JButton();\r |
928b45fb |
197 | jButtonGenerateGuid.setBounds(new java.awt.Rectangle(415, 112, 65, 20));\r |
06a19cee |
198 | jButtonGenerateGuid.setPreferredSize(new java.awt.Dimension(65, 20));\r |
199 | jButtonGenerateGuid.setText("GEN");\r |
200 | jButtonGenerateGuid.setVisible(false);\r |
201 | jButtonGenerateGuid.addActionListener(this);\r |
202 | }\r |
203 | return jButtonGenerateGuid;\r |
204 | }\r |
205 | \r |
206 | /**\r |
207 | * This method initializes jTextFieldFeatureFlag \r |
208 | * \r |
209 | * @return javax.swing.JTextField \r |
210 | */\r |
211 | private JTextField getJTextFieldFeatureFlag() {\r |
212 | if (jTextFieldFeatureFlag == null) {\r |
213 | jTextFieldFeatureFlag = new JTextField();\r |
928b45fb |
214 | jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 87, 320, 20));\r |
06a19cee |
215 | jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));\r |
a929458e |
216 | jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");\r |
06a19cee |
217 | }\r |
218 | return jTextFieldFeatureFlag;\r |
219 | }\r |
220 | \r |
221 | /**\r |
222 | This method initializes iCheckBoxListArch \r |
223 | \r |
224 | @return ICheckBoxList \r |
225 | **/\r |
226 | private ICheckBoxList getICheckBoxListSupModuleList() {\r |
227 | if (iCheckBoxListModule == null) {\r |
228 | iCheckBoxListModule = new ICheckBoxList();\r |
229 | }\r |
230 | return iCheckBoxListModule;\r |
231 | }\r |
232 | \r |
233 | /**\r |
234 | This method initializes jScrollPaneModuleList \r |
235 | \r |
236 | @return javax.swing.JScrollPane \r |
237 | \r |
238 | **/\r |
239 | private JScrollPane getJScrollPaneModuleList() {\r |
240 | if (jScrollPaneModuleList == null) {\r |
241 | jScrollPaneModuleList = new JScrollPane();\r |
928b45fb |
242 | jScrollPaneModuleList.setBounds(new java.awt.Rectangle(168, 137, 320, 80));\r |
06a19cee |
243 | jScrollPaneModuleList.setPreferredSize(new java.awt.Dimension(320, 80));\r |
244 | jScrollPaneModuleList.setViewportView(getICheckBoxListSupModuleList());\r |
245 | }\r |
246 | return jScrollPaneModuleList;\r |
247 | }\r |
248 | \r |
249 | /**\r |
250 | This method initializes jTextFieldHelpText \r |
251 | \r |
252 | @return javax.swing.JTextField \r |
253 | \r |
254 | **/\r |
255 | private JTextField getJTextFieldHelpText() {\r |
256 | if (jTextFieldHelpText == null) {\r |
257 | jTextFieldHelpText = new JTextField();\r |
928b45fb |
258 | jTextFieldHelpText.setBounds(new java.awt.Rectangle(168, 62, 320, 20));\r |
06a19cee |
259 | jTextFieldHelpText.setPreferredSize(new java.awt.Dimension(320, 20));\r |
260 | }\r |
261 | return jTextFieldHelpText;\r |
262 | }\r |
263 | \r |
264 | /**\r |
265 | This method initializes jButtonOk \r |
266 | \r |
267 | @return javax.swing.JButton \r |
268 | \r |
269 | **/\r |
270 | private JButton getJButtonOk() {\r |
271 | if (jButtonOk == null) {\r |
272 | jButtonOk = new JButton();\r |
928b45fb |
273 | jButtonOk.setBounds(new java.awt.Rectangle(300, 232, 90, 20));\r |
06a19cee |
274 | jButtonOk.setText("Ok");\r |
275 | jButtonOk.addActionListener(this);\r |
276 | }\r |
277 | return jButtonOk;\r |
278 | }\r |
279 | \r |
280 | /**\r |
281 | This method initializes jButtonCancel \r |
282 | \r |
283 | @return javax.swing.JButton \r |
284 | \r |
285 | **/\r |
286 | private JButton getJButtonCancel() {\r |
287 | if (jButtonCancel == null) {\r |
288 | jButtonCancel = new JButton();\r |
928b45fb |
289 | jButtonCancel.setBounds(new java.awt.Rectangle(400, 232, 90, 20));\r |
06a19cee |
290 | jButtonCancel.setText("Cancel");\r |
291 | jButtonCancel.addActionListener(this);\r |
292 | }\r |
293 | return jButtonCancel;\r |
294 | }\r |
295 | \r |
296 | public static void main(String[] args) {\r |
297 | \r |
298 | }\r |
299 | \r |
300 | /**\r |
301 | This is the default constructor\r |
302 | \r |
303 | **/\r |
304 | public LibraryClassDefsDlg(LibraryClassIdentification inLibraryClassIdentification, IFrame iFrame) {\r |
305 | super(iFrame, true);\r |
306 | init(inLibraryClassIdentification);\r |
307 | }\r |
308 | \r |
309 | /**\r |
310 | This method initializes this\r |
311 | \r |
312 | **/\r |
313 | private void init() {\r |
314 | this.setContentPane(getJScrollPane());\r |
315 | this.setTitle("Library Class Definitions");\r |
928b45fb |
316 | this.setBounds(new java.awt.Rectangle(0, 0, 505, 305));\r |
06a19cee |
317 | initFrame();\r |
318 | this.setViewMode(false);\r |
319 | this.centerWindow();\r |
320 | }\r |
321 | \r |
322 | /**\r |
323 | This method initializes this\r |
324 | \r |
325 | **/\r |
326 | private void init(LibraryClassIdentification inLibraryClassIdentification) {\r |
327 | init();\r |
328 | this.lcid = inLibraryClassIdentification;\r |
329 | if (lcid != null) {\r |
330 | this.jComboBoxLibraryClassName.setSelectedItem(lcid.getLibraryClassName());\r |
331 | this.jComboBoxUsage.setSelectedItem(lcid.getUsage());\r |
332 | this.jTextFieldRecommendedInstanceVersion.setText(lcid.getRecommendedInstanceVersion());\r |
333 | this.jTextFieldRecommendedInstanceGuid.setText(lcid.getRecommendedInstanceGuid());\r |
334 | this.jTextFieldFeatureFlag.setText(lcid.getFeatureFlag());\r |
335 | this.jArchCheckBox.setSelectedItems(lcid.getSupArchList());\r |
336 | this.iCheckBoxListModule.setAllItemsUnchecked();\r |
337 | this.iCheckBoxListModule.initCheckedItem(true, lcid.getSupModuleList());\r |
338 | this.jTextFieldHelpText.setText(lcid.getHelp());\r |
339 | }\r |
340 | }\r |
341 | \r |
342 | /**\r |
343 | Disable all components when the mode is view\r |
344 | \r |
345 | @param isView true - The view mode; false - The non-view mode\r |
346 | \r |
347 | **/\r |
348 | public void setViewMode(boolean isView) {\r |
349 | if (isView) {\r |
350 | this.jComboBoxLibraryClassName.setEnabled(!isView);\r |
351 | this.jComboBoxUsage.setEnabled(!isView);\r |
352 | }\r |
353 | }\r |
354 | \r |
355 | /**\r |
356 | This method initializes jContentPane\r |
357 | \r |
358 | @return javax.swing.JPanel jContentPane\r |
359 | \r |
360 | **/\r |
361 | private JPanel getJContentPane() {\r |
362 | if (jContentPane == null) {\r |
363 | jArchCheckBox = new ArchCheckBox();\r |
928b45fb |
364 | jArchCheckBox.setBounds(new java.awt.Rectangle(168, 112, 320, 20));\r |
06a19cee |
365 | jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));\r |
366 | jLabelHelpText = new JLabel();\r |
928b45fb |
367 | jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 168, 20));\r |
06a19cee |
368 | jLabelHelpText.setText("Help Text");\r |
369 | jLabelModuleList = new JLabel();\r |
928b45fb |
370 | jLabelModuleList.setBounds(new java.awt.Rectangle(12, 137, 168, 20));\r |
ccb063b1 |
371 | jLabelModuleList.setText("Supported Module Types");\r |
06a19cee |
372 | jLabelArch = new JLabel();\r |
928b45fb |
373 | jLabelArch.setBounds(new java.awt.Rectangle(12, 112, 168, 20));\r |
ccb063b1 |
374 | jLabelArch.setText("Supported Architectures");\r |
06a19cee |
375 | jLabelFeatureFlag = new JLabel();\r |
928b45fb |
376 | jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 87, 168, 20));\r |
a929458e |
377 | jLabelFeatureFlag.setText("Feature Flag Expression");\r |
06a19cee |
378 | jLabelRecommendedInstanceGuid = new JLabel();\r |
928b45fb |
379 | jLabelRecommendedInstanceGuid.setBounds(new java.awt.Rectangle(12, 112, 200, 20));\r |
06a19cee |
380 | jLabelRecommendedInstanceGuid.setText("Recommended Instance Guid");\r |
381 | jLabelRecommendedInstanceGuid.setVisible(false);\r |
382 | jLabelRecommendedInstanceVersion = new JLabel();\r |
928b45fb |
383 | jLabelRecommendedInstanceVersion.setBounds(new java.awt.Rectangle(12, 87, 200, 20));\r |
06a19cee |
384 | jLabelRecommendedInstanceVersion.setText("Recommended Instance Version");\r |
385 | jLabelRecommendedInstanceVersion.setVisible(false);\r |
386 | jLabelLibraryClassName = new JLabel();\r |
928b45fb |
387 | jLabelLibraryClassName.setBounds(new java.awt.Rectangle(12, 12, 168, 20));\r |
06a19cee |
388 | jLabelLibraryClassName.setText("Library Class Name");\r |
389 | jLabelUsage = new JLabel();\r |
928b45fb |
390 | jLabelUsage.setBounds(new java.awt.Rectangle(12, 37, 168, 20));\r |
06a19cee |
391 | jLabelUsage.setText("Usage");\r |
392 | jContentPane = new JPanel();\r |
393 | jContentPane.setLayout(null);\r |
928b45fb |
394 | jContentPane.setPreferredSize(new java.awt.Dimension(495, 255));\r |
06a19cee |
395 | \r |
396 | jContentPane.add(getJComboBoxLibraryClassName(), null);\r |
397 | jContentPane.add(jLabelUsage, null);\r |
398 | jContentPane.add(getJComboBoxUsage(), null);\r |
399 | jContentPane.add(jLabelLibraryClassName, null);\r |
400 | jContentPane.add(jLabelRecommendedInstanceVersion, null);\r |
401 | jContentPane.add(getJTextFieldRecommendedInstanceVersion(), null);\r |
402 | jContentPane.add(jLabelRecommendedInstanceGuid, null);\r |
403 | jContentPane.add(getJTextFieldRecommendedInstanceGuid(), null);\r |
404 | jContentPane.add(getJButtonGenerateGuid(), null);\r |
405 | jContentPane.add(jLabelFeatureFlag, null);\r |
406 | jContentPane.add(getJTextFieldFeatureFlag(), null);\r |
407 | jContentPane.add(jLabelArch, null);\r |
408 | jStarLabel1 = new StarLabel();\r |
ccb063b1 |
409 | jStarLabel1.setLocation(new java.awt.Point(2, 10));\r |
06a19cee |
410 | jStarLabel2 = new StarLabel();\r |
ccb063b1 |
411 | jStarLabel2.setLocation(new java.awt.Point(2, 35));\r |
06a19cee |
412 | \r |
413 | jContentPane.add(jStarLabel1, null);\r |
414 | jContentPane.add(jStarLabel2, null);\r |
415 | jContentPane.add(jLabelModuleList, null);\r |
416 | jContentPane.add(getJScrollPaneModuleList(), null);\r |
417 | jContentPane.add(jLabelHelpText, null);\r |
418 | jContentPane.add(getJTextFieldHelpText(), null);\r |
419 | jContentPane.add(jArchCheckBox, null);\r |
420 | jContentPane.add(getJButtonOk(), null);\r |
421 | jContentPane.add(getJButtonCancel(), null);\r |
422 | }\r |
423 | return jContentPane;\r |
424 | }\r |
425 | \r |
426 | /**\r |
427 | This method initializes all existing libraries and usage types\r |
428 | \r |
429 | **/\r |
430 | private void initFrame() {\r |
431 | Tools.generateComboBoxByVector(jComboBoxLibraryClassName, wt.getAllLibraryClassDefinitionsFromWorkspace());\r |
432 | Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVLibraryUsage());\r |
433 | this.iCheckBoxListModule.setAllItems(ed.getVFrameworkModuleTypes());\r |
434 | }\r |
435 | \r |
436 | /* (non-Javadoc)\r |
437 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r |
438 | *\r |
439 | * Override actionPerformed to listen all actions\r |
440 | * \r |
441 | */\r |
442 | public void actionPerformed(ActionEvent arg0) {\r |
443 | if (arg0.getSource() == jButtonGenerateGuid) {\r |
444 | this.jTextFieldRecommendedInstanceGuid.setText(Tools.generateUuidString());\r |
445 | }\r |
446 | \r |
447 | if (arg0.getSource() == jButtonOk) {\r |
448 | if (checkAdd()) {\r |
449 | getCurrentLibraryClass();\r |
450 | this.returnType = DataType.RETURN_TYPE_OK;\r |
451 | this.setVisible(false);\r |
452 | }\r |
453 | }\r |
454 | \r |
455 | if (arg0.getSource() == jButtonCancel) {\r |
456 | this.returnType = DataType.RETURN_TYPE_CANCEL;\r |
457 | this.setVisible(false);\r |
458 | }\r |
459 | }\r |
460 | \r |
461 | /**\r |
462 | Data validation for all fields\r |
463 | \r |
464 | @retval true - All datas are valid\r |
465 | @retval false - At least one data is invalid\r |
466 | \r |
467 | **/\r |
468 | public boolean checkAdd() {\r |
469 | //\r |
470 | // Check LibraryClass\r |
471 | //\r |
472 | if (this.jComboBoxLibraryClassName.getSelectedItem() == null) {\r |
ed1665f2 |
473 | Log.wrn("Update Library Class Definitions", "No Library Class can be added");\r |
06a19cee |
474 | return false;\r |
475 | }\r |
476 | if (!DataValidation.isLibraryClass(this.jComboBoxLibraryClassName.getSelectedItem().toString())) {\r |
ed1665f2 |
477 | Log.wrn("Update Library Class Definitions", "Incorrect data type for Library Class");\r |
06a19cee |
478 | return false;\r |
479 | }\r |
480 | \r |
481 | //\r |
482 | // Check RecommendedInstanceVersion\r |
483 | //\r |
484 | // if (!isEmpty(this.jTextFieldRecommendedInstanceVersion.getText())) {\r |
485 | // if (!DataValidation.isRecommendedInstanceVersion(this.jTextFieldRecommendedInstanceVersion.getText())) {\r |
486 | // Log.err("Incorrect data type for Recommended Instance Version");\r |
487 | // return false;\r |
488 | // }\r |
489 | // }\r |
490 | \r |
491 | //\r |
492 | // Check RecommendedInstanceGuid\r |
493 | //\r |
494 | // if (!isEmpty(this.jTextFieldRecommendedInstanceGuid.getText())) {\r |
495 | // if (!DataValidation.isGuid(this.jTextFieldRecommendedInstanceGuid.getText())) {\r |
496 | // Log.err("Incorrect data type for Recommended Instance Guid");\r |
497 | // return false;\r |
498 | // }\r |
499 | // }\r |
500 | \r |
501 | //\r |
502 | // Check FeatureFlag\r |
503 | //\r |
504 | if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {\r |
505 | if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {\r |
ed1665f2 |
506 | Log.wrn("Update Library Class Definitions", "Incorrect data type for Feature Flag");\r |
06a19cee |
507 | return false;\r |
508 | }\r |
509 | }\r |
510 | \r |
511 | return true;\r |
512 | }\r |
513 | \r |
514 | private LibraryClassIdentification getCurrentLibraryClass() {\r |
515 | String name = this.jComboBoxLibraryClassName.getSelectedItem().toString();\r |
516 | String usage = this.jComboBoxUsage.getSelectedItem().toString();\r |
517 | String version = this.jTextFieldRecommendedInstanceVersion.getText();\r |
518 | String guid = this.jTextFieldRecommendedInstanceGuid.getText();\r |
519 | String featureFlag = this.jTextFieldFeatureFlag.getText();\r |
520 | Vector<String> arch = this.jArchCheckBox.getSelectedItemsVector();\r |
521 | Vector<String> module = this.iCheckBoxListModule.getAllCheckedItemsString();\r |
522 | String help = this.jTextFieldHelpText.getText();\r |
523 | lcid = new LibraryClassIdentification(name, usage, version, guid, arch, featureFlag, module, help);\r |
524 | return lcid;\r |
525 | }\r |
526 | \r |
527 | public LibraryClassIdentification getLcid() {\r |
528 | return lcid;\r |
529 | }\r |
530 | \r |
531 | public void setLcid(LibraryClassIdentification lcid) {\r |
532 | this.lcid = lcid;\r |
533 | }\r |
534 | }\r |