978214645eae578e612f552d41b87f5cfbaf0f5c
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / module / ui / ModuleBootModes.java
1 /** @file
2
3 The file is used to create, update BootModes of MSA/MBD file
4
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 package org.tianocore.frameworkwizard.module.ui;
17
18 import java.awt.event.ActionEvent;
19 import java.awt.event.ComponentEvent;
20 import java.awt.event.ItemEvent;
21 import java.util.Vector;
22
23 import javax.swing.JButton;
24 import javax.swing.JComboBox;
25 import javax.swing.JLabel;
26 import javax.swing.JPanel;
27 import javax.swing.JScrollPane;
28 import javax.swing.JTextArea;
29 import javax.swing.JTextField;
30
31 import org.tianocore.BootModeNames;
32 import org.tianocore.BootModeUsage;
33 import org.tianocore.BootModesDocument;
34 import org.tianocore.BootModesDocument.BootModes;
35 import org.tianocore.BootModesDocument.BootModes.BootMode;
36 import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
37 import org.tianocore.frameworkwizard.common.DataType;
38 import org.tianocore.frameworkwizard.common.DataValidation;
39 import org.tianocore.frameworkwizard.common.EnumerationData;
40 import org.tianocore.frameworkwizard.common.Log;
41 import org.tianocore.frameworkwizard.common.Tools;
42 import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
43 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
44 import org.tianocore.frameworkwizard.common.ui.StarLabel;
45 import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
46 import org.tianocore.frameworkwizard.module.Identifications.BootModes.BootModesIdentification;
47 import org.tianocore.frameworkwizard.module.Identifications.BootModes.BootModesVector;
48
49 /**
50 The class is used to create, update BootModes of MSA/MBD file
51 It extends IInternalFrame
52
53
54
55 **/
56 public class ModuleBootModes extends IInternalFrame {
57
58 ///
59 /// Define class Serial Version UID
60 ///
61 private static final long serialVersionUID = -3888558623432442561L;
62
63 //
64 //Define class members
65 //
66 private JPanel jContentPane = null;
67
68 private JLabel jLabelBootModeName = null;
69
70 private JComboBox jComboBoxBootModeName = null;
71
72 private JLabel jLabelUsage = null;
73
74 private JComboBox jComboBoxUsage = null;
75
76 private StarLabel jStarLabel1 = null;
77
78 private StarLabel jStarLabel2 = null;
79
80 private JLabel jLabelFeatureFlag = null;
81
82 private JTextField jTextFieldFeatureFlag = null;
83
84 private JLabel jLabelArch = null;
85
86 private JTextArea jTextAreaList = null;
87
88 private JComboBox jComboBoxList = null;
89
90 private JButton jButtonAdd = null;
91
92 private JButton jButtonRemove = null;
93
94 private JButton jButtonUpdate = null;
95
96 private JScrollPane jScrollPane = null;
97
98 private JScrollPane jScrollPaneList = null;
99
100 private ICheckBoxList iCheckBoxListArch = null;
101
102 private JScrollPane jScrollPaneArch = null;
103
104 private JLabel jLabelHelpText = null;
105
106 private JTextField jTextFieldHelpText = null;
107
108 //
109 // Not used by UI
110 //
111 private int intSelectedItemId = 0;
112
113 private OpeningModuleType omt = null;
114
115 private ModuleSurfaceArea msa = null;
116
117 private BootModesDocument.BootModes bootModes = null;
118
119 private BootModesIdentification id = null;
120
121 private BootModesVector vid = new BootModesVector();
122
123 private EnumerationData ed = new EnumerationData();
124
125 /**
126 This method initializes jComboBoxBootModeName
127
128 @return javax.swing.JComboBox jComboBoxBootModeName
129
130 **/
131 private JComboBox getJComboBoxBootModeName() {
132 if (jComboBoxBootModeName == null) {
133 jComboBoxBootModeName = new JComboBox();
134 jComboBoxBootModeName.setBounds(new java.awt.Rectangle(160, 10, 320, 20));
135 jComboBoxBootModeName.setPreferredSize(new java.awt.Dimension(320, 20));
136 }
137 return jComboBoxBootModeName;
138 }
139
140 /**
141 This method initializes jComboBoxUsage
142
143 @return javax.swing.JComboBox jComboBoxUsage
144
145 **/
146 private JComboBox getJComboBoxUsage() {
147 if (jComboBoxUsage == null) {
148 jComboBoxUsage = new JComboBox();
149 jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 35, 320, 20));
150 jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
151 }
152 return jComboBoxUsage;
153 }
154
155 /**
156 * This method initializes jTextFieldFeatureFlag
157 *
158 * @return javax.swing.JTextField
159 */
160 private JTextField getJTextFieldFeatureFlag() {
161 if (jTextFieldFeatureFlag == null) {
162 jTextFieldFeatureFlag = new JTextField();
163 jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 85, 320, 20));
164 jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
165 }
166 return jTextFieldFeatureFlag;
167 }
168
169 /**
170 This method initializes jComboBoxFileList
171
172 @return javax.swing.JComboBox jComboBoxFileList
173
174 **/
175 private JComboBox getJComboBoxList() {
176 if (jComboBoxList == null) {
177 jComboBoxList = new JComboBox();
178 jComboBoxList.setBounds(new java.awt.Rectangle(15, 195, 210, 20));
179 jComboBoxList.addItemListener(this);
180 jComboBoxList.addActionListener(this);
181 jComboBoxList.setPreferredSize(new java.awt.Dimension(210, 20));
182 }
183 return jComboBoxList;
184 }
185
186 /**
187 This method initializes jButtonAdd
188
189 @return javax.swing.JButton jButtonAdd
190
191 **/
192 private JButton getJButtonAdd() {
193 if (jButtonAdd == null) {
194 jButtonAdd = new JButton();
195 jButtonAdd.setBounds(new java.awt.Rectangle(230, 195, 80, 20));
196 jButtonAdd.setText("Add");
197 jButtonAdd.addActionListener(this);
198 jButtonAdd.setPreferredSize(new java.awt.Dimension(80, 20));
199 }
200 return jButtonAdd;
201 }
202
203 /**
204 This method initializes jButtonRemove
205
206 @return javax.swing.JButton jButtonRemove
207
208 **/
209 private JButton getJButtonRemove() {
210 if (jButtonRemove == null) {
211 jButtonRemove = new JButton();
212 jButtonRemove.setBounds(new java.awt.Rectangle(400, 195, 80, 20));
213 jButtonRemove.setText("Remove");
214 jButtonRemove.addActionListener(this);
215 jButtonRemove.setPreferredSize(new java.awt.Dimension(80, 20));
216 }
217 return jButtonRemove;
218 }
219
220 /**
221 This method initializes jButtonUpdate
222
223 @return javax.swing.JButton jButtonUpdate
224
225 **/
226 private JButton getJButtonUpdate() {
227 if (jButtonUpdate == null) {
228 jButtonUpdate = new JButton();
229 jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 80, 20));
230 jButtonUpdate.setPreferredSize(new java.awt.Dimension(80, 20));
231 jButtonUpdate.setText("Update");
232 jButtonUpdate.addActionListener(this);
233 }
234 return jButtonUpdate;
235 }
236
237 /**
238 * This method initializes jScrollPaneFileList
239 *
240 * @return javax.swing.JScrollPane
241 */
242 private JScrollPane getJScrollPaneList() {
243 if (jScrollPaneList == null) {
244 jScrollPaneList = new JScrollPane();
245 jScrollPaneList.setBounds(new java.awt.Rectangle(15, 220, 465, 240));
246 jScrollPaneList.setViewportView(getJTextAreaList());
247 jScrollPaneList.setPreferredSize(new java.awt.Dimension(465, 240));
248 }
249 return jScrollPaneList;
250 }
251
252 /**
253 This method initializes jScrollPane
254
255 @return javax.swing.JScrollPane
256 */
257 private JScrollPane getJScrollPane() {
258 if (jScrollPane == null) {
259 jScrollPane = new JScrollPane();
260 jScrollPane.setViewportView(getJContentPane());
261 }
262 return jScrollPane;
263 }
264
265 /**
266 * This method initializes jTextAreaFileList
267 *
268 * @return javax.swing.JTextArea
269 */
270 private JTextArea getJTextAreaList() {
271 if (jTextAreaList == null) {
272 jTextAreaList = new JTextArea();
273 jTextAreaList.setEditable(false);
274
275 }
276 return jTextAreaList;
277 }
278
279 /**
280 This method initializes iCheckBoxListArch
281
282 @return ICheckBoxList
283 **/
284 private ICheckBoxList getICheckBoxListSupportedArchitectures() {
285 if (iCheckBoxListArch == null) {
286 iCheckBoxListArch = new ICheckBoxList();
287 iCheckBoxListArch.addFocusListener(this);
288 iCheckBoxListArch.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
289 }
290 return iCheckBoxListArch;
291 }
292
293 /**
294 This method initializes jScrollPaneArch
295
296 @return javax.swing.JScrollPane
297
298 **/
299 private JScrollPane getJScrollPaneArch() {
300 if (jScrollPaneArch == null) {
301 jScrollPaneArch = new JScrollPane();
302 jScrollPaneArch.setBounds(new java.awt.Rectangle(160, 110, 320, 80));
303 jScrollPaneArch.setPreferredSize(new java.awt.Dimension(320, 80));
304 jScrollPaneArch.setViewportView(getICheckBoxListSupportedArchitectures());
305 }
306 return jScrollPaneArch;
307 }
308
309 /**
310 This method initializes jTextFieldHelpText
311
312 @return javax.swing.JTextField
313
314 **/
315 private JTextField getJTextFieldHelpText() {
316 if (jTextFieldHelpText == null) {
317 jTextFieldHelpText = new JTextField();
318 jTextFieldHelpText.setBounds(new java.awt.Rectangle(160, 60, 320, 20));
319 jTextFieldHelpText.setPreferredSize(new java.awt.Dimension(320, 20));
320 }
321 return jTextFieldHelpText;
322 }
323
324 public static void main(String[] args) {
325 }
326
327 /**
328 This method initializes this
329
330 **/
331 private void init() {
332 this.setSize(500, 515);
333 this.setContentPane(getJScrollPane());
334 this.setTitle("Boot Modes");
335 initFrame();
336 this.setViewMode(false);
337 }
338
339 /**
340 This method initializes this
341 Fill values to all fields if these values are not empty
342
343 @param inPackageDependencies
344
345 **/
346 private void init(BootModes inBootModes) {
347 init();
348 this.bootModes = inBootModes;
349
350 if (this.bootModes != null) {
351 if (this.bootModes.getBootModeList().size() > 0) {
352 for (int index = 0; index < this.bootModes.getBootModeList().size(); index++) {
353 String arg0 = null;
354 if (bootModes.getBootModeList().get(index).getBootModeName() != null) {
355 arg0 = bootModes.getBootModeList().get(index).getBootModeName().toString();
356 }
357 String arg1 = null;
358 if (bootModes.getBootModeList().get(index).getUsage() != null) {
359 arg1 = bootModes.getBootModeList().get(index).getUsage().toString();
360 }
361
362 String arg2 = bootModes.getBootModeList().get(index).getFeatureFlag();
363 Vector<String> arg3 = Tools.convertListToVector(bootModes.getBootModeList().get(index).getSupArchList());
364 String arg4 = bootModes.getBootModeList().get(index).getHelpText();
365
366 id = new BootModesIdentification(arg0, arg1, arg2, arg3, arg4);
367 vid.addBootModes(id);
368 }
369 }
370 }
371 //
372 // Update the list
373 //
374 Tools.generateComboBoxByVector(jComboBoxList, vid.getBootModesName());
375 reloadListArea();
376 }
377
378 /**
379 This is the default constructor
380
381 **/
382 public ModuleBootModes() {
383 super();
384 init();
385 this.setVisible(true);
386 }
387
388 /**
389 This is the override edit constructor
390
391 @param inBootModes The input BootModesDocument.BootModes
392
393 **/
394 public ModuleBootModes(OpeningModuleType inOmt) {
395 super();
396 this.omt = inOmt;
397 this.msa = omt.getXmlMsa();
398 init(msa.getBootModes());
399 this.setVisible(true);
400 }
401
402
403 /**
404 Disable all components when the mode is view
405
406 @param isView true - The view mode; false - The non-view mode
407
408 **/
409 public void setViewMode(boolean isView) {
410 if (isView) {
411 this.jComboBoxBootModeName.setEnabled(!isView);
412 this.jComboBoxUsage.setEnabled(!isView);
413 }
414 }
415
416 /**
417 This method initializes jContentPane
418
419 @return javax.swing.JPanel jContentPane
420
421 **/
422 private JPanel getJContentPane() {
423 if (jContentPane == null) {
424 jLabelArch = new JLabel();
425 jLabelArch.setBounds(new java.awt.Rectangle(15, 110, 140, 20));
426 jLabelArch.setText("Arch");
427 jLabelFeatureFlag = new JLabel();
428 jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 85, 140, 20));
429 jLabelFeatureFlag.setText("Feature Flag");
430 jLabelUsage = new JLabel();
431 jLabelUsage.setText("Usage");
432 jLabelUsage.setBounds(new java.awt.Rectangle(15, 35, 140, 20));
433 jLabelBootModeName = new JLabel();
434 jLabelBootModeName.setText("Boot Mode Name");
435 jLabelBootModeName.setBounds(new java.awt.Rectangle(15, 10, 140, 20));
436 jLabelHelpText = new JLabel();
437 jLabelHelpText.setBounds(new java.awt.Rectangle(14, 60, 140, 20));
438 jLabelHelpText.setText("Help Text");
439
440 jContentPane = new JPanel();
441 jContentPane.setLayout(null);
442 jContentPane.setPreferredSize(new java.awt.Dimension(490, 475));
443
444 jContentPane.add(jLabelBootModeName, null);
445 jContentPane.add(getJComboBoxBootModeName(), null);
446 jContentPane.add(jLabelUsage, null);
447 jContentPane.add(getJComboBoxUsage(), null);
448 jStarLabel1 = new StarLabel();
449 jStarLabel1.setLocation(new java.awt.Point(0, 10));
450 jStarLabel2 = new StarLabel();
451 jStarLabel2.setLocation(new java.awt.Point(0, 35));
452
453 jContentPane.add(jStarLabel1, null);
454 jContentPane.add(jStarLabel2, null);
455 jContentPane.add(jLabelFeatureFlag, null);
456 jContentPane.add(getJTextFieldFeatureFlag(), null);
457 jContentPane.add(jLabelArch, null);
458
459 jContentPane.add(getJComboBoxList(), null);
460 jContentPane.add(getJButtonAdd(), null);
461 jContentPane.add(getJButtonRemove(), null);
462 jContentPane.add(getJButtonUpdate(), null);
463 jContentPane.add(getJScrollPaneList(), null);
464 jContentPane.add(getJScrollPaneArch(), null);
465 jContentPane.add(jLabelHelpText, null);
466 jContentPane.add(getJTextFieldHelpText(), null);
467 }
468 return jContentPane;
469 }
470
471 /**
472 This method initializes BootModeName groups and Usage type
473
474 **/
475 private void initFrame() {
476 Tools.generateComboBoxByVector(jComboBoxBootModeName, ed.getVBootModeNames());
477 Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage());
478
479 this.iCheckBoxListArch.setAllItems(ed.getVSupportedArchitectures());
480 }
481
482 /* (non-Javadoc)
483 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
484 *
485 * Override actionPerformed to listen all actions
486 *
487 */
488 public void actionPerformed(ActionEvent arg0) {
489 if (arg0.getSource() == jButtonAdd) {
490 if (!checkAdd()) {
491 return;
492 }
493 addToList();
494 }
495 if (arg0.getSource() == jButtonRemove) {
496 removeFromList();
497 }
498 if (arg0.getSource() == jButtonUpdate) {
499 if (!checkAdd()) {
500 return;
501 }
502 updateForList();
503 }
504 }
505
506 /**
507 Data validation for all fields
508
509 @retval true - All datas are valid
510 @retval false - At least one data is invalid
511
512 **/
513 public boolean checkAdd() {
514 //
515 // Check if all fields have correct data types
516 //
517
518 //
519 // Check FeatureFlag
520 //
521 if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
522 if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
523 Log.err("Incorrect data type for Feature Flag");
524 return false;
525 }
526 }
527
528 return true;
529 }
530
531 /**
532 Save all components of Mbd Header
533 if exists bootModes, set the value directly
534 if not exists bootModes, new an instance first
535
536 **/
537 public void save() {
538 try {
539 int count = this.vid.size();
540
541 this.bootModes = BootModes.Factory.newInstance();
542 if (count > 0) {
543 for (int index = 0; index < count; index++) {
544 BootMode p = BootMode.Factory.newInstance();
545 if (!isEmpty(vid.getBootModes(index).getName())) {
546 p.setBootModeName(BootModeNames.Enum.forString(vid.getBootModes(index).getName()));
547 }
548 if (!isEmpty(vid.getBootModes(index).getUsage())) {
549 p.setUsage(BootModeUsage.Enum.forString(vid.getBootModes(index).getUsage()));
550 }
551 if (!isEmpty(vid.getBootModes(index).getFeatureFlag())) {
552 p.setFeatureFlag(vid.getBootModes(index).getFeatureFlag());
553 }
554 if (vid.getBootModes(index).getSupArchList() != null && vid.getBootModes(index).getSupArchList().size() > 0) {
555 p.setSupArchList(vid.getBootModes(index).getSupArchList());
556 }
557 if (!isEmpty(vid.getBootModes(index).getHelp())) {
558 p.setHelpText(vid.getBootModes(index).getHelp());
559 }
560 this.bootModes.addNewBootMode();
561 this.bootModes.setBootModeArray(bootModes.getBootModeList().size() - 1, p);
562 }
563 }
564
565 this.msa.setBootModes(bootModes);
566 this.omt.setSaved(false);
567 } catch (Exception e) {
568 Log.err("Update Boot Modes", e.getMessage());
569 }
570 }
571
572 /* (non-Javadoc)
573 * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
574 *
575 * Override componentResized to resize all components when frame's size is changed
576 */
577 public void componentResized(ComponentEvent arg0) {
578 int intCurrentWidth = this.getJContentPane().getWidth();
579 int intCurrentHeight = this.getJContentPane().getHeight();
580 int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
581 int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
582
583 resizeComponentWidth(jComboBoxBootModeName, intCurrentWidth, intPreferredWidth);
584 resizeComponentWidth(jComboBoxUsage, intCurrentWidth, intPreferredWidth);
585 resizeComponentWidth(jTextFieldHelpText, intCurrentWidth, intPreferredWidth);
586 resizeComponentWidth(jTextFieldFeatureFlag, intCurrentWidth, intPreferredWidth);
587 resizeComponentWidth(jScrollPaneArch, intCurrentWidth, intPreferredWidth);
588
589 resizeComponentWidth(jComboBoxList, intCurrentWidth, intPreferredWidth);
590 resizeComponent(jScrollPaneList, intCurrentWidth, intCurrentHeight, intPreferredWidth, intPreferredHeight);
591
592 relocateComponentX(jButtonAdd, intCurrentWidth, intPreferredWidth, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON);
593 relocateComponentX(jButtonRemove, intCurrentWidth, intPreferredWidth, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON);
594 relocateComponentX(jButtonUpdate, intCurrentWidth, intPreferredWidth, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON);
595 }
596
597 private BootModesIdentification getCurrentBootModes() {
598 String arg0 = this.jComboBoxBootModeName.getSelectedItem().toString();
599
600 String arg1 = this.jComboBoxUsage.getSelectedItem().toString();
601
602 String arg2 = this.jTextFieldFeatureFlag.getText();
603 Vector<String> arg3 = this.iCheckBoxListArch.getAllCheckedItemsString();
604 String arg4 = this.jTextFieldHelpText.getText();
605 id = new BootModesIdentification(arg0, arg1, arg2, arg3, arg4);
606 return id;
607 }
608
609 /**
610 Add current item to Vector
611
612 **/
613 private void addToList() {
614 intSelectedItemId = vid.size();
615
616 vid.addBootModes(getCurrentBootModes());
617
618 jComboBoxList.addItem(id.getName());
619 jComboBoxList.setSelectedItem(id.getName());
620
621 //
622 // Reset select item index
623 //
624 intSelectedItemId = vid.size();
625
626 //
627 // Reload all fields of selected item
628 //
629 reloadFromList();
630
631 //
632 // Save to memory
633 //
634 save();
635 }
636
637 /**
638 Remove current item from Vector
639
640 **/
641 private void removeFromList() {
642 //
643 // Check if exist items
644 //
645 if (this.vid.size() < 1) {
646 return;
647 }
648
649 int intTempIndex = intSelectedItemId;
650
651 jComboBoxList.removeItemAt(intSelectedItemId);
652
653 vid.removeBootModes(intTempIndex);
654
655 //
656 // Reload all fields of selected item
657 //
658 reloadFromList();
659
660 //
661 // Save to memory
662 //
663 save();
664 }
665
666 /**
667 Update current item of Vector
668
669 **/
670 private void updateForList() {
671 //
672 // Check if exist items
673 //
674 if (this.vid.size() < 1) {
675 return;
676 }
677
678 //
679 // Backup selected item index
680 //
681 int intTempIndex = intSelectedItemId;
682
683 vid.updateBootModes(getCurrentBootModes(), intTempIndex);
684
685 jComboBoxList.removeAllItems();
686 for (int index = 0; index < vid.size(); index++) {
687 jComboBoxList.addItem(vid.getBootModes(index).getName());
688 }
689
690 //
691 // Restore selected item index
692 //
693 intSelectedItemId = intTempIndex;
694
695 //
696 // Reset select item index
697 //
698 jComboBoxList.setSelectedIndex(intSelectedItemId);
699
700 //
701 // Reload all fields of selected item
702 //
703 reloadFromList();
704
705 //
706 // Save to memory
707 //
708 save();
709 }
710
711 /**
712 Refresh all fields' values of selected item of Vector
713
714 **/
715 private void reloadFromList() {
716 if (vid.size() > 0) {
717 //
718 // Get selected item index
719 //
720 intSelectedItemId = jComboBoxList.getSelectedIndex();
721
722 this.jComboBoxBootModeName.setSelectedItem(vid.getBootModes(intSelectedItemId).getName());
723 this.jComboBoxUsage.setSelectedItem(vid.getBootModes(intSelectedItemId).getUsage());
724 this.jTextFieldHelpText.setText(vid.getBootModes(intSelectedItemId).getHelp());
725
726 jTextFieldFeatureFlag.setText(vid.getBootModes(intSelectedItemId).getFeatureFlag());
727 iCheckBoxListArch.setAllItemsUnchecked();
728 iCheckBoxListArch.initCheckedItem(true, vid.getBootModes(intSelectedItemId).getSupArchList());
729
730 } else {
731 }
732
733 reloadListArea();
734 }
735
736 /**
737 Update list area pane via the elements of Vector
738
739 **/
740 private void reloadListArea() {
741 String strListItem = "";
742 for (int index = 0; index < vid.size(); index++) {
743 strListItem = strListItem + vid.getBootModes(index).getName() + DataType.UNIX_LINE_SEPARATOR;
744 }
745 this.jTextAreaList.setText(strListItem);
746 }
747
748 /* (non-Javadoc)
749 * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
750 *
751 * Reflesh the frame when selected item changed
752 *
753 */
754 public void itemStateChanged(ItemEvent arg0) {
755 if (arg0.getSource() == this.jComboBoxList && arg0.getStateChange() == ItemEvent.SELECTED) {
756 reloadFromList();
757 }
758 }
759 }