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