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
;
39 import org
.tianocore
.packaging
.workspace
.common
.Workspace
;
42 The class is used to create, update Include of MSA/MBD file
43 It extends IInternalFrame
45 @since ModuleEditor 1.0
48 public class ModuleIncludes
extends IInternalFrame
implements ItemListener
{
51 /// Define class Serial Version UID
53 private static final long serialVersionUID
= 3465193035145152131L;
56 //Define class members
58 private IncludesDocument
.Includes includes
= null;
60 private int location
= -1;
62 private int intSelectedItemId
= 0;
65 // 1 - Add; 2 - Update
67 private int operation
= -1;
69 private Vector
<String
> vPackageName
= new Vector
<String
>();
71 private Vector
<String
> vUsage
= new Vector
<String
>();
73 private Vector
<String
> vPackageType
= new Vector
<String
>();
75 private Vector
<String
> vUpdatedDate
= new Vector
<String
>();
77 private JPanel jContentPane
= null;
79 private JButton jButtonOk
= null;
81 private JButton jButtonCancel
= null;
83 private JLabel jLabelPackageName
= null;
85 private JLabel jLabelPackageType
= null;
87 private JComboBox jComboBoxPackageType
= null;
89 private JLabel jLabelUsage
= null;
91 private JComboBox jComboBoxUsage
= null;
93 private StarLabel jStarLabel1
= null;
95 private JComboBox jComboBoxFileList
= null;
97 private JButton jButtonAdd
= null;
99 private JButton jButtonUpdate
= null;
101 private JButton jButtonRemove
= null;
103 private JLabel jLabelUpdatedDate
= null;
105 private JTextField jTextFieldUpdatedDate
= null;
107 private JCheckBox jCheckBoxArch
= null;
109 private JComboBox jComboBoxArch
= null;
111 private JComboBox jComboBoxPackageName
= null;
113 private Workspace ws
= null;
115 private Vector vecPackageName
= null;
118 This method initializes jButtonOk
120 @return javax.swing.JButton jButtonOk
123 private JButton
getJButton() {
124 if (jButtonOk
== null) {
125 jButtonOk
= new JButton();
126 jButtonOk
.setText("OK");
127 jButtonOk
.setBounds(new java
.awt
.Rectangle(290, 165, 90, 20));
128 jButtonOk
.addActionListener(this);
135 This method initializes jButtonCancel
137 @return javax.swing.JButton jButtonCancel
140 private JButton
getJButton1() {
141 if (jButtonCancel
== null) {
142 jButtonCancel
= new JButton();
143 jButtonCancel
.setText("Cancel");
144 jButtonCancel
.setBounds(new java
.awt
.Rectangle(390, 165, 90, 20));
145 jButtonCancel
.addActionListener(this);
147 return jButtonCancel
;
151 This method initializes jComboBoxPackageType
153 @return javax.swing.JComboBox jComboBoxPackageType
156 private JComboBox
getJComboBoxPackageType() {
157 if (jComboBoxPackageType
== null) {
158 jComboBoxPackageType
= new JComboBox();
159 jComboBoxPackageType
.setBounds(new java
.awt
.Rectangle(160, 35, 320, 20));
161 return jComboBoxPackageType
;
165 This method initializes jComboBoxUsage
167 @return javax.swing.JComboBox jComboBoxUsage
170 private JComboBox
getJComboBoxUsage() {
171 if (jComboBoxUsage
== null) {
172 jComboBoxUsage
= new JComboBox();
173 jComboBoxUsage
.setBounds(new java
.awt
.Rectangle(160, 60, 320, 20));
175 return jComboBoxUsage
;
179 This method initializes jComboBoxFileList
181 @return javax.swing.JComboBox jComboBoxFileList
184 private JComboBox
getJComboBoxFileList() {
185 if (jComboBoxFileList
== null) {
186 jComboBoxFileList
= new JComboBox();
187 jComboBoxFileList
.setBounds(new java
.awt
.Rectangle(15, 110, 210, 20));
188 jComboBoxFileList
.addActionListener(this);
189 jComboBoxFileList
.addItemListener(this);
191 return jComboBoxFileList
;
195 This method initializes jButtonAdd
197 @return javax.swing.JButton jButtonAdd
200 private JButton
getJButtonAdd() {
201 if (jButtonAdd
== null) {
202 jButtonAdd
= new JButton();
203 jButtonAdd
.setBounds(new java
.awt
.Rectangle(230, 110, 80, 20));
204 jButtonAdd
.setText("Add");
205 jButtonAdd
.addActionListener(this);
211 This method initializes jButtonUpdate
213 @return javax.swing.JButton jButtonUpdate
216 private JButton
getJButtonUpdate() {
217 if (jButtonUpdate
== null) {
218 jButtonUpdate
= new JButton();
219 jButtonUpdate
.setBounds(new java
.awt
.Rectangle(315, 110, 80, 20));
220 jButtonUpdate
.setText("Update");
221 jButtonUpdate
.addActionListener(this);
223 return jButtonUpdate
;
227 This method initializes jButtonRemove
229 @return javax.swing.JButton jButtonRemove
232 private JButton
getJButtonRemove() {
233 if (jButtonRemove
== null) {
234 jButtonRemove
= new JButton();
235 jButtonRemove
.setBounds(new java
.awt
.Rectangle(400, 110, 80, 20));
236 jButtonRemove
.setText("Remove");
237 jButtonRemove
.addActionListener(this);
239 return jButtonRemove
;
243 This method initializes jTextFieldUpdatedDate
245 @return javax.swing.JTextField jTextFieldUpdatedDate
248 private JTextField
getJTextFieldUpdatedDate() {
249 if (jTextFieldUpdatedDate
== null) {
250 jTextFieldUpdatedDate
= new JTextField();
251 jTextFieldUpdatedDate
.setBounds(new java
.awt
.Rectangle(160, 85, 320, 20));
253 return jTextFieldUpdatedDate
;
257 This method initializes jCheckBoxArch
259 @return javax.swing.JCheckBox jCheckBoxArch
262 private JCheckBox
getJCheckBoxArch() {
263 if (jCheckBoxArch
== null) {
264 jCheckBoxArch
= new JCheckBox();
265 jCheckBoxArch
.setBounds(new java
.awt
.Rectangle(10, 135, 120, 20));
266 jCheckBoxArch
.setText("Specific Arch");
267 jCheckBoxArch
.addActionListener(this);
269 return jCheckBoxArch
;
273 This method initializes jComboBoxArch
275 @return javax.swing.JComboBox jComboBoxArch
278 private JComboBox
getJComboBoxArch() {
279 if (jComboBoxArch
== null) {
280 jComboBoxArch
= new JComboBox();
281 jComboBoxArch
.setBounds(new java
.awt
.Rectangle(140, 135, 340, 20));
282 jComboBoxArch
.setEnabled(false);
284 return jComboBoxArch
;
288 * This method initializes jComboBoxPackageName
290 * @return javax.swing.JComboBox
292 private JComboBox
getJComboBoxPackageName() {
293 if (jComboBoxPackageName
== null) {
294 jComboBoxPackageName
= new JComboBox();
295 jComboBoxPackageName
.setBounds(new java
.awt
.Rectangle(160,10,320,20));
297 return jComboBoxPackageName
;
300 public static void main(String
[] args
) {
305 This is the default constructor
308 public ModuleIncludes() {
311 this.setVisible(true);
315 This is the override edit constructor
317 @param inIncludes The input data of IncludesDocument.Includes
320 public ModuleIncludes(IncludesDocument
.Includes inIncludes
) {
323 this.setVisible(true);
327 This is the override edit constructor
329 @param inIncludes The input data of IncludesDocument.Includes
330 @param type The input data of node type
331 @param index The input data of node index
334 public ModuleIncludes(IncludesDocument
.Includes inIncludes
, int type
, int index
) {
336 this.setVisible(true);
340 This is the override edit constructor
342 @param inIncludes The input data of IncludesDocument.Includes
343 @param type The input data of node type
344 @param index The input data of node index
345 @param inOperation The input data of current operation type
348 public ModuleIncludes(IncludesDocument
.Includes inIncludes
, int type
, int index
, int inOperation
) {
350 init(inIncludes
, type
, index
, inOperation
);
351 this.operation
= inOperation
;
352 this.setVisible(true);
356 This method initializes this
361 private void init(IncludesDocument
.Includes inIncludes
) {
363 this.setIncludes(inIncludes
);
367 This method initializes this
368 Fill values to all fields if these values are not empty
370 @param inIncludes The input data of IncludesDocument.Includes
371 @param type The input data of node type
372 @param index The input data of node index
373 @param inOperation The input data of current operation type
376 private void init(IncludesDocument
.Includes inIncludes
, int type
, int index
, int inOperation
) {
378 this.location
= index
;
379 this.operation
= inOperation
;
381 if (operation
== 2) {
382 this.jCheckBoxArch
.setEnabled(false);
383 this.jComboBoxArch
.setEnabled(false);
385 if (type
== IDefaultMutableTreeNode
.INCLUDES_PACKAGENAME
) {
386 if (this.includes
.getPackageNameList().size() > 0) {
387 for (int indexI
= 0; indexI
< this.includes
.getPackageNameList().size(); indexI
++) {
388 if (this.includes
.getPackageNameArray(indexI
).getStringValue() != null) {
389 vPackageName
.addElement(this.includes
.getPackageNameArray(indexI
).getStringValue());
391 vPackageName
.addElement("");
393 if (this.includes
.getPackageNameArray(indexI
).getUsage() != null) {
394 vUsage
.addElement(this.includes
.getPackageNameArray(indexI
).getUsage().toString());
396 vUsage
.addElement("ALWAYS_CONSUMED");
398 if (this.includes
.getPackageNameArray(indexI
).getPackageType() != null) {
399 vPackageType
.addElement(this.includes
.getPackageNameArray(indexI
).getPackageType()
402 vPackageType
.addElement("SOURCE");
404 if (this.includes
.getPackageNameArray(indexI
).getUpdatedDate() != null) {
405 vUpdatedDate
.addElement(this.includes
.getPackageNameArray(indexI
).getUpdatedDate());
407 vUpdatedDate
.addElement("");
409 jComboBoxFileList
.addItem(this.includes
.getPackageNameArray(indexI
).getStringValue());
413 if (type
== IDefaultMutableTreeNode
.INCLUDES_ARCH_ITEM
) {
414 this.jCheckBoxArch
.setSelected(true);
415 this.jComboBoxArch
.setSelectedItem(this.includes
.getArchArray(index
).getArchType().toString());
416 for (int indexI
= 0; indexI
< this.includes
.getArchArray(index
).getPackageNameList().size(); indexI
++) {
417 if (this.includes
.getArchArray(index
).getPackageNameArray(indexI
).getStringValue() != null) {
418 vPackageName
.addElement(this.includes
.getArchArray(index
).getPackageNameArray(indexI
)
421 vPackageName
.addElement("");
423 if (this.includes
.getArchArray(index
).getPackageNameArray(indexI
).getUsage() != null) {
424 vUsage
.addElement(this.includes
.getArchArray(index
).getPackageNameArray(indexI
).getUsage()
427 vUsage
.addElement("");
429 if (this.includes
.getArchArray(index
).getPackageNameArray(indexI
).getPackageType() != null) {
430 vPackageType
.addElement(this.includes
.getArchArray(index
).getPackageNameArray(indexI
)
431 .getPackageType().toString());
433 vPackageType
.addElement("");
435 if (this.includes
.getArchArray(index
).getPackageNameArray(indexI
).getUpdatedDate() != null) {
436 vUpdatedDate
.addElement(this.includes
.getArchArray(index
).getPackageNameArray(indexI
)
439 vUpdatedDate
.addElement("");
441 jComboBoxFileList
.addItem(this.includes
.getArchArray(index
).getPackageNameArray(indexI
)
449 This method initializes this
452 private void init() {
453 this.setSize(500, 515);
454 this.setContentPane(getJContentPane());
455 this.setTitle("Includes");
457 this.setViewMode(false);
461 Disable all components when the mode is view
463 @param isView true - The view mode; false - The non-view mode
466 public void setViewMode(boolean isView
) {
467 this.jButtonOk
.setVisible(false);
468 this.jButtonCancel
.setVisible(false);
470 this.jComboBoxPackageType
.setEnabled(!isView
);
471 this.jComboBoxUsage
.setEnabled(!isView
);
472 this.jComboBoxPackageName
.setEnabled(!isView
);
473 this.jButtonAdd
.setEnabled(!isView
);
474 this.jButtonUpdate
.setEnabled(!isView
);
475 this.jButtonRemove
.setEnabled(!isView
);
476 this.jTextFieldUpdatedDate
.setEnabled(!isView
);
477 this.jCheckBoxArch
.setEnabled(!isView
);
478 this.jComboBoxArch
.setEnabled(!isView
);
480 this.jButtonCancel
.setEnabled(!isView
);
481 this.jButtonOk
.setEnabled(!isView
);
486 This method initializes jContentPane
488 @return javax.swing.JPanel jContentPane
491 private JPanel
getJContentPane() {
492 if (jContentPane
== null) {
493 jLabelUpdatedDate
= new JLabel();
494 jLabelUpdatedDate
.setBounds(new java
.awt
.Rectangle(15, 85, 140, 20));
495 jLabelUpdatedDate
.setText("Updated Date");
496 jLabelUsage
= new JLabel();
497 jLabelUsage
.setBounds(new java
.awt
.Rectangle(15, 60, 140, 20));
498 jLabelUsage
.setText("Usage");
499 jLabelPackageType
= new JLabel();
500 jLabelPackageType
.setBounds(new java
.awt
.Rectangle(15, 35, 140, 20));
501 jLabelPackageType
.setText("Package Type");
502 jLabelPackageName
= new JLabel();
503 jLabelPackageName
.setBounds(new java
.awt
.Rectangle(15, 10, 140, 20));
504 jLabelPackageName
.setText("Package Name");
505 jContentPane
= new JPanel();
506 jContentPane
.setLayout(null);
507 jContentPane
.add(getJButton(), null);
508 jContentPane
.add(getJButton1(), null);
509 jContentPane
.add(jLabelPackageName
, null);
510 jContentPane
.add(jLabelPackageType
, null);
511 jContentPane
.add(getJComboBoxPackageType(), null);
512 jContentPane
.add(jLabelUsage
, null);
513 jContentPane
.add(getJComboBoxUsage(), null);
515 jStarLabel1
= new StarLabel();
516 jStarLabel1
.setLocation(new java
.awt
.Point(0, 10));
518 jContentPane
.add(jStarLabel1
, null);
519 jContentPane
.add(getJComboBoxFileList(), null);
520 jContentPane
.add(getJButtonAdd(), null);
521 jContentPane
.add(getJButtonUpdate(), null);
522 jContentPane
.add(getJButtonRemove(), null);
523 jContentPane
.add(jLabelUpdatedDate
, null);
524 jContentPane
.add(getJTextFieldUpdatedDate(), null);
525 jContentPane
.add(getJCheckBoxArch(), null);
526 jContentPane
.add(getJComboBoxArch(), null);
527 jContentPane
.add(getJComboBoxPackageName(), null);
533 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
535 * Override actionPerformed to listen all actions
538 public void actionPerformed(ActionEvent arg0
) {
539 if (arg0
.getSource() == jButtonOk
) {
540 this.setEdited(true);
544 if (arg0
.getSource() == jButtonCancel
) {
547 if (arg0
.getSource() == jButtonAdd
) {
553 if (arg0
.getSource() == jButtonRemove
) {
556 if (arg0
.getSource() == jButtonUpdate
) {
564 //When and only when checked Arch box then can choose different arch types
566 if (arg0
.getSource() == jCheckBoxArch
) {
567 if (this.jCheckBoxArch
.isSelected()) {
568 this.jComboBoxArch
.setEnabled(true);
570 this.jComboBoxArch
.setEnabled(false);
576 This method initializes Usage type, Package type and Arch type
579 private void initFrame() {
580 ws
= new Workspace();
581 vecPackageName
= ws
.getAllPackageName();
582 for (int index
= 0; index
< vecPackageName
.size(); index
++) {
583 jComboBoxPackageName
.addItem(vecPackageName
.elementAt(index
));
586 jComboBoxUsage
.addItem("ALWAYS_CONSUMED");
587 jComboBoxUsage
.addItem("ALWAYS_PRODUCED");
588 jComboBoxUsage
.addItem("DEFAULT");
590 jComboBoxPackageType
.addItem("SOURCE");
591 jComboBoxPackageType
.addItem("BINARY");
592 jComboBoxPackageType
.addItem("MIXED");
594 jComboBoxArch
.addItem("ALL");
595 jComboBoxArch
.addItem("EBC");
596 jComboBoxArch
.addItem("ARM");
597 jComboBoxArch
.addItem("IA32");
598 jComboBoxArch
.addItem("X64");
599 jComboBoxArch
.addItem("IPF");
600 jComboBoxArch
.addItem("PPC");
604 Add current item to Vector
607 private void addToList() {
608 intSelectedItemId
= vPackageName
.size();
609 vPackageName
.addElement(this.jComboBoxPackageName
.getSelectedItem().toString());
610 vUsage
.addElement(this.jComboBoxUsage
.getSelectedItem().toString());
611 vPackageType
.addElement(this.jComboBoxPackageType
.getSelectedItem().toString());
612 vUpdatedDate
.addElement(this.jTextFieldUpdatedDate
.getText());
613 jComboBoxFileList
.addItem(this.jComboBoxPackageName
.getSelectedItem().toString());
614 jComboBoxFileList
.setSelectedItem(this.jComboBoxPackageName
.getSelectedItem().toString());
617 // Reset select item index
619 intSelectedItemId
= vPackageName
.size();
622 // Reload all fields of selected item
628 Remove item from Vector
631 private void removeFromList() {
632 int intTempIndex
= intSelectedItemId
;
633 if (vPackageName
.size() < 1) {
637 jComboBoxFileList
.removeItemAt(intSelectedItemId
);
639 vPackageName
.removeElementAt(intTempIndex
);
640 vUsage
.removeElementAt(intTempIndex
);
641 vPackageType
.removeElementAt(intTempIndex
);
642 vUpdatedDate
.removeElementAt(intTempIndex
);
645 // Reload all fields of selected item
651 Update current item of Vector
654 private void updateForList() {
656 // Backup selected item index
658 int intTempIndex
= intSelectedItemId
;
660 vPackageName
.setElementAt(this.jComboBoxPackageName
.getSelectedItem().toString(), intSelectedItemId
);
661 vUsage
.setElementAt(this.jComboBoxUsage
.getSelectedItem().toString(), intSelectedItemId
);
662 vPackageType
.setElementAt(this.jComboBoxPackageType
.getSelectedItem().toString(), intSelectedItemId
);
663 vUpdatedDate
.setElementAt(this.jTextFieldUpdatedDate
.getText(), intSelectedItemId
);
665 jComboBoxFileList
.removeAllItems();
666 for (int index
= 0; index
< vPackageName
.size(); index
++) {
667 jComboBoxFileList
.addItem(vPackageName
.elementAt(index
));
671 // Restore selected item index
673 intSelectedItemId
= intTempIndex
;
676 // Reset select item index
678 jComboBoxFileList
.setSelectedIndex(intSelectedItemId
);
681 // Reload all fields of selected item
687 Refresh all fields' values of selected item of Vector
690 private void reloadFromList() {
691 if (vPackageName
.size() > 0) {
693 // Get selected item index
695 intSelectedItemId
= jComboBoxFileList
.getSelectedIndex();
697 this.jComboBoxPackageName
.setSelectedItem(vPackageName
.elementAt(intSelectedItemId
).toString());
698 this.jComboBoxUsage
.setSelectedItem(vUsage
.elementAt(intSelectedItemId
).toString());
699 this.jComboBoxPackageType
.setSelectedItem(vPackageType
.elementAt(intSelectedItemId
).toString());
700 this.jTextFieldUpdatedDate
.setText(vUpdatedDate
.elementAt(intSelectedItemId
).toString());
702 this.jComboBoxPackageName
.setSelectedIndex(0);
703 this.jComboBoxUsage
.setSelectedIndex(0);
704 this.jComboBoxPackageType
.setSelectedIndex(0);
705 this.jTextFieldUpdatedDate
.setText("");
710 Get IncludesDocument.Includes
712 @return IncludesDocument.Includes
715 public IncludesDocument
.Includes
getIncludes() {
720 Set IncludesDocument.Includes
722 @param includes IncludesDocument.Includes
725 public void setIncludes(IncludesDocument
.Includes includes
) {
726 this.includes
= includes
;
730 * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
732 * Reflesh the frame when selected item changed
735 public void itemStateChanged(ItemEvent arg0
) {
736 if (arg0
.getStateChange() == ItemEvent
.SELECTED
) {
742 Data validation for all fields
744 @retval true - All datas are valid
745 @retval false - At least one data is invalid
748 public boolean check() {
749 if (this.jComboBoxFileList
.getItemCount() < 1) {
750 Log
.err("Must have one include at least!");
757 Data validation for all fields before add current item to Vector
759 @retval true - All datas are valid
760 @retval false - At least one data is invalid
763 public boolean checkAdd() {
765 // Check if all fields have correct data types
767 if (!isEmpty(this.jTextFieldUpdatedDate
.getText())
768 && !DataValidation
.isDateType(this.jTextFieldUpdatedDate
.getText())) {
769 Log
.err("Incorrect data type for Update Date");
777 Save all components of Includes
778 if exists includes, set the value directly
779 if not exists includes, new an instance first
784 if (this.includes
== null) {
785 includes
= IncludesDocument
.Includes
.Factory
.newInstance();
790 if (!this.jCheckBoxArch
.isSelected()) {
791 if (this.operation
== 2) { //Add new packageName
793 //First remove all existed packageName
795 if (includes
.getPackageNameList().size() > 0) {
796 for (int index
= includes
.getPackageNameList().size() - 1; index
>= 0; index
--) {
797 includes
.removePackageName(index
);
801 for (int index
= 0; index
< vPackageName
.size(); index
++) {
802 PackageNameDocument
.PackageName packageName
= PackageNameDocument
.PackageName
.Factory
.newInstance();
803 if (!isEmpty(vPackageName
.elementAt(index
).toString())) {
804 packageName
.setStringValue(vPackageName
.elementAt(index
).toString());
806 if (!isEmpty(vUsage
.elementAt(index
).toString())) {
807 packageName
.setUsage(PackageUsage
.Enum
.forString(vUsage
.elementAt(index
).toString()));
809 if (!isEmpty(vPackageType
.elementAt(index
).toString())) {
811 .setPackageType(PackageType
.Enum
.forString(vPackageType
.elementAt(index
).toString()));
813 if (!isEmpty(vUpdatedDate
.elementAt(index
).toString())) {
814 packageName
.setUpdatedDate(vUpdatedDate
.elementAt(index
).toString());
816 includes
.addNewPackageName();
817 includes
.setPackageNameArray(includes
.getPackageNameList().size() - 1, packageName
);
823 if (this.jCheckBoxArch
.isSelected()) {
824 IncludesDocument
.Includes
.Arch arch
= IncludesDocument
.Includes
.Arch
.Factory
.newInstance();
825 if (this.operation
== 2) {
827 //First remove all existed filename
829 for (int index
= includes
.getArchArray(location
).getPackageNameList().size() - 1; index
>= 0; index
--) {
830 includes
.getArchArray(location
).removePackageName(index
);
834 for (int index
= 0; index
< vPackageName
.size(); index
++) {
835 PackageNameDocument
.PackageName packageName
= PackageNameDocument
.PackageName
.Factory
.newInstance();
836 if (!isEmpty(vPackageName
.elementAt(index
).toString())) {
837 packageName
.setStringValue(vPackageName
.elementAt(index
).toString());
839 if (!isEmpty(vUsage
.elementAt(index
).toString())) {
840 packageName
.setUsage(PackageUsage
.Enum
.forString(vUsage
.elementAt(index
).toString()));
842 if (!isEmpty(vPackageType
.elementAt(index
).toString())) {
844 .setPackageType(PackageType
.Enum
.forString(vPackageType
.elementAt(index
).toString()));
846 if (!isEmpty(vUpdatedDate
.elementAt(index
).toString())) {
847 packageName
.setUpdatedDate(vUpdatedDate
.elementAt(index
).toString());
849 arch
.addNewPackageName();
850 arch
.setPackageNameArray(arch
.getPackageNameList().size() - 1, packageName
);
853 .setArchType(SupportedArchitectures
.Enum
.forString(this.jComboBoxArch
.getSelectedItem().toString()));
855 includes
.setArchArray(location
, arch
);
857 includes
.addNewArch();
858 includes
.setArchArray(includes
.getArchList().size() - 1, arch
);
861 } catch (Exception e
) {
862 Log
.err("Update Source Files", e
.getMessage());