3 The file is used to create, update Include of MSA/MBD file
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
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.
15 package org
.tianocore
.packaging
.module
.ui
;
17 import java
.awt
.event
.ActionEvent
;
18 import java
.awt
.event
.ItemEvent
;
19 import java
.awt
.event
.ItemListener
;
20 import java
.util
.Vector
;
22 import javax
.swing
.JButton
;
23 import javax
.swing
.JCheckBox
;
24 import javax
.swing
.JComboBox
;
25 import javax
.swing
.JLabel
;
26 import javax
.swing
.JPanel
;
27 import javax
.swing
.JTextField
;
29 import org
.tianocore
.IncludesDocument
;
30 import org
.tianocore
.PackageNameDocument
;
31 import org
.tianocore
.PackageType
;
32 import org
.tianocore
.PackageUsage
;
33 import org
.tianocore
.SupportedArchitectures
;
34 import org
.tianocore
.common
.DataValidation
;
35 import org
.tianocore
.common
.Log
;
36 import org
.tianocore
.packaging
.common
.ui
.IDefaultMutableTreeNode
;
37 import org
.tianocore
.packaging
.common
.ui
.IInternalFrame
;
38 import org
.tianocore
.packaging
.common
.ui
.StarLabel
;
41 The class is used to create, update Include of MSA/MBD file
42 It extends IInternalFrame
44 @since ModuleEditor 1.0
47 public class ModuleIncludes
extends IInternalFrame
implements ItemListener
{
50 /// Define class Serial Version UID
52 private static final long serialVersionUID
= 3465193035145152131L;
55 //Define class members
57 private IncludesDocument
.Includes includes
= null;
59 private int location
= -1;
61 private int intSelectedItemId
= 0;
64 // 1 - Add; 2 - Update
66 private int operation
= -1;
68 private Vector
<String
> vPackageName
= new Vector
<String
>();
70 private Vector
<String
> vUsage
= new Vector
<String
>();
72 private Vector
<String
> vPackageType
= new Vector
<String
>();
74 private Vector
<String
> vUpdatedDate
= new Vector
<String
>();
76 private JPanel jContentPane
= null;
78 private JButton jButtonOk
= null;
80 private JButton jButtonCancel
= null;
82 private JLabel jLabelPackageName
= null;
84 private JLabel jLabelPackageType
= null;
86 private JComboBox jComboBoxPackageType
= null;
88 private JLabel jLabelUsage
= null;
90 private JComboBox jComboBoxUsage
= null;
92 private StarLabel jStarLabel1
= null;
94 private JTextField jTextFieldPackageName
= null;
96 private JComboBox jComboBoxFileList
= null;
98 private JButton jButtonAdd
= null;
100 private JButton jButtonUpdate
= null;
102 private JButton jButtonRemove
= null;
104 private JLabel jLabelUpdatedDate
= null;
106 private JTextField jTextFieldUpdatedDate
= null;
108 private JCheckBox jCheckBoxArch
= null;
110 private JComboBox jComboBoxArch
= null;
113 This method initializes jButtonOk
115 @return javax.swing.JButton jButtonOk
118 private JButton
getJButton() {
119 if (jButtonOk
== null) {
120 jButtonOk
= new JButton();
121 jButtonOk
.setText("OK");
122 jButtonOk
.setBounds(new java
.awt
.Rectangle(290, 165, 90, 20));
123 jButtonOk
.addActionListener(this);
130 This method initializes jButtonCancel
132 @return javax.swing.JButton jButtonCancel
135 private JButton
getJButton1() {
136 if (jButtonCancel
== null) {
137 jButtonCancel
= new JButton();
138 jButtonCancel
.setText("Cancel");
139 jButtonCancel
.setBounds(new java
.awt
.Rectangle(390, 165, 90, 20));
140 jButtonCancel
.addActionListener(this);
142 return jButtonCancel
;
146 This method initializes jComboBoxPackageType
148 @return javax.swing.JComboBox jComboBoxPackageType
151 private JComboBox
getJComboBoxPackageType() {
152 if (jComboBoxPackageType
== null) {
153 jComboBoxPackageType
= new JComboBox();
154 jComboBoxPackageType
.setBounds(new java
.awt
.Rectangle(160, 35, 320, 20));
156 return jComboBoxPackageType
;
160 This method initializes jComboBoxUsage
162 @return javax.swing.JComboBox jComboBoxUsage
165 private JComboBox
getJComboBoxUsage() {
166 if (jComboBoxUsage
== null) {
167 jComboBoxUsage
= new JComboBox();
168 jComboBoxUsage
.setBounds(new java
.awt
.Rectangle(160, 60, 320, 20));
170 return jComboBoxUsage
;
174 This method initializes jTextFieldPackageName
176 @return javax.swing.JTextField jTextFieldPackageName
179 private JTextField
getJTextFieldPackageName() {
180 if (jTextFieldPackageName
== null) {
181 jTextFieldPackageName
= new JTextField();
182 jTextFieldPackageName
.setBounds(new java
.awt
.Rectangle(160, 10, 320, 20));
184 return jTextFieldPackageName
;
188 This method initializes jComboBoxFileList
190 @return javax.swing.JComboBox jComboBoxFileList
193 private JComboBox
getJComboBoxFileList() {
194 if (jComboBoxFileList
== null) {
195 jComboBoxFileList
= new JComboBox();
196 jComboBoxFileList
.setBounds(new java
.awt
.Rectangle(15, 110, 210, 20));
197 jComboBoxFileList
.addActionListener(this);
198 jComboBoxFileList
.addItemListener(this);
200 return jComboBoxFileList
;
204 This method initializes jButtonAdd
206 @return javax.swing.JButton jButtonAdd
209 private JButton
getJButtonAdd() {
210 if (jButtonAdd
== null) {
211 jButtonAdd
= new JButton();
212 jButtonAdd
.setBounds(new java
.awt
.Rectangle(230, 110, 80, 20));
213 jButtonAdd
.setText("Add");
214 jButtonAdd
.addActionListener(this);
220 This method initializes jButtonUpdate
222 @return javax.swing.JButton jButtonUpdate
225 private JButton
getJButtonUpdate() {
226 if (jButtonUpdate
== null) {
227 jButtonUpdate
= new JButton();
228 jButtonUpdate
.setBounds(new java
.awt
.Rectangle(315, 110, 80, 20));
229 jButtonUpdate
.setText("Update");
230 jButtonUpdate
.addActionListener(this);
232 return jButtonUpdate
;
236 This method initializes jButtonRemove
238 @return javax.swing.JButton jButtonRemove
241 private JButton
getJButtonRemove() {
242 if (jButtonRemove
== null) {
243 jButtonRemove
= new JButton();
244 jButtonRemove
.setBounds(new java
.awt
.Rectangle(400, 110, 80, 20));
245 jButtonRemove
.setText("Remove");
246 jButtonRemove
.addActionListener(this);
248 return jButtonRemove
;
252 This method initializes jTextFieldUpdatedDate
254 @return javax.swing.JTextField jTextFieldUpdatedDate
257 private JTextField
getJTextFieldUpdatedDate() {
258 if (jTextFieldUpdatedDate
== null) {
259 jTextFieldUpdatedDate
= new JTextField();
260 jTextFieldUpdatedDate
.setBounds(new java
.awt
.Rectangle(160, 85, 320, 20));
262 return jTextFieldUpdatedDate
;
266 This method initializes jCheckBoxArch
268 @return javax.swing.JCheckBox jCheckBoxArch
271 private JCheckBox
getJCheckBoxArch() {
272 if (jCheckBoxArch
== null) {
273 jCheckBoxArch
= new JCheckBox();
274 jCheckBoxArch
.setBounds(new java
.awt
.Rectangle(10, 135, 120, 20));
275 jCheckBoxArch
.setText("Specific Arch");
276 jCheckBoxArch
.addActionListener(this);
278 return jCheckBoxArch
;
282 This method initializes jComboBoxArch
284 @return javax.swing.JComboBox jComboBoxArch
287 private JComboBox
getJComboBoxArch() {
288 if (jComboBoxArch
== null) {
289 jComboBoxArch
= new JComboBox();
290 jComboBoxArch
.setBounds(new java
.awt
.Rectangle(140, 135, 340, 20));
291 jComboBoxArch
.setEnabled(false);
293 return jComboBoxArch
;
296 public static void main(String
[] args
) {
301 This is the default constructor
304 public ModuleIncludes() {
307 this.setVisible(true);
311 This is the override edit constructor
313 @param inIncludes The input data of IncludesDocument.Includes
316 public ModuleIncludes(IncludesDocument
.Includes inIncludes
) {
319 this.setVisible(true);
323 This is the override edit constructor
325 @param inIncludes The input data of IncludesDocument.Includes
326 @param type The input data of node type
327 @param index The input data of node index
330 public ModuleIncludes(IncludesDocument
.Includes inIncludes
, int type
, int index
) {
332 this.setVisible(true);
336 This is the override edit constructor
338 @param inIncludes The input data of IncludesDocument.Includes
339 @param type The input data of node type
340 @param index The input data of node index
341 @param inOperation The input data of current operation type
344 public ModuleIncludes(IncludesDocument
.Includes inIncludes
, int type
, int index
, int inOperation
) {
346 init(inIncludes
, type
, index
, inOperation
);
347 this.operation
= inOperation
;
348 this.setVisible(true);
352 This method initializes this
357 private void init(IncludesDocument
.Includes inIncludes
) {
359 this.setIncludes(inIncludes
);
363 This method initializes this
364 Fill values to all fields if these values are not empty
366 @param inIncludes The input data of IncludesDocument.Includes
367 @param type The input data of node type
368 @param index The input data of node index
369 @param inOperation The input data of current operation type
372 private void init(IncludesDocument
.Includes inIncludes
, int type
, int index
, int inOperation
) {
374 this.location
= index
;
375 this.operation
= inOperation
;
377 if (operation
== 2) {
378 this.jCheckBoxArch
.setEnabled(false);
379 this.jComboBoxArch
.setEnabled(false);
381 if (type
== IDefaultMutableTreeNode
.INCLUDES_PACKAGENAME
) {
382 if (this.includes
.getPackageNameList().size() > 0) {
383 for (int indexI
= 0; indexI
< this.includes
.getPackageNameList().size(); indexI
++) {
384 if (this.includes
.getPackageNameArray(indexI
).getStringValue() != null) {
385 vPackageName
.addElement(this.includes
.getPackageNameArray(indexI
).getStringValue());
387 vPackageName
.addElement("");
389 if (this.includes
.getPackageNameArray(indexI
).getUsage() != null) {
390 vUsage
.addElement(this.includes
.getPackageNameArray(indexI
).getUsage().toString());
392 vUsage
.addElement("ALWAYS_CONSUMED");
394 if (this.includes
.getPackageNameArray(indexI
).getPackageType() != null) {
395 vPackageType
.addElement(this.includes
.getPackageNameArray(indexI
).getPackageType()
398 vPackageType
.addElement("SOURCE");
400 if (this.includes
.getPackageNameArray(indexI
).getUpdatedDate() != null) {
401 vUpdatedDate
.addElement(this.includes
.getPackageNameArray(indexI
).getUpdatedDate());
403 vUpdatedDate
.addElement("");
405 jComboBoxFileList
.addItem(this.includes
.getPackageNameArray(indexI
).getStringValue());
409 if (type
== IDefaultMutableTreeNode
.INCLUDES_ARCH_ITEM
) {
410 this.jCheckBoxArch
.setSelected(true);
411 this.jComboBoxArch
.setSelectedItem(this.includes
.getArchArray(index
).getArchType().toString());
412 for (int indexI
= 0; indexI
< this.includes
.getArchArray(index
).getPackageNameList().size(); indexI
++) {
413 if (this.includes
.getArchArray(index
).getPackageNameArray(indexI
).getStringValue() != null) {
414 vPackageName
.addElement(this.includes
.getArchArray(index
).getPackageNameArray(indexI
)
417 vPackageName
.addElement("");
419 if (this.includes
.getArchArray(index
).getPackageNameArray(indexI
).getUsage() != null) {
420 vUsage
.addElement(this.includes
.getArchArray(index
).getPackageNameArray(indexI
).getUsage()
423 vUsage
.addElement("");
425 if (this.includes
.getArchArray(index
).getPackageNameArray(indexI
).getPackageType() != null) {
426 vPackageType
.addElement(this.includes
.getArchArray(index
).getPackageNameArray(indexI
)
427 .getPackageType().toString());
429 vPackageType
.addElement("");
431 if (this.includes
.getArchArray(index
).getPackageNameArray(indexI
).getUpdatedDate() != null) {
432 vUpdatedDate
.addElement(this.includes
.getArchArray(index
).getPackageNameArray(indexI
)
435 vUpdatedDate
.addElement("");
437 jComboBoxFileList
.addItem(this.includes
.getArchArray(index
).getPackageNameArray(indexI
)
445 This method initializes this
448 private void init() {
449 this.setSize(500, 515);
450 this.setContentPane(getJContentPane());
451 this.setTitle("Includes");
453 this.setViewMode(false);
457 Disable all components when the mode is view
459 @param isView true - The view mode; false - The non-view mode
462 public void setViewMode(boolean isView
) {
463 this.jButtonOk
.setVisible(false);
464 this.jButtonCancel
.setVisible(false);
466 this.jComboBoxPackageType
.setEnabled(!isView
);
467 this.jComboBoxUsage
.setEnabled(!isView
);
468 this.jTextFieldPackageName
.setEnabled(!isView
);
469 this.jButtonAdd
.setEnabled(!isView
);
470 this.jButtonUpdate
.setEnabled(!isView
);
471 this.jButtonRemove
.setEnabled(!isView
);
472 this.jTextFieldUpdatedDate
.setEnabled(!isView
);
473 this.jCheckBoxArch
.setEnabled(!isView
);
474 this.jComboBoxArch
.setEnabled(!isView
);
476 this.jButtonCancel
.setEnabled(!isView
);
477 this.jButtonOk
.setEnabled(!isView
);
482 This method initializes jContentPane
484 @return javax.swing.JPanel jContentPane
487 private JPanel
getJContentPane() {
488 if (jContentPane
== null) {
489 jLabelUpdatedDate
= new JLabel();
490 jLabelUpdatedDate
.setBounds(new java
.awt
.Rectangle(15, 85, 140, 20));
491 jLabelUpdatedDate
.setText("Updated Date");
492 jLabelUsage
= new JLabel();
493 jLabelUsage
.setBounds(new java
.awt
.Rectangle(15, 60, 140, 20));
494 jLabelUsage
.setText("Usage");
495 jLabelPackageType
= new JLabel();
496 jLabelPackageType
.setBounds(new java
.awt
.Rectangle(15, 35, 140, 20));
497 jLabelPackageType
.setText("Package Type");
498 jLabelPackageName
= new JLabel();
499 jLabelPackageName
.setBounds(new java
.awt
.Rectangle(15, 10, 140, 20));
500 jLabelPackageName
.setText("Package Name");
501 jContentPane
= new JPanel();
502 jContentPane
.setLayout(null);
503 jContentPane
.add(getJButton(), null);
504 jContentPane
.add(getJButton1(), null);
505 jContentPane
.add(jLabelPackageName
, null);
506 jContentPane
.add(jLabelPackageType
, null);
507 jContentPane
.add(getJComboBoxPackageType(), null);
508 jContentPane
.add(jLabelUsage
, null);
509 jContentPane
.add(getJComboBoxUsage(), null);
511 jStarLabel1
= new StarLabel();
512 jStarLabel1
.setLocation(new java
.awt
.Point(0, 10));
514 jContentPane
.add(jStarLabel1
, null);
515 jContentPane
.add(getJTextFieldPackageName(), null);
516 jContentPane
.add(getJComboBoxFileList(), null);
517 jContentPane
.add(getJButtonAdd(), null);
518 jContentPane
.add(getJButtonUpdate(), null);
519 jContentPane
.add(getJButtonRemove(), null);
520 jContentPane
.add(jLabelUpdatedDate
, null);
521 jContentPane
.add(getJTextFieldUpdatedDate(), null);
522 jContentPane
.add(getJCheckBoxArch(), null);
523 jContentPane
.add(getJComboBoxArch(), null);
529 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
531 * Override actionPerformed to listen all actions
534 public void actionPerformed(ActionEvent arg0
) {
535 if (arg0
.getSource() == jButtonOk
) {
536 this.setEdited(true);
540 if (arg0
.getSource() == jButtonCancel
) {
543 if (arg0
.getSource() == jButtonAdd
) {
549 if (arg0
.getSource() == jButtonRemove
) {
552 if (arg0
.getSource() == jButtonUpdate
) {
560 //When and only when checked Arch box then can choose different arch types
562 if (arg0
.getSource() == jCheckBoxArch
) {
563 if (this.jCheckBoxArch
.isSelected()) {
564 this.jComboBoxArch
.setEnabled(true);
566 this.jComboBoxArch
.setEnabled(false);
572 This method initializes Usage type, Package type and Arch type
575 private void initFrame() {
576 jComboBoxUsage
.addItem("ALWAYS_CONSUMED");
577 jComboBoxUsage
.addItem("ALWAYS_PRODUCED");
578 jComboBoxUsage
.addItem("DEFAULT");
580 jComboBoxPackageType
.addItem("SOURCE");
581 jComboBoxPackageType
.addItem("BINARY");
582 jComboBoxPackageType
.addItem("MIXED");
584 jComboBoxArch
.addItem("ALL");
585 jComboBoxArch
.addItem("EBC");
586 jComboBoxArch
.addItem("ARM");
587 jComboBoxArch
.addItem("IA32");
588 jComboBoxArch
.addItem("X64");
589 jComboBoxArch
.addItem("IPF");
590 jComboBoxArch
.addItem("PPC");
594 Add current item to Vector
597 private void addToList() {
598 intSelectedItemId
= vPackageName
.size();
599 vPackageName
.addElement(this.jTextFieldPackageName
.getText());
600 vUsage
.addElement(this.jComboBoxUsage
.getSelectedItem().toString());
601 vPackageType
.addElement(this.jComboBoxPackageType
.getSelectedItem().toString());
602 vUpdatedDate
.addElement(this.jTextFieldUpdatedDate
.getText());
603 jComboBoxFileList
.addItem(this.jTextFieldPackageName
.getText());
604 jComboBoxFileList
.setSelectedItem(this.jTextFieldPackageName
.getText());
607 // Reset select item index
609 intSelectedItemId
= vPackageName
.size();
612 // Reload all fields of selected item
618 Remove item from Vector
621 private void removeFromList() {
622 int intTempIndex
= intSelectedItemId
;
623 if (vPackageName
.size() < 1) {
627 jComboBoxFileList
.removeItemAt(intSelectedItemId
);
629 vPackageName
.removeElementAt(intTempIndex
);
630 vUsage
.removeElementAt(intTempIndex
);
631 vPackageType
.removeElementAt(intTempIndex
);
632 vUpdatedDate
.removeElementAt(intTempIndex
);
635 // Reload all fields of selected item
641 Update current item of Vector
644 private void updateForList() {
646 // Backup selected item index
648 int intTempIndex
= intSelectedItemId
;
650 vPackageName
.setElementAt(this.jTextFieldPackageName
.getText(), intSelectedItemId
);
651 vUsage
.setElementAt(this.jComboBoxUsage
.getSelectedItem().toString(), intSelectedItemId
);
652 vPackageType
.setElementAt(this.jComboBoxPackageType
.getSelectedItem().toString(), intSelectedItemId
);
653 vUpdatedDate
.setElementAt(this.jTextFieldUpdatedDate
.getText(), intSelectedItemId
);
655 jComboBoxFileList
.removeAllItems();
656 for (int index
= 0; index
< vPackageName
.size(); index
++) {
657 jComboBoxFileList
.addItem(vPackageName
.elementAt(index
));
661 // Restore selected item index
663 intSelectedItemId
= intTempIndex
;
666 // Reset select item index
668 jComboBoxFileList
.setSelectedIndex(intSelectedItemId
);
671 // Reload all fields of selected item
677 Refresh all fields' values of selected item of Vector
680 private void reloadFromList() {
681 if (vPackageName
.size() > 0) {
683 // Get selected item index
685 intSelectedItemId
= jComboBoxFileList
.getSelectedIndex();
687 this.jTextFieldPackageName
.setText(vPackageName
.elementAt(intSelectedItemId
).toString());
688 this.jComboBoxUsage
.setSelectedItem(vUsage
.elementAt(intSelectedItemId
).toString());
689 this.jComboBoxPackageType
.setSelectedItem(vPackageType
.elementAt(intSelectedItemId
).toString());
690 this.jTextFieldUpdatedDate
.setText(vUpdatedDate
.elementAt(intSelectedItemId
).toString());
692 this.jTextFieldPackageName
.setText("");
693 this.jComboBoxUsage
.setSelectedItem("");
694 this.jComboBoxPackageType
.setSelectedItem("");
695 this.jTextFieldUpdatedDate
.setText("");
700 Get IncludesDocument.Includes
702 @return IncludesDocument.Includes
705 public IncludesDocument
.Includes
getIncludes() {
710 Set IncludesDocument.Includes
712 @param includes IncludesDocument.Includes
715 public void setIncludes(IncludesDocument
.Includes includes
) {
716 this.includes
= includes
;
720 * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
722 * Reflesh the frame when selected item changed
725 public void itemStateChanged(ItemEvent arg0
) {
726 if (arg0
.getStateChange() == ItemEvent
.SELECTED
) {
732 Data validation for all fields
734 @retval true - All datas are valid
735 @retval false - At least one data is invalid
738 public boolean check() {
739 if (this.jComboBoxFileList
.getItemCount() < 1) {
740 Log
.err("Must have one include at least!");
747 Data validation for all fields before add current item to Vector
749 @retval true - All datas are valid
750 @retval false - At least one data is invalid
753 public boolean checkAdd() {
755 // Check if all required fields are not empty
757 if (isEmpty(this.jTextFieldPackageName
.getText())) {
758 Log
.err("File Name couldn't be empty");
763 // Check if all fields have correct data types
765 if (!DataValidation
.isPackageName(this.jTextFieldPackageName
.getText())) {
766 Log
.err("Incorrect data type for Package Name");
769 if (!isEmpty(this.jTextFieldUpdatedDate
.getText())
770 && !DataValidation
.isDateType(this.jTextFieldUpdatedDate
.getText())) {
771 Log
.err("Incorrect data type for Update Date");
779 Save all components of Includes
780 if exists includes, set the value directly
781 if not exists includes, new an instance first
786 if (this.includes
== null) {
787 includes
= IncludesDocument
.Includes
.Factory
.newInstance();
792 if (!this.jCheckBoxArch
.isSelected()) {
793 if (this.operation
== 2) { //Add new packageName
795 //First remove all existed packageName
797 if (includes
.getPackageNameList().size() > 0) {
798 for (int index
= includes
.getPackageNameList().size() - 1; index
>= 0; index
--) {
799 includes
.removePackageName(index
);
803 for (int index
= 0; index
< vPackageName
.size(); index
++) {
804 PackageNameDocument
.PackageName packageName
= PackageNameDocument
.PackageName
.Factory
.newInstance();
805 if (!isEmpty(vPackageName
.elementAt(index
).toString())) {
806 packageName
.setStringValue(vPackageName
.elementAt(index
).toString());
808 if (!isEmpty(vUsage
.elementAt(index
).toString())) {
809 packageName
.setUsage(PackageUsage
.Enum
.forString(vUsage
.elementAt(index
).toString()));
811 if (!isEmpty(vPackageType
.elementAt(index
).toString())) {
813 .setPackageType(PackageType
.Enum
.forString(vPackageType
.elementAt(index
).toString()));
815 if (!isEmpty(vUpdatedDate
.elementAt(index
).toString())) {
816 packageName
.setUpdatedDate(vUpdatedDate
.elementAt(index
).toString());
818 includes
.addNewPackageName();
819 includes
.setPackageNameArray(includes
.getPackageNameList().size() - 1, packageName
);
825 if (this.jCheckBoxArch
.isSelected()) {
826 IncludesDocument
.Includes
.Arch arch
= IncludesDocument
.Includes
.Arch
.Factory
.newInstance();
827 if (this.operation
== 2) {
829 //First remove all existed filename
831 for (int index
= includes
.getArchArray(location
).getPackageNameList().size() - 1; index
>= 0; index
--) {
832 includes
.getArchArray(location
).removePackageName(index
);
836 for (int index
= 0; index
< vPackageName
.size(); index
++) {
837 PackageNameDocument
.PackageName packageName
= PackageNameDocument
.PackageName
.Factory
.newInstance();
838 if (!isEmpty(vPackageName
.elementAt(index
).toString())) {
839 packageName
.setStringValue(vPackageName
.elementAt(index
).toString());
841 if (!isEmpty(vUsage
.elementAt(index
).toString())) {
842 packageName
.setUsage(PackageUsage
.Enum
.forString(vUsage
.elementAt(index
).toString()));
844 if (!isEmpty(vPackageType
.elementAt(index
).toString())) {
846 .setPackageType(PackageType
.Enum
.forString(vPackageType
.elementAt(index
).toString()));
848 if (!isEmpty(vUpdatedDate
.elementAt(index
).toString())) {
849 packageName
.setUpdatedDate(vUpdatedDate
.elementAt(index
).toString());
851 arch
.addNewPackageName();
852 arch
.setPackageNameArray(arch
.getPackageNameList().size() - 1, packageName
);
855 .setArchType(SupportedArchitectures
.Enum
.forString(this.jComboBoxArch
.getSelectedItem().toString()));
857 includes
.setArchArray(location
, arch
);
859 includes
.addNewArch();
860 includes
.setArchArray(includes
.getArchList().size() - 1, arch
);
863 } catch (Exception e
) {
864 Log
.err("Update Source Files", e
.getMessage());