+\r
+ public void itemStateChanged(ItemEvent arg0) {\r
+ if (arg0.getSource() == this.jCheckBoxIa32 || arg0.getSource() == this.jCheckBoxIpf\r
+ || arg0.getSource() == this.jCheckBoxX64 || arg0.getSource() == this.jCheckBoxEbc\r
+ || arg0.getSource() == this.jCheckBoxArm || arg0.getSource() == this.jCheckBoxPpc) {\r
+ if (!this.jCheckBoxIa32.isSelected() && !this.jCheckBoxX64.isSelected() && !this.jCheckBoxIpf.isSelected()\r
+ && !this.jCheckBoxEbc.isSelected() && !this.jCheckBoxPpc.isSelected()\r
+ && !this.jCheckBoxArm.isSelected()) {\r
+ Log\r
+ .wrn("At lease one Supportted Architecture should be selected! IA32 is selected as default value!");\r
+ this.jCheckBoxIa32.setSelected(true);\r
+ }\r
+ }\r
+\r
+ if (arg0.getSource() == this.jComboBoxModuleType) {\r
+ if (this.jComboBoxModuleType.getSelectedItem().equals("PEIM")\r
+ || this.jComboBoxModuleType.getSelectedItem().equals("DXE_DRIVER")) {\r
+ this.jCheckBoxPcd.setEnabled(true);\r
+ if (this.jCheckBoxPcd.isSelected()) {\r
+ this.jCheckBoxPcd.setSelected(false);\r
+ this.jCheckBoxPcd.setSelected(true);\r
+ }\r
+ } else {\r
+ this.jCheckBoxPcd.setEnabled(false);\r
+ this.jCheckBoxPcd.setSelected(false);\r
+ }\r
+ }\r
+\r
+ //\r
+ // Check Pcd is Driver\r
+ //\r
+ if (arg0.getSource() == this.jCheckBoxPcd) {\r
+ if (this.jCheckBoxPcd.isSelected()) {\r
+ if (this.jComboBoxModuleType.getSelectedItem().toString().equals("DXE_DRIVER")) {\r
+ this.jComboBoxPcdIsDriver.setText("DXE_PCD_DRIVER");\r
+ this.jComboBoxPcdIsDriver.setEnabled(true);\r
+ } else if (this.jComboBoxModuleType.getSelectedItem().toString().equals("PEIM")) {\r
+ this.jComboBoxPcdIsDriver.setText("PEI_PCD_DRIVER");\r
+ this.jComboBoxPcdIsDriver.setEnabled(true);\r
+ }\r
+ }\r
+\r
+ if ((this.ex == null) && this.jCheckBoxPcd.isSelected()) {\r
+ this.ex = ExternsDocument.Externs.Factory.newInstance();\r
+ this.ex.setPcdIsDriver(PcdDriverTypes.Enum.forString(this.jComboBoxPcdIsDriver.getText()));\r
+ this.msa.setExterns(this.ex);\r
+ } else if ((this.ex != null) && (this.ex.getPcdIsDriver() == null) && this.jCheckBoxPcd.isSelected()) {\r
+ this.ex.setPcdIsDriver(PcdDriverTypes.Enum.forString(this.jComboBoxPcdIsDriver.getText()));\r
+ this.msa.setExterns(this.ex);\r
+ } else if ((this.ex != null) && (this.ex.getPcdIsDriver() != null)) {\r
+ if (this.jCheckBoxPcd.isSelected()\r
+ && !this.jComboBoxPcdIsDriver.getText().toString().equals(this.ex.getPcdIsDriver().toString())) {\r
+ this.ex.setPcdIsDriver(PcdDriverTypes.Enum.forString(this.jComboBoxPcdIsDriver.getText()));\r
+ this.msa.setExterns(this.ex);\r
+ }\r
+ if (!this.jCheckBoxPcd.isSelected()) {\r
+ ExternsDocument.Externs newEx = ExternsDocument.Externs.Factory.newInstance();\r
+ if (this.ex.getExternList() != null) {\r
+ for (int index = 0; index < this.ex.getExternList().size(); index++) {\r
+ newEx.addNewExtern();\r
+ newEx.setExternArray(index, this.ex.getExternArray(index));\r
+ }\r
+ }\r
+ if (this.ex.getSpecificationList() != null) {\r
+ for (int index = 0; index < this.ex.getSpecificationList().size(); index++) {\r
+ newEx.addNewSpecification();\r
+ newEx.setSpecificationArray(index, this.ex.getSpecificationArray(index));\r
+ }\r
+ }\r
+ if (this.ex.getTianoR8FlashMapH()) {\r
+ newEx.setTianoR8FlashMapH(this.ex.getTianoR8FlashMapH());\r
+ }\r
+ this.ex = newEx;\r
+ this.msa.setExterns(this.ex);\r
+ }\r
+ }\r
+ this.save();\r
+ }\r
+ }\r