]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | \r | |
3 | The file is used to create, update Protocol of section of the MSA 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 | |
16 | package org.tianocore.frameworkwizard.module.ui.dialog;\r | |
17 | \r | |
18 | import java.awt.event.ActionEvent;\r | |
19 | import java.awt.event.ItemEvent;\r | |
20 | import java.awt.event.ItemListener;\r | |
21 | import java.util.Vector;\r | |
22 | \r | |
23 | import javax.swing.JButton;\r | |
24 | import javax.swing.JComboBox;\r | |
25 | import javax.swing.JLabel;\r | |
26 | import javax.swing.JPanel;\r | |
27 | import javax.swing.JScrollPane;\r | |
28 | import javax.swing.JTextField;\r | |
29 | import javax.swing.JTextArea;\r | |
30 | \r | |
31 | import org.tianocore.frameworkwizard.common.DataType;\r | |
32 | import org.tianocore.frameworkwizard.common.DataValidation;\r | |
33 | import org.tianocore.frameworkwizard.common.EnumerationData;\r | |
34 | import org.tianocore.frameworkwizard.common.Log;\r | |
35 | import org.tianocore.frameworkwizard.common.Tools;\r | |
36 | import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;\r | |
37 | import org.tianocore.frameworkwizard.common.ui.IComboBox;\r | |
38 | import org.tianocore.frameworkwizard.common.ui.IDialog;\r | |
39 | import org.tianocore.frameworkwizard.common.ui.IFrame;\r | |
40 | import org.tianocore.frameworkwizard.common.ui.StarLabel;\r | |
41 | import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r | |
42 | import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsIdentification;\r | |
43 | import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r | |
44 | import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r | |
45 | \r | |
46 | /**\r | |
47 | * The class is used to create, update Protocol of MSA file\r | |
48 | * \r | |
49 | * It extends IDialog\r | |
50 | * \r | |
51 | */\r | |
52 | public class ProtocolsDlg extends IDialog implements ItemListener {\r | |
53 | \r | |
54 | // /\r | |
55 | // / Define class Serial Version UID\r | |
56 | // /\r | |
57 | private static final long serialVersionUID = -9084913640747858848L;\r | |
58 | \r | |
59 | //\r | |
60 | // Define class members\r | |
61 | //\r | |
62 | private JPanel jContentPane = null;\r | |
63 | \r | |
64 | private JLabel jLabelC_Name = null;\r | |
65 | \r | |
66 | private JLabel jLabelFeatureFlag = null;\r | |
67 | \r | |
68 | private JTextField jTextFieldFeatureFlag = null;\r | |
69 | \r | |
70 | private JLabel jLabelUsage = null;\r | |
71 | \r | |
72 | private JComboBox jComboBoxUsage = null;\r | |
73 | \r | |
74 | private StarLabel jStarLabel1 = null;\r | |
75 | \r | |
76 | private StarLabel jStarLabel2 = null;\r | |
77 | \r | |
78 | private StarLabel jStarLabel3 = null;\r | |
79 | \r | |
80 | private JLabel jLabelProtocolType = null;\r | |
81 | \r | |
82 | private JLabel jLabelArch = null;\r | |
83 | \r | |
84 | private JScrollPane jScrollPane = null;\r | |
85 | \r | |
86 | private JComboBox jComboBoxProtocolType = null;\r | |
87 | \r | |
88 | private IComboBox iComboBoxCName = null;\r | |
89 | \r | |
90 | private JLabel jLabelHelpText = null;\r | |
91 | \r | |
92 | private JTextArea jTextAreaHelpText = null;\r | |
93 | \r | |
94 | private JScrollPane jScrollPaneHelpText = null;\r | |
95 | \r | |
96 | private ArchCheckBox jArchCheckBox = null;\r | |
97 | \r | |
98 | private JButton jButtonOk = null;\r | |
99 | \r | |
100 | private JButton jButtonCancel = null;\r | |
101 | \r | |
102 | //\r | |
103 | // Not used by UI\r | |
104 | //\r | |
105 | private ProtocolsIdentification id = null;\r | |
106 | \r | |
107 | private WorkspaceTools wt = new WorkspaceTools();\r | |
108 | \r | |
109 | private EnumerationData ed = new EnumerationData();\r | |
110 | \r | |
111 | /**\r | |
112 | * This method initializes jTextFieldFeatureFlag\r | |
113 | * \r | |
114 | * @return javax.swing.JTextField jTextFieldFeatureFlag\r | |
115 | * \r | |
116 | */\r | |
117 | private JTextField getJTextFieldFeatureFlag() {\r | |
118 | if (jTextFieldFeatureFlag == null) {\r | |
119 | jTextFieldFeatureFlag = new JTextField();\r | |
120 | jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 157, 320, 20));\r | |
121 | jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));\r | |
122 | jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");\r | |
123 | jTextFieldFeatureFlag.setEnabled(false);\r | |
124 | }\r | |
125 | return jTextFieldFeatureFlag;\r | |
126 | }\r | |
127 | \r | |
128 | /**\r | |
129 | * This method initializes jComboBoxUsage\r | |
130 | * \r | |
131 | * @return javax.swing.JComboBox jComboBoxUsage\r | |
132 | * \r | |
133 | */\r | |
134 | private JComboBox getJComboBoxProtocolUsage() {\r | |
135 | if (jComboBoxUsage == null) {\r | |
136 | jComboBoxUsage = new JComboBox();\r | |
137 | jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 62, 320, 20));\r | |
138 | jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));\r | |
139 | jComboBoxUsage\r | |
140 | .setToolTipText("<html><table><tr><td colspan=2 align=center><b>Protocol</b></td></tr>"\r | |
141 | + "<tr><td>ALWAYS_CONSUMED</td><td>Module always consumes the protocol</td></tr>"\r | |
142 | + "<tr><td>SOMETIMES_CONSUMES</td><td>Module sometimes consumes the protocol</td></tr>"\r | |
143 | + "<tr><td>ALWAYS_PRODUCED</td><td>Module always produces the protocol</td></tr>"\r | |
144 | + "<tr><td>SOMETIMES_PRODUCED</td><td>Module sometimes produces the protocol</td></tr>"\r | |
145 | + "<tr><td>TO_START</td><td>The protocol is consumed by a Driver Binding protocol <b>Start</b><br>function. The protocol is used in EFI 1.10 driver model</td></tr>"\r | |
146 | + "<tr><td>BY_START</td><td>Protocol is produced by a Driver Binding protocol <b>Start</b><br>function. The protocol is used in EFI 1.10 driver model</td></tr>"\r | |
147 | + "<tr><td colspan=2 align=center><b>Protocol Notify</b></td></tr>"\r | |
148 | + "<tr><td>SOMETIMES_CONSUMED</td><td>Module will consume the protocol if it is produced.<br>Consumption is defined by executing the protocol notify<br>function.</td></tr></table></html>");\r | |
149 | }\r | |
150 | return jComboBoxUsage;\r | |
151 | }\r | |
152 | \r | |
153 | /**\r | |
154 | * This method initializes jScrollPane\r | |
155 | * \r | |
156 | * @return javax.swing.JScrollPane\r | |
157 | */\r | |
158 | private JScrollPane getJScrollPane() {\r | |
159 | if (jScrollPane == null) {\r | |
160 | jScrollPane = new JScrollPane();\r | |
161 | jScrollPane.setViewportView(getJContentPane());\r | |
162 | }\r | |
163 | return jScrollPane;\r | |
164 | }\r | |
165 | \r | |
166 | /**\r | |
167 | * This method initializes jComboBoxProtocolType\r | |
168 | * \r | |
169 | * @return javax.swing.JComboBox\r | |
170 | */\r | |
171 | private JComboBox getJComboBoxProtocolType() {\r | |
172 | if (jComboBoxProtocolType == null) {\r | |
173 | jComboBoxProtocolType = new JComboBox();\r | |
174 | jComboBoxProtocolType.setBounds(new java.awt.Rectangle(168, 12, 320, 20));\r | |
175 | jComboBoxProtocolType.setPreferredSize(new java.awt.Dimension(320, 20));\r | |
176 | jComboBoxProtocolType.addItemListener(this);\r | |
177 | jComboBoxProtocolType\r | |
178 | .setToolTipText("<html>Select Protocol Type<br>Protocol Notify is a register protocol notify mechanism.");\r | |
179 | }\r | |
180 | return jComboBoxProtocolType;\r | |
181 | }\r | |
182 | \r | |
183 | /**\r | |
184 | * This method initializes iComboBoxCName\r | |
185 | * \r | |
186 | * @return javax.swing.JComboBox\r | |
187 | */\r | |
188 | private IComboBox getIComboBoxCName() {\r | |
189 | if (iComboBoxCName == null) {\r | |
190 | iComboBoxCName = new IComboBox();\r | |
191 | iComboBoxCName.setBounds(new java.awt.Rectangle(168, 37, 320, 20));\r | |
192 | iComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20));\r | |
193 | iComboBoxCName.setToolTipText("Select Guid C Name of the Protocol");\r | |
194 | \r | |
195 | }\r | |
196 | return iComboBoxCName;\r | |
197 | }\r | |
198 | \r | |
199 | /**\r | |
200 | * This method initializes jTextAreaHelpText\r | |
201 | * \r | |
202 | * @return javax.swing.JTextArea\r | |
203 | * \r | |
204 | */\r | |
205 | private JTextArea getJTextAreaHelpText() {\r | |
206 | if (jTextAreaHelpText == null) {\r | |
207 | jTextAreaHelpText = new JTextArea();\r | |
208 | jTextAreaHelpText.setLineWrap(true);\r | |
209 | jTextAreaHelpText.setWrapStyleWord(true);\r | |
210 | }\r | |
211 | return jTextAreaHelpText;\r | |
212 | }\r | |
213 | \r | |
214 | /**\r | |
215 | * This method initializes jScrollPaneHelpText\r | |
216 | * \r | |
217 | * @return javax.swing.JScrollPane\r | |
218 | * \r | |
219 | */\r | |
220 | private JScrollPane getJScrollPaneHelpText() {\r | |
221 | if (jScrollPaneHelpText == null) {\r | |
222 | jScrollPaneHelpText = new JScrollPane();\r | |
223 | jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);\r | |
224 | jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));\r | |
225 | jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));\r | |
226 | jScrollPaneHelpText.setLocation(new java.awt.Point(168, 87));\r | |
227 | jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());\r | |
228 | }\r | |
229 | return jScrollPaneHelpText;\r | |
230 | }\r | |
231 | \r | |
232 | /**\r | |
233 | * This method initializes jButtonOk\r | |
234 | * \r | |
235 | * @return javax.swing.JButton\r | |
236 | * \r | |
237 | */\r | |
238 | private JButton getJButtonOk() {\r | |
239 | if (jButtonOk == null) {\r | |
240 | jButtonOk = new JButton();\r | |
241 | jButtonOk.setBounds(new java.awt.Rectangle(290, 187, 90, 20));\r | |
242 | jButtonOk.setText("Ok");\r | |
243 | jButtonOk.addActionListener(this);\r | |
244 | }\r | |
245 | return jButtonOk;\r | |
246 | }\r | |
247 | \r | |
248 | /**\r | |
249 | * This method initializes jButtonCancel\r | |
250 | * \r | |
251 | * @return javax.swing.JButton\r | |
252 | * \r | |
253 | */\r | |
254 | private JButton getJButtonCancel() {\r | |
255 | if (jButtonCancel == null) {\r | |
256 | jButtonCancel = new JButton();\r | |
257 | jButtonCancel.setBounds(new java.awt.Rectangle(390, 187, 90, 20));\r | |
258 | jButtonCancel.setText("Cancel");\r | |
259 | jButtonCancel.addActionListener(this);\r | |
260 | }\r | |
261 | return jButtonCancel;\r | |
262 | }\r | |
263 | \r | |
264 | public static void main(String[] args) {\r | |
265 | \r | |
266 | }\r | |
267 | \r | |
268 | /**\r | |
269 | * This method initializes this\r | |
270 | * \r | |
271 | */\r | |
272 | private void init() {\r | |
273 | // Width must be 20 larger than Content Pane PreferredSize width for MSFT\r | |
274 | // Height must be 45 larger than ContentPane PreferredSize height for MSFT\r | |
275 | this.setSize(505, 260);\r | |
276 | this.setContentPane(getJScrollPane());\r | |
277 | this.setTitle("Protocols");\r | |
278 | initFrame();\r | |
279 | this.setViewMode(false);\r | |
280 | this.centerWindow();\r | |
281 | }\r | |
282 | \r | |
283 | /**\r | |
284 | * This method initializes this Fill values to all fields if these values are\r | |
285 | * not empty\r | |
286 | * \r | |
287 | * @param inProtocolsId\r | |
288 | * \r | |
289 | */\r | |
290 | private void init(ProtocolsIdentification inProtocolsId, ModuleIdentification mid) {\r | |
291 | init();\r | |
292 | this.id = inProtocolsId;\r | |
293 | \r | |
294 | //\r | |
295 | // Init arch with module's arch\r | |
296 | //\r | |
297 | this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));\r | |
298 | \r | |
299 | //\r | |
300 | // Get defined protocols from dependent packages\r | |
301 | //\r | |
302 | Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r | |
303 | if (vpid.size() <= 0) {\r | |
304 | Log.wrn("Init Protocol", "This module hasn't defined any package dependency, so there is no protocol can be added");\r | |
305 | }\r | |
306 | \r | |
307 | Tools.generateComboBoxByVector(this.iComboBoxCName,\r | |
308 | wt.getAllProtocolDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));\r | |
309 | \r | |
310 | if (this.id != null) {\r | |
311 | this.iComboBoxCName.setSelectedItem(id.getName());\r | |
312 | this.jComboBoxProtocolType.setSelectedItem(id.getType());\r | |
313 | this.jComboBoxUsage.setSelectedItem(id.getUsage());\r | |
314 | this.jTextAreaHelpText.setText(id.getHelp());\r | |
315 | this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());\r | |
316 | this.jArchCheckBox.setSelectedItems(id.getSupArchList());\r | |
317 | }\r | |
318 | }\r | |
319 | \r | |
320 | /**\r | |
321 | * This is the override edit constructor\r | |
322 | * \r | |
323 | * @param inProtocolsIdentification\r | |
324 | * @param iFrame\r | |
325 | * \r | |
326 | */\r | |
327 | public ProtocolsDlg(ProtocolsIdentification inProtocolsIdentification, IFrame iFrame, ModuleIdentification mid) {\r | |
328 | super(iFrame, true);\r | |
329 | init(inProtocolsIdentification, mid);\r | |
330 | }\r | |
331 | \r | |
332 | /**\r | |
333 | * Disable all components when the mode is view\r | |
334 | * \r | |
335 | * @param isView\r | |
336 | * true - The view mode; false - The non-view mode\r | |
337 | * \r | |
338 | */\r | |
339 | public void setViewMode(boolean isView) {\r | |
340 | if (isView) {\r | |
341 | this.jComboBoxUsage.setEnabled(!isView);\r | |
342 | this.jTextFieldFeatureFlag.setEnabled(!isView);\r | |
343 | }\r | |
344 | }\r | |
345 | \r | |
346 | /**\r | |
347 | * This method initializes jContentPane\r | |
348 | * \r | |
349 | * @return javax.swing.JPanel jContentPane\r | |
350 | * \r | |
351 | */\r | |
352 | private JPanel getJContentPane() {\r | |
353 | if (jContentPane == null) {\r | |
354 | jStarLabel1 = new StarLabel();\r | |
355 | jStarLabel1.setLocation(new java.awt.Point(2, 12));\r | |
356 | jLabelProtocolType = new JLabel();\r | |
357 | jLabelProtocolType.setBounds(new java.awt.Rectangle(12, 12, 155, 20));\r | |
358 | jLabelProtocolType.setText("Select Protocol Type");\r | |
359 | \r | |
360 | jStarLabel2 = new StarLabel();\r | |
361 | jStarLabel2.setLocation(new java.awt.Point(2, 37));\r | |
362 | jLabelC_Name = new JLabel();\r | |
363 | jLabelC_Name.setText("Protocol Guid C Name");\r | |
364 | jLabelC_Name.setBounds(new java.awt.Rectangle(12, 37, 155, 20));\r | |
365 | \r | |
366 | jStarLabel3 = new StarLabel();\r | |
367 | jStarLabel3.setLocation(new java.awt.Point(2, 62));\r | |
368 | jLabelUsage = new JLabel();\r | |
369 | jLabelUsage.setText("Usage");\r | |
370 | jLabelUsage.setBounds(new java.awt.Rectangle(12, 62, 155, 20));\r | |
371 | \r | |
372 | jLabelHelpText = new JLabel();\r | |
373 | jLabelHelpText.setBounds(new java.awt.Rectangle(12, 87, 155, 20));\r | |
374 | jLabelHelpText.setText("Help Text");\r | |
375 | \r | |
376 | jLabelFeatureFlag = new JLabel();\r | |
377 | jLabelFeatureFlag.setText("Feature Flag Expression");\r | |
378 | jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 157, 155, 20));\r | |
379 | jLabelFeatureFlag.setEnabled(false);\r | |
380 | \r | |
381 | jLabelArch = new JLabel();\r | |
382 | jLabelArch.setBounds(new java.awt.Rectangle(12, 132, 155, 20));\r | |
383 | jLabelArch.setText("Supported Architectures");\r | |
384 | jArchCheckBox = new ArchCheckBox();\r | |
385 | jArchCheckBox.setBounds(new java.awt.Rectangle(168, 132, 320, 20));\r | |
386 | jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));\r | |
387 | \r | |
388 | jContentPane = new JPanel();\r | |
389 | jContentPane.setLayout(null);\r | |
390 | jContentPane.setPreferredSize(new java.awt.Dimension(485, 215));\r | |
391 | \r | |
392 | jContentPane.add(jStarLabel1, null);\r | |
393 | jContentPane.add(jLabelProtocolType, null);\r | |
394 | jContentPane.add(getJComboBoxProtocolType(), null);\r | |
395 | jContentPane.add(jStarLabel2, null);\r | |
396 | jContentPane.add(jLabelC_Name, null);\r | |
397 | jContentPane.add(getIComboBoxCName(), null);\r | |
398 | jContentPane.add(jStarLabel3, null);\r | |
399 | jContentPane.add(jLabelUsage, null);\r | |
400 | jContentPane.add(getJComboBoxProtocolUsage(), null);\r | |
401 | jContentPane.add(jLabelHelpText, null);\r | |
402 | jContentPane.add(getJScrollPaneHelpText(), null);\r | |
403 | jContentPane.add(jLabelFeatureFlag, null);\r | |
404 | jContentPane.add(getJTextFieldFeatureFlag(), null);\r | |
405 | jContentPane.add(jLabelArch, null);\r | |
406 | jContentPane.add(jArchCheckBox, null);\r | |
407 | jContentPane.add(getJButtonOk(), null);\r | |
408 | jContentPane.add(getJButtonCancel(), null);\r | |
409 | }\r | |
410 | return jContentPane;\r | |
411 | }\r | |
412 | \r | |
413 | /**\r | |
414 | * This method initializes Usage type\r | |
415 | * \r | |
416 | */\r | |
417 | private void initFrame() {\r | |
418 | Tools.generateComboBoxByVector(jComboBoxProtocolType, ed.getVProtocolType());\r | |
419 | Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVProtocolUsage());\r | |
420 | }\r | |
421 | \r | |
422 | /*\r | |
423 | * (non-Javadoc)\r | |
424 | * \r | |
425 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r | |
426 | * \r | |
427 | * Override actionPerformed to listen all actions\r | |
428 | * \r | |
429 | */\r | |
430 | public void actionPerformed(ActionEvent arg0) {\r | |
431 | if (arg0.getSource() == jButtonOk) {\r | |
432 | if (checkAdd()) {\r | |
433 | getCurrentProtocols();\r | |
434 | this.returnType = DataType.RETURN_TYPE_OK;\r | |
435 | this.setVisible(false);\r | |
436 | }\r | |
437 | }\r | |
438 | \r | |
439 | if (arg0.getSource() == jButtonCancel) {\r | |
440 | this.returnType = DataType.RETURN_TYPE_CANCEL;\r | |
441 | this.setVisible(false);\r | |
442 | }\r | |
443 | }\r | |
444 | \r | |
445 | /**\r | |
446 | * Data validation for all fields\r | |
447 | * \r | |
448 | * @retval true - All datas are valid\r | |
449 | * @retval false - At least one data is invalid\r | |
450 | * \r | |
451 | */\r | |
452 | public boolean checkAdd() {\r | |
453 | //\r | |
454 | // Check if all fields have correct data types\r | |
455 | //\r | |
456 | \r | |
457 | //\r | |
458 | // Check Name\r | |
459 | //\r | |
460 | if (this.iComboBoxCName.getSelectedItem() == null) {\r | |
461 | Log.wrn("Update protocols", "Please select one Protocol/ProtocolNotify Name");\r | |
462 | return false;\r | |
463 | }\r | |
464 | \r | |
465 | if (!isEmpty(this.iComboBoxCName.getSelectedItem().toString())) {\r | |
466 | if (!DataValidation.isC_NameType(this.iComboBoxCName.getSelectedItem().toString())) {\r | |
467 | Log.wrn("Update Protocols", "Incorrect data type for Protocol/ProtocolNotify Name");\r | |
468 | return false;\r | |
469 | }\r | |
470 | }\r | |
471 | \r | |
472 | //\r | |
473 | // Check FeatureFlag\r | |
474 | //\r | |
475 | if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {\r | |
476 | if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {\r | |
477 | Log.wrn("Update Protocols", "Incorrect data type for Feature Flag");\r | |
478 | return false;\r | |
479 | }\r | |
480 | }\r | |
481 | \r | |
482 | return true;\r | |
483 | }\r | |
484 | \r | |
485 | private ProtocolsIdentification getCurrentProtocols() {\r | |
486 | String arg0 = this.iComboBoxCName.getSelectedItem().toString();\r | |
487 | String arg1 = this.jComboBoxProtocolType.getSelectedItem().toString();\r | |
488 | String arg2 = this.jComboBoxUsage.getSelectedItem().toString();\r | |
489 | \r | |
490 | String arg3 = this.jTextFieldFeatureFlag.getText();\r | |
491 | Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();\r | |
492 | String arg5 = this.jTextAreaHelpText.getText();\r | |
493 | id = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);\r | |
494 | return id;\r | |
495 | }\r | |
496 | \r | |
497 | /*\r | |
498 | * (non-Javadoc)\r | |
499 | * \r | |
500 | * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)\r | |
501 | * \r | |
502 | * Reflesh the frame when selected item changed\r | |
503 | * \r | |
504 | */\r | |
505 | \r | |
506 | public void itemStateChanged(ItemEvent arg0) {\r | |
507 | if (arg0.getSource() == this.jComboBoxProtocolType && arg0.getStateChange() == ItemEvent.SELECTED) {\r | |
508 | if (this.jComboBoxProtocolType.getSelectedItem().toString().equals(ed.getVProtocolType().get(0))) {\r | |
509 | Tools.generateComboBoxByVector(this.jComboBoxUsage, ed.getVProtocolUsage());\r | |
510 | } else {\r | |
511 | Tools.generateComboBoxByVector(this.jComboBoxUsage, ed.getVProtocolNotifyUsage());\r | |
512 | }\r | |
513 | }\r | |
514 | }\r | |
515 | \r | |
516 | public ProtocolsIdentification getId() {\r | |
517 | return id;\r | |
518 | }\r | |
519 | \r | |
520 | public void setId(ProtocolsIdentification id) {\r | |
521 | this.id = id;\r | |
522 | }\r | |
523 | }\r |