summaryrefslogtreecommitdiff
path: root/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module')
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesIdentification.java89
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesVector.java96
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsIdentification.java93
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsVector.java95
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsIdentification.java89
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsVector.java96
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsIdentification.java114
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsIdentification.java152
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsVector.java174
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsIdentification.java112
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesIdentification.java89
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesVector.java96
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsIdentification.java103
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassIdentification.java147
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassVector.java105
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/ModuleIdentification.java170
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesIdentification.java89
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedIdentification.java175
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedVector.java98
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdIdentification.java74
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisIdentification.java123
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsIdentification.java123
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesIdentification.java100
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesVector.java100
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesIdentification.java89
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesVector.java96
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesIdentification.java100
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBootModes.java472
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBuildOptions.java493
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDataHubs.java469
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java537
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java655
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleGuids.java465
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHiiPackages.java469
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHobs.java471
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleLibraryClassDefinitions.java485
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePCDs.java485
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePackageDependencies.java479
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePpis.java514
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleProtocols.java515
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java491
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSystemTables.java469
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleVariables.java472
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java1696
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BootModesDlg.java445
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BuildOptionsDlg.java495
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/DataHubsDlg.java452
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.java546
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java948
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java465
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HiiPackagesDlg.java461
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HobsDlg.java511
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/LibraryClassDefsDlg.java589
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PCDsDlg.java611
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PackageDepDlg.java441
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PpisDlg.java493
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ProtocolsDlg.java523
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java547
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SystemTablesDlg.java458
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java498
68 files changed, 0 insertions, 21883 deletions
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesIdentification.java
deleted file mode 100644
index 3a81248926..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesIdentification.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file
-
- The file is used to define Boot Modes Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.BootModes;
-
-import java.util.Vector;
-
-public class BootModesIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- public BootModesIdentification(String arg0, String arg1, String arg2, Vector<String> arg3, String arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.usage = (arg1 == null ? "" : arg1);
- this.featureFlag = (arg2 == null ? "" : arg2);
- this.supArchList = arg3;
- this.help = (arg4 == null ? "" : arg4);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(BootModesIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesVector.java
deleted file mode 100644
index 4c0840370f..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesVector.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/** @file
-
- The file is used to define Boot Modes Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.BootModes;
-
-import java.util.Vector;
-
-public class BootModesVector {
-
- private Vector<BootModesIdentification> vBootModes = new Vector<BootModesIdentification>();
-
- public int findBootModes(BootModesIdentification sfi) {
- for (int index = 0; index < vBootModes.size(); index++) {
- if (vBootModes.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findBootModes(String name) {
- for (int index = 0; index < vBootModes.size(); index++) {
- if (vBootModes.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public BootModesIdentification getBootModes(int index) {
- if (index > -1) {
- return vBootModes.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addBootModes(BootModesIdentification arg0) {
- vBootModes.addElement(arg0);
- }
-
- public void setBootModes(BootModesIdentification arg0, int arg1) {
- vBootModes.setElementAt(arg0, arg1);
- }
-
- public void removeBootModes(BootModesIdentification arg0) {
- int index = findBootModes(arg0);
- if (index > -1) {
- vBootModes.removeElementAt(index);
- }
- }
-
- public void removeBootModes(int index) {
- if (index > -1 && index < this.size()) {
- vBootModes.removeElementAt(index);
- }
- }
-
- public Vector<BootModesIdentification> getvBootModes() {
- return vBootModes;
- }
-
- public void setvBootModes(Vector<BootModesIdentification> BootModes) {
- vBootModes = BootModes;
- }
-
- public Vector<String> getBootModesName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vBootModes.size(); index++) {
- v.addElement(vBootModes.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vBootModes.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getBootModes(index).getName());
- v.addElement(getBootModes(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsIdentification.java
deleted file mode 100644
index 7074d3c7e0..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsIdentification.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/** @file
-
- The file is used to define Build Options Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.BuildOptions;
-
-import java.util.Vector;
-
-public class BuildOptionsIdentification {
-
- //
- // Define class members
- //
- private String option = null;
-
- private Vector<String> buildTargets = null;
-
- private String toolChainFamily = null;
-
- private String tagName = null;
-
- private String toolCode = null;
-
- private Vector<String> supArchList = null;
-
- public BuildOptionsIdentification(String arg0, Vector<String> arg1, String arg2, String arg3, String arg4, Vector<String> arg5) {
- this.option = (arg0 == null ? "" : arg0);
- this.buildTargets = arg1;
- this.toolChainFamily = (arg2 == null ? "" : arg2);
- this.tagName = (arg3 == null ? "" : arg3);
- this.toolCode = (arg4 == null ? "" : arg4);
- this.supArchList = arg5;
- }
-
- public String getOption() {
- return option;
- }
-
- public void setOption(String option) {
- this.option = option;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public String getTagName() {
- return tagName;
- }
-
- public void setTagName(String tagName) {
- this.tagName = tagName;
- }
-
- public String getToolChainFamily() {
- return toolChainFamily;
- }
-
- public void setToolChainFamily(String toolChainFamily) {
- this.toolChainFamily = toolChainFamily;
- }
-
- public String getToolCode() {
- return toolCode;
- }
-
- public void setToolCode(String toolCode) {
- this.toolCode = toolCode;
- }
-
- public Vector<String> getBuildTargets() {
- return buildTargets;
- }
-
- public void setBuildTargets(Vector<String> buildTargets) {
- this.buildTargets = buildTargets;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsVector.java
deleted file mode 100644
index dcd1bff392..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsVector.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/** @file
-
- The file is used to define Build Options Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.BuildOptions;
-
-import java.util.Vector;
-
-public class BuildOptionsVector {
-
- private Vector<BuildOptionsIdentification> vBuildOptions = new Vector<BuildOptionsIdentification>();
-
- public int findBuildOptions(BuildOptionsIdentification sfi) {
- for (int index = 0; index < vBuildOptions.size(); index++) {
- if (vBuildOptions.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findBuildOptions(String name) {
- for (int index = 0; index < vBuildOptions.size(); index++) {
- if (vBuildOptions.elementAt(index).getOption().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public BuildOptionsIdentification getBuildOptions(int index) {
- if (index > -1) {
- return vBuildOptions.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addBuildOptions(BuildOptionsIdentification arg0) {
- vBuildOptions.addElement(arg0);
- }
-
- public void setBuildOptions(BuildOptionsIdentification arg0, int arg1) {
- vBuildOptions.setElementAt(arg0, arg1);
- }
-
- public void removeBuildOptions(BuildOptionsIdentification arg0) {
- int index = findBuildOptions(arg0);
- if (index > -1) {
- vBuildOptions.removeElementAt(index);
- }
- }
-
- public void removeBuildOptions(int index) {
- if (index > -1 && index < this.size()) {
- vBuildOptions.removeElementAt(index);
- }
- }
-
- public Vector<BuildOptionsIdentification> getvBuildOptions() {
- return vBuildOptions;
- }
-
- public void setvBuildOptions(Vector<BuildOptionsIdentification> BuildOptions) {
- vBuildOptions = BuildOptions;
- }
-
- public Vector<String> getBuildOptionsName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vBuildOptions.size(); index++) {
- v.addElement(vBuildOptions.get(index).getOption());
- }
- return v;
- }
-
- public int size() {
- return this.vBuildOptions.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getBuildOptions(index).getOption());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsIdentification.java
deleted file mode 100644
index 2b5b362acb..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsIdentification.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.DataHubs;
-
-import java.util.Vector;
-
-public class DataHubsIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- public DataHubsIdentification(String arg0, String arg1, String arg2, Vector<String> arg3, String arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.usage = (arg1 == null ? "" : arg1);
- this.featureFlag = (arg2 == null ? "" : arg2);
- this.supArchList = arg3;
- this.help = (arg4 == null ? "" : arg4);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(DataHubsIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsVector.java
deleted file mode 100644
index 7405342c74..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsVector.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.DataHubs;
-
-import java.util.Vector;
-
-public class DataHubsVector {
-
- private Vector<DataHubsIdentification> vDataHubs = new Vector<DataHubsIdentification>();
-
- public int findDataHubs(DataHubsIdentification sfi) {
- for (int index = 0; index < vDataHubs.size(); index++) {
- if (vDataHubs.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findDataHubs(String name) {
- for (int index = 0; index < vDataHubs.size(); index++) {
- if (vDataHubs.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public DataHubsIdentification getDataHubs(int index) {
- if (index > -1) {
- return vDataHubs.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addDataHubs(DataHubsIdentification arg0) {
- vDataHubs.addElement(arg0);
- }
-
- public void setDataHubs(DataHubsIdentification arg0, int arg1) {
- vDataHubs.setElementAt(arg0, arg1);
- }
-
- public void removeDataHubs(DataHubsIdentification arg0) {
- int index = findDataHubs(arg0);
- if (index > -1) {
- vDataHubs.removeElementAt(index);
- }
- }
-
- public void removeDataHubs(int index) {
- if (index > -1 && index < this.size()) {
- vDataHubs.removeElementAt(index);
- }
- }
-
- public Vector<DataHubsIdentification> getvDataHubs() {
- return vDataHubs;
- }
-
- public void setvDataHubs(Vector<DataHubsIdentification> DataHubs) {
- vDataHubs = DataHubs;
- }
-
- public Vector<String> getDataHubsName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vDataHubs.size(); index++) {
- v.addElement(vDataHubs.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vDataHubs.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getDataHubs(index).getName());
- v.addElement(getDataHubs(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsIdentification.java
deleted file mode 100644
index bbb22e594a..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsIdentification.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.Events;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.common.DataType;
-
-public class EventsIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String type = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- private String group = null;
-
- public EventsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5, String arg6) {
- this.name = (arg0 == null ? "" : arg0);
- this.name = (this.name == DataType.EMPTY_SELECT_ITEM ? "" : this.name);
- this.type = (arg1 == null ? "" : arg1);
- this.usage = (arg2 == null ? "" : arg2);
- this.featureFlag = (arg3 == null ? "" : arg3);
- this.supArchList = arg4;
- this.help = (arg5 == null ? "" : arg5);
- this.group = (arg6 == null ? "" : arg6);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(EventsIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-
- public String getGroup() {
- return group;
- }
-
- public void setGroup(String group) {
- this.group = group;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsVector.java
deleted file mode 100644
index f64e184aa3..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.Events;
-
-import java.util.Vector;
-
-public class EventsVector {
-
- private Vector<EventsIdentification> vEvents = new Vector<EventsIdentification>();
-
- public int findEvents(EventsIdentification sfi) {
- for (int index = 0; index < vEvents.size(); index++) {
- if (vEvents.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findEvents(String name) {
- for (int index = 0; index < vEvents.size(); index++) {
- if (vEvents.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public EventsIdentification getEvents(int index) {
- if (index > -1) {
- return vEvents.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addEvents(EventsIdentification arg0) {
- vEvents.addElement(arg0);
- }
-
- public void setEvents(EventsIdentification arg0, int arg1) {
- vEvents.setElementAt(arg0, arg1);
- }
-
- public void removeEvents(EventsIdentification arg0) {
- int index = findEvents(arg0);
- if (index > -1) {
- vEvents.removeElementAt(index);
- }
- }
-
- public void removeEvents(int index) {
- if (index > -1 && index < this.size()) {
- vEvents.removeElementAt(index);
- }
- }
-
- public Vector<EventsIdentification> getvEvents() {
- return vEvents;
- }
-
- public void setvEvents(Vector<EventsIdentification> Events) {
- vEvents = Events;
- }
-
- public Vector<String> getEventsName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vEvents.size(); index++) {
- v.addElement(vEvents.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vEvents.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getEvents(index).getName());
- v.addElement(getEvents(index).getType());
- v.addElement(getEvents(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsIdentification.java
deleted file mode 100644
index 31979ceb88..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsIdentification.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.Externs;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.common.EnumerationData;
-
-public class ExternsIdentification {
-
- //
- // Define class members
- //
- private String name0 = null;
-
- private String name1 = null;
-
- private String name2 = null;
-
- private String name3 = null;
-
- private String type = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- public ExternsIdentification(String arg0, String arg1) {
- this.name0 = (arg0 == null ? "" : arg0);
- this.type = (arg1 == null ? "" : arg1);
- }
-
- public ExternsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4) {
- this.name0 = (arg0 == null ? "" : arg0);
- this.name1 = (arg1 == null ? "" : arg1);
- this.type = (arg2 == null ? "" : arg2);
- this.featureFlag = (arg3 == null ? "" : arg3);
- this.supArchList = arg4;
- }
-
- public ExternsIdentification(String arg0, String arg1, String arg2, String arg3, String arg4, String arg5,
- Vector<String> arg6) {
- this.name0 = (arg0 == null ? "" : arg0);
- this.name1 = (arg1 == null ? "" : arg1);
- this.name2 = (arg2 == null ? "" : arg2);
- this.name3 = (arg3 == null ? "" : arg3);
- this.type = (arg4 == null ? "" : arg4);
- this.featureFlag = (arg5 == null ? "" : arg5);
- this.supArchList = arg6;
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(ExternsIdentification pi) {
- if (this.type.equals(pi.type)) {
- if (this.type.equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- if (this.name0.equals(pi.name0)) {
- return true;
- }
- }
- if (this.type.equals(EnumerationData.EXTERNS_IMAGE)) {
- if (this.name0.equals(pi.name0) && this.name1.equals(pi.name1)) {
- return true;
- }
- }
- if (this.type.equals(EnumerationData.EXTERNS_LIBRARY)) {
- if (this.name0.equals(pi.name0) && this.name1.equals(pi.name1)) {
- return true;
- }
- }
- if (this.type.equals(EnumerationData.EXTERNS_CALL_BACK)) {
- if (this.name0.equals(pi.name0) && this.name1.equals(pi.name1)) {
- return true;
- }
- }
- if (this.type.equals(EnumerationData.EXTERNS_DRIVER)) {
- if (this.name0.equals(pi.name0) && this.name1.equals(pi.name1) && this.name2.equals(pi.name2) && this.name3.equals(pi.name3)) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getName0() {
- return name0;
- }
-
- public void setName0(String name0) {
- this.name0 = name0;
- }
-
- public String getName1() {
- return name1;
- }
-
- public void setName1(String name1) {
- this.name1 = name1;
- }
-
- public String getName2() {
- return name2;
- }
-
- public void setName2(String name2) {
- this.name2 = name2;
- }
-
- public String getName3() {
- return name3;
- }
-
- public void setName3(String name3) {
- this.name3 = name3;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsVector.java
deleted file mode 100644
index dbc2035fa9..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsVector.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.Externs;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-
-public class ExternsVector {
-
- private Vector<ExternsIdentification> vExterns = new Vector<ExternsIdentification>();
-
- public int findExterns(ExternsIdentification sfi) {
- for (int index = 0; index < vExterns.size(); index++) {
- if (vExterns.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public ExternsIdentification getExterns(int index) {
- if (index > -1) {
- return vExterns.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addExterns(ExternsIdentification arg0) {
- vExterns.addElement(arg0);
- }
-
- public void setExterns(ExternsIdentification arg0, int arg1) {
- vExterns.setElementAt(arg0, arg1);
- }
-
- public void removeExterns(ExternsIdentification arg0) {
- int index = findExterns(arg0);
- if (index > -1) {
- vExterns.removeElementAt(index);
- }
- }
-
- public void removeExterns(int index) {
- if (index > -1 && index < this.size()) {
- vExterns.removeElementAt(index);
- }
- }
-
- public Vector<ExternsIdentification> getvExterns() {
- return vExterns;
- }
-
- public void setvExterns(Vector<ExternsIdentification> Externs) {
- vExterns = Externs;
- }
-
- public int size() {
- return this.vExterns.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
-
- //
- // For Specification
- //
- if (this.getExterns(index).getType().equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- v.addElement(getExterns(index).getType());
- v.addElement(getExterns(index).getType() + " Name");
- v.addElement(getExterns(index).getName0());
- return v;
- }
-
- //
- // For Image
- //
- if (this.getExterns(index).getType().equals(EnumerationData.EXTERNS_IMAGE)) {
- v.addElement(getExterns(index).getType());
- String name = "";
- String value = "";
-
- name = EnumerationData.EXTERNS_MODULE_ENTRY_POINT;
- value = this.getExterns(index).getName0();
- name = name + DataType.HTML_LINE_SEPARATOR + EnumerationData.EXTERNS_MODULE_UNLOAD_IMAGE;
- value = value + DataType.HTML_LINE_SEPARATOR + this.getExterns(index).getName1()
- + DataType.HTML_LINE_SEPARATOR;
-
- v.addElement("<html>" + name + "<html>");
- v.addElement("<html>" + value + "<html>");
- return v;
- }
-
- //
- // For Library
- //
- if (this.getExterns(index).getType().equals(EnumerationData.EXTERNS_LIBRARY)) {
- v.addElement(getExterns(index).getType());
- String name = "";
- String value = "";
-
- name = EnumerationData.EXTERNS_CONSTRUCTOR;
- value = this.getExterns(index).getName0();
- name = name + DataType.HTML_LINE_SEPARATOR + EnumerationData.EXTERNS_DESTRUCTOR;
- value = value + DataType.HTML_LINE_SEPARATOR + this.getExterns(index).getName1()
- + DataType.HTML_LINE_SEPARATOR;
-
- v.addElement("<html>" + name + "<html>");
- v.addElement("<html>" + value + "<html>");
- return v;
- }
-
- //
- // For Driver
- //
- if (this.getExterns(index).getType().equals(EnumerationData.EXTERNS_DRIVER)) {
- v.addElement(getExterns(index).getType());
- String name = "";
- String value = "";
-
- name = EnumerationData.EXTERNS_DRIVER_BINDING;
- value = this.getExterns(index).getName0();
- name = name + DataType.HTML_LINE_SEPARATOR + EnumerationData.EXTERNS_COMPONENT_NAME;
- value = value + DataType.HTML_LINE_SEPARATOR + this.getExterns(index).getName1();
- name = name + DataType.HTML_LINE_SEPARATOR + EnumerationData.EXTERNS_DRIVER_CONFIG;
- value = value + DataType.HTML_LINE_SEPARATOR + this.getExterns(index).getName2();
- name = name + DataType.HTML_LINE_SEPARATOR + EnumerationData.EXTERNS_DRIVER_DIAG;
- value = value + DataType.HTML_LINE_SEPARATOR + this.getExterns(index).getName3()
- + DataType.HTML_LINE_SEPARATOR;
-
- v.addElement("<html>" + name + "<html>");
- v.addElement("<html>" + value + "<html>");
- return v;
- }
-
- //
- // For Call Back
- //
- if (this.getExterns(index).getType().equals(EnumerationData.EXTERNS_CALL_BACK)) {
- v.addElement(getExterns(index).getType());
- String name = "";
- String value = "";
-
- name = EnumerationData.EXTERNS_VIRTUAL_ADDRESS_MAP_CALL_BACK;
- value = this.getExterns(index).getName0();
- name = name + DataType.HTML_LINE_SEPARATOR + EnumerationData.EXTERNS_EXIT_BOOT_SERVICES_CALL_BACK;
- value = value + DataType.HTML_LINE_SEPARATOR + this.getExterns(index).getName1()
- + DataType.HTML_LINE_SEPARATOR;
-
- v.addElement("<html>" + name + "<html>");
- v.addElement("<html>" + value + "<html>");
- return v;
- }
-
- //
- // Return a empty v
- //
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsIdentification.java
deleted file mode 100644
index 4affae9797..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsIdentification.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.Guids;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class GuidsIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- private ModuleIdentification belongModule = null;
-
- private PackageIdentification declaredBy = null;
-
- public GuidsIdentification(String arg0, String arg1, String arg2, Vector<String> arg3, String arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.usage = (arg1 == null ? "" : arg1);
- this.featureFlag = (arg2 == null ? "" : arg2);
- this.supArchList = arg3;
- this.help = (arg4 == null ? "" : arg4);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(GuidsIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-
- public ModuleIdentification getBelongModule() {
- return belongModule;
- }
-
- public void setBelongModule(ModuleIdentification belongModule) {
- this.belongModule = belongModule;
- }
-
- public PackageIdentification getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(PackageIdentification declaredBy) {
- this.declaredBy = declaredBy;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsVector.java
deleted file mode 100644
index 6d415c3162..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.Guids;
-
-import java.util.Vector;
-
-public class GuidsVector {
-
- private Vector<GuidsIdentification> vGuids = new Vector<GuidsIdentification>();
-
- public int findGuids(GuidsIdentification sfi) {
- for (int index = 0; index < vGuids.size(); index++) {
- if (vGuids.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findGuids(String name) {
- for (int index = 0; index < vGuids.size(); index++) {
- if (vGuids.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public GuidsIdentification getGuids(int index) {
- if (index > -1) {
- return vGuids.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addGuids(GuidsIdentification arg0) {
- vGuids.addElement(arg0);
- }
-
- public void setGuids(GuidsIdentification arg0, int arg1) {
- vGuids.setElementAt(arg0, arg1);
- }
-
- public void removeGuids(GuidsIdentification arg0) {
- int index = findGuids(arg0);
- if (index > -1) {
- vGuids.removeElementAt(index);
- }
- }
-
- public void removeGuids(int index) {
- if (index > -1 && index < this.size()) {
- vGuids.removeElementAt(index);
- }
- }
-
- public Vector<GuidsIdentification> getvGuids() {
- return vGuids;
- }
-
- public void setvGuids(Vector<GuidsIdentification> Guids) {
- vGuids = Guids;
- }
-
- public Vector<String> getGuidsName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vGuids.size(); index++) {
- v.addElement(vGuids.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vGuids.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getGuids(index).getName());
- v.addElement(getGuids(index).getUsage());
- return v;
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesIdentification.java
deleted file mode 100644
index 4935d306b0..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesIdentification.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.HiiPackages;
-
-import java.util.Vector;
-
-public class HiiPackagesIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- public HiiPackagesIdentification(String arg0, String arg1, String arg2, Vector<String> arg3, String arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.usage = (arg1 == null ? "" : arg1);
- this.featureFlag = (arg2 == null ? "" : arg2);
- this.supArchList = arg3;
- this.help = (arg4 == null ? "" : arg4);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(HiiPackagesIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesVector.java
deleted file mode 100644
index f946c0c7e3..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesVector.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.HiiPackages;
-
-import java.util.Vector;
-
-public class HiiPackagesVector {
-
- private Vector<HiiPackagesIdentification> vHiiPackages = new Vector<HiiPackagesIdentification>();
-
- public int findHiiPackages(HiiPackagesIdentification sfi) {
- for (int index = 0; index < vHiiPackages.size(); index++) {
- if (vHiiPackages.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findHiiPackages(String name) {
- for (int index = 0; index < vHiiPackages.size(); index++) {
- if (vHiiPackages.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public HiiPackagesIdentification getHiiPackages(int index) {
- if (index > -1) {
- return vHiiPackages.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addHiiPackages(HiiPackagesIdentification arg0) {
- vHiiPackages.addElement(arg0);
- }
-
- public void setHiiPackages(HiiPackagesIdentification arg0, int arg1) {
- vHiiPackages.setElementAt(arg0, arg1);
- }
-
- public void removeHiiPackages(HiiPackagesIdentification arg0) {
- int index = findHiiPackages(arg0);
- if (index > -1) {
- vHiiPackages.removeElementAt(index);
- }
- }
-
- public void removeHiiPackages(int index) {
- if (index > -1 && index < this.size()) {
- vHiiPackages.removeElementAt(index);
- }
- }
-
- public Vector<HiiPackagesIdentification> getvHiiPackages() {
- return vHiiPackages;
- }
-
- public void setvHiiPackages(Vector<HiiPackagesIdentification> HiiPackages) {
- vHiiPackages = HiiPackages;
- }
-
- public Vector<String> getHiiPackagesName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vHiiPackages.size(); index++) {
- v.addElement(vHiiPackages.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vHiiPackages.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getHiiPackages(index).getName());
- v.addElement(getHiiPackages(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsIdentification.java
deleted file mode 100644
index 7b9dadd15e..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsIdentification.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.Hobs;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.common.DataType;
-
-public class HobsIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String type = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- public HobsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5) {
- this.name = (arg0 == null ? "" : arg0);
- this.name = (this.name == DataType.EMPTY_SELECT_ITEM ? "" : this.name);
- this.type = (arg1 == null ? "" : arg1);
- this.usage = (arg2 == null ? "" : arg2);
- this.featureFlag = (arg3 == null ? "" : arg3);
- this.supArchList = arg4;
- this.help = (arg5 == null ? "" : arg5);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(HobsIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsVector.java
deleted file mode 100644
index 550cb0aca1..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.Hobs;
-
-import java.util.Vector;
-
-public class HobsVector {
-
- private Vector<HobsIdentification> vHobs = new Vector<HobsIdentification>();
-
- public int findHobs(HobsIdentification sfi) {
- for (int index = 0; index < vHobs.size(); index++) {
- if (vHobs.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findHobs(String name) {
- for (int index = 0; index < vHobs.size(); index++) {
- if (vHobs.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public HobsIdentification getHobs(int index) {
- if (index > -1) {
- return vHobs.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addHobs(HobsIdentification arg0) {
- vHobs.addElement(arg0);
- }
-
- public void setHobs(HobsIdentification arg0, int arg1) {
- vHobs.setElementAt(arg0, arg1);
- }
-
- public void removeHobs(HobsIdentification arg0) {
- int index = findHobs(arg0);
- if (index > -1) {
- vHobs.removeElementAt(index);
- }
- }
-
- public void removeHobs(int index) {
- if (index > -1 && index < this.size()) {
- vHobs.removeElementAt(index);
- }
- }
-
- public Vector<HobsIdentification> getvHobs() {
- return vHobs;
- }
-
- public void setvHobs(Vector<HobsIdentification> Hobs) {
- vHobs = Hobs;
- }
-
- public Vector<String> getHobsName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vHobs.size(); index++) {
- v.addElement(vHobs.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vHobs.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getHobs(index).getName());
- v.addElement(getHobs(index).getType());
- v.addElement(getHobs(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassIdentification.java
deleted file mode 100644
index d47fa74208..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassIdentification.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/** @file
-
- The file is used to define Library Class Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.LibraryClass;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class LibraryClassIdentification {
- private String libraryClassName = null;
-
- private String usage = null;
-
- private String recommendedInstanceVersion = null;
-
- private String recommendedInstanceGuid = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private Vector<String> supModuleList = null;
-
- private String help = null;
-
- private ModuleIdentification belongModule = null;
-
- private PackageIdentification declaredBy = null;
-
- public LibraryClassIdentification() {
-
- }
-
- public LibraryClassIdentification(String strName, String strUsage, String strRecommendedInstanceVersion,
- String strRecommendedInstanceGuid, Vector<String> vSupArchList,
- String strFeatureFlag, Vector<String> vSupModuleList, String strHelp) {
- this.libraryClassName = (strName == null ? "" : strName);
- this.usage = (strUsage == null ? "" : strUsage);
- this.recommendedInstanceVersion = (strRecommendedInstanceVersion == null ? "" : strRecommendedInstanceVersion);
- this.recommendedInstanceGuid = (strRecommendedInstanceGuid == null ? "" : strRecommendedInstanceGuid);
- this.supArchList = vSupArchList;
- this.featureFlag = (strFeatureFlag == null ? "" : strFeatureFlag);
- this.supModuleList = vSupModuleList;
- this.help = (strHelp == null ? "" : strHelp);
- }
-
- public String getLibraryClassName() {
- return libraryClassName;
- }
-
- public void setLibraryClassName(String libraryClassName) {
- this.libraryClassName = libraryClassName;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getRecommendedInstanceGuid() {
- return recommendedInstanceGuid;
- }
-
- public void setRecommendedInstanceGuid(String recommendedInstanceGuid) {
- this.recommendedInstanceGuid = recommendedInstanceGuid;
- }
-
- public String getRecommendedInstanceVersion() {
- return recommendedInstanceVersion;
- }
-
- public void setRecommendedInstanceVersion(String recommendedInstanceVersion) {
- this.recommendedInstanceVersion = recommendedInstanceVersion;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(LibraryClassIdentification lib) {
- if (this.libraryClassName.equals(lib.libraryClassName) && this.usage.equals(lib.getUsage())) {
- return true;
- }
- return false;
- }
-
- public Vector<String> getSupModuleList() {
- return supModuleList;
- }
-
- public void setSupModuleList(Vector<String> supModuleList) {
- this.supModuleList = supModuleList;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-
- public ModuleIdentification getBelongModule() {
- return belongModule;
- }
-
- public void setBelongModule(ModuleIdentification belongModule) {
- this.belongModule = belongModule;
- }
-
- public PackageIdentification getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(PackageIdentification declaredBy) {
- this.declaredBy = declaredBy;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassVector.java
deleted file mode 100644
index 3155cf6329..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassVector.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/** @file
-
- The file is used to define Library Class Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.LibraryClass;
-
-import java.util.Vector;
-
-public class LibraryClassVector {
- private Vector<LibraryClassIdentification> vLibraryClass = new Vector<LibraryClassIdentification>();
-
- public int findLibraryClass(LibraryClassIdentification lib) {
- for (int index = 0; index < vLibraryClass.size(); index++) {
- if (vLibraryClass.elementAt(index).getLibraryClassName().equals(lib.getLibraryClassName())
- && vLibraryClass.elementAt(index).getUsage().equals(lib.getUsage())) {
- if (vLibraryClass.elementAt(index).getBelongModule() != null && lib.getBelongModule() != null) {
- if (vLibraryClass.elementAt(index).getBelongModule().equals(lib.getBelongModule())) {
- return index;
- }
- }
- if (vLibraryClass.elementAt(index).getBelongModule() == null && lib.getBelongModule() == null) {
- return index;
- }
- }
- }
- return -1;
- }
-
- public int findLibraryClass(String name) {
- for (int index = 0; index < vLibraryClass.size(); index++) {
- if (vLibraryClass.elementAt(index).getLibraryClassName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public LibraryClassIdentification getLibraryClass(int index) {
- if (index > -1) {
- return vLibraryClass.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addLibraryClass(LibraryClassIdentification lib) {
- if (findLibraryClass(lib) == -1) {
- vLibraryClass.addElement(lib);
- }
- }
-
- public void setLibraryClass(LibraryClassIdentification lib, int index) {
- vLibraryClass.setElementAt(lib, index);
- }
-
- public void removeLibraryClass(LibraryClassIdentification lib) {
- int index = findLibraryClass(lib);
- if (index > -1) {
- vLibraryClass.removeElementAt(index);
- }
- }
-
- public void removeLibraryClass(int index) {
- if (index > -1 && index < this.size()) {
- vLibraryClass.removeElementAt(index);
- }
- }
-
- public Vector<LibraryClassIdentification> getVLibraryClass() {
- return vLibraryClass;
- }
-
- public void setVLibraryClass(Vector<LibraryClassIdentification> libraryClass) {
- vLibraryClass = libraryClass;
- }
-
- public Vector<String> getLibraryClassName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vLibraryClass.size(); index++) {
- v.addElement(vLibraryClass.get(index).getLibraryClassName());
- }
- return v;
- }
-
- public int size() {
- return this.vLibraryClass.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getLibraryClass(index).getLibraryClassName());
- v.addElement(getLibraryClass(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/ModuleIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/ModuleIdentification.java
deleted file mode 100644
index 1302f665f7..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/ModuleIdentification.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/** @file
-
- The file is used to save basic information of module
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications;
-
-import java.io.IOException;
-
-import org.apache.xmlbeans.XmlException;
-import org.tianocore.LibraryUsage;
-import org.tianocore.LibraryClassDefinitionsDocument.LibraryClassDefinitions;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.OpenFile;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.Identification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class ModuleIdentification extends Identification {
-
- private PackageIdentification packageId;
-
- private String moduleType;
-
- private boolean isLibrary;
-
- public ModuleIdentification(String name, String guid, String version, String path) {
- super(name, guid, version, path);
- setModuleType();
- }
-
- public ModuleIdentification(String name, String guid, String version, String path, boolean library) {
- super(name, guid, version, path);
- this.isLibrary = library;
- }
-
- public ModuleIdentification(Identification id) {
- super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
- }
-
- public ModuleIdentification(Identification id, boolean library) {
- super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
- this.isLibrary = library;
- }
-
- public ModuleIdentification(String name, String guid, String version, String path, PackageIdentification packageId) {
- super(name, guid, version, path);
- this.packageId = packageId;
- setModuleType();
- }
-
- public ModuleIdentification(String name, String guid, String version, String path, PackageIdentification packageId,
- String type) {
- super(name, guid, version, path);
- this.packageId = packageId;
- this.moduleType = type;
- }
-
- public ModuleIdentification(Identification id, PackageIdentification packageId) {
- super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
- this.packageId = packageId;
- setModuleType();
- }
-
- public ModuleIdentification(Identification id, PackageIdentification packageId, boolean library) {
- super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
- this.packageId = packageId;
- this.isLibrary = library;
- }
-
- public ModuleIdentification(Identification id, PackageIdentification packageId, String type) {
- super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
- this.packageId = packageId;
- this.moduleType = type;
- }
-
- public String toString() {
- return "Module " + this.getName() + "[" + this.getGuid() + "] in package " + packageId;
- }
-
- public PackageIdentification getPackageId() {
- return packageId;
- }
-
- public void setPackageId(PackageIdentification packageId) {
- this.packageId = packageId;
- }
-
- public String getModuleType() {
- return moduleType;
- }
-
- public void setModuleType(String moduleType) {
- this.moduleType = moduleType;
- }
-
- private void setModuleType() {
- ModuleSurfaceArea msa = null;
- try {
- msa = OpenFile.openMsaFile(this.getPath());
- } catch (IOException e) {
- // TODO Auto-generated catch block
-
- } catch (XmlException e) {
- // TODO Auto-generated catch block
-
- } catch (Exception e) {
- // TODO Auto-generated catch block
-
- }
- setModuleType(DataType.MODULE_TYPE_MODULE);
- setLibrary(false);
- if (msa != null) {
- LibraryClassDefinitions lib = msa.getLibraryClassDefinitions();
- if (lib != null) {
- for (int index = 0; index < lib.getLibraryClassList().size(); index++) {
- if (lib.getLibraryClassList().get(index).getUsage().equals(LibraryUsage.ALWAYS_PRODUCED)) {
- setModuleType(DataType.MODULE_TYPE_LIBRARY);
- setLibrary(true);
- break;
- }
- }
- }
- }
- }
-
- public boolean equals(String moduleGuid, String moduleVersion, String packageGuid, String packageVersion) {
- boolean b = false;
- if (this.getGuid().equals(moduleGuid) && this.getPackageId().getGuid().equals(packageGuid)) {
- b = true;
- //
- // Check Version
- //
- if (moduleVersion != null) {
- if (!Tools.isEmpty(moduleVersion)) {
- if (!moduleVersion.equals(this.getVersion())) {
- b = false;
- }
- }
- }
- if (packageVersion != null) {
- if (!Tools.isEmpty(packageVersion)) {
- if (!packageVersion.equals(this.getPackageId().getVersion())) {
- b = false;
- }
- }
- }
- }
- return b;
- }
-
- public boolean isLibrary() {
- return isLibrary;
- }
-
- public void setLibrary(boolean isLibrary) {
- this.isLibrary = isLibrary;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesIdentification.java
deleted file mode 100644
index 170c417371..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesIdentification.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.PackageDependencies;
-
-import java.util.Vector;
-
-public class PackageDependenciesIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String version = null;
-
- private String guid = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- public PackageDependenciesIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.version = (arg1 == null ? "" : arg1);
- this.guid = (arg2 == null ? "" : arg2);
- this.featureFlag = (arg3 == null ? "" : arg3);
- this.supArchList = arg4;
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getGuid() {
- return guid;
- }
-
- public void setGuid(String guid) {
- this.guid = guid;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public boolean equals(PackageDependenciesIdentification pdi) {
- if (this.guid.equals(pdi.guid)) {
- return true;
- }
- return false;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesVector.java
deleted file mode 100644
index 7661453c4f..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.PackageDependencies;
-
-import java.util.Vector;
-
-public class PackageDependenciesVector {
-
- private Vector<PackageDependenciesIdentification> vPackageDependencies = new Vector<PackageDependenciesIdentification>();
-
- public int findPackageDependencies(PackageDependenciesIdentification sfi) {
- for (int index = 0; index < vPackageDependencies.size(); index++) {
- if (vPackageDependencies.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findPackageDependencies(String name) {
- for (int index = 0; index < vPackageDependencies.size(); index++) {
- if (vPackageDependencies.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public PackageDependenciesIdentification getPackageDependencies(int index) {
- if (index > -1) {
- return vPackageDependencies.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addPackageDependencies(PackageDependenciesIdentification arg0) {
- vPackageDependencies.addElement(arg0);
- }
-
- public void setPackageDependencies(PackageDependenciesIdentification arg0, int arg1) {
- vPackageDependencies.setElementAt(arg0, arg1);
- }
-
- public void removePackageDependencies(PackageDependenciesIdentification arg0) {
- int index = findPackageDependencies(arg0);
- if (index > -1) {
- vPackageDependencies.removeElementAt(index);
- }
- }
-
- public void removePackageDependencies(int index) {
- if (index > -1 && index < this.size()) {
- vPackageDependencies.removeElementAt(index);
- }
- }
-
- public Vector<PackageDependenciesIdentification> getvPackageDependencies() {
- return vPackageDependencies;
- }
-
- public void setvPackageDependencies(Vector<PackageDependenciesIdentification> PackageDependencies) {
- vPackageDependencies = PackageDependencies;
- }
-
- public Vector<String> getPackageDependenciesName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vPackageDependencies.size(); index++) {
- v.addElement(vPackageDependencies.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vPackageDependencies.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getPackageDependencies(index).getName());
- v.addElement(getPackageDependencies(index).getVersion());
- return v;
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedIdentification.java
deleted file mode 100644
index 13ed398fa3..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedIdentification.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.PcdCoded;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class PcdCodedIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String guid = null;
-
- private String featureFlag = null;
-
- private Vector<String> supArchList = null;
-
- private String value = null;
-
- private String help = null;
-
- private String type = null;
-
- private String usage = null;
-
- private String tokenSpaceGuidCName = null;
-
- private String token = null;
-
- private String datumType = null;
-
- private ModuleIdentification belongModule = null;
-
- private PackageIdentification declaredBy = null;
-
- public PcdCodedIdentification(String arg0, String arg1, String arg2, Vector<String> arg3, String arg4, String arg5, String arg6, String arg7) {
- this.name = (arg0 == null ? "" : arg0);
- this.guid = (arg1 == null ? "" : arg1);
- this.featureFlag = (arg2 == null ? "" : arg2);
- this.supArchList = arg3;
- this.value = (arg4 == null ? "" : arg4);
- this.help = (arg5 == null ? "" : arg5);
- this.type = (arg6 == null ? "" : arg6);
- this.usage = (arg7 == null ? "" : arg7);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(PcdCodedIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getGuid() {
- return guid;
- }
-
- public void setGuid(String guid) {
- this.guid = guid;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public ModuleIdentification getBelongModule() {
- return belongModule;
- }
-
- public void setBelongModule(ModuleIdentification belongModule) {
- this.belongModule = belongModule;
- }
-
- public PackageIdentification getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(PackageIdentification declaredBy) {
- this.declaredBy = declaredBy;
- }
-
- public String getToken() {
- return token;
- }
-
- public void setToken(String token) {
- this.token = token;
- }
-
- public String getTokenSpaceGuidCName() {
- return tokenSpaceGuidCName;
- }
-
- public void setTokenSpaceGuidCName(String tokenSpaceGuidCName) {
- this.tokenSpaceGuidCName = tokenSpaceGuidCName;
- }
-
- public String getDatumType() {
- return datumType;
- }
-
- public void setDatumType(String datumType) {
- this.datumType = datumType;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedVector.java
deleted file mode 100644
index 7b35f1a426..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedVector.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/** @file
-
- The file is used to define PcdCoded Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.PcdCoded;
-
-import java.util.Vector;
-
-public class PcdCodedVector {
-
- private Vector<PcdCodedIdentification> vPcdCoded = new Vector<PcdCodedIdentification>();
-
- public int findPcdCoded(PcdCodedIdentification sfi) {
- for (int index = 0; index < vPcdCoded.size(); index++) {
- if (vPcdCoded.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findPcdCoded(String name) {
- for (int index = 0; index < vPcdCoded.size(); index++) {
- if (vPcdCoded.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public PcdCodedIdentification getPcdCoded(int index) {
- if (index > -1) {
- return vPcdCoded.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addPcdCoded(PcdCodedIdentification arg0) {
- vPcdCoded.addElement(arg0);
- }
-
- public void setPcdCoded(PcdCodedIdentification arg0, int arg1) {
- vPcdCoded.setElementAt(arg0, arg1);
- }
-
- public void removePcdCoded(PcdCodedIdentification arg0) {
- int index = findPcdCoded(arg0);
- if (index > -1) {
- vPcdCoded.removeElementAt(index);
- }
- }
-
- public void removePcdCoded(int index) {
- if (index > -1 && index < this.size()) {
- vPcdCoded.removeElementAt(index);
- }
- }
-
- public Vector<PcdCodedIdentification> getvPcdCoded() {
- return vPcdCoded;
- }
-
- public void setvPcdCoded(Vector<PcdCodedIdentification> PcdCoded) {
- vPcdCoded = PcdCoded;
- }
-
- public Vector<String> getPcdCodedName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vPcdCoded.size(); index++) {
- v.addElement(vPcdCoded.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vPcdCoded.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getPcdCoded(index).getName());
- v.addElement(getPcdCoded(index).getType());
- v.addElement(getPcdCoded(index).getValue());
- v.addElement(getPcdCoded(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdIdentification.java
deleted file mode 100644
index 85a770662a..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdIdentification.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/** @file
-
- The file is used to define Pcd Item Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.PcdCoded;
-
-import java.util.Vector;
-
-public class PcdIdentification {
- //
- // Define class members
- //
- private String name = null;
-
- private String guidCName = null;
-
- private String help = null;
-
- private Vector<String> type = null;
-
- public PcdIdentification(String arg0, String arg1, String arg2, Vector<String> arg3) {
- this.name = (arg0 == null ? "" : arg0);
- this.guidCName = (arg1 == null ? "" : arg1);
- this.help = (arg2 == null ? "" : arg2);
- this.type = arg3;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-
- public String getGuidCName() {
- return guidCName;
- }
-
- public void setGuidCName(String guidCName) {
- this.guidCName = guidCName;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getType() {
- return type;
- }
-
- public void setType(Vector<String> type) {
- this.type = type;
- }
-
- public String toString() {
- return name;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdVector.java
deleted file mode 100644
index dd2832e778..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Pcd Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.PcdCoded;
-
-import java.util.Vector;
-
-public class PcdVector {
-
- private Vector<PcdIdentification> vPcd = new Vector<PcdIdentification>();
-
- public int findPcd(PcdIdentification sfi) {
- for (int index = 0; index < vPcd.size(); index++) {
- if (vPcd.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findPcd(String name) {
- for (int index = 0; index < vPcd.size(); index++) {
- if (vPcd.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public PcdIdentification getPcd(int index) {
- if (index > -1) {
- return vPcd.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addPcd(PcdIdentification arg0) {
- vPcd.addElement(arg0);
- }
-
- public void setPcd(PcdIdentification arg0, int arg1) {
- vPcd.setElementAt(arg0, arg1);
- }
-
- public void removePcd(PcdIdentification arg0) {
- int index = findPcd(arg0);
- if (index > -1) {
- vPcd.removeElementAt(index);
- }
- }
-
- public void removePcd(int index) {
- if (index > -1 && index < this.size()) {
- vPcd.removeElementAt(index);
- }
- }
-
- public Vector<PcdIdentification> getvPcd() {
- return vPcd;
- }
-
- public void setvPcd(Vector<PcdIdentification> Pcd) {
- vPcd = Pcd;
- }
-
- public Vector<String> getPcdName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vPcd.size(); index++) {
- v.addElement(vPcd.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vPcd.size();
- }
-
- public void addAll(PcdVector v) {
- if (v != null) {
- for (int index = 0; index < v.size(); index++) {
- vPcd.add(v.getPcd(index));
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisIdentification.java
deleted file mode 100644
index a871f628db..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisIdentification.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.Ppis;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class PpisIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String type = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- private ModuleIdentification belongModule = null;
-
- private PackageIdentification declaredBy = null;
-
- public PpisIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5) {
- this.name = (arg0 == null ? "" : arg0);
- this.type = (arg1 == null ? "" : arg1);
- this.usage = (arg2 == null ? "" : arg2);
- this.featureFlag = (arg3 == null ? "" : arg3);
- this.supArchList = arg4;
- this.help = (arg5 == null ? "" : arg5);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(PpisIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-
- public ModuleIdentification getBelongModule() {
- return belongModule;
- }
-
- public void setBelongModule(ModuleIdentification belongModule) {
- this.belongModule = belongModule;
- }
-
- public PackageIdentification getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(PackageIdentification declaredBy) {
- this.declaredBy = declaredBy;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisVector.java
deleted file mode 100644
index 9c6f343ee7..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.Ppis;
-
-import java.util.Vector;
-
-public class PpisVector {
-
- private Vector<PpisIdentification> vPpis = new Vector<PpisIdentification>();
-
- public int findPpis(PpisIdentification sfi) {
- for (int index = 0; index < vPpis.size(); index++) {
- if (vPpis.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findPpis(String name) {
- for (int index = 0; index < vPpis.size(); index++) {
- if (vPpis.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public PpisIdentification getPpis(int index) {
- if (index > -1) {
- return vPpis.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addPpis(PpisIdentification arg0) {
- vPpis.addElement(arg0);
- }
-
- public void setPpis(PpisIdentification arg0, int arg1) {
- vPpis.setElementAt(arg0, arg1);
- }
-
- public void removePpis(PpisIdentification arg0) {
- int index = findPpis(arg0);
- if (index > -1) {
- vPpis.removeElementAt(index);
- }
- }
-
- public void removePpis(int index) {
- if (index > -1 && index < this.size()) {
- vPpis.removeElementAt(index);
- }
- }
-
- public Vector<PpisIdentification> getvPpis() {
- return vPpis;
- }
-
- public void setvPpis(Vector<PpisIdentification> Ppis) {
- vPpis = Ppis;
- }
-
- public Vector<String> getPpisName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vPpis.size(); index++) {
- v.addElement(vPpis.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vPpis.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getPpis(index).getName());
- v.addElement(getPpis(index).getType());
- v.addElement(getPpis(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsIdentification.java
deleted file mode 100644
index 685c6d1b6e..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsIdentification.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.Protocols;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class ProtocolsIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String type = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- private ModuleIdentification belongModule = null;
-
- private PackageIdentification declaredBy = null;
-
- public ProtocolsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5) {
- this.name = (arg0 == null ? "" : arg0);
- this.type = (arg1 == null ? "" : arg1);
- this.usage = (arg2 == null ? "" : arg2);
- this.featureFlag = (arg3 == null ? "" : arg3);
- this.supArchList = arg4;
- this.help = (arg5 == null ? "" : arg5);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(ProtocolsIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-
- public ModuleIdentification getBelongModule() {
- return belongModule;
- }
-
- public void setBelongModule(ModuleIdentification belongModule) {
- this.belongModule = belongModule;
- }
-
- public PackageIdentification getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(PackageIdentification declaredBy) {
- this.declaredBy = declaredBy;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsVector.java
deleted file mode 100644
index 7f09670d5a..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.Protocols;
-
-import java.util.Vector;
-
-public class ProtocolsVector {
-
- private Vector<ProtocolsIdentification> vProtocols = new Vector<ProtocolsIdentification>();
-
- public int findProtocols(ProtocolsIdentification sfi) {
- for (int index = 0; index < vProtocols.size(); index++) {
- if (vProtocols.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findProtocols(String name) {
- for (int index = 0; index < vProtocols.size(); index++) {
- if (vProtocols.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public ProtocolsIdentification getProtocols(int index) {
- if (index > -1) {
- return vProtocols.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addProtocols(ProtocolsIdentification arg0) {
- vProtocols.addElement(arg0);
- }
-
- public void setProtocols(ProtocolsIdentification arg0, int arg1) {
- vProtocols.setElementAt(arg0, arg1);
- }
-
- public void removeProtocols(ProtocolsIdentification arg0) {
- int index = findProtocols(arg0);
- if (index > -1) {
- vProtocols.removeElementAt(index);
- }
- }
-
- public void removeProtocols(int index) {
- if (index > -1 && index < this.size()) {
- vProtocols.removeElementAt(index);
- }
- }
-
- public Vector<ProtocolsIdentification> getvProtocols() {
- return vProtocols;
- }
-
- public void setvProtocols(Vector<ProtocolsIdentification> Protocols) {
- vProtocols = Protocols;
- }
-
- public Vector<String> getProtocolsName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vProtocols.size(); index++) {
- v.addElement(vProtocols.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vProtocols.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getProtocols(index).getName());
- v.addElement(getProtocols(index).getType());
- v.addElement(getProtocols(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesIdentification.java
deleted file mode 100644
index 02a9d7faf4..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesIdentification.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/** @file
-
- The file is used to define Source Files Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.SourceFiles;
-
-import java.util.Vector;
-
-public class SourceFilesIdentification {
-
- private String filename = null;
-
- private String tagName = null;
-
- private String toolCode = null;
-
- private String toolChainFamily = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- public SourceFilesIdentification(String strFilename, String strTagName, String strToolCode,
- String strToolChainFamily, String strFeatureFlag, Vector<String> arch) {
- this.filename = (strFilename == null ? "" : strFilename);
- this.tagName = (strTagName == null ? "" : strTagName);
- this.toolCode = (strToolCode == null ? "" : strToolCode);
- this.toolChainFamily = (strToolChainFamily == null ? "" : strToolChainFamily);
- this.featureFlag = (strFeatureFlag == null ? "" : strFeatureFlag);
- this.supArchList = arch;
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getFilename() {
- return filename;
- }
-
- public void setFilename(String filename) {
- this.filename = filename;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public String getTagName() {
- return tagName;
- }
-
- public void setTagName(String tagName) {
- this.tagName = tagName;
- }
-
- public String getToolChainFamily() {
- return toolChainFamily;
- }
-
- public void setToolChainFamily(String toolChainFamily) {
- this.toolChainFamily = toolChainFamily;
- }
-
- public String getToolCode() {
- return toolCode;
- }
-
- public void setToolCode(String toolCode) {
- this.toolCode = toolCode;
- }
-
- public boolean equals(SourceFilesIdentification sfid) {
- if (this.filename.equals(sfid.filename) && this.tagName.equals(sfid.tagName)
- && this.toolCode.equals(sfid.toolCode) && this.toolChainFamily.equals(sfid.toolChainFamily)
- && this.featureFlag.equals(sfid.featureFlag)
- && this.supArchList.toString().equals(sfid.supArchList.toString())) {
- return true;
- }
- return false;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesVector.java
deleted file mode 100644
index 0e5cdc97a5..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesVector.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/** @file
-
- The file is used to define Source Files Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.SourceFiles;
-
-import java.util.Vector;
-
-public class SourceFilesVector {
- private Vector<SourceFilesIdentification> vSourceFiles = new Vector<SourceFilesIdentification>();
-
- public int findSourceFiles(SourceFilesIdentification sfi) {
- for (int index = 0; index < vSourceFiles.size(); index++) {
- if (vSourceFiles.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findSourceFiles(String name) {
- for (int index = 0; index < vSourceFiles.size(); index++) {
- if (vSourceFiles.elementAt(index).getFilename().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public SourceFilesIdentification getSourceFiles(int index) {
- if (index > -1) {
- return vSourceFiles.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addSourceFiles(SourceFilesIdentification sfi) {
- if (findSourceFiles(sfi) == -1) {
- vSourceFiles.addElement(sfi);
- }
- }
-
- public void setSourceFiles(SourceFilesIdentification sfi, int index) {
- vSourceFiles.setElementAt(sfi, index);
- }
-
- public void removeSourceFiles(SourceFilesIdentification sfi) {
- int index = findSourceFiles(sfi);
- if (index > -1) {
- vSourceFiles.removeElementAt(index);
- }
- }
-
- public void removeSourceFiles(int index) {
- if (index > -1 && index < this.size()) {
- vSourceFiles.removeElementAt(index);
- }
- }
-
- public Vector<SourceFilesIdentification> getvSourceFiles() {
- return vSourceFiles;
- }
-
- public void setvSourceFiles(Vector<SourceFilesIdentification> SourceFiles) {
- vSourceFiles = SourceFiles;
- }
-
- public Vector<String> getSourceFilesName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vSourceFiles.size(); index++) {
- v.addElement(vSourceFiles.get(index).getFilename());
- }
- return v;
- }
-
- public int size() {
- return this.vSourceFiles.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getSourceFiles(index).getFilename());
- v.addElement(getSourceFiles(index).getTagName());
- v.addElement(getSourceFiles(index).getToolCode());
- v.addElement(getSourceFiles(index).getToolChainFamily());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesIdentification.java
deleted file mode 100644
index d2952c0e7e..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesIdentification.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.SystemTables;
-
-import java.util.Vector;
-
-public class SystemTablesIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- public SystemTablesIdentification(String arg0, String arg1, String arg2, Vector<String> arg3, String arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.usage = (arg1 == null ? "" : arg1);
- this.featureFlag = (arg2 == null ? "" : arg2);
- this.supArchList = arg3;
- this.help = (arg4 == null ? "" : arg4);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(SystemTablesIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesVector.java
deleted file mode 100644
index fb875acfd5..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesVector.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.SystemTables;
-
-import java.util.Vector;
-
-public class SystemTablesVector {
-
- private Vector<SystemTablesIdentification> vSystemTables = new Vector<SystemTablesIdentification>();
-
- public int findSystemTables(SystemTablesIdentification sfi) {
- for (int index = 0; index < vSystemTables.size(); index++) {
- if (vSystemTables.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findSystemTables(String name) {
- for (int index = 0; index < vSystemTables.size(); index++) {
- if (vSystemTables.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public SystemTablesIdentification getSystemTables(int index) {
- if (index > -1) {
- return vSystemTables.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addSystemTables(SystemTablesIdentification arg0) {
- vSystemTables.addElement(arg0);
- }
-
- public void setSystemTables(SystemTablesIdentification arg0, int arg1) {
- vSystemTables.setElementAt(arg0, arg1);
- }
-
- public void removeSystemTables(SystemTablesIdentification arg0) {
- int index = findSystemTables(arg0);
- if (index > -1) {
- vSystemTables.removeElementAt(index);
- }
- }
-
- public void removeSystemTables(int index) {
- if (index > -1 && index < this.size()) {
- vSystemTables.removeElementAt(index);
- }
- }
-
- public Vector<SystemTablesIdentification> getvSystemTables() {
- return vSystemTables;
- }
-
- public void setvSystemTables(Vector<SystemTablesIdentification> SystemTables) {
- vSystemTables = SystemTables;
- }
-
- public Vector<String> getSystemTablesName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vSystemTables.size(); index++) {
- v.addElement(vSystemTables.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vSystemTables.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getSystemTables(index).getName());
- v.addElement(getSystemTables(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesIdentification.java
deleted file mode 100644
index 24d81860a4..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesIdentification.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.Variables;
-
-import java.util.Vector;
-
-public class VariablesIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String guid = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- public VariablesIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5) {
- this.name = (arg0 == null ? "" : arg0);
- this.guid = (arg1 == null ? "" : arg1);
- this.usage = (arg2 == null ? "" : arg2);
- this.featureFlag = (arg3 == null ? "" : arg3);
- this.supArchList = arg4;
- this.help = (arg5 == null ? "" : arg5);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(VariablesIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getGuid() {
- return guid;
- }
-
- public void setGuid(String guid) {
- this.guid = guid;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesVector.java
deleted file mode 100644
index 6949eff7c3..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.Variables;
-
-import java.util.Vector;
-
-public class VariablesVector {
-
- private Vector<VariablesIdentification> vVariables = new Vector<VariablesIdentification>();
-
- public int findVariables(VariablesIdentification sfi) {
- for (int index = 0; index < vVariables.size(); index++) {
- if (vVariables.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findVariables(String name) {
- for (int index = 0; index < vVariables.size(); index++) {
- if (vVariables.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public VariablesIdentification getVariables(int index) {
- if (index > -1) {
- return vVariables.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addVariables(VariablesIdentification arg0) {
- vVariables.addElement(arg0);
- }
-
- public void setVariables(VariablesIdentification arg0, int arg1) {
- vVariables.setElementAt(arg0, arg1);
- }
-
- public void removeVariables(VariablesIdentification arg0) {
- int index = findVariables(arg0);
- if (index > -1) {
- vVariables.removeElementAt(index);
- }
- }
-
- public void removeVariables(int index) {
- if (index > -1 && index < this.size()) {
- vVariables.removeElementAt(index);
- }
- }
-
- public Vector<VariablesIdentification> getvVariables() {
- return vVariables;
- }
-
- public void setvVariables(Vector<VariablesIdentification> Variables) {
- vVariables = Variables;
- }
-
- public Vector<String> getVariablesName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vVariables.size(); index++) {
- v.addElement(vVariables.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vVariables.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getVariables(index).getName());
- v.addElement(getVariables(index).getGuid());
- v.addElement(getVariables(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBootModes.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBootModes.java
deleted file mode 100644
index aee620db50..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBootModes.java
+++ /dev/null
@@ -1,472 +0,0 @@
-/** @file
-
- The file is used to create, update BootModes of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.BootModeNames;
-import org.tianocore.BootModeUsage;
-import org.tianocore.BootModesDocument;
-import org.tianocore.BootModesDocument.BootModes;
-import org.tianocore.BootModesDocument.BootModes.BootMode;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.BootModes.BootModesIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.BootModes.BootModesVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.BootModesDlg;
-
-/**
- The class is used to create, update BootModes of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModuleBootModes extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -3888558623432442561L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- private IFrame parentFrame = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private BootModesDocument.BootModes bootModes = null;
-
- private BootModesIdentification id = null;
-
- private BootModesVector vid = new BootModesVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(210, 195, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(390, 195, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Name");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Boot Modes");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inBootModes
-
- **/
- private void init(BootModes inBootModes) {
- init();
- this.bootModes = inBootModes;
-
- if (this.bootModes != null) {
- if (this.bootModes.getBootModeList().size() > 0) {
- for (int index = 0; index < this.bootModes.getBootModeList().size(); index++) {
- String arg0 = null;
- if (bootModes.getBootModeList().get(index).getBootModeName() != null) {
- arg0 = bootModes.getBootModeList().get(index).getBootModeName().toString();
- }
- String arg1 = null;
- if (bootModes.getBootModeList().get(index).getUsage() != null) {
- arg1 = bootModes.getBootModeList().get(index).getUsage().toString();
- }
-
- String arg2 = bootModes.getBootModeList().get(index).getFeatureFlag();
- Vector<String> arg3 = Tools.convertListToVector(bootModes.getBootModeList().get(index)
- .getSupArchList());
- String arg4 = bootModes.getBootModeList().get(index).getHelpText();
-
- id = new BootModesIdentification(arg0, arg1, arg2, arg3, arg4);
- vid.addBootModes(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleBootModes() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inBootModes The input BootModesDocument.BootModes
-
- **/
- public ModuleBootModes(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getBootModes());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- BootModesDlg dlg = new BootModesDlg(vid.getBootModes(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addBootModes(dlg.getId());
- } else {
- this.vid.setBootModes(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Boot Modes", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeBootModes(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Mbd Header
- if exists bootModes, set the value directly
- if not exists bootModes, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.bootModes = BootModes.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- BootMode p = BootMode.Factory.newInstance();
- if (!isEmpty(vid.getBootModes(index).getName())) {
- p.setBootModeName(BootModeNames.Enum.forString(vid.getBootModes(index).getName()));
- }
- if (!isEmpty(vid.getBootModes(index).getUsage())) {
- p.setUsage(BootModeUsage.Enum.forString(vid.getBootModes(index).getUsage()));
- }
- if (!isEmpty(vid.getBootModes(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getBootModes(index).getFeatureFlag());
- }
- if (vid.getBootModes(index).getSupArchList() != null
- && vid.getBootModes(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getBootModes(index).getSupArchList());
- }
- if (!isEmpty(vid.getBootModes(index).getHelp())) {
- p.setHelpText(vid.getBootModes(index).getHelp());
- }
- this.bootModes.addNewBootMode();
- this.bootModes.setBootModeArray(bootModes.getBootModeList().size() - 1, p);
- }
- }
-
- this.msa.setBootModes(bootModes);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Boot Modes", e.getMessage());
- Log.err("Update Boot Modes", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBuildOptions.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBuildOptions.java
deleted file mode 100644
index 993d1b9dcb..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBuildOptions.java
+++ /dev/null
@@ -1,493 +0,0 @@
-/** @file
-
- The file is used to create, update BuildOptions of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.List;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.ModuleBuildOptionsDocument;
-import org.tianocore.UserExtensionsDocument;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.OptionDocument.Option;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.BuildOptions.BuildOptionsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.BuildOptions.BuildOptionsVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.BuildOptionsDlg;
-
-/**
- The class is used to create, update BuildOptions of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModuleBuildOptions extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -3888558623432442561L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private ModuleBuildOptionsDocument.ModuleBuildOptions mbo = null;
-
- private List<UserExtensionsDocument.UserExtensions> ue = null;
-
- private BuildOptionsIdentification id = null;
-
- private BuildOptionsVector vid = new BuildOptionsVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(210, 195, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(390, 195, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Option String Value");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Boot Modes");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inBuildOptions
-
- **/
- private void init(ModuleBuildOptionsDocument.ModuleBuildOptions inModuleBuildOptions) {
- init();
- this.mbo = inModuleBuildOptions;
-
- if (this.mbo != null) {
- //
- // Save User Extensitions
- //
- if (this.mbo.getUserExtensionsList() != null) {
- this.ue = this.mbo.getUserExtensionsList();
- }
-
- if (this.mbo.getOptions() != null) {
- if (this.mbo.getOptions().getOptionList() != null) {
- for (int index = 0; index < this.mbo.getOptions().getOptionList().size(); index++) {
- Option o = this.mbo.getOptions().getOptionList().get(index);
- if (o != null) {
- String arg0 = o.getStringValue();
- Vector<String> arg1 = Tools.convertListToVector(o.getBuildTargets());
- String arg2 = o.getToolChainFamily();
- String arg3 = o.getTagName();
- String arg4 = o.getToolCode();
- Vector<String> arg5 = Tools.convertListToVector(o.getSupArchList());
-
- id = new BuildOptionsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- vid.addBuildOptions(id);
- }
- }
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleBuildOptions() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inBuildOptions The input BuildOptionsDocument.BuildOptions
-
- **/
- public ModuleBuildOptions(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getModuleBuildOptions());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- BuildOptionsDlg dlg = new BuildOptionsDlg(vid.getBuildOptions(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addBuildOptions(dlg.getId());
- } else {
- this.vid.setBuildOptions(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Boot Modes", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeBuildOptions(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Mbd Header
- if exists BuildOptions, set the value directly
- if not exists BuildOptions, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.mbo = ModuleBuildOptionsDocument.ModuleBuildOptions.Factory.newInstance();
- this.mbo.addNewOptions();
- //
- // Restore User Extensions Data
- //
- if (this.ue != null) {
- for (int index = 0; index < this.ue.size(); index++) {
- this.mbo.addNewUserExtensions();
- this.mbo.setUserExtensionsArray(index, ue.get(index));
- }
- }
-
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- Option o = Option.Factory.newInstance();
- if (!isEmpty(vid.getBuildOptions(index).getOption())) {
- o.setStringValue(vid.getBuildOptions(index).getOption());
- }
- if (vid.getBuildOptions(index).getBuildTargets() != null
- && vid.getBuildOptions(index).getBuildTargets().size() > 0) {
- o.setBuildTargets(vid.getBuildOptions(index).getBuildTargets());
- }
- if (!isEmpty(vid.getBuildOptions(index).getToolChainFamily())) {
- o.setToolChainFamily(vid.getBuildOptions(index).getToolChainFamily());
- }
- if (!isEmpty(vid.getBuildOptions(index).getTagName())) {
- o.setTagName(vid.getBuildOptions(index).getTagName());
- }
- if (!isEmpty(vid.getBuildOptions(index).getToolCode())) {
- o.setToolCode(vid.getBuildOptions(index).getToolCode());
- }
- if (vid.getBuildOptions(index).getSupArchList() != null
- && vid.getBuildOptions(index).getSupArchList().size() > 0) {
- o.setSupArchList(vid.getBuildOptions(index).getSupArchList());
- }
-
- this.mbo.getOptions().addNewOption();
- this.mbo.getOptions().setOptionArray(this.mbo.getOptions().getOptionList().size() - 1, o);
- }
- }
-
- this.msa.setModuleBuildOptions(this.mbo);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Module Build Options", e.getMessage());
- Log.err("Update Module Build Options", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDataHubs.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDataHubs.java
deleted file mode 100644
index b2217f15cd..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDataHubs.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/** @file
-
- The file is used to create, update DataHub of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.DataHubUsage;
-import org.tianocore.DataHubsDocument;
-import org.tianocore.DataHubsDocument.DataHubs;
-import org.tianocore.DataHubsDocument.DataHubs.DataHubRecord;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.DataHubs.DataHubsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.DataHubs.DataHubsVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.DataHubsDlg;
-
-/**
- The class is used to create, update DataHub of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModuleDataHubs extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -3667906991966638892L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private DataHubsDocument.DataHubs dataHubs = null;
-
- private DataHubsIdentification id = null;
-
- private DataHubsVector vid = new DataHubsVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 195, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 195, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Data Hub C_Name");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Data Hubs");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(DataHubs inDataHubs) {
- init();
- this.dataHubs = inDataHubs;
-
- if (this.dataHubs != null) {
- if (this.dataHubs.getDataHubRecordList().size() > 0) {
- for (int index = 0; index < this.dataHubs.getDataHubRecordList().size(); index++) {
- String arg0 = dataHubs.getDataHubRecordList().get(index).getDataHubCName();
- String arg1 = null;
- if (dataHubs.getDataHubRecordList().get(index).getUsage() != null) {
- arg1 = dataHubs.getDataHubRecordList().get(index).getUsage().toString();
- }
-
- String arg2 = dataHubs.getDataHubRecordList().get(index).getFeatureFlag();
- Vector<String> arg3 = Tools.convertListToVector(dataHubs.getDataHubRecordList().get(index)
- .getSupArchList());
- String arg4 = dataHubs.getDataHubRecordList().get(index).getHelpText();
-
- id = new DataHubsIdentification(arg0, arg1, arg2, arg3, arg4);
- vid.addDataHubs(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleDataHubs() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inDataHubs The input DataHubsDocument.DataHubs
-
- **/
- public ModuleDataHubs(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getDataHubs());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- DataHubsDlg dlg = new DataHubsDlg(vid.getDataHubs(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addDataHubs(dlg.getId());
- } else {
- this.vid.setDataHubs(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Data Hubs", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeDataHubs(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of DataHubs
- if exists dataHubs, set the value directly
- if not exists dataHubs, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.dataHubs = DataHubs.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- DataHubRecord p = DataHubRecord.Factory.newInstance();
- if (!isEmpty(vid.getDataHubs(index).getName())) {
- p.setDataHubCName(vid.getDataHubs(index).getName());
- }
- if (!isEmpty(vid.getDataHubs(index).getUsage())) {
- p.setUsage(DataHubUsage.Enum.forString(vid.getDataHubs(index).getUsage()));
- }
- if (!isEmpty(vid.getDataHubs(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getDataHubs(index).getFeatureFlag());
- }
- if (vid.getDataHubs(index).getSupArchList() != null
- && vid.getDataHubs(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getDataHubs(index).getSupArchList());
- }
- if (!isEmpty(vid.getDataHubs(index).getHelp())) {
- p.setHelpText(vid.getDataHubs(index).getHelp());
- }
- this.dataHubs.addNewDataHubRecord();
- this.dataHubs.setDataHubRecordArray(dataHubs.getDataHubRecordList().size() - 1, p);
- }
- }
-
- this.msa.setDataHubs(dataHubs);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Data Hubs", e.getMessage());
- Log.err("Update Data Hubs", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java
deleted file mode 100644
index 354be3ddae..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java
+++ /dev/null
@@ -1,537 +0,0 @@
-/** @file
-
- The file is used to create, update Event of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.EventTypes;
-import org.tianocore.EventsDocument;
-import org.tianocore.ProtocolNotifyUsage;
-import org.tianocore.ProtocolUsage;
-import org.tianocore.EventsDocument.Events;
-import org.tianocore.EventsDocument.Events.CreateEvents;
-import org.tianocore.EventsDocument.Events.SignalEvents;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.Events.EventsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Events.EventsVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.EventsDlg;
-
-/**
- The class is used to create, update Event of MSA/MBD file
- It extends IInternalFrame
-
- @since ModuleEditor 1.0
-
- **/
-public class ModuleEvents extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -4396143706422842331L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private EventsDocument.Events events = null;
-
- private EventsIdentification id = null;
-
- private EventsVector vid = new EventsVector();
-
- private EnumerationData ed = new EnumerationData();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 220, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 220, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 220, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Guid C_Name");
- model.addColumn("Type");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Events");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(Events inEvents) {
- init();
- this.events = inEvents;
-
- if (this.events != null) {
- if (this.events.getCreateEvents() != null) {
- if (this.events.getCreateEvents().getEventTypesList().size() > 0) {
- for (int index = 0; index < this.events.getCreateEvents().getEventTypesList().size(); index++) {
- String arg0 = events.getCreateEvents().getEventTypesList().get(index).getEventGuidCName();
- String arg1 = ed.getVEventType().get(0);
- String arg2 = null;
- if (events.getCreateEvents().getEventTypesList().get(index).getUsage() != null) {
- arg2 = events.getCreateEvents().getEventTypesList().get(index).getUsage().toString();
- }
-
- String arg3 = events.getCreateEvents().getEventTypesList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(events.getCreateEvents().getEventTypesList()
- .get(index).getSupArchList());
- String arg5 = events.getCreateEvents().getEventTypesList().get(index).getHelpText();
- String arg6 = events.getCreateEvents().getEventTypesList().get(index).getEventType().toString();
- id = new EventsIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
- vid.addEvents(id);
- }
- }
- }
- if (this.events.getSignalEvents() != null) {
- if (this.events.getSignalEvents().getEventTypesList().size() > 0) {
- for (int index = 0; index < this.events.getSignalEvents().getEventTypesList().size(); index++) {
- String arg0 = events.getSignalEvents().getEventTypesList().get(index).getEventGuidCName();
- String arg1 = ed.getVEventType().get(1);
- String arg2 = null;
- if (events.getSignalEvents().getEventTypesList().get(index).getUsage() != null) {
- arg2 = events.getSignalEvents().getEventTypesList().get(index).getUsage().toString();
- }
-
- String arg3 = events.getSignalEvents().getEventTypesList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(events.getSignalEvents().getEventTypesList()
- .get(index).getSupArchList());
- String arg5 = events.getSignalEvents().getEventTypesList().get(index).getHelpText();
- String arg6 = events.getSignalEvents().getEventTypesList().get(index).getEventType().toString();
- id = new EventsIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
- vid.addEvents(id);
- }
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleEvents() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inEvents The input EventsDocument.Events
-
- **/
- public ModuleEvents(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getEvents());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- EventsDlg dlg = new EventsDlg(vid.getEvents(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addEvents(dlg.getId());
- } else {
- this.vid.setEvents(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Events", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeEvents(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Events
- if exists events, set the value directly
- if not exists events, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.events = Events.Factory.newInstance();
- CreateEvents ce = CreateEvents.Factory.newInstance();
- SignalEvents se = SignalEvents.Factory.newInstance();
-
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- if (vid.getEvents(index).getType().equals(ed.getVEventType().get(0))) {
- CreateEvents.EventTypes e = CreateEvents.EventTypes.Factory.newInstance();
- if (!isEmpty(vid.getEvents(index).getName())) {
- e.setEventGuidCName(vid.getEvents(index).getName());
- }
- if (!isEmpty(vid.getEvents(index).getUsage())) {
- e.setUsage(ProtocolUsage.Enum.forString(vid.getEvents(index).getUsage()));
- }
- if (!isEmpty(vid.getEvents(index).getFeatureFlag())) {
- e.setFeatureFlag(vid.getEvents(index).getFeatureFlag());
- }
- if (vid.getEvents(index).getSupArchList() != null
- && vid.getEvents(index).getSupArchList().size() > 0) {
- e.setSupArchList(vid.getEvents(index).getSupArchList());
- }
- if (!isEmpty(vid.getEvents(index).getHelp())) {
- e.setHelpText(vid.getEvents(index).getHelp());
- }
- if (!isEmpty(vid.getEvents(index).getGroup())) {
- e.setEventType(EventTypes.Enum.forString(vid.getEvents(index).getGroup()));
- }
- ce.addNewEventTypes();
- ce.setEventTypesArray(ce.getEventTypesList().size() - 1, e);
- }
- if (vid.getEvents(index).getType().equals(ed.getVEventType().get(1))) {
- SignalEvents.EventTypes e = SignalEvents.EventTypes.Factory.newInstance();
- if (!isEmpty(vid.getEvents(index).getName())) {
- e.setEventGuidCName(vid.getEvents(index).getName());
- }
- if (!isEmpty(vid.getEvents(index).getUsage())) {
- e.setUsage(ProtocolNotifyUsage.Enum.forString(vid.getEvents(index).getUsage()));
- }
- if (!isEmpty(vid.getEvents(index).getFeatureFlag())) {
- e.setFeatureFlag(vid.getEvents(index).getFeatureFlag());
- }
- if (vid.getEvents(index).getSupArchList() != null
- && vid.getEvents(index).getSupArchList().size() > 0) {
- e.setSupArchList(vid.getEvents(index).getSupArchList());
- }
- if (!isEmpty(vid.getEvents(index).getHelp())) {
- e.setHelpText(vid.getEvents(index).getHelp());
- }
- if (!isEmpty(vid.getEvents(index).getGroup())) {
- e.setEventType(EventTypes.Enum.forString(vid.getEvents(index).getGroup()));
- }
- se.addNewEventTypes();
- se.setEventTypesArray(se.getEventTypesList().size() - 1, e);
- }
- }
- }
- if (ce.getEventTypesList().size() > 0) {
- events.addNewCreateEvents();
- events.setCreateEvents(ce);
- }
- if (se.getEventTypesList().size() > 0) {
- events.addNewSignalEvents();
- events.setSignalEvents(se);
- }
- this.msa.setEvents(events);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Events", e.getMessage());
- Log.err("Update Events", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java
deleted file mode 100644
index b1917dd033..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java
+++ /dev/null
@@ -1,655 +0,0 @@
-/** @file
-
- The file is used to create, update DataHub of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.ExternsDocument;
-import org.tianocore.ExternsDocument.Externs;
-import org.tianocore.ExternsDocument.Externs.Extern;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.Externs.ExternsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Externs.ExternsVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.ExternsDlg;
-
-/**
- The class is used to create, update DataHub of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModuleExterns extends IInternalFrame implements ItemListener {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -7382008402932047191L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private ExternsDocument.Externs externs = null;
-
- private ExternsIdentification id = null;
-
- private ExternsVector vid = new ExternsVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 195, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 195, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Type");
- model.addColumn("Name");
- model.addColumn("Value");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Externs");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(Externs inExterns) {
- init();
- this.externs = inExterns;
-
- if (this.externs != null) {
- //
- // Get specification
- //
- if (this.externs.getSpecificationList().size() > 0) {
- for (int index = 0; index < this.externs.getSpecificationList().size(); index++) {
- String arg0 = externs.getSpecificationList().get(index);
- String arg1 = EnumerationData.EXTERNS_SPECIFICATION;
-
- id = new ExternsIdentification(arg0, arg1);
- vid.addExterns(id);
- }
- }
-
- //
- // Get Externs list
- //
- if (this.externs.getExternList().size() > 0) {
- for (int index = 0; index < this.externs.getExternList().size(); index++) {
- //
- // Get common data
- //
- String featureFlag = externs.getExternList().get(index).getFeatureFlag();
- Vector<String> arch = Tools
- .convertListToVector(externs.getExternList().get(index).getSupArchList());
-
- //
- // Get Image data
- //
- if (this.externs.getExternList().get(index).getModuleEntryPoint() != null
- || this.externs.getExternList().get(index).getModuleUnloadImage() != null) {
- String moduleEntryPoint = this.externs.getExternList().get(index).getModuleEntryPoint();
- String moduleUnloadImage = this.externs.getExternList().get(index).getModuleUnloadImage();
- String type = EnumerationData.EXTERNS_IMAGE;
- id = new ExternsIdentification(moduleEntryPoint, moduleUnloadImage, type, featureFlag, arch);
- }
-
- //
- // Get Library Data
- //
- if (this.externs.getExternList().get(index).getConstructor() != null
- || this.externs.getExternList().get(index).getDestructor() != null) {
- String constructor = this.externs.getExternList().get(index).getConstructor();
- String destructor = this.externs.getExternList().get(index).getDestructor();
- String type = EnumerationData.EXTERNS_LIBRARY;
- id = new ExternsIdentification(constructor, destructor, type, featureFlag, arch);
- }
-
- //
- // Get Driver Data
- //
- if (this.externs.getExternList().get(index).getDriverBinding() != null) {
- String driverBinding = this.externs.getExternList().get(index).getDriverBinding();
- String componentName = this.externs.getExternList().get(index).getComponentName();
- String driverConfig = this.externs.getExternList().get(index).getDriverConfig();
- String driverDiag = this.externs.getExternList().get(index).getDriverDiag();
- String type = EnumerationData.EXTERNS_DRIVER;
- id = new ExternsIdentification(driverBinding, componentName, driverConfig, driverDiag, type,
- featureFlag, arch);
- }
-
- //
- // Get Call Back Data
- //
- if (this.externs.getExternList().get(index).getSetVirtualAddressMapCallBack() != null
- || this.externs.getExternList().get(index).getExitBootServicesCallBack() != null) {
- String virtualAddressMap = this.externs.getExternList().get(index)
- .getSetVirtualAddressMapCallBack();
- String exitBootServices = this.externs.getExternList().get(index).getExitBootServicesCallBack();
- String type = EnumerationData.EXTERNS_CALL_BACK;
- id = new ExternsIdentification(virtualAddressMap, exitBootServices, type, featureFlag, arch);
- }
-
- //
- // Add id to vector
- //
- vid.addExterns(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleExterns() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inExterns The input data of ExternsDocument.Externs
-
- **/
- public ModuleExterns(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getExterns());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- ExternsDlg dlg = new ExternsDlg(vid.getExterns(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addExterns(dlg.getId());
- } else {
- this.vid.setExterns(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- int line = 1;
-
- //
- // For Specification
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- line = 1;
- }
-
- //
- // For Image
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_IMAGE)) {
- line = 2;
- }
-
- //
- // For Library
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_LIBRARY)) {
- line = 2;
- }
-
- //
- // For Driver
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_DRIVER)) {
- line = 4;
- }
-
- //
- // For Call Back
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_CALL_BACK)) {
- line = 2;
- }
-
- model.addRow(vid.toStringVector(index));
- jTable.setRowHeight(index, line * 18);
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Externs", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeExterns(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Externs
- if exists externs, set the value directly
- if not exists externs, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- //
- // Save pcd and flash map information first
- //
- Externs ex = Externs.Factory.newInstance();
- if (this.externs != null) {
- if (this.externs.getPcdIsDriver() != null) {
- ex.setPcdIsDriver(this.externs.getPcdIsDriver());
- }
- if (this.externs.getTianoR8FlashMapH()) {
- ex.setTianoR8FlashMapH(this.externs.getTianoR8FlashMapH());
- }
- }
- this.externs = ex;
-
- //
- // Save externs
- //
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- //
- // Save specfication
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- if (!isEmpty(vid.getExterns(index).getName0())) {
- this.externs.addNewSpecification();
- this.externs.setSpecificationArray(externs.getSpecificationList().size() - 1,
- vid.getExterns(index).getName0());
- continue;
- }
- }
-
- Extern e = Extern.Factory.newInstance();
- //
- // Save image
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_IMAGE)) {
- if (!isEmpty(vid.getExterns(index).getName0()) || !isEmpty(vid.getExterns(index).getName1())) {
- e = Extern.Factory.newInstance();
- if (!isEmpty(vid.getExterns(index).getName0())) {
- e.setModuleEntryPoint(vid.getExterns(index).getName0());
- }
- if (!isEmpty(vid.getExterns(index).getName1())) {
- e.setModuleUnloadImage(vid.getExterns(index).getName1());
- }
- }
- }
-
- //
- // Save library
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_LIBRARY)) {
- if (!isEmpty(vid.getExterns(index).getName0()) || !isEmpty(vid.getExterns(index).getName1())) {
- e = Extern.Factory.newInstance();
- if (!isEmpty(vid.getExterns(index).getName0())) {
- e.setConstructor(vid.getExterns(index).getName0());
- }
- if (!isEmpty(vid.getExterns(index).getName1())) {
- e.setDestructor(vid.getExterns(index).getName1());
- }
- }
- }
-
- //
- // Save call back
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_CALL_BACK)) {
- if (!isEmpty(vid.getExterns(index).getName0()) || !isEmpty(vid.getExterns(index).getName1())) {
- e = Extern.Factory.newInstance();
- if (!isEmpty(vid.getExterns(index).getName0())) {
- e.setSetVirtualAddressMapCallBack(vid.getExterns(index).getName0());
- }
- if (!isEmpty(vid.getExterns(index).getName1())) {
- e.setExitBootServicesCallBack(vid.getExterns(index).getName1());
- }
- }
- }
-
- //
- // Save driver
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_DRIVER)) {
- if (!isEmpty(vid.getExterns(index).getName0()) || !isEmpty(vid.getExterns(index).getName1())
- || !isEmpty(vid.getExterns(index).getName2()) || !isEmpty(vid.getExterns(index).getName3())) {
- e = Extern.Factory.newInstance();
- if (!isEmpty(vid.getExterns(index).getName0())) {
- e.setDriverBinding(vid.getExterns(index).getName0());
- }
- if (!isEmpty(vid.getExterns(index).getName1())) {
- e.setComponentName(vid.getExterns(index).getName1());
- }
- if (!isEmpty(vid.getExterns(index).getName2())) {
- e.setDriverConfig(vid.getExterns(index).getName2());
- }
- if (!isEmpty(vid.getExterns(index).getName3())) {
- e.setDriverDiag(vid.getExterns(index).getName3());
- }
- }
- }
-
- //
- // Save common data
- //
- if (!isEmpty(vid.getExterns(index).getFeatureFlag())) {
- e.setFeatureFlag(vid.getExterns(index).getFeatureFlag());
- }
- if (vid.getExterns(index).getSupArchList() != null
- && vid.getExterns(index).getSupArchList().size() > 0) {
- e.setSupArchList(vid.getExterns(index).getSupArchList());
- }
-
- this.externs.addNewExtern();
- this.externs.setExternArray(this.externs.getExternList().size() - 1, e);
- }
- }
-
- this.msa.setExterns(externs);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Externs", e.getMessage());
- Log.err("Update Externs", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleGuids.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleGuids.java
deleted file mode 100644
index 5c9d329a55..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleGuids.java
+++ /dev/null
@@ -1,465 +0,0 @@
-/** @file
-
- The file is used to create, update Guids of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.GuidUsage;
-import org.tianocore.GuidsDocument;
-import org.tianocore.GuidsDocument.Guids;
-import org.tianocore.GuidsDocument.Guids.GuidCNames;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.GuidsDlg;
-
-/**
- The class is used to create, update Guids of MSA/MBD file
- It extends IInternalFrame
-
- **/
-public class ModuleGuids extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = 6710858997766979803L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private GuidsDocument.Guids guids = null;
-
- private GuidsIdentification id = null;
-
- private GuidsVector vid = new GuidsVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 195, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 195, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Guid C_Name");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Guids");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(Guids inGuids) {
- init();
- this.guids = inGuids;
-
- if (this.guids != null) {
- if (this.guids.getGuidCNamesList().size() > 0) {
- for (int index = 0; index < this.guids.getGuidCNamesList().size(); index++) {
- String arg0 = guids.getGuidCNamesList().get(index).getGuidCName();
- String arg1 = null;
- if (guids.getGuidCNamesList().get(index).getUsage() != null) {
- arg1 = guids.getGuidCNamesList().get(index).getUsage().toString();
- }
-
- String arg2 = guids.getGuidCNamesList().get(index).getFeatureFlag();
- Vector<String> arg3 = Tools.convertListToVector(guids.getGuidCNamesList().get(index)
- .getSupArchList());
- String arg4 = guids.getGuidCNamesList().get(index).getHelpText();
-
- id = new GuidsIdentification(arg0, arg1, arg2, arg3, arg4);
- vid.addGuids(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleGuids() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inGuids The input data of GuidsDocument.Guids
-
- **/
- public ModuleGuids(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getGuids());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- GuidsDlg dlg = new GuidsDlg(vid.getGuids(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addGuids(dlg.getId());
- } else {
- this.vid.setGuids(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Guids", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeGuids(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Guids
- if exists guids, set the value directly
- if not exists guids, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.guids = Guids.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- GuidCNames p = GuidCNames.Factory.newInstance();
- if (!isEmpty(vid.getGuids(index).getName())) {
- p.setGuidCName(vid.getGuids(index).getName());
- }
- if (!isEmpty(vid.getGuids(index).getUsage())) {
- p.setUsage(GuidUsage.Enum.forString(vid.getGuids(index).getUsage()));
- }
- if (!isEmpty(vid.getGuids(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getGuids(index).getFeatureFlag());
- }
- if (vid.getGuids(index).getSupArchList() != null && vid.getGuids(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getGuids(index).getSupArchList());
- }
- if (!isEmpty(vid.getGuids(index).getHelp())) {
- p.setHelpText(vid.getGuids(index).getHelp());
- }
- this.guids.addNewGuidCNames();
- this.guids.setGuidCNamesArray(guids.getGuidCNamesList().size() - 1, p);
- }
- }
-
- this.msa.setGuids(guids);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Guids", e.getMessage());
- Log.err("Update Guids", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHiiPackages.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHiiPackages.java
deleted file mode 100644
index 5914b6a69a..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHiiPackages.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/** @file
-
- The file is used to create, update Formset of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.HiiPackageUsage;
-import org.tianocore.HiiPackagesDocument;
-import org.tianocore.HiiPackagesDocument.HiiPackages;
-import org.tianocore.HiiPackagesDocument.HiiPackages.HiiPackage;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.HiiPackages.HiiPackagesIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.HiiPackages.HiiPackagesVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.HiiPackagesDlg;
-
-/**
- The class is used to create, update Formset of MSA/MBD file
- It extends IInternalFrame
-
- **/
-public class ModuleHiiPackages extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -6851574146786158116L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private HiiPackagesDocument.HiiPackages hiiPackages = null;
-
- private HiiPackagesIdentification id = null;
-
- private HiiPackagesVector vid = new HiiPackagesVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 195, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 195, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Hii Package C_Name");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Hii Packages");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(HiiPackages inHiiPackages) {
- init();
- this.hiiPackages = inHiiPackages;
-
- if (this.hiiPackages != null) {
- if (this.hiiPackages.getHiiPackageList().size() > 0) {
- for (int index = 0; index < this.hiiPackages.getHiiPackageList().size(); index++) {
- String arg0 = hiiPackages.getHiiPackageList().get(index).getHiiCName();
- String arg1 = null;
- if (hiiPackages.getHiiPackageList().get(index).getUsage() != null) {
- arg1 = hiiPackages.getHiiPackageList().get(index).getUsage().toString();
- }
-
- String arg2 = hiiPackages.getHiiPackageList().get(index).getFeatureFlag();
- Vector<String> arg3 = Tools.convertListToVector(hiiPackages.getHiiPackageList().get(index)
- .getSupArchList());
- String arg4 = hiiPackages.getHiiPackageList().get(index).getHelpText();
-
- id = new HiiPackagesIdentification(arg0, arg1, arg2, arg3, arg4);
- vid.addHiiPackages(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleHiiPackages() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- *
- */
- /**
- This is the override edit constructor
-
- @param inFormsets The input data of HiiPackagesDocument.HiiPackages
-
- **/
- public ModuleHiiPackages(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getHiiPackages());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- HiiPackagesDlg dlg = new HiiPackagesDlg(vid.getHiiPackages(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addHiiPackages(dlg.getId());
- } else {
- this.vid.setHiiPackages(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Hii Packages", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeHiiPackages(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of hiiPackages
- if exists formset, set the value directly
- if not exists formset, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.hiiPackages = HiiPackages.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- HiiPackage p = HiiPackage.Factory.newInstance();
- if (!isEmpty(vid.getHiiPackages(index).getName())) {
- p.setHiiCName(vid.getHiiPackages(index).getName());
- }
- if (!isEmpty(vid.getHiiPackages(index).getUsage())) {
- p.setUsage(HiiPackageUsage.Enum.forString(vid.getHiiPackages(index).getUsage()));
- }
- if (!isEmpty(vid.getHiiPackages(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getHiiPackages(index).getFeatureFlag());
- }
- if (vid.getHiiPackages(index).getSupArchList() != null
- && vid.getHiiPackages(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getHiiPackages(index).getSupArchList());
- }
- if (!isEmpty(vid.getHiiPackages(index).getHelp())) {
- p.setHelpText(vid.getHiiPackages(index).getHelp());
- }
- this.hiiPackages.addNewHiiPackage();
- this.hiiPackages.setHiiPackageArray(hiiPackages.getHiiPackageList().size() - 1, p);
- }
- }
-
- this.msa.setHiiPackages(hiiPackages);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update hiiPackages", e.getMessage());
- Log.err("Update hiiPackages", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHobs.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHobs.java
deleted file mode 100644
index 465ebee104..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHobs.java
+++ /dev/null
@@ -1,471 +0,0 @@
-/** @file
-
- The file is used to create, update Hob of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.HobTypes;
-import org.tianocore.HobUsage;
-import org.tianocore.HobsDocument;
-import org.tianocore.HobsDocument.Hobs;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.Hobs.HobsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Hobs.HobsVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.HobsDlg;
-
-/**
- The class is used to create, update Hob of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModuleHobs extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -553473437579358325L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private HobsDocument.Hobs hobs = null;
-
- private HobsIdentification id = null;
-
- private HobsVector vid = new HobsVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 220, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 220, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 220, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Guid C_Name");
- model.addColumn("Type");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Hobs");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(Hobs inHobs) {
- init();
- this.hobs = inHobs;
-
- if (this.hobs != null) {
- if (this.hobs.getHobTypesList().size() > 0) {
- for (int index = 0; index < this.hobs.getHobTypesList().size(); index++) {
- String arg0 = hobs.getHobTypesList().get(index).getHobGuidCName();
- String arg1 = null;
- if (hobs.getHobTypesList().get(index).getHobType() != null) {
- arg1 = hobs.getHobTypesList().get(index).getHobType().toString();
- }
- String arg2 = null;
- if (hobs.getHobTypesList().get(index).getUsage() != null) {
- arg2 = hobs.getHobTypesList().get(index).getUsage().toString();
- }
-
- String arg3 = hobs.getHobTypesList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(hobs.getHobTypesList().get(index).getSupArchList());
- String arg5 = hobs.getHobTypesList().get(index).getHelpText();
- id = new HobsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- vid.addHobs(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleHobs() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inHobs The input data of HobsDocument.Hobs
-
- **/
- public ModuleHobs(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getHobs());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- public JPanel getJContentPane() {
- if (jContentPane == null) {
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- HobsDlg dlg = new HobsDlg(vid.getHobs(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addHobs(dlg.getId());
- } else {
- this.vid.setHobs(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Hobs", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeHobs(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Hobs
- if exists hobs, set the value directly
- if not exists hobs, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.hobs = Hobs.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- HobsDocument.Hobs.HobTypes p = HobsDocument.Hobs.HobTypes.Factory.newInstance();
- if (!isEmpty(vid.getHobs(index).getName())) {
- p.setHobGuidCName(vid.getHobs(index).getName());
- }
- if (!isEmpty(vid.getHobs(index).getUsage())) {
- p.setUsage(HobUsage.Enum.forString(vid.getHobs(index).getUsage()));
- }
- if (!isEmpty(vid.getHobs(index).getType())) {
- p.setHobType(HobTypes.Enum.forString(vid.getHobs(index).getType()));
- }
- if (!isEmpty(vid.getHobs(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getHobs(index).getFeatureFlag());
- }
- if (vid.getHobs(index).getSupArchList() != null && vid.getHobs(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getHobs(index).getSupArchList());
- }
- this.hobs.addNewHobTypes();
- this.hobs.setHobTypesArray(hobs.getHobTypesList().size() - 1, p);
- }
- }
-
- this.msa.setHobs(hobs);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Hobs", e.getMessage());
- Log.err("Update Hobs", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleLibraryClassDefinitions.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleLibraryClassDefinitions.java
deleted file mode 100644
index 09685719fe..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleLibraryClassDefinitions.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/** @file
-
- The file is used to create, update Library Class Definition of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.LibraryClassDefinitionsDocument;
-import org.tianocore.LibraryUsage;
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.LibraryClassDefinitionsDocument.LibraryClassDefinitions;
-import org.tianocore.LibraryClassDocument.LibraryClass;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.LibraryClassDefsDlg;
-
-/**
- The class is used to create, update Library Class Definition of MSA/MBD file
- It extends IInternalFrame
-
- **/
-public class ModuleLibraryClassDefinitions extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -1743248695411382857L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not for UI
- //
- private ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = null;
-
- private LibraryClassDefinitions lcd = null;
-
- private LibraryClassVector vLibraryClass = new LibraryClassVector();
-
- private OpeningModuleType omt = null;
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 330, 90, 20));
- jButtonAdd.setPreferredSize(new Dimension(90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 330, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.setPreferredSize(new Dimension(90, 20));
- jButtonRemove.addActionListener(this);
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 330, 90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.setPreferredSize(new Dimension(90, 20));
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Library Class Name");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleLibraryClassDefinitions() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param
-
- **/
- public ModuleLibraryClassDefinitions(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getLibraryClassDefinitions());
- this.setVisible(true);
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inLibraryClassDefinitions The input data of LibraryClassDefinitionsDocument.LibraryClassDefinitions
-
- **/
- private void init(LibraryClassDefinitionsDocument.LibraryClassDefinitions inLibraryClassDefinitions) {
- init();
- this.lcd = inLibraryClassDefinitions;
- if (this.lcd != null) {
- if (this.lcd.getLibraryClassList().size() > 0) {
- for (int index = 0; index < this.lcd.getLibraryClassList().size(); index++) {
- String name = lcd.getLibraryClassList().get(index).getKeyword();
- String usage = null;
- if (lcd.getLibraryClassList().get(index).getUsage() != null) {
- usage = lcd.getLibraryClassList().get(index).getUsage().toString();
- }
- String version = lcd.getLibraryClassList().get(index).getRecommendedInstanceVersion();
- String guid = lcd.getLibraryClassList().get(index).getRecommendedInstanceGuid();
- String featureFlag = lcd.getLibraryClassList().get(index).getFeatureFlag();
- Vector<String> arch = Tools.convertListToVector(lcd.getLibraryClassList().get(index)
- .getSupArchList());
- Vector<String> module = Tools.convertListToVector(lcd.getLibraryClassList().get(index)
- .getSupModuleList());
- String help = lcd.getLibraryClassList().get(index).getHelpText();
- LibraryClassIdentification lcid = new LibraryClassIdentification(name, usage, version, guid, arch,
- featureFlag, module, help);
- vLibraryClass.addLibraryClass(lcid);
- }
- }
- }
- //
- // Update the list
- //
- showTable();
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setContentPane(getJScrollPane());
- this.setTitle("Library Class Definitions");
- this.setBounds(new java.awt.Rectangle(0, 0, 500, 515));
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- /**
- Save all components of Mbd Header
- if exists mbdHeader, set the value directly
- if not exists mbdHeader, new an instance first
-
- **/
- public void save() {
- try {
- int intLibraryCount = this.vLibraryClass.size();
-
- lcd = LibraryClassDefinitions.Factory.newInstance();
- if (intLibraryCount > 0) {
- for (int index = 0; index < intLibraryCount; index++) {
- LibraryClass mLibraryClass = LibraryClass.Factory.newInstance();
-
- mLibraryClass.setKeyword(vLibraryClass.getLibraryClass(index).getLibraryClassName());
- mLibraryClass
- .setUsage(LibraryUsage.Enum.forString(vLibraryClass.getLibraryClass(index).getUsage()));
- if (!isEmpty(vLibraryClass.getLibraryClass(index).getRecommendedInstanceVersion())) {
- mLibraryClass.setRecommendedInstanceVersion(vLibraryClass.getLibraryClass(index)
- .getRecommendedInstanceVersion());
- }
- if (!isEmpty(vLibraryClass.getLibraryClass(index).getRecommendedInstanceGuid())) {
- mLibraryClass.setRecommendedInstanceGuid(vLibraryClass.getLibraryClass(index)
- .getRecommendedInstanceGuid());
- }
- if (!isEmpty(vLibraryClass.getLibraryClass(index).getFeatureFlag())) {
- mLibraryClass.setFeatureFlag(vLibraryClass.getLibraryClass(index).getFeatureFlag());
- }
- if (vLibraryClass.getLibraryClass(index).getSupArchList() != null
- && vLibraryClass.getLibraryClass(index).getSupArchList().size() > 0) {
- mLibraryClass.setSupArchList(vLibraryClass.getLibraryClass(index).getSupArchList());
- }
- if (vLibraryClass.getLibraryClass(index).getSupModuleList() != null
- && vLibraryClass.getLibraryClass(index).getSupModuleList().size() > 0) {
- mLibraryClass.setSupModuleList(vLibraryClass.getLibraryClass(index).getSupModuleList());
- }
- if (!isEmpty(vLibraryClass.getLibraryClass(index).getHelp())) {
- mLibraryClass.setHelpText(vLibraryClass.getLibraryClass(index).getHelp());
- }
-
- this.lcd.addNewLibraryClass();
- this.lcd.setLibraryClassArray(index, mLibraryClass);
- }
- }
-
- if (msa.getLibraryClassDefinitions() == null) {
- this.msa.addNewLibraryClassDefinitions();
- }
- this.msa.setLibraryClassDefinitions(this.lcd);
-
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Library Class Definitions", e.getMessage());
- Log.err("Update Library Class Definitions", e.getMessage());
- }
- }
-
- private void showEdit(int index) {
- LibraryClassDefsDlg mcdd = new LibraryClassDefsDlg(vLibraryClass.getLibraryClass(index), this.parentFrame, omt.getId());
- int result = mcdd.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vLibraryClass.addLibraryClass(mcdd.getLcid());
- } else {
- this.vLibraryClass.setLibraryClass(mcdd.getLcid(), index);
- }
- this.showTable();
- this.save();
- mcdd.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- mcdd.dispose();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Library Class Definitions", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vLibraryClass.removeLibraryClass(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vLibraryClass.size() > 0) {
- for (int index = 0; index < vLibraryClass.size(); index++) {
- model.addRow(vLibraryClass.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- //this.jScrollPane.setViewportView(this.jTable);
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePCDs.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePCDs.java
deleted file mode 100644
index a50475527b..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePCDs.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/** @file
-
- The file is used to create, update PCD of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.PcdCodedDocument;
-import org.tianocore.PcdItemTypes;
-import org.tianocore.PcdUsage;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.PcdCodedDocument.PcdCoded;
-import org.tianocore.PcdCodedDocument.PcdCoded.PcdEntry;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.PCDsDlg;
-
-/**
- The class is used to create, update PCD of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModulePCDs extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = 2227717658188438696L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private PcdCodedDocument.PcdCoded pcds = null;
-
- private PcdCodedIdentification id = null;
-
- private PcdCodedVector vid = new PcdCodedVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 245, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 245, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 245, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Name");
- model.addColumn("Type");
- model.addColumn("Value");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Pcd Coded");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(PcdCoded inPcdCodeds) {
- init();
- this.pcds = inPcdCodeds;
-
- if (this.pcds != null) {
- if (this.pcds.getPcdEntryList().size() > 0) {
- for (int index = 0; index < this.pcds.getPcdEntryList().size(); index++) {
- String arg0 = pcds.getPcdEntryList().get(index).getCName();
- String arg1 = pcds.getPcdEntryList().get(index).getTokenSpaceGuidCName();
-
- String arg2 = pcds.getPcdEntryList().get(index).getFeatureFlag();
- Vector<String> arg3 = Tools.convertListToVector(pcds.getPcdEntryList().get(index).getSupArchList());
-
- String arg4 = pcds.getPcdEntryList().get(index).getDefaultValue();
- String arg5 = pcds.getPcdEntryList().get(index).getHelpText();
- String arg6 = null;
- if (pcds.getPcdEntryList().get(index).getPcdItemType() != null) {
- arg6 = pcds.getPcdEntryList().get(index).getPcdItemType().toString();
- }
- String arg7 = null;
- if (pcds.getPcdEntryList().get(index).getUsage() != null) {
- arg7 = pcds.getPcdEntryList().get(index).getUsage().toString();
- }
- id = new PcdCodedIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
- vid.addPcdCoded(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModulePCDs() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inPcds The input data of PCDsDocument.PCDs
-
- **/
- public ModulePCDs(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getPcdCoded());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- PCDsDlg dlg = new PCDsDlg(vid.getPcdCoded(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addPcdCoded(dlg.getId());
- } else {
- this.vid.setPcdCoded(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update PcdCoded", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removePcdCoded(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of PCDs
- if exists pcds, set the value directly
- if not exists pcds, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.pcds = PcdCoded.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- PcdEntry p = PcdEntry.Factory.newInstance();
- if (!isEmpty(vid.getPcdCoded(index).getName())) {
- p.setCName(vid.getPcdCoded(index).getName());
- }
- if (!isEmpty(vid.getPcdCoded(index).getGuid())) {
- p.setTokenSpaceGuidCName(vid.getPcdCoded(index).getGuid());
- }
- if (!isEmpty(vid.getPcdCoded(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getPcdCoded(index).getFeatureFlag());
- }
- if (vid.getPcdCoded(index).getSupArchList() != null
- && vid.getPcdCoded(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getPcdCoded(index).getSupArchList());
- }
- if (!isEmpty(vid.getPcdCoded(index).getValue())) {
- p.setDefaultValue(vid.getPcdCoded(index).getValue());
- }
- if (!isEmpty(vid.getPcdCoded(index).getHelp())) {
- p.setHelpText(vid.getPcdCoded(index).getHelp());
- }
- if (!isEmpty(vid.getPcdCoded(index).getType())) {
- p.setPcdItemType(PcdItemTypes.Enum.forString(vid.getPcdCoded(index).getType()));
- }
- if (!isEmpty(vid.getPcdCoded(index).getUsage())) {
- p.setUsage(PcdUsage.Enum.forString(vid.getPcdCoded(index).getUsage()));
- }
- this.pcds.addNewPcdEntry();
- this.pcds.setPcdEntryArray(pcds.getPcdEntryList().size() - 1, p);
- }
- }
-
- this.msa.setPcdCoded(pcds);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update PcdCoded", e.getMessage());
- Log.err("Update PcdCoded", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePackageDependencies.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePackageDependencies.java
deleted file mode 100644
index 3077f3d251..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePackageDependencies.java
+++ /dev/null
@@ -1,479 +0,0 @@
-/** @file
-
- The file is used to create, update Include of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.PackageDependenciesDocument.PackageDependencies;
-import org.tianocore.PackageDependenciesDocument.PackageDependencies.Package;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.PackageDependencies.PackageDependenciesIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.PackageDependencies.PackageDependenciesVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.PackageDepDlg;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- The class is used to create, update Include of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModulePackageDependencies extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = 3465193035145152131L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private PackageDependencies pd = null;
-
- private PackageDependenciesIdentification pdid = null;
-
- private PackageDependenciesVector vid = new PackageDependenciesVector();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private Vector<PackageIdentification> vPackage = wt.getAllPackages();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 445, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 445, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 445, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Package Name");
- model.addColumn("Package Version");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This is the default constructor
-
- **/
- public ModulePackageDependencies() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param
-
- **/
- public ModulePackageDependencies(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getPackageDependencies());
- this.setVisible(true);
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Package Dependencies");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(PackageDependencies inPackageDependencies) {
- init();
- this.pd = inPackageDependencies;
-
- if (this.pd != null) {
- if (this.pd.getPackageList().size() > 0) {
- for (int index = 0; index < this.pd.getPackageList().size(); index++) {
- String arg0 = "";
- String arg1 = pd.getPackageList().get(index).getPackageVersion();
- String arg2 = pd.getPackageList().get(index).getPackageGuid();
- //
- // If no guid, skip current item
- //
- if (arg2 == null) {
- continue;
- }
- for (int indexJ = 0; indexJ < this.vPackage.size(); indexJ++) {
- if (vPackage.get(indexJ).getGuid().equals(arg2)) {
- arg0 = vPackage.get(indexJ).getName();
- }
- }
- String arg3 = pd.getPackageList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(pd.getPackageList().get(index).getSupArchList());
- pdid = new PackageDependenciesIdentification(arg0, arg1, arg2, arg3, arg4);
- vid.addPackageDependencies(pdid);
- }
- }
- }
- showTable();
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- PackageDepDlg pdd = new PackageDepDlg(vid.getPackageDependencies(index), this.parentFrame, omt.getId());
- int result = pdd.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addPackageDependencies(pdd.getPdid());
- } else {
- this.vid.setPackageDependencies(pdd.getPdid(), index);
- }
- this.showTable();
- this.save();
- pdd.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- pdd.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- //this.jScrollPane.setViewportView(this.jTable);
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Package Dependencies", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removePackageDependencies(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Includes
- if exists includes, set the value directly
- if not exists includes, new an instance first
-
- **/
- public void save() {
- try {
- //
- //Save as file name
- //
- int count = this.vid.size();
-
- this.pd = PackageDependencies.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- Package p = Package.Factory.newInstance();
-
- if (!isEmpty(vid.getPackageDependencies(index).getVersion())) {
- p.setPackageVersion(vid.getPackageDependencies(index).getVersion());
- }
- if (!isEmpty(vid.getPackageDependencies(index).getGuid())) {
- p.setPackageGuid(vid.getPackageDependencies(index).getGuid());
- }
- if (!isEmpty(vid.getPackageDependencies(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getPackageDependencies(index).getFeatureFlag());
- }
- if (vid.getPackageDependencies(index).getSupArchList() != null
- && vid.getPackageDependencies(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getPackageDependencies(index).getSupArchList());
- }
-
- this.pd.addNewPackage();
- this.pd.setPackageArray(index, p);
- }
- }
- this.msa.setPackageDependencies(pd);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Package Dependencies", e.getMessage());
- Log.err("Update Package Dependencies", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePpis.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePpis.java
deleted file mode 100644
index c7a3e424e9..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePpis.java
+++ /dev/null
@@ -1,514 +0,0 @@
-/** @file
-
- The file is used to create, update Ppi of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.PPIsDocument;
-import org.tianocore.PpiNotifyUsage;
-import org.tianocore.PpiUsage;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.PPIsDocument.PPIs;
-import org.tianocore.PPIsDocument.PPIs.Ppi;
-import org.tianocore.PPIsDocument.PPIs.PpiNotify;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.PpisDlg;
-
-/**
- The class is used to create, update Ppi of MSA/MBD file
- It extends IInternalFrame
-
- **/
-public class ModulePpis extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -4284901202357037724L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
-
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private PPIsDocument.PPIs ppis = null;
-
- private PpisIdentification id = null;
-
- private PpisVector vid = new PpisVector();
-
- private EnumerationData ed = new EnumerationData();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 220, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 220, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 220, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Guid C_Name");
- model.addColumn("Type");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Ppis");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(PPIs inPpis) {
- init();
- this.ppis = inPpis;
-
- if (this.ppis != null) {
- if (this.ppis.getPpiList().size() > 0) {
- for (int index = 0; index < this.ppis.getPpiList().size(); index++) {
- String arg0 = ppis.getPpiList().get(index).getPpiCName();
- String arg1 = ed.getVPpiType().get(0);
- String arg2 = null;
- if (ppis.getPpiList().get(index).getUsage() != null) {
- arg2 = ppis.getPpiList().get(index).getUsage().toString();
- }
-
- String arg3 = ppis.getPpiList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(ppis.getPpiList().get(index).getSupArchList());
- String arg5 = ppis.getPpiList().get(index).getHelpText();
-
- id = new PpisIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- vid.addPpis(id);
- }
- }
- if (this.ppis.getPpiNotifyList().size() > 0) {
- for (int index = 0; index < this.ppis.getPpiNotifyList().size(); index++) {
- String arg0 = ppis.getPpiNotifyList().get(index).getPpiNotifyCName();
- String arg1 = ed.getVPpiType().get(1);
- String arg2 = null;
- if (ppis.getPpiNotifyList().get(index).getUsage() != null) {
- arg2 = ppis.getPpiNotifyList().get(index).getUsage().toString();
- }
-
- String arg3 = ppis.getPpiNotifyList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools
- .convertListToVector(ppis.getPpiNotifyList().get(index).getSupArchList());
- String arg5 = ppis.getPpiNotifyList().get(index).getHelpText();
-
- id = new PpisIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- vid.addPpis(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModulePpis() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inPpis The input data of PPIsDocument.PPIs
-
- **/
- public ModulePpis(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getPPIs());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- PpisDlg dlg = new PpisDlg(vid.getPpis(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addPpis(dlg.getId());
- } else {
- this.vid.setPpis(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Ppis", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removePpis(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of PPIs
- if exists ppis, set the value directly
- if not exists ppis, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.ppis = PPIs.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- if (vid.getPpis(index).getType().equals(ed.getVPpiType().get(0))) {
- Ppi p = Ppi.Factory.newInstance();
- if (!isEmpty(vid.getPpis(index).getName())) {
- p.setPpiCName(vid.getPpis(index).getName());
- }
- if (!isEmpty(vid.getPpis(index).getUsage())) {
- p.setUsage(PpiUsage.Enum.forString(vid.getPpis(index).getUsage()));
- }
- if (!isEmpty(vid.getPpis(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getPpis(index).getFeatureFlag());
- }
- if (vid.getPpis(index).getSupArchList() != null
- && vid.getPpis(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getPpis(index).getSupArchList());
- }
- if (!isEmpty(vid.getPpis(index).getHelp())) {
- p.setHelpText(vid.getPpis(index).getHelp());
- }
- this.ppis.addNewPpi();
- this.ppis.setPpiArray(ppis.getPpiList().size() - 1, p);
- }
- if (vid.getPpis(index).getType().equals(ed.getVPpiType().get(1))) {
- PpiNotify p = PpiNotify.Factory.newInstance();
- if (!isEmpty(vid.getPpis(index).getName())) {
- p.setPpiNotifyCName(vid.getPpis(index).getName());
- }
- if (!isEmpty(vid.getPpis(index).getUsage())) {
- p.setUsage(PpiNotifyUsage.Enum.forString(vid.getPpis(index).getUsage()));
- }
- if (!isEmpty(vid.getPpis(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getPpis(index).getFeatureFlag());
- }
- if (vid.getPpis(index).getSupArchList() != null
- && vid.getPpis(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getPpis(index).getSupArchList());
- }
- if (!isEmpty(vid.getPpis(index).getHelp())) {
- p.setHelpText(vid.getPpis(index).getHelp());
- }
- this.ppis.addNewPpiNotify();
- this.ppis.setPpiNotifyArray(ppis.getPpiNotifyList().size() - 1, p);
- }
- }
- }
-
- this.msa.setPPIs(ppis);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Ppis", e.getMessage());
- Log.err("Update Ppis", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleProtocols.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleProtocols.java
deleted file mode 100644
index 61c5dd80ae..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleProtocols.java
+++ /dev/null
@@ -1,515 +0,0 @@
-/** @file
-
- The file is used to create, update Protocol of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.ProtocolNotifyUsage;
-import org.tianocore.ProtocolUsage;
-import org.tianocore.ProtocolsDocument;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.ProtocolsDocument.Protocols;
-import org.tianocore.ProtocolsDocument.Protocols.Protocol;
-import org.tianocore.ProtocolsDocument.Protocols.ProtocolNotify;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.ProtocolsDlg;
-
-/**
- The class is used to create, update Protocol of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModuleProtocols extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -9084913640747858848L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private ProtocolsDocument.Protocols protocols = null;
-
- private ProtocolsIdentification id = null;
-
- private ProtocolsVector vid = new ProtocolsVector();
-
- private EnumerationData ed = new EnumerationData();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 220, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 220, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 220, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Guid C_Name");
- model.addColumn("Type");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Protocols");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(Protocols inProtocols) {
- init();
- this.protocols = inProtocols;
-
- if (this.protocols != null) {
- if (this.protocols.getProtocolList().size() > 0) {
- for (int index = 0; index < this.protocols.getProtocolList().size(); index++) {
- String arg0 = protocols.getProtocolList().get(index).getProtocolCName();
- String arg1 = ed.getVProtocolType().get(0);
- String arg2 = null;
- if (protocols.getProtocolList().get(index).getUsage() != null) {
- arg2 = protocols.getProtocolList().get(index).getUsage().toString();
- }
-
- String arg3 = protocols.getProtocolList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(protocols.getProtocolList().get(index)
- .getSupArchList());
- String arg5 = protocols.getProtocolList().get(index).getHelpText();
- id = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- vid.addProtocols(id);
- }
- }
- if (this.protocols.getProtocolNotifyList().size() > 0) {
- for (int index = 0; index < this.protocols.getProtocolNotifyList().size(); index++) {
- String arg0 = protocols.getProtocolNotifyList().get(index).getProtocolNotifyCName();
- String arg1 = ed.getVProtocolType().get(1);
- String arg2 = null;
- if (protocols.getProtocolNotifyList().get(index).getUsage() != null) {
- arg2 = protocols.getProtocolNotifyList().get(index).getUsage().toString();
- }
-
- String arg3 = protocols.getProtocolNotifyList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(protocols.getProtocolNotifyList().get(index)
- .getSupArchList());
- String arg5 = protocols.getProtocolNotifyList().get(index).getHelpText();
- id = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- vid.addProtocols(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleProtocols() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inProtocol The input data of ProtocolsDocument.Protocols
-
- **/
- public ModuleProtocols(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getProtocols());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- ProtocolsDlg dlg = new ProtocolsDlg(vid.getProtocols(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addProtocols(dlg.getId());
- } else {
- this.vid.setProtocols(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Protocols", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeProtocols(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Protocols
- if exists protocols, set the value directly
- if not exists protocols, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.protocols = Protocols.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- if (vid.getProtocols(index).getType().equals(ed.getVProtocolType().get(0))) {
- Protocol p = Protocol.Factory.newInstance();
- if (!isEmpty(vid.getProtocols(index).getName())) {
- p.setProtocolCName(vid.getProtocols(index).getName());
- }
- if (!isEmpty(vid.getProtocols(index).getUsage())) {
- p.setUsage(ProtocolUsage.Enum.forString(vid.getProtocols(index).getUsage()));
- }
- if (!isEmpty(vid.getProtocols(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getProtocols(index).getFeatureFlag());
- }
- if (vid.getProtocols(index).getSupArchList() != null
- && vid.getProtocols(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getProtocols(index).getSupArchList());
- }
- if (!isEmpty(vid.getProtocols(index).getHelp())) {
- p.setHelpText(vid.getProtocols(index).getHelp());
- }
- this.protocols.addNewProtocol();
- this.protocols.setProtocolArray(protocols.getProtocolList().size() - 1, p);
- }
- if (vid.getProtocols(index).getType().equals(ed.getVProtocolType().get(1))) {
- ProtocolNotify p = ProtocolNotify.Factory.newInstance();
- if (!isEmpty(vid.getProtocols(index).getName())) {
- p.setProtocolNotifyCName(vid.getProtocols(index).getName());
- }
- if (!isEmpty(vid.getProtocols(index).getUsage())) {
- p.setUsage(ProtocolNotifyUsage.Enum.forString(vid.getProtocols(index).getUsage()));
- }
- if (!isEmpty(vid.getProtocols(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getProtocols(index).getFeatureFlag());
- }
- if (vid.getProtocols(index).getSupArchList() != null
- && vid.getProtocols(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getProtocols(index).getSupArchList());
- }
- if (!isEmpty(vid.getProtocols(index).getHelp())) {
- p.setHelpText(vid.getProtocols(index).getHelp());
- }
- this.protocols.addNewProtocolNotify();
- this.protocols.setProtocolNotifyArray(protocols.getProtocolNotifyList().size() - 1, p);
- }
- }
- }
-
- this.msa.setProtocols(protocols);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Protocols", e.getMessage());
- Log.err("Update Protocols", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java
deleted file mode 100644
index 0d31e10525..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java
+++ /dev/null
@@ -1,491 +0,0 @@
-/** @file
-
- The file is used to create, update SourceFile of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.SourceFilesDocument;
-import org.tianocore.FilenameDocument.Filename;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.SourceFilesDocument.SourceFiles;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.SourceFiles.SourceFilesIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.SourceFiles.SourceFilesVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.SourceFilesDlg;
-
-/**
- The class is used to create, update SourceFile of MSA/MBD file
- It extends IInternalFrame
-
- **/
-public class ModuleSourceFiles extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -6765742852142775378L;
-
- //
- // Define class members
- //
- private SourceFilesDocument.SourceFiles sourceFiles = null;
-
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JCheckBox jCheckBoxArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private SourceFilesVector vSourceFiles = new SourceFilesVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 220, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 220, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 220, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jScrollPaneTable
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- * This method initializes jTable
- *
- * @return javax.swing.JTable
- */
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("File Name");
- model.addColumn("Tag Name");
- model.addColumn("Tool Code");
- model.addColumn("Tool Chain Family");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleSourceFiles() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param
-
- **/
- public ModuleSourceFiles(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getSourceFiles());
- this.setVisible(true);
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
-
- @param inSourceFiles The input data of SourceFilesDocument.SourceFiles
-
- **/
- private void init(SourceFilesDocument.SourceFiles inSourceFiles) {
- init();
- this.sourceFiles = inSourceFiles;
-
- if (this.sourceFiles != null) {
- if (this.sourceFiles.getFilenameList().size() > 0) {
- for (int index = 0; index < this.sourceFiles.getFilenameList().size(); index++) {
- String name = sourceFiles.getFilenameList().get(index).getStringValue();
- String tagName = sourceFiles.getFilenameList().get(index).getTagName();
- String toolCode = sourceFiles.getFilenameList().get(index).getToolCode();
- String tcf = sourceFiles.getFilenameList().get(index).getToolChainFamily();
- String featureFlag = sourceFiles.getFilenameList().get(index).getFeatureFlag();
- Vector<String> arch = Tools.convertListToVector(sourceFiles.getFilenameList().get(index)
- .getSupArchList());
- SourceFilesIdentification sfid = new SourceFilesIdentification(name, tagName, toolCode, tcf,
- featureFlag, arch);
- vSourceFiles.addSourceFiles(sfid);
- }
- }
- }
- showTable();
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Source Files");
- this.setViewMode(false);
- }
-
- /**
- Disable all components when the mode is view
-
- @param isView true - The view mode; false - The non-view mode
-
- **/
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jButtonAdd.setEnabled(!isView);
- this.jButtonRemove.setEnabled(!isView);
- this.jButtonUpdate.setEnabled(!isView);
- this.jCheckBoxArch.setEnabled(!isView);
- }
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- /**
- Save all components of SourceFiles
- if exists sourceFiles, set the value directly
- if not exists sourceFiles, new an instance first
-
- **/
- public void save() {
- try {
- //
- //Save as file name
- //
- int count = this.vSourceFiles.size();
-
- this.sourceFiles = SourceFiles.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- Filename mFilename = Filename.Factory.newInstance();
- if (!isEmpty(vSourceFiles.getSourceFiles(index).getFilename())) {
- mFilename.setStringValue(vSourceFiles.getSourceFiles(index).getFilename());
- }
- if (!isEmpty(vSourceFiles.getSourceFiles(index).getTagName())) {
- mFilename.setTagName(vSourceFiles.getSourceFiles(index).getTagName());
- }
- if (!isEmpty(vSourceFiles.getSourceFiles(index).getToolCode())) {
- mFilename.setToolCode(vSourceFiles.getSourceFiles(index).getToolCode());
- }
- if (!isEmpty(vSourceFiles.getSourceFiles(index).getToolChainFamily())) {
- mFilename.setToolChainFamily(vSourceFiles.getSourceFiles(index).getToolChainFamily());
- }
- if (!isEmpty(vSourceFiles.getSourceFiles(index).getFeatureFlag())) {
- mFilename.setFeatureFlag(vSourceFiles.getSourceFiles(index).getFeatureFlag());
- }
- if (vSourceFiles.getSourceFiles(index).getSupArchList() != null
- && vSourceFiles.getSourceFiles(index).getSupArchList().size() > 0) {
- mFilename.setSupArchList(vSourceFiles.getSourceFiles(index).getSupArchList());
- }
-
- this.sourceFiles.addNewFilename();
- this.sourceFiles.setFilenameArray(index, mFilename);
- }
- }
- this.msa.setSourceFiles(sourceFiles);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Source Files", e.getMessage());
- Log.err("Update Source Files", e.getMessage());
- }
- }
-
- private void showEdit(int index) {
- SourceFilesDlg sfd = new SourceFilesDlg(this.vSourceFiles.getSourceFiles(index), this.parentFrame, omt.getId());
- int result = sfd.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- for (int indexI = 0; indexI < sfd.getSfid().length; indexI++) {
- this.vSourceFiles.addSourceFiles(sfd.getSfid()[indexI]);
- }
- } else {
- this.vSourceFiles.setSourceFiles(sfd.getSfid()[0], index);
- }
- this.showTable();
- this.save();
- sfd.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- sfd.dispose();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Source Files", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vSourceFiles.removeSourceFiles(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vSourceFiles.size() > 0) {
- for (int index = 0; index < vSourceFiles.size(); index++) {
- model.addRow(vSourceFiles.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- //this.jScrollPane.setViewportView(this.jTable);
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSystemTables.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSystemTables.java
deleted file mode 100644
index 8bcb18c1de..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSystemTables.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/** @file
-
- The file is used to create, update SystemTable of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.SystemTableUsage;
-import org.tianocore.SystemTablesDocument;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.SystemTablesDocument.SystemTables;
-import org.tianocore.SystemTablesDocument.SystemTables.SystemTableCNames;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.SystemTables.SystemTablesIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.SystemTables.SystemTablesVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.SystemTablesDlg;
-
-/**
- The class is used to create, update SystemTable of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModuleSystemTables extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = 7488769180379442276L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private SystemTablesDocument.SystemTables systemTables = null;
-
- private SystemTablesIdentification id = null;
-
- private SystemTablesVector vid = new SystemTablesVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 195, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 195, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Guid C_Name");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("System Tables");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inSystemTables
-
- **/
- private void init(SystemTables inSystemTables) {
- init();
- this.systemTables = inSystemTables;
-
- if (this.systemTables != null) {
- if (this.systemTables.getSystemTableCNamesList().size() > 0) {
- for (int index = 0; index < this.systemTables.getSystemTableCNamesList().size(); index++) {
- String arg0 = systemTables.getSystemTableCNamesList().get(index).getSystemTableCName();
- String arg1 = null;
- if (systemTables.getSystemTableCNamesList().get(index).getUsage() != null) {
- arg1 = systemTables.getSystemTableCNamesList().get(index).getUsage().toString();
- }
-
- String arg2 = systemTables.getSystemTableCNamesList().get(index).getFeatureFlag();
- Vector<String> arg3 = Tools.convertListToVector(systemTables.getSystemTableCNamesList().get(index)
- .getSupArchList());
- String arg4 = systemTables.getSystemTableCNamesList().get(index).getHelpText();
-
- id = new SystemTablesIdentification(arg0, arg1, arg2, arg3, arg4);
- vid.addSystemTables(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleSystemTables() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inSystemTables The input data of SystemTablesDocument.SystemTables
-
- **/
- public ModuleSystemTables(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getSystemTables());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- SystemTablesDlg dlg = new SystemTablesDlg(vid.getSystemTables(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addSystemTables(dlg.getId());
- } else {
- this.vid.setSystemTables(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update System Tables", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeSystemTables(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of SystemTables
- if exists systemTables, set the value directly
- if not exists systemTables, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.systemTables = SystemTables.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- SystemTableCNames p = SystemTableCNames.Factory.newInstance();
- if (!isEmpty(vid.getSystemTables(index).getName())) {
- p.setSystemTableCName(vid.getSystemTables(index).getName());
- }
- if (!isEmpty(vid.getSystemTables(index).getUsage())) {
- p.setUsage(SystemTableUsage.Enum.forString(vid.getSystemTables(index).getUsage()));
- }
- if (!isEmpty(vid.getSystemTables(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getSystemTables(index).getFeatureFlag());
- }
- if (vid.getSystemTables(index).getSupArchList() != null
- && vid.getSystemTables(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getSystemTables(index).getSupArchList());
- }
- if (!isEmpty(vid.getSystemTables(index).getHelp())) {
- p.setHelpText(vid.getSystemTables(index).getHelp());
- }
- this.systemTables.addNewSystemTableCNames();
- this.systemTables.setSystemTableCNamesArray(systemTables.getSystemTableCNamesList().size() - 1, p);
- }
- }
-
- this.msa.setSystemTables(systemTables);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update System Tables", e.getMessage());
- Log.err("Update System Tables", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleVariables.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleVariables.java
deleted file mode 100644
index 29eb4ff852..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleVariables.java
+++ /dev/null
@@ -1,472 +0,0 @@
-/** @file
-
- The file is used to create, update Variable of MSA/MBD file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.VariableUsage;
-import org.tianocore.VariablesDocument;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.VariablesDocument.Variables;
-import org.tianocore.VariablesDocument.Variables.Variable;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.Variables.VariablesIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Variables.VariablesVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.VariablesDlg;
-
-/**
- The class is used to create, update Variable of MSA/MBD file
- It extends IInternalFrame
-
- **/
-public class ModuleVariables extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -6998982978030439446L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private VariablesDocument.Variables variables = null;
-
- private VariablesIdentification id = null;
-
- private VariablesVector vid = new VariablesVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 220, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 220, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 220, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Name");
- model.addColumn("Guid C_Name");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Variables");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(Variables inVariables) {
- init();
- this.variables = inVariables;
-
- if (this.variables != null) {
- if (this.variables.getVariableList().size() > 0) {
- for (int index = 0; index < this.variables.getVariableList().size(); index++) {
- String arg0 = Tools.convertUnicodeHexStringToString(variables.getVariableList().get(index)
- .getVariableName());
- String arg1 = variables.getVariableList().get(index).getGuidCName();
- String arg2 = null;
- if (variables.getVariableList().get(index).getUsage() != null) {
- arg2 = variables.getVariableList().get(index).getUsage().toString();
- }
-
- String arg3 = variables.getVariableList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(variables.getVariableList().get(index)
- .getSupArchList());
- String arg5 = variables.getVariableList().get(index).getHelpText();
- id = new VariablesIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- vid.addVariables(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleVariables() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inVariables The input data of VariablesDocument.Variables
-
- **/
- public ModuleVariables(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getVariables());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- VariablesDlg dlg = new VariablesDlg(vid.getVariables(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addVariables(dlg.getId());
- } else {
- this.vid.setVariables(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Variables", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeVariables(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Variables
- if exists variables, set the value directly
- if not exists variables, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.variables = Variables.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- Variable p = Variable.Factory.newInstance();
- if (!isEmpty(vid.getVariables(index).getName())) {
- p.setVariableName(Tools.convertStringToUnicodeHexString(vid.getVariables(index).getName()));
- }
- if (!isEmpty(vid.getVariables(index).getGuid())) {
- p.setGuidCName(vid.getVariables(index).getGuid());
- }
- if (!isEmpty(vid.getVariables(index).getUsage())) {
- p.setUsage(VariableUsage.Enum.forString(vid.getVariables(index).getUsage()));
- }
- if (!isEmpty(vid.getVariables(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getVariables(index).getFeatureFlag());
- }
- if (vid.getVariables(index).getSupArchList() != null
- && vid.getVariables(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getVariables(index).getSupArchList());
- }
- if (!isEmpty(vid.getVariables(index).getHelp())) {
- p.setHelpText(vid.getVariables(index).getHelp());
- }
- this.variables.addNewVariable();
- this.variables.setVariableArray(variables.getVariableList().size() - 1, p);
- }
- }
-
- this.msa.setVariables(variables);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Variables", e.getMessage());
- Log.err("Update Variables", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java
deleted file mode 100644
index 4284af2b10..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java
+++ /dev/null
@@ -1,1696 +0,0 @@
-/** @file
-
- The file is used to create, update MsaHeader of MSA file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.FocusEvent;
-import java.awt.event.ItemEvent;
-import java.util.Vector;
-
-import javax.swing.ButtonGroup;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
-
-import org.tianocore.ExternsDocument;
-import org.tianocore.ModuleDefinitionsDocument;
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.ModuleTypeDef;
-import org.tianocore.MsaHeaderDocument;
-import org.tianocore.PcdDriverTypes;
-import org.tianocore.LicenseDocument.License;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import javax.swing.JRadioButton;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-
-/**
- The class is used to create, update MsaHeader of MSA file
- It extends IInternalFrame
-
-
-
- **/
-public class MsaHeader extends IInternalFrame implements DocumentListener {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -8152099582923006900L;
-
- private int dialogWidth = 500;
-
- private int dialogHeight = 630;
-
- private final int labelWidth = 155;
-
- private int valueWidth = 320;
-
- private final int labelCol = 12;
-
- private final int valueCol = 168;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelBaseName = null;
-
- private JTextField jTextFieldBaseName = null;
-
- private JLabel jLabelGuid = null;
-
- private JTextField jTextFieldGuid = null;
-
- private JLabel jLabelVersion = null;
-
- private JTextField jTextFieldVersion = null;
-
- private JButton jButtonGenerateGuid = null;
-
- private JLabel jLabelLicense = null;
-
- private JTextArea jTextAreaLicense = null;
-
- private JLabel jLabelCopyright = null;
-
- private JLabel jLabelDescription = null;
-
- private JTextArea jTextAreaDescription = null;
-
- private JLabel jLabelSpecification = null;
-
- private JTextField jTextFieldSpecification = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- private JScrollPane jScrollPaneLicense = null;
-
- private JScrollPane jScrollPaneDescription = null;
-
- private JLabel jLabelAbstract = null;
-
- private JTextField jTextFieldAbstract = null;
-
- private JLabel jLabelModuleType = null;
-
- private JComboBox jComboBoxModuleType = null;
-
- private JLabel jLabelArch = null;
-
- private JLabel jLabelBinaryModule = null;
-
- private JLabel jLabelOutputFileBasename = null;
-
- private JTextField jTextFieldOutputFileBasename = null;
-
- private JScrollPane jScrollPaneCopyright = null;
-
- private JTextArea jTextAreaCopyright = null;
-
- private JLabel jLabelURL = null;
-
- private JTextField jTextFieldURL = null;
-
- private JScrollPane jScrollPane = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel4 = null;
-
- private StarLabel jStarLabel5 = null;
-
- private StarLabel jStarLabel6 = null;
-
- private StarLabel jStarLabel7 = null;
-
- private StarLabel jStarLabel8 = null;
-
- private StarLabel jStarLabel10 = null;
-
- private StarLabel jStarLabel12 = null;
-
- private StarLabel jStarLabel13 = null;
-
- private StarLabel jStarLabel14 = null;
-
- private JCheckBox jCheckBoxIa32 = null;
-
- private JCheckBox jCheckBoxX64 = null;
-
- private JCheckBox jCheckBoxIpf = null;
-
- private JCheckBox jCheckBoxEbc = null;
-
- private JCheckBox jCheckBoxArm = null;
-
- private JCheckBox jCheckBoxPpc = null;
-
- private JTextField jComboBoxPcdIsDriver = null;
-
- private JCheckBox jCheckBoxPcd = null;
-
- private JCheckBox jCheckBoxFlashMap = null;
-
- //
- // Not used for UI
- //
- private MsaHeaderDocument.MsaHeader msaHeader = null;
-
- private ModuleDefinitionsDocument.ModuleDefinitions md = null;
-
- private ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = null;
-
- private ExternsDocument.Externs ex = null;
-
- private OpeningModuleType omt = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private JRadioButton jRadioButtonBinaryModuleTrue = null;
-
- private JRadioButton jRadioButtonBinaryModuleFalse = null;
-
- /**
- * This method initializes jCheckBoxIa32
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxIa32() {
- if (jCheckBoxIa32 == null) {
- jCheckBoxIa32 = new JCheckBox();
- jCheckBoxIa32.setBounds(new java.awt.Rectangle(valueCol, 505, 55, 20));
- jCheckBoxIa32.setText("IA32");
- jCheckBoxIa32.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxIa32;
- }
-
- /**
- * This method initializes jCheckBoxX64
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxX64() {
- if (jCheckBoxX64 == null) {
- jCheckBoxX64 = new JCheckBox();
- jCheckBoxX64.setBounds(new java.awt.Rectangle(valueCol + 55, 505, 53, 20));
- jCheckBoxX64.setText("X64");
- jCheckBoxX64.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxX64;
- }
-
- /**
- * This method initializes jCheckBoxIpf
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxIpf() {
- if (jCheckBoxIpf == null) {
- jCheckBoxIpf = new JCheckBox();
- jCheckBoxIpf.setBounds(new java.awt.Rectangle(valueCol + 110, 505, 52, 20));
- jCheckBoxIpf.setText("IPF");
- jCheckBoxIpf.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxIpf;
- }
-
- /**
- * This method initializes jCheckBoxEbc
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxEbc() {
- if (jCheckBoxEbc == null) {
- jCheckBoxEbc = new JCheckBox();
- jCheckBoxEbc.setBounds(new java.awt.Rectangle(valueCol + 165, 505, 53, 20));
- jCheckBoxEbc.setText("EBC");
- jCheckBoxEbc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxEbc;
- }
-
- /**
- * This method initializes jCheckBoxArm
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxArm() {
- if (jCheckBoxArm == null) {
- jCheckBoxArm = new JCheckBox();
- jCheckBoxArm.setBounds(new java.awt.Rectangle(valueCol + 220, 505, 54, 20));
- jCheckBoxArm.setText("ARM");
- jCheckBoxArm.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxArm;
- }
-
- /**
- * This method initializes jCheckBoxPpc
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxPpc() {
- if (jCheckBoxPpc == null) {
- jCheckBoxPpc = new JCheckBox();
- jCheckBoxPpc.setBounds(new java.awt.Rectangle(valueCol + 285, 505, 53, 20));
- jCheckBoxPpc.setText("PPC");
- jCheckBoxPpc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxPpc;
- }
-
- /**
- This method initializes jTextFieldBaseName
-
- @return javax.swing.JTextField jTextFieldBaseName
-
- **/
- private JTextField getJTextFieldBaseName() {
- if (jTextFieldBaseName == null) {
- jTextFieldBaseName = new JTextField();
- jTextFieldBaseName.setBounds(new java.awt.Rectangle(valueCol, 10, valueWidth, 20));
- jTextFieldBaseName.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldBaseName.addFocusListener(this);
- jTextFieldBaseName.setToolTipText("A brief Identifier, such as USB I/O Library, of the module");
- }
- return jTextFieldBaseName;
- }
-
- /**
- This method initializes jTextFieldGuid
-
- @return javax.swing.JTextField jTextFieldGuid
-
- **/
- private JTextField getJTextFieldGuid() {
- if (jTextFieldGuid == null) {
- jTextFieldGuid = new JTextField();
- jTextFieldGuid.setPreferredSize(new java.awt.Dimension(250, 20));
- jTextFieldGuid.setLocation(new java.awt.Point(valueCol, 60));
- jTextFieldGuid.setSize(new java.awt.Dimension(250, 20));
- jTextFieldGuid.addFocusListener(this);
- jTextFieldGuid.setToolTipText("Guaranteed Unique Identification Number, Registry Format (8-4-4-4-12)");
- }
- return jTextFieldGuid;
- }
-
- /**
- This method initializes jTextFieldVersion
-
- @return javax.swing.JTextField jTextFieldVersion
-
- **/
- private JTextField getJTextFieldVersion() {
- if (jTextFieldVersion == null) {
- jTextFieldVersion = new JTextField();
- jTextFieldVersion.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
- jTextFieldVersion.setLocation(new java.awt.Point(valueCol, 85));
- jTextFieldVersion.setSize(new java.awt.Dimension(valueWidth, 20));
- jTextFieldVersion.addFocusListener(this);
- jTextFieldVersion.setToolTipText("A Version Number, 1.0, 1, 1.01, 1.0.1");
- }
- return jTextFieldVersion;
- }
-
- /**
- This method initializes jButtonGenerateGuid
-
- @return javax.swing.JButton jButtonGenerateGuid
-
- **/
- private JButton getJButtonGenerateGuid() {
- if (jButtonGenerateGuid == null) {
- int genGuidCol = valueCol + 285;
- jButtonGenerateGuid = new JButton();
- jButtonGenerateGuid.setPreferredSize(new java.awt.Dimension(65, 20));
- jButtonGenerateGuid.setSize(new java.awt.Dimension(65, 20));
- jButtonGenerateGuid.setLocation(new java.awt.Point(genGuidCol, 60));
- jButtonGenerateGuid.setText("GEN");
- jButtonGenerateGuid.addActionListener(this);
- }
- return jButtonGenerateGuid;
- }
-
- /**
- This method initializes jTextAreaLicense
-
- @return javax.swing.JTextArea jTextAreaLicense
-
- **/
- private JTextArea getJTextAreaLicense() {
- if (jTextAreaLicense == null) {
- jTextAreaLicense = new JTextArea();
- jTextAreaLicense.setText("");
- jTextAreaLicense.setLineWrap(true);
- jTextAreaLicense.addFocusListener(this);
- jTextAreaLicense.setWrapStyleWord(true);
- jTextAreaLicense.setSelectionStart(0);
- jTextAreaLicense.setSelectionEnd(0);
- jTextAreaLicense.setToolTipText("The License for this Module.");
- }
- return jTextAreaLicense;
- }
-
- /**
- This method initializes jTextAreaDescription
-
- @return javax.swing.JTextArea jTextAreaDescription
-
- **/
- private JTextArea getJTextAreaDescription() {
- if (jTextAreaDescription == null) {
- jTextAreaDescription = new JTextArea();
- jTextAreaDescription.setLineWrap(true);
- jTextAreaDescription.addFocusListener(this);
- jTextAreaDescription.setToolTipText("A verbose description of the module.");
- jTextAreaDescription.setWrapStyleWord(true);
- jTextAreaDescription.setSelectionStart(0);
- jTextAreaDescription.setSelectionEnd(0);
- }
- return jTextAreaDescription;
- }
-
- /**
- This method initializes jTextFieldSpecification
-
- @return javax.swing.JTextField jTextFieldSpecification
-
- **/
- private JTextField getJTextFieldSpecification() {
- if (jTextFieldSpecification == null) {
- int specWidth = valueWidth + 50;
- jTextFieldSpecification = new JTextField();
-
- jTextFieldSpecification.setPreferredSize(new java.awt.Dimension(specWidth, 20));
- jTextFieldSpecification.setText("FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052");
- jTextFieldSpecification.setBorder(null);
-
- jTextFieldSpecification.setSize(new java.awt.Dimension(specWidth, 20));
- jTextFieldSpecification.setLocation(new java.awt.Point(labelCol, dialogHeight - 30));
- jTextFieldSpecification.setEditable(false);
- jTextFieldSpecification.addFocusListener(this);
- }
- return jTextFieldSpecification;
- }
-
- /**
- This method initializes jButtonOk
-
- @return javax.swing.JButton jButtonOk
-
- **/
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setText("OK");
- jButtonOk.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonOk.setBounds(new java.awt.Rectangle(390, 455, 90, 20));
- jButtonOk.addActionListener(this);
- jButtonOk.setVisible(false);
- }
- return jButtonOk;
- }
-
- /**
- This method initializes jButtonCancel
-
- @return javax.swing.JButton jButtonCancel
-
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setText("Cancel");
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 445, 90, 20));
- jButtonCancel.addActionListener(this);
- jButtonCancel.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonCancel.setVisible(false);
- }
- return jButtonCancel;
- }
-
- /**
- This method initializes jScrollPaneLicense
-
- @return javax.swing.JScrollPane jScrollPaneLicense
-
- **/
- private JScrollPane getJScrollPaneLicense() {
- if (jScrollPaneLicense == null) {
- jScrollPaneLicense = new JScrollPane();
- jScrollPaneLicense.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneLicense.setSize(new java.awt.Dimension(valueWidth, 120));
- jScrollPaneLicense.setLocation(new java.awt.Point(valueCol, 305));
- jScrollPaneLicense.setViewportView(getJTextAreaLicense());
- jScrollPaneLicense.setPreferredSize(new java.awt.Dimension(valueWidth, 120));
- }
- return jScrollPaneLicense;
- }
-
- /**
- This method initializes jScrollPaneDescription
-
- @return javax.swing.JScrollPane jScrollPaneDescription
-
- **/
- private JScrollPane getJScrollPaneDescription() {
- if (jScrollPaneDescription == null) {
- jScrollPaneDescription = new JScrollPane();
- jScrollPaneDescription.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneDescription.setSize(new java.awt.Dimension(valueWidth, 120));
- jScrollPaneDescription.setLocation(new java.awt.Point(valueCol, 135));
- jScrollPaneDescription.setViewportView(getJTextAreaDescription());
- jScrollPaneDescription.setPreferredSize(new java.awt.Dimension(valueWidth, 120));
- }
- return jScrollPaneDescription;
- }
-
- /**
- This method initializes jTextFieldAbstract
-
- @return javax.swing.JTextField jTextFieldAbstract
-
- **/
- private JTextField getJTextFieldAbstract() {
- if (jTextFieldAbstract == null) {
- jTextFieldAbstract = new JTextField();
- jTextFieldAbstract.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
- jTextFieldAbstract.setLocation(new java.awt.Point(valueCol, 110));
- jTextFieldAbstract.setSize(new java.awt.Dimension(valueWidth, 20));
- jTextFieldAbstract.addFocusListener(this);
- jTextFieldAbstract.setToolTipText("A one sentence description of this module.");
- }
- return jTextFieldAbstract;
- }
-
- /**
- This method initializes jComboBoxModuleType
-
- @return javax.swing.JComboBox jComboBoxModuleType
-
- **/
- private JComboBox getJComboBoxModuleType() {
- if (jComboBoxModuleType == null) {
- jComboBoxModuleType = new JComboBox();
- jComboBoxModuleType.setBounds(new java.awt.Rectangle(valueCol, 35, valueWidth, 20));
- jComboBoxModuleType.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
- }
- return jComboBoxModuleType;
- }
-
- /**
- This method initializes jTextFieldURL
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldURL() {
- if (jTextFieldURL == null) {
- jTextFieldURL = new JTextField();
- jTextFieldURL.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
- jTextFieldURL.setLocation(new java.awt.Point(valueCol, 430));
- jTextFieldURL.setSize(new java.awt.Dimension(valueWidth, 20));
- jTextFieldURL.addFocusListener(this);
- jTextFieldURL.setToolTipText("A URL for the latest version of the license.");
- }
- return jTextFieldURL;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
-
- **/
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneCopyright
-
- @return javax.swing.JScrollPane
-
- **/
- private JScrollPane getJScrollPaneCopyright() {
- if (jScrollPaneCopyright == null) {
- jScrollPaneCopyright = new JScrollPane();
- jScrollPaneCopyright.setBounds(new java.awt.Rectangle(valueCol, 260, valueWidth, 40));
- jScrollPaneCopyright.setPreferredSize(new java.awt.Dimension(valueWidth, 40));
- jScrollPaneCopyright.setViewportView(getJTextAreaCopyright());
- jScrollPaneCopyright.setSize(new java.awt.Dimension(valueWidth, 40));
- }
- return jScrollPaneCopyright;
- }
-
- /**
- This method initializes jTextAreaCopyright
-
- @return javax.swing.JTextArea
-
- **/
- private JTextArea getJTextAreaCopyright() {
- if (jTextAreaCopyright == null) {
- jTextAreaCopyright = new JTextArea();
- jTextAreaCopyright.setLineWrap(true);
- jTextAreaCopyright.addFocusListener(this);
- jTextAreaCopyright.setWrapStyleWord(true);
- jTextAreaCopyright.setSelectionStart(0);
- jTextAreaCopyright.setSelectionEnd(0);
- jTextAreaCopyright.setBounds(new java.awt.Rectangle(0, 0, valueWidth, 40));
- jTextAreaCopyright.setToolTipText("One or more copyright lines.");
- }
- return jTextAreaCopyright;
- }
-
- /**
- * This method initializes jTextFieldOutputFileBasename
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldOutputFileBasename() {
- if (jTextFieldOutputFileBasename == null) {
- jTextFieldOutputFileBasename = new JTextField();
- jTextFieldOutputFileBasename.setBounds(new java.awt.Rectangle(valueCol, 455, valueWidth, 20));
- jTextFieldOutputFileBasename.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
- jTextFieldOutputFileBasename.addFocusListener(this);
- jTextFieldOutputFileBasename.setToolTipText("Enter a single word for generated output file names.");
- }
- return jTextFieldOutputFileBasename;
- }
-
- /**
- * This method initializes jComboBoxPcdIsDriver
- *
- * @return javax.swing.JComboBox
- */
- private JTextField getJComboBoxPcdIsDriver() {
- if (jComboBoxPcdIsDriver == null) {
- jComboBoxPcdIsDriver = new JTextField();
- jComboBoxPcdIsDriver.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
- jComboBoxPcdIsDriver.setBounds(new java.awt.Rectangle(valueCol, 530, valueWidth, 20));
- jComboBoxPcdIsDriver.setEnabled(false);
- jComboBoxPcdIsDriver.setVisible(false);
- }
- return jComboBoxPcdIsDriver;
- }
-
- /**
- This is the default constructor
-
- **/
- public MsaHeader() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inMsaHeader The input data of MsaHeaderDocument.MsaHeader
-
- **/
- public MsaHeader(OpeningModuleType inMsa) {
- super();
- this.omt = inMsa;
- this.msa = omt.getXmlMsa();
-
- //
- // Set module definitions default value
- //
- if (msa.getModuleDefinitions() == null) {
- ModuleDefinitionsDocument.ModuleDefinitions md = ModuleDefinitionsDocument.ModuleDefinitions.Factory
- .newInstance();
- md.setOutputFileBasename(msa.getMsaHeader().getModuleName());
- md.setBinaryModule(false);
- md.setSupportedArchitectures(ed.getVSupportedArchitectures());
- msa.setModuleDefinitions(md);
- }
-
- //
- // Init items of Header, Definitions and Externs
- //
- init(msa.getMsaHeader());
- init(msa.getModuleDefinitions());
- init(msa.getExterns());
- this.addListeners();
-
- this.setVisible(true);
- this.setViewMode(false);
- }
-
- /**
- Disable all components when the mode is view
-
- @param isView true - The view mode; false - The non-view mode
-
- **/
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldBaseName.setEnabled(!isView);
- this.jTextFieldGuid.setEnabled(!isView);
- this.jTextFieldVersion.setEnabled(!isView);
- this.jTextAreaLicense.setEnabled(!isView);
- this.jTextAreaCopyright.setEnabled(!isView);
- this.jTextAreaDescription.setEnabled(!isView);
- this.jTextFieldSpecification.setEnabled(!isView);
- this.jTextFieldAbstract.setEnabled(!isView);
- this.jComboBoxModuleType.setEnabled(!isView);
- this.jButtonCancel.setEnabled(!isView);
- this.jButtonGenerateGuid.setEnabled(!isView);
- this.jButtonOk.setEnabled(!isView);
- }
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(dialogWidth, dialogHeight);
- this.setPreferredSize(new java.awt.Dimension(dialogWidth, dialogHeight));
- this.setContentPane(getJScrollPane());
- this.setTitle("Module Surface Area Header");
- initFrame();
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inMsaHeader The input data of MsaHeaderDocument.MsaHeader
-
- **/
- private void init(MsaHeaderDocument.MsaHeader inMsaHeader) {
- init();
- if (inMsaHeader != null) {
- setMsaHeader(inMsaHeader);
- if (this.msaHeader.getModuleName() != null) {
- this.jTextFieldBaseName.setText(this.msaHeader.getModuleName());
- }
- if (this.msaHeader.getModuleType() != null) {
- this.jComboBoxModuleType.setSelectedItem(this.msaHeader.getModuleType().toString());
- }
- if (this.msaHeader.getGuidValue() != null) {
- this.jTextFieldGuid.setText(this.msaHeader.getGuidValue());
- }
- if (this.msaHeader.getVersion() != null) {
- this.jTextFieldVersion.setText(this.msaHeader.getVersion());
- }
- if (this.msaHeader.getAbstract() != null) {
- this.jTextFieldAbstract.setText(this.msaHeader.getAbstract());
- }
- if (this.msaHeader.getDescription() != null) {
- this.jTextAreaDescription.setText(this.msaHeader.getDescription());
- jTextAreaDescription.setSelectionStart(0);
- jTextAreaDescription.setSelectionEnd(0);
- }
- if (this.msaHeader.getCopyright() != null) {
- this.jTextAreaCopyright.setText(this.msaHeader.getCopyright());
- }
- if (this.msaHeader.getLicense() != null) {
- this.jTextAreaLicense.setText(this.msaHeader.getLicense().getStringValue());
- jTextAreaLicense.setSelectionStart(0);
- jTextAreaLicense.setSelectionEnd(0);
- }
- if (this.msaHeader.getLicense() != null && this.msaHeader.getLicense().getURL() != null) {
- this.jTextFieldURL.setText(this.msaHeader.getLicense().getURL());
- }
- if (this.msaHeader.getSpecification() != null) {
- this.jTextFieldSpecification.setText(this.msaHeader.getSpecification());
- }
- }
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inMsaHeader The input data of MsaHeaderDocument.MsaHeader
-
- **/
- private void init(ModuleDefinitionsDocument.ModuleDefinitions inMd) {
- if (inMd != null) {
- this.md = inMd;
- if (md.getSupportedArchitectures() != null) {
- this.setSelectedItems(Tools.convertListToVector(md.getSupportedArchitectures()));
- }
- if (md.getBinaryModule()) {
- this.jRadioButtonBinaryModuleTrue.setSelected(true);
- } else {
- this.jRadioButtonBinaryModuleFalse.setSelected(true);
- }
- if (md.getOutputFileBasename() != null) {
- this.jTextFieldOutputFileBasename.setText(md.getOutputFileBasename());
- }
- }
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inEx The input data of ExternsDocument.Externs
-
- **/
- private void init(ExternsDocument.Externs inEx) {
- if (inEx != null) {
- this.ex = inEx;
- if (ex.getPcdIsDriver() != null) {
- this.jCheckBoxPcd.setSelected(true);
- this.jCheckBoxPcd.setEnabled(true);
- }
- this.jCheckBoxFlashMap.setSelected(ex.getTianoR8FlashMapH());
- }
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
-
- jLabelURL = new JLabel();
- jLabelURL.setText("License URL");
- jLabelURL.setLocation(new java.awt.Point(labelCol, 430));
- jLabelURL.setSize(new java.awt.Dimension(labelWidth, 20));
- jLabelBaseName = new JLabel();
- jLabelBaseName.setText("Module Name");
- jLabelBaseName.setBounds(new java.awt.Rectangle(labelCol, 10, labelWidth, 20));
- jLabelModuleType = new JLabel();
- jLabelModuleType.setBounds(new java.awt.Rectangle(labelCol, 35, labelWidth, 20));
- jLabelModuleType.setText("Module Type");
- jLabelGuid = new JLabel();
- jLabelGuid.setText("Guid Value");
- jLabelGuid.setLocation(new java.awt.Point(labelCol, 60));
- jLabelGuid.setSize(new java.awt.Dimension(labelWidth, 20));
- jLabelVersion = new JLabel();
- jLabelVersion.setText("Version");
- jLabelVersion.setLocation(new java.awt.Point(labelCol, 85));
- jLabelVersion.setSize(new java.awt.Dimension(labelWidth, 20));
- jLabelAbstract = new JLabel();
- jLabelAbstract.setText("Abstract");
- jLabelAbstract.setLocation(new java.awt.Point(labelCol, 110));
- jLabelAbstract.setSize(new java.awt.Dimension(labelWidth, 20));
- jLabelDescription = new JLabel();
- jLabelDescription.setText("Description");
- jLabelDescription.setLocation(new java.awt.Point(labelCol, 135));
- jLabelDescription.setSize(new java.awt.Dimension(labelWidth, 20));
- jLabelCopyright = new JLabel();
- jLabelCopyright.setText("Copyright");
- jLabelCopyright.setLocation(new java.awt.Point(labelCol, 260));
- jLabelCopyright.setSize(new java.awt.Dimension(labelWidth, 20));
- jLabelLicense = new JLabel();
- jLabelLicense.setText("License");
- jLabelLicense.setLocation(new java.awt.Point(labelCol, 305));
- jLabelLicense.setSize(new java.awt.Dimension(labelWidth, 20));
- jLabelOutputFileBasename = new JLabel();
- jLabelOutputFileBasename.setBounds(new java.awt.Rectangle(labelCol, 455, labelWidth, 20));
- jLabelOutputFileBasename.setText("Output File Basename");
- jLabelBinaryModule = new JLabel();
- jLabelBinaryModule.setBounds(new java.awt.Rectangle(labelCol, 480, labelWidth, 20));
- jLabelBinaryModule.setText("Binary Module");
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(labelCol, 505, labelWidth, 20));
- jLabelArch.setText("Supported Architectures");
- jLabelSpecification = new JLabel();
- jLabelSpecification.setText("Specification");
- jLabelSpecification.setLocation(new java.awt.Point(labelCol, 530));
- jLabelSpecification.setSize(new java.awt.Dimension(labelWidth, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(dialogWidth - 10, dialogHeight - 10));
-
- jContentPane.addFocusListener(this);
-
- jContentPane.add(jLabelBaseName, null);
- jContentPane.add(getJTextFieldBaseName(), null);
- jContentPane.add(jLabelGuid, null);
- jContentPane.add(getJTextFieldGuid(), null);
- jContentPane.add(jLabelVersion, null);
- jContentPane.add(getJTextFieldVersion(), null);
- jContentPane.add(getJButtonGenerateGuid(), null);
- jContentPane.add(jLabelLicense, null);
- jContentPane.add(jLabelCopyright, null);
- jContentPane.add(jLabelDescription, null);
- jContentPane.add(getJTextFieldSpecification(), null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJScrollPaneLicense(), null);
- jContentPane.add(getJScrollPaneDescription(), null);
- jContentPane.add(jLabelAbstract, null);
- jContentPane.add(getJTextFieldAbstract(), null);
- jContentPane.add(jLabelModuleType, null);
- jContentPane.add(getJComboBoxModuleType(), null);
- jContentPane.add(jLabelURL, null);
- jContentPane.add(getJTextFieldURL(), null);
- jContentPane.add(jLabelOutputFileBasename, null);
- jContentPane.add(getJTextFieldOutputFileBasename(), null);
- jContentPane.add(jLabelBinaryModule, null);
- jContentPane.add(jLabelArch, null);
-
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(0, 10));
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(0, 35));
- jStarLabel4 = new StarLabel();
- jStarLabel4.setLocation(new java.awt.Point(0, 60));
- jStarLabel5 = new StarLabel();
- jStarLabel5.setLocation(new java.awt.Point(0, 85));
- jStarLabel6 = new StarLabel();
- jStarLabel6.setLocation(new java.awt.Point(0, 135));
- jStarLabel7 = new StarLabel();
- jStarLabel7.setLocation(new java.awt.Point(0, 260));
- jStarLabel8 = new StarLabel();
- jStarLabel8.setLocation(new java.awt.Point(0, 305));
- jStarLabel10 = new StarLabel();
- jStarLabel10.setLocation(new java.awt.Point(0, 110));
- jStarLabel12 = new StarLabel();
- jStarLabel12.setLocation(new java.awt.Point(0, 455));
- jStarLabel13 = new StarLabel();
- jStarLabel13.setLocation(new java.awt.Point(0, 480));
- jStarLabel14 = new StarLabel();
- jStarLabel14.setLocation(new java.awt.Point(0, 505));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jStarLabel4, null);
- jContentPane.add(jStarLabel5, null);
- jContentPane.add(jStarLabel6, null);
- jContentPane.add(jStarLabel7, null);
- jContentPane.add(jStarLabel8, null);
- jContentPane.add(jStarLabel10, null);
- jContentPane.add(jStarLabel12, null);
- jContentPane.add(jStarLabel13, null);
- jContentPane.add(jStarLabel14, null);
- jContentPane.add(getJScrollPaneCopyright(), null);
-
- jContentPane.add(getJCheckBoxIa32(), null);
- jContentPane.add(getJCheckBoxX64(), null);
- jContentPane.add(getJCheckBoxIpf(), null);
- jContentPane.add(getJCheckBoxEbc(), null);
- jContentPane.add(getJCheckBoxArm(), null);
- jContentPane.add(getJCheckBoxPpc(), null);
-
- jContentPane.add(getJCheckBoxPcd(), null);
- jContentPane.add(getJComboBoxPcdIsDriver(), null);
- jContentPane.add(getJCheckBoxFlashMap(), null);
-
- ButtonGroup bg = new ButtonGroup();
- jContentPane.add(getJRadioButtonBinaryModuleTrue(), null);
- jContentPane.add(getJRadioButtonBinaryModuleFalse(), null);
- bg.add(getJRadioButtonBinaryModuleTrue());
- bg.add(getJRadioButtonBinaryModuleFalse());
- }
- return jContentPane;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonGenerateGuid) {
- jTextFieldGuid.setText(Tools.generateUuidString());
- jTextFieldGuid.requestFocus();
- jButtonGenerateGuid.requestFocus();
- }
- }
-
- /**
- Data validation for all fields
-
- @retval true - All datas are valid
- @retval false - At least one data is invalid
-
- **/
- public boolean check() {
- //
- // Check if all required fields are not empty
- // and check if all data fields values are valid
- //
-
- //
- // Check Base Name
- //
- if (isEmpty(this.jTextFieldBaseName.getText())) {
- Log.wrn("Update Msa Header", "Name must be entered!");
- //this.jTextFieldBaseName.requestFocus();
- return false;
- }
- if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Name, it must start with an alpha character!");
- //this.jTextFieldBaseName.requestFocus();
- return false;
- }
-
- //
- // Check Guid
- //
- if (isEmpty(this.jTextFieldGuid.getText())) {
- Log.wrn("Update Msa Header", "The Guid Value must be entered!");
- //this.jTextFieldGuid.requestFocus();
- return false;
- }
- if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Guid, it must be registry format, 8-4-4-4-12");
- //this.jTextFieldGuid.requestFocus();
- return false;
- }
-
- //
- // Check Version
- //
- if (isEmpty(this.jTextFieldVersion.getText())) {
- Log.wrn("Update Msa Header", "Version must be entered!");
- //this.jTextFieldVersion.requestFocus();
- return false;
- }
- if (!DataValidation.isVersion(this.jTextFieldVersion.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Version, it must start with a digit.");
- //this.jTextFieldVersion.requestFocus();
- return false;
- }
-
- //
- // Check Abstact
- //
- if (isEmpty(this.jTextFieldAbstract.getText())) {
- Log.wrn("Update Msa Header", "Abstract must be entered!");
- //this.jTextFieldAbstract.requestFocus();
- return false;
- }
- if (!DataValidation.isAbstract(this.jTextFieldAbstract.getText())) {
- Log.wrn("Update Msa Header",
- "Incorrect data type for Abstract, is should be a sentence describing the module.");
- //this.jTextFieldAbstract.requestFocus();
- return false;
- }
-
- //
- // Check Description
- //
- if (isEmpty(this.jTextAreaDescription.getText())) {
- Log.wrn("Update Msa Header", "Description must be entered!");
- //this.jTextAreaDescription.requestFocus();
- return false;
- }
-
- //
- // Check Copyright
- //
- if (isEmpty(this.jTextAreaCopyright.getText())) {
- Log.wrn("Update Msa Header", "Copyright must be entered!");
- //this.jTextFieldCopyright.requestFocus();
- return false;
- }
-
- //
- // Check License
- //
- if (isEmpty(this.jTextAreaLicense.getText())) {
- Log.wrn("Update Msa Header", "License must be entered!");
- //this.jTextAreaLicense.requestFocus();
- return false;
- }
-
- //
- // Check Specification
- //
- if (isEmpty(this.jTextFieldSpecification.getText())) {
- Log.wrn("Update Msa Header", "Specification must exist.");
- //this.jTextFieldSpecification.requestFocus();
- return false;
- }
- if (!DataValidation.isSpecification(this.jTextFieldSpecification.getText())) {
- // TODO Add code to check the specification number.
- // Future releases of Schema may require that we process these files
- // differently.
- Log.wrn("Update Msa Header", "Incorrect data type for Specification");
- //this.jTextFieldSpecification.requestFocus();
- return false;
- }
-
- return true;
- }
-
- /**
- Save all components of Msa Header
- if exists msaHeader, set the value directly
- if not exists msaHeader, new an instance first
-
- **/
- public void save() {
- try {
- msaHeader.setSpecification(this.jTextFieldSpecification.getText());
- msa.setMsaHeader(msaHeader);
- msa.setModuleDefinitions(md);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Save Module", e.getMessage());
- Log.err("Save Module", e.getMessage());
- }
- }
-
- /**
- This method initializes Module type and Compontent type
-
- **/
- private void initFrame() {
- EnumerationData ed = new EnumerationData();
- Tools.generateComboBoxByVector(jComboBoxModuleType, ed.getVModuleType());
- this.setSelectedItems(ed.getVSupportedArchitectures());
- }
-
- /**
- Get MsaHeaderDocument.MsaHeader
-
- @return MsaHeaderDocument.MsaHeader
-
- **/
- public MsaHeaderDocument.MsaHeader getMsaHeader() {
- return msaHeader;
- }
-
- /**
- Set MsaHeaderDocument.MsaHeader
-
- @param msaHeader The input data of MsaHeaderDocument.MsaHeader
-
- **/
- public void setMsaHeader(MsaHeaderDocument.MsaHeader msaHeader) {
- this.msaHeader = msaHeader;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
-
- Tools.resizeComponentWidth(this.jTextFieldBaseName, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldGuid, intCurrentWidth, intPreferredWidth + 7);
- Tools.resizeComponentWidth(this.jTextFieldVersion, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jScrollPaneLicense, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldURL, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jScrollPaneCopyright, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jScrollPaneDescription, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldSpecification, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldAbstract, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jComboBoxModuleType, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldOutputFileBasename, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jComboBoxPcdIsDriver, intCurrentWidth, intPreferredWidth);
-
- Tools.relocateComponentX(this.jButtonGenerateGuid, intCurrentWidth, intPreferredWidth,
- DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON);
- }
-
- public void focusLost(FocusEvent arg0) {
- if (this.msaHeader == null) {
- msaHeader = MsaHeaderDocument.MsaHeader.Factory.newInstance();
- }
-
- //
- // Check BaseName
- //
- if (arg0.getSource() == this.jTextFieldBaseName) {
- if (isEmpty(this.jTextFieldBaseName.getText())) {
- Log.wrn("Update Msa Header", "The Name must be entered!");
- //this.jTextFieldBaseName.requestFocus();
- return;
- }
- if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Name, it must begin with an alpha character.");
- //this.jTextFieldBaseName.requestFocus();
- return;
- }
- if (!this.jTextFieldBaseName.getText().equals(msaHeader.getModuleName())) {
- this.msaHeader.setModuleName(this.jTextFieldBaseName.getText());
- } else {
- return;
- }
- }
-
- //
- // Check Guid
- //
- if (arg0.getSource() == this.jTextFieldGuid) {
- if (isEmpty(this.jTextFieldGuid.getText())) {
- Log.wrn("Update Msa Header", "Guid must be entered!");
- //this.jTextFieldGuid.requestFocus();
- return;
- }
- if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Guid, it must be registry format. (8-4-4-4-12)");
- //this.jTextFieldGuid.requestFocus();
- return;
- }
- if (!this.jTextFieldGuid.getText().equals(msaHeader.getGuidValue())) {
- this.msaHeader.setGuidValue(this.jTextFieldGuid.getText());
- } else {
- return;
- }
- }
-
- //
- // Check Version
- //
- if (arg0.getSource() == this.jTextFieldVersion) {
- if (isEmpty(this.jTextFieldVersion.getText())) {
- Log.wrn("Update Msa Header", "Version must be entered!");
- //this.jTextFieldVersion.requestFocus();
- return;
- }
- if (!DataValidation.isVersion(this.jTextFieldVersion.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Version, it must start with a digit.");
- //this.jTextFieldVersion.requestFocus();
- return;
- }
- if (!this.jTextFieldVersion.getText().equals(msaHeader.getVersion())) {
- this.msaHeader.setVersion(this.jTextFieldVersion.getText());
- } else {
- return;
- }
- }
-
- //
- // Check Abstact
- //
- if (arg0.getSource() == this.jTextFieldAbstract) {
- if (isEmpty(this.jTextFieldAbstract.getText())) {
- Log.wrn("Update Msa Header", "Abstract must be entered!");
- //this.jTextFieldAbstract.requestFocus();
- return;
- }
- if (!DataValidation.isAbstract(this.jTextFieldAbstract.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Abstract, it must be sentence.");
- //this.jTextFieldAbstract.requestFocus();
- return;
- }
- if (!this.jTextFieldAbstract.getText().equals(msaHeader.getAbstract())) {
- this.msaHeader.setAbstract(this.jTextFieldAbstract.getText());
- } else {
- return;
- }
- }
-
- //
- // Check Description
- //
- if (arg0.getSource() == this.jTextAreaDescription) {
- if (isEmpty(this.jTextAreaDescription.getText())) {
- Log.wrn("Update Msa Header", "Description must be entered!");
- //this.jTextAreaDescription.requestFocus();
- return;
- }
- if (!this.jTextAreaDescription.getText().equals(msaHeader.getDescription())) {
- this.msaHeader.setDescription(this.jTextAreaDescription.getText());
- } else {
- return;
- }
- }
-
- //
- // Check Copyright
- //
- if (arg0.getSource() == this.jTextAreaCopyright) {
- if (isEmpty(this.jTextAreaCopyright.getText())) {
- Log.wrn("Update Msa Header", "Copyright must be entered!");
- //this.jTextFieldCopyright.requestFocus();
- return;
- }
- if (!this.jTextAreaCopyright.getText().equals(msaHeader.getCopyright())) {
- this.msaHeader.setCopyright(this.jTextAreaCopyright.getText());
- } else {
- return;
- }
- }
-
- //
- // Check License
- //
- if (arg0.getSource() == this.jTextAreaLicense) {
- if (isEmpty(this.jTextAreaLicense.getText())) {
- Log.wrn("Update Msa Header", "License must be entered!");
- //this.jTextAreaLicense.requestFocus();
- return;
- }
- if (this.msaHeader.getLicense() != null) {
- if (!this.jTextAreaLicense.getText().equals(msaHeader.getLicense().getStringValue())) {
- this.msaHeader.getLicense().setStringValue(this.jTextAreaLicense.getText());
- } else {
- return;
- }
- } else {
- License mLicense = License.Factory.newInstance();
- mLicense.setStringValue(this.jTextAreaLicense.getText());
- this.msaHeader.setLicense(mLicense);
- }
- }
-
- //
- // Check License URL
- //
- if (arg0.getSource() == this.jTextFieldURL) {
- if (!isEmpty(this.jTextFieldURL.getText())) {
- if (this.msaHeader.getLicense() == null) {
- License mLicense = License.Factory.newInstance();
- mLicense.setURL(this.jTextFieldURL.getText());
- this.msaHeader.setLicense(mLicense);
- } else {
- if (!this.jTextFieldURL.getText().equals(msaHeader.getLicense().getURL())) {
- this.msaHeader.getLicense().setURL(this.jTextFieldURL.getText());
- } else {
- return;
- }
- }
- }
- }
-
- //
- // Check Output File Basename
- //
- if (arg0.getSource() == this.jTextFieldOutputFileBasename) {
- if (isEmpty(this.jTextFieldOutputFileBasename.getText())) {
- Log.wrn("Update Msa Header", "Output File Basename must be entered!");
- // jTextFieldOutputFileBasename.removeFocusListener(this);
- // jTextFieldOutputFileBasename.requestFocus();
- // jTextFieldOutputFileBasename.addFocusListener(this);
- return;
- }
-
- if (!DataValidation.isOutputFileBasename(this.jTextFieldOutputFileBasename.getText())) {
- Log.wrn("Update Msa Header",
- "Incorrect data type for Output File Basename, it must be a valid file name");
- return;
- }
-
- if (!this.jTextFieldOutputFileBasename.getText().equals(md.getOutputFileBasename())) {
- this.md.setOutputFileBasename(this.jTextFieldOutputFileBasename.getText());
- } else {
- return;
- }
- }
-
- //
- // Check Binary Module Type
- //
- if (arg0.getSource() == this.jRadioButtonBinaryModuleTrue) {
- if (jRadioButtonBinaryModuleTrue.isSelected()) {
- if (md.getBinaryModule()) {
- return;
- } else {
- md.setBinaryModule(true);
- }
- }
- }
-
- //
- // Check Binary Module Type
- //
- if (arg0.getSource() == this.jRadioButtonBinaryModuleFalse) {
- if (jRadioButtonBinaryModuleFalse.isSelected()) {
- if (md.getBinaryModule()) {
- md.setBinaryModule(false);
- } else {
- return;
- }
- }
- }
-
- this.save();
- }
-
- private Vector<String> getSelectedItemsVector() {
- Vector<String> v = new Vector<String>();
- if (this.jCheckBoxIa32.isSelected()) {
- v.addElement(jCheckBoxIa32.getText());
- }
- if (this.jCheckBoxX64.isSelected()) {
- v.addElement(jCheckBoxX64.getText());
- }
- if (this.jCheckBoxIpf.isSelected()) {
- v.addElement(jCheckBoxIpf.getText());
- }
- if (this.jCheckBoxEbc.isSelected()) {
- v.addElement(jCheckBoxEbc.getText());
- }
- if (this.jCheckBoxArm.isSelected()) {
- v.addElement(jCheckBoxArm.getText());
- }
- if (this.jCheckBoxPpc.isSelected()) {
- v.addElement(jCheckBoxPpc.getText());
- }
- return v;
- }
-
- private String getSelectedItemsString() {
- String s = "";
- if (this.jCheckBoxIa32.isSelected()) {
- s = s + jCheckBoxIa32.getText() + " ";
- }
- if (this.jCheckBoxX64.isSelected()) {
- s = s + jCheckBoxX64.getText() + " ";
- }
- if (this.jCheckBoxIpf.isSelected()) {
- s = s + jCheckBoxIpf.getText() + " ";
- }
- if (this.jCheckBoxEbc.isSelected()) {
- s = s + jCheckBoxEbc.getText() + " ";
- }
- if (this.jCheckBoxArm.isSelected()) {
- s = s + jCheckBoxArm.getText() + " ";
- }
- if (this.jCheckBoxPpc.isSelected()) {
- s = s + jCheckBoxPpc.getText() + " ";
- }
- return s.trim();
- }
-
- private void setAllItemsSelected(boolean isSelected) {
- this.jCheckBoxIa32.setSelected(true);
- this.jCheckBoxX64.setSelected(isSelected);
- this.jCheckBoxIpf.setSelected(isSelected);
- this.jCheckBoxEbc.setSelected(isSelected);
- this.jCheckBoxArm.setSelected(isSelected);
- this.jCheckBoxPpc.setSelected(isSelected);
- }
-
- private void setSelectedItems(Vector<String> v) {
- setAllItemsSelected(false);
- boolean isIA32Selected = false;
- if (v != null) {
- for (int index = 0; index < v.size(); index++) {
- if (v.get(index).equals(this.jCheckBoxIa32.getText())) {
- this.jCheckBoxIa32.setSelected(true);
- isIA32Selected = true;
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxIpf.getText())) {
- this.jCheckBoxIpf.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxX64.getText())) {
- this.jCheckBoxX64.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxEbc.getText())) {
- this.jCheckBoxEbc.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxArm.getText())) {
- this.jCheckBoxArm.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxPpc.getText())) {
- this.jCheckBoxPpc.setSelected(true);
- continue;
- }
- }
- if (!isIA32Selected) {
- this.jCheckBoxIa32.setSelected(false);
- }
- }
- }
-
- /**
- * This method initializes jCheckBoxPcd
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxPcd() {
- if (jCheckBoxPcd == null) {
- jCheckBoxPcd = new JCheckBox();
- jCheckBoxPcd.setBounds(new java.awt.Rectangle(labelCol, 530, labelWidth, 20));
- jCheckBoxPcd.setText("Is this a PCD Driver?");
- jCheckBoxPcd.addFocusListener(this);
- jCheckBoxPcd.addActionListener(this);
- jCheckBoxPcd.setEnabled(false);
- }
- return jCheckBoxPcd;
- }
-
- /**
- * This method initializes jCheckBoxFlashMap
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxFlashMap() {
- if (jCheckBoxFlashMap == null) {
- jCheckBoxFlashMap = new JCheckBox();
- jCheckBoxFlashMap.setBounds(new java.awt.Rectangle(labelCol, 555, 480, 20));
- jCheckBoxFlashMap.setText("Does this module require a legacy FlashMap header file?");
- }
- return jCheckBoxFlashMap;
- }
-
- /**
- * This method initializes jRadioButtonBinaryModuleTrue
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButtonBinaryModuleTrue() {
- if (jRadioButtonBinaryModuleTrue == null) {
- jRadioButtonBinaryModuleTrue = new JRadioButton();
- jRadioButtonBinaryModuleTrue.setBounds(new java.awt.Rectangle(valueCol, 480, 140, 20));
- jRadioButtonBinaryModuleTrue.setText("True");
- jRadioButtonBinaryModuleTrue.setSelected(true);
- jRadioButtonBinaryModuleTrue.addFocusListener(this);
- jRadioButtonBinaryModuleTrue
- .setToolTipText("<html>Modules are either source modules which can be compiled or binary <br>"
- + "modules which are linked. A module cannot contain both. <br>"
- + "The GUID numbers should be identical for a binary and source MSA, <br>"
- + "however the BINARY MSA should have a higher version number.</html>");
- }
- return jRadioButtonBinaryModuleTrue;
- }
-
- /**
- * This method initializes jRadioButtonBinaryModuleFalse
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButtonBinaryModuleFalse() {
- if (jRadioButtonBinaryModuleFalse == null) {
- jRadioButtonBinaryModuleFalse = new JRadioButton();
- jRadioButtonBinaryModuleFalse.setBounds(new java.awt.Rectangle(valueCol + 140, 480, 140, 20));
- jRadioButtonBinaryModuleFalse.setText("False");
- jRadioButtonBinaryModuleFalse.addFocusListener(this);
- jRadioButtonBinaryModuleFalse
- .setToolTipText("<html>Modules are either source modules which can be compiled or binary <br>"
- + "modules which are linked. A module cannot contain both. <br>"
- + "The GUID numbers should be identical for a binary and source MSA, <br>"
- + "however the BINARY MSA should have a higher version number.</html>");
- }
- return jRadioButtonBinaryModuleFalse;
- }
-
- public void itemStateChanged(ItemEvent arg0) {
- //
- // Check Supported Arch
- //
- if (arg0.getSource() == this.jCheckBoxIa32 || arg0.getSource() == this.jCheckBoxIpf
- || arg0.getSource() == this.jCheckBoxX64 || arg0.getSource() == this.jCheckBoxEbc
- || arg0.getSource() == this.jCheckBoxArm || arg0.getSource() == this.jCheckBoxPpc) {
- if (!this.jCheckBoxIa32.isSelected() && !this.jCheckBoxX64.isSelected() && !this.jCheckBoxIpf.isSelected()
- && !this.jCheckBoxEbc.isSelected() && !this.jCheckBoxPpc.isSelected()
- && !this.jCheckBoxArm.isSelected()) {
- Log
- .wrn("At lease one Supportted Architecture should be selected! IA32 is selected as default value!");
- this.jCheckBoxIa32.setSelected(true);
- }
-
- if (!this.getSelectedItemsString().equals(md.getSupportedArchitectures().toString())) {
- md.setSupportedArchitectures(this.getSelectedItemsVector());
- this.save();
- }
- }
-
- if (arg0.getSource() == this.jComboBoxModuleType) {
- if (this.jComboBoxModuleType.getSelectedItem().equals("PEIM")
- || this.jComboBoxModuleType.getSelectedItem().equals("DXE_DRIVER")) {
- this.jCheckBoxPcd.setEnabled(true);
- if (this.jCheckBoxPcd.isSelected()) {
- this.jCheckBoxPcd.setSelected(false);
- this.jCheckBoxPcd.setSelected(true);
- }
- } else {
- this.jCheckBoxPcd.setEnabled(false);
- this.jCheckBoxPcd.setSelected(false);
- }
- if (!jComboBoxModuleType.getSelectedItem().toString().equals(msaHeader.getModuleType().toString())) {
- msaHeader.setModuleType(ModuleTypeDef.Enum.forString(jComboBoxModuleType.getSelectedItem().toString()));
- this.save();
- }
- }
-
- //
- // Check Pcd is Driver
- //
- if (arg0.getSource() == this.jCheckBoxPcd) {
- if (this.jCheckBoxPcd.isSelected()) {
- if (this.jComboBoxModuleType.getSelectedItem().toString().equals("DXE_DRIVER")) {
- this.jComboBoxPcdIsDriver.setText("DXE_PCD_DRIVER");
- this.jComboBoxPcdIsDriver.setEnabled(true);
- } else if (this.jComboBoxModuleType.getSelectedItem().toString().equals("PEIM")) {
- this.jComboBoxPcdIsDriver.setText("PEI_PCD_DRIVER");
- this.jComboBoxPcdIsDriver.setEnabled(true);
- }
- }
-
- if ((this.ex == null) && this.jCheckBoxPcd.isSelected()) {
- this.ex = ExternsDocument.Externs.Factory.newInstance();
- this.ex.setPcdIsDriver(PcdDriverTypes.Enum.forString(this.jComboBoxPcdIsDriver.getText()));
- this.msa.setExterns(this.ex);
- } else if ((this.ex != null) && (this.ex.getPcdIsDriver() == null) && this.jCheckBoxPcd.isSelected()) {
- this.ex.setPcdIsDriver(PcdDriverTypes.Enum.forString(this.jComboBoxPcdIsDriver.getText()));
- this.msa.setExterns(this.ex);
- } else if ((this.ex != null) && (this.ex.getPcdIsDriver() != null)) {
- if (this.jCheckBoxPcd.isSelected()
- && !this.jComboBoxPcdIsDriver.getText().toString().equals(this.ex.getPcdIsDriver().toString())) {
- this.ex.setPcdIsDriver(PcdDriverTypes.Enum.forString(this.jComboBoxPcdIsDriver.getText()));
- this.msa.setExterns(this.ex);
- }
- if (!this.jCheckBoxPcd.isSelected()) {
- ExternsDocument.Externs newEx = ExternsDocument.Externs.Factory.newInstance();
- if (this.ex.getExternList() != null) {
- for (int index = 0; index < this.ex.getExternList().size(); index++) {
- newEx.addNewExtern();
- newEx.setExternArray(index, this.ex.getExternArray(index));
- }
- }
- if (this.ex.getSpecificationList() != null) {
- for (int index = 0; index < this.ex.getSpecificationList().size(); index++) {
- newEx.addNewSpecification();
- newEx.setSpecificationArray(index, this.ex.getSpecificationArray(index));
- }
- }
- if (this.ex.getTianoR8FlashMapH()) {
- newEx.setTianoR8FlashMapH(this.ex.getTianoR8FlashMapH());
- }
- this.ex = newEx;
- this.msa.setExterns(this.ex);
- }
- }
- this.save();
- }
- //
- // Check Flash Map
- //
- if (arg0.getSource() == this.jCheckBoxFlashMap) {
- if ((this.ex == null) && this.jCheckBoxFlashMap.isSelected()) {
- this.ex = ExternsDocument.Externs.Factory.newInstance();
- this.ex.setTianoR8FlashMapH(this.jCheckBoxFlashMap.isSelected());
- this.msa.setExterns(this.ex);
- } else if ((this.ex != null) && this.jCheckBoxFlashMap.isSelected()) {
- this.ex.setTianoR8FlashMapH(this.jCheckBoxFlashMap.isSelected());
- this.msa.setExterns(this.ex);
- } else if ((this.ex != null) && !this.jCheckBoxFlashMap.isSelected()) {
- ExternsDocument.Externs newEx = ExternsDocument.Externs.Factory.newInstance();
- if (this.ex.getExternList() != null) {
- for (int index = 0; index < this.ex.getExternList().size(); index++) {
- newEx.addNewExtern();
- newEx.setExternArray(index, this.ex.getExternArray(index));
- }
- }
- if (this.ex.getSpecificationList() != null) {
- for (int index = 0; index < this.ex.getSpecificationList().size(); index++) {
- newEx.addNewSpecification();
- newEx.setSpecificationArray(index, this.ex.getSpecificationArray(index));
- }
- }
- if (this.ex.getPcdIsDriver() != null) {
- newEx.setPcdIsDriver(this.ex.getPcdIsDriver());
- }
- this.ex = newEx;
- this.msa.setExterns(this.ex);
- }
- this.save();
- }
- }
-
- private void addListeners() {
- this.jTextFieldBaseName.getDocument().addDocumentListener(this);
- this.jTextFieldGuid.getDocument().addDocumentListener(this);
- this.jTextFieldAbstract.getDocument().addDocumentListener(this);
- this.jTextAreaCopyright.getDocument().addDocumentListener(this);
- this.jTextAreaDescription.getDocument().addDocumentListener(this);
- this.jTextAreaLicense.getDocument().addDocumentListener(this);
- this.jTextFieldOutputFileBasename.getDocument().addDocumentListener(this);
- this.jTextFieldSpecification.getDocument().addDocumentListener(this);
- this.jTextFieldURL.getDocument().addDocumentListener(this);
- this.jTextFieldVersion.getDocument().addDocumentListener(this);
-
- this.jComboBoxModuleType.addItemListener(this);
-
- this.jCheckBoxIa32.addItemListener(this);
- this.jCheckBoxX64.addItemListener(this);
- this.jCheckBoxIpf.addItemListener(this);
- this.jCheckBoxEbc.addItemListener(this);
- this.jCheckBoxArm.addItemListener(this);
- this.jCheckBoxPpc.addItemListener(this);
-
- this.jCheckBoxPcd.addItemListener(this);
-
- this.jCheckBoxFlashMap.addItemListener(this);
- }
-
- public void insertUpdate(DocumentEvent e) {
- this.omt.setSaved(false);
- }
-
- public void removeUpdate(DocumentEvent e) {
- this.omt.setSaved(false);
- }
-
- public void changedUpdate(DocumentEvent e) {
- // Do nothing
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BootModesDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BootModesDlg.java
deleted file mode 100644
index 5b5f49dc59..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BootModesDlg.java
+++ /dev/null
@@ -1,445 +0,0 @@
-/** @file
- <<The file is used to create, update BootModes of MSA file>>
-
- <<The BootModesDlg is called to add or edit a Module's Boot Modes definitions.>>
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- Package Name: Tools
- Module Name: FrameworkWizard
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.BootModes.BootModesIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update BootModes of MSA/MBD file
- *
- * It extends IDialog
- *
- */
-public class BootModesDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -3888558623432442561L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelBootModeName = null;
-
- private JComboBox jComboBoxBootModeName = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private BootModesIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- * This method initializes jComboBoxBootModeName
- *
- * @return javax.swing.JComboBox jComboBoxBootModeName
- *
- */
- private JComboBox getJComboBoxBootModeName() {
- if (jComboBoxBootModeName == null) {
- jComboBoxBootModeName = new JComboBox();
- jComboBoxBootModeName.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jComboBoxBootModeName.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxBootModeName
- .setToolTipText("<html><table>"
- + "<tr><td>FULL</td><td>Boot with full configuration</td></tr>"
- + "<tr><td>MINIMAL</td><td>Boot with minimal configuration</td></tr>"
- + "<tr><td>NO_CHANGE</td><td>Boot assuming no configuration changes</td></tr>"
- + "<tr><td>DIAGNOSTICS</td><td>Boot with full configuration plus diagnostics</td></tr>"
- + "<tr><td>DEFAULT</td><td>Boot with default settings</td></tr>"
- + "<tr><td>BOOT_ON_S#_RESUME</td><td>where # is 2, 3, 4 or 5</td></tr>"
- + "<tr><td>FLASH_UPDATE</td><td>Boot on flash update</td></tr>"
- + "<tr><td>RECOVERY</td><td>Boot in recovery mode</td></tr>"
- + "</table></html>");
- }
- return jComboBoxBootModeName;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>Indicates Supports the specified boot mode</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>Indicates Supports the specified boot mode on some execution paths</td></tr>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>Always changes the boot mode</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>Change the boot mode sometimes</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 62));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 162, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 162, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 235);
- this.setContentPane(getJScrollPane());
- this.setTitle("Boot Modes");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inBootModesId
- *
- */
- private void init(BootModesIdentification inBootModesId, ModuleIdentification mid) {
- init();
- this.id = inBootModesId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- if (this.id != null) {
- this.jComboBoxBootModeName.setSelectedItem(id.getName());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inBootModesIdentification
- * @param iFrame
- *
- */
- public BootModesDlg(BootModesIdentification inBootModesIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inBootModesIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jComboBoxBootModeName.setEnabled(!isView);
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelBootModeName = new JLabel();
- jLabelBootModeName.setText("Boot Mode Name");
- jLabelBootModeName.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelHelpText.setText("Help Text");
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 132, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 107, 155, 20));
- jLabelArch.setText("Supported Archectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 107, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(480, 180));
-
- jContentPane.add(jLabelBootModeName, null);
- jContentPane.add(getJComboBoxBootModeName(), null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
-
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes BootModeName groups and Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxBootModeName, ed.getVBootModeNames());
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVBootModeUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentBootModes();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Boot Modes", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private BootModesIdentification getCurrentBootModes() {
- String arg0 = this.jComboBoxBootModeName.getSelectedItem().toString();
- String arg1 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg2 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
- String arg4 = this.jTextAreaHelpText.getText();
- id = new BootModesIdentification(arg0, arg1, arg2, arg3, arg4);
- return id;
- }
-
- public BootModesIdentification getId() {
- return id;
- }
-
- public void setId(BootModesIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BuildOptionsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BuildOptionsDlg.java
deleted file mode 100644
index a4bad7e40a..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BuildOptionsDlg.java
+++ /dev/null
@@ -1,495 +0,0 @@
-/** @file
-
- The file is used to create, update SourceFiles section of the MSA file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.BuildOptions.BuildOptionsIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update SourceFiles section of the MSA file
- *
- * It extends IDialog
- *
- **/
-public class BuildOptionsDlg extends IDialog {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -6765742852142775378L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelFileName = null;
-
- private JTextField jTextFieldFileOption = null;
-
- private JLabel jLabelToolChainFamily = null;
-
- private StarLabel jStarLabel1 = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelTagName = null;
-
- private JTextField jTextFieldTagName = null;
-
- private JLabel jLabelToolCode = null;
-
- private JTextField jTextFieldToolCode = null;
-
- private IComboBox iComboBoxToolCode = null;
-
- private JTextField jTextFieldToolChainFamily = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- private JScrollPane jScrollPaneBuildTargets = null;
-
- private ICheckBoxList iCheckBoxListBuildTargets = null;
-
- //
- // Not used by UI
- //
- private BuildOptionsIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private JLabel jLabelBuildTargets = null;
-
- /**
- This method initializes jTextFieldFileOption
-
- @return javax.swing.JTextField jTextFieldFileOption
-
- **/
- private JTextField getJTextFieldSourceFilesDirectory() {
- if (jTextFieldFileOption == null) {
- jTextFieldFileOption = new JTextField();
- jTextFieldFileOption.setBounds(new java.awt.Rectangle(168, 12, 340, 20));
- jTextFieldFileOption.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldFileOption.setToolTipText("Path is relative to the MSA file and must include the file name");
- }
- return jTextFieldFileOption;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextFieldTagName
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldTagName() {
- if (jTextFieldTagName == null) {
- jTextFieldTagName = new JTextField();
- jTextFieldTagName.setBounds(new java.awt.Rectangle(168, 37, 340, 20));
- jTextFieldTagName.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldTagName.setToolTipText("You may specify a specific tool chain tag name, such as BILL1");
- }
- return jTextFieldTagName;
- }
-
- private IComboBox getIComboBoxToolCode() {
- if (iComboBoxToolCode == null) {
- iComboBoxToolCode = new IComboBox();
- iComboBoxToolCode.setBounds(new java.awt.Rectangle(168, 62, 340, 20));
- iComboBoxToolCode.setPreferredSize(new java.awt.Dimension(340, 20));
- iComboBoxToolCode.setToolTipText("<html>You may select a specific tool command from drop down list,<br>"
- + "or you can DOUBLE-CLICK this field to enter your customized<br>"
- + "tool command.<br>"
- + "Press ENTER to save your input or press ESCAPE to quit</html>");
- }
- return iComboBoxToolCode;
- }
-
- /**
- * This method initializes jTextFieldToolCode
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldToolCode() {
- if (jTextFieldToolCode == null) {
- jTextFieldToolCode = new JTextField();
- jTextFieldToolCode.setBounds(new java.awt.Rectangle(168, 62, 340, 20));
- jTextFieldToolCode.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldToolCode.setToolTipText("You may specify a specific tool command, such as ASM");
- jTextFieldToolCode.setVisible(false);
- }
- return jTextFieldToolCode;
- }
-
- /**
- * This method initializes jTextFieldToolChainFamily
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldToolChainFamily() {
- if (jTextFieldToolChainFamily == null) {
- jTextFieldToolChainFamily = new JTextField();
- jTextFieldToolChainFamily.setBounds(new java.awt.Rectangle(168, 87, 340, 20));
- jTextFieldToolChainFamily.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldToolChainFamily.setToolTipText("You may specify a specific tool chain family, such as GCC");
- }
- return jTextFieldToolChainFamily;
- }
-
- /**
- This method initializes jButtonOk
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(317, 202, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- This method initializes jButtonCancel
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(412, 202, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- This method initializes iCheckBoxListArch
-
- @return ICheckBoxList
- **/
- private ICheckBoxList getICheckBoxListSupModuleList() {
- if (iCheckBoxListBuildTargets == null) {
- iCheckBoxListBuildTargets = new ICheckBoxList();
- }
- return iCheckBoxListBuildTargets;
- }
-
- /**
- This method initializes jScrollPaneBuildTargets
-
- @return javax.swing.JScrollPane
-
- **/
- private JScrollPane getJScrollPaneBuildTargets() {
- if (jScrollPaneBuildTargets == null) {
- jScrollPaneBuildTargets = new JScrollPane();
- jScrollPaneBuildTargets.setBounds(new java.awt.Rectangle(168, 137, 340, 40));
- jScrollPaneBuildTargets.setPreferredSize(new java.awt.Dimension(340, 40));
- jScrollPaneBuildTargets.setViewportView(getICheckBoxListSupModuleList());
- }
- return jScrollPaneBuildTargets;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This is the default constructor
-
- **/
- public BuildOptionsDlg(BuildOptionsIdentification inBuildOptionsIdentification, IFrame iFrame,
- ModuleIdentification mid) {
- super(iFrame, true);
- init(inBuildOptionsIdentification, mid);
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(525, 270);
- this.setContentPane(getJScrollPane());
- this.setTitle("Source Files");
- this.setViewMode(false);
- this.centerWindow();
- Tools.generateComboBoxByVector(iComboBoxToolCode, ed.getVToolCode());
- this.iCheckBoxListBuildTargets.setAllItems(ed.getVBuildTargets());
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
-
- @param inSourceFiles The input data of SourceFilesDocument.SourceFiles
-
- **/
- private void init(BuildOptionsIdentification inBuildOptionsIdentification, ModuleIdentification mid) {
- init();
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- if (inBuildOptionsIdentification != null) {
- this.jTextFieldFileOption.setText(inBuildOptionsIdentification.getOption());
- this.jTextFieldTagName.setText(inBuildOptionsIdentification.getTagName());
-
- //
- // Generate Tool Code selection list
- //
- Vector<String> v = ed.getVToolCode();
- boolean isFind = false;
- String strToolCode = inBuildOptionsIdentification.getToolCode();
-
- //
- // If the input value is not in the default list, add it to the list
- //
- if (strToolCode != null) {
- for (int index = 0; index < v.size(); index++) {
- if (v.elementAt(index).equals(strToolCode)) {
- isFind = true;
- break;
- }
- }
- if (!isFind && !isEmpty(strToolCode)) {
- v.addElement(strToolCode);
- }
- }
-
- Tools.generateComboBoxByVector(iComboBoxToolCode, v);
- this.iComboBoxToolCode.setSelectedItem(strToolCode);
-
- this.jTextFieldToolChainFamily.setText(inBuildOptionsIdentification.getToolChainFamily());
-
- this.jArchCheckBox.setSelectedItems(inBuildOptionsIdentification.getSupArchList());
-
- this.iCheckBoxListBuildTargets.setAllItemsUnchecked();
- this.iCheckBoxListBuildTargets.initCheckedItem(true, inBuildOptionsIdentification.getBuildTargets());
- }
- }
-
- /**
- Disable all components when the mode is view
-
- @param isView true - The view mode; false - The non-view mode
-
- **/
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldFileOption.setEnabled(!isView);
- }
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabelBuildTargets = new JLabel();
- jLabelBuildTargets.setBounds(new java.awt.Rectangle(12, 137, 155, 20));
- jLabelBuildTargets.setText("Build Targets");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 112, 340, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(340, 20));
- jLabelToolCode = new JLabel();
- jLabelToolCode.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelToolCode.setText("Tool Code");
- jLabelTagName = new JLabel();
- jLabelTagName.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
- jLabelTagName.setText("Tag Name");
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 112, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jLabelToolChainFamily = new JLabel();
- jLabelToolChainFamily.setBounds(new java.awt.Rectangle(12, 87, 155, 20));
- jLabelToolChainFamily.setText("Tool Chain Family");
- jLabelFileName = new JLabel();
- jLabelFileName.setText("Option String");
- jLabelFileName.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(505, 222));
-
- jContentPane.add(jLabelFileName, null);
- jContentPane.add(getJTextFieldSourceFilesDirectory(), null);
- jContentPane.add(jLabelToolChainFamily, null);
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(0, 10));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jLabelTagName, null);
- jContentPane.add(getJTextFieldTagName(), null);
- jContentPane.add(jLabelToolCode, null);
- jContentPane.add(getJTextFieldToolCode(), null);
- jContentPane.add(getIComboBoxToolCode(), null);
- jContentPane.add(getJTextFieldToolChainFamily(), null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(jLabelBuildTargets, null);
- jContentPane.add(getJScrollPaneBuildTargets(), null);
- }
- return jContentPane;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentId();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- private BuildOptionsIdentification getCurrentId() {
- String arg0 = this.jTextFieldFileOption.getText();
- Vector<String> arg1 = this.iCheckBoxListBuildTargets.getAllCheckedItemsString();
- String arg2 = this.jTextFieldToolChainFamily.getText();
- String arg3 = this.jTextFieldTagName.getText();
- String arg4 = this.iComboBoxToolCode.getSelectedItem().toString();
- if (arg4.equals(DataType.EMPTY_SELECT_ITEM)) {
- arg4 = "";
- }
- Vector<String> arg5 = this.jArchCheckBox.getSelectedItemsVector();
-
- id = new BuildOptionsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- return id;
- }
-
- /**
- Data validation for all fields
-
- @retval true - All datas are valid
- @retval false - At least one data is invalid
-
- **/
- public boolean checkAdd() {
- //
- // Check Option
- //
- if (isEmpty(this.jTextFieldFileOption.getText())) {
- Log.wrn("Update Build Options", "Option String must be entered!");
- return false;
- }
-
- //
- // Check TagName
- //
- if (!isEmpty(this.jTextFieldTagName.getText())) {
- if (!DataValidation.isTagName(this.jTextFieldTagName.getText())) {
- Log.wrn("Update Build Options", "Incorrect data type for Tag Name");
- return false;
- }
- }
-
- //
- // Check ToolCode
- //
- if (!isEmpty(this.jTextFieldToolCode.getText())) {
- if (!DataValidation.isToolCode(this.jTextFieldToolCode.getText())) {
- Log.wrn("Update Build Options", "Incorrect data type for Tool Code");
- return false;
- }
- }
-
- //
- // Check ToolChainFamily
- //
- if (!isEmpty(this.jTextFieldToolChainFamily.getText())) {
- if (!DataValidation.isToolChainFamily(this.jTextFieldToolChainFamily.getText())) {
- Log.wrn("Update Build Options", "Incorrect data type for Tool Chain Family");
- return false;
- }
- }
-
- return true;
- }
-
- public BuildOptionsIdentification getId() {
- return id;
- }
-
- public void setId(BuildOptionsIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/DataHubsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/DataHubsDlg.java
deleted file mode 100644
index a3c6c63838..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/DataHubsDlg.java
+++ /dev/null
@@ -1,452 +0,0 @@
-/** @file
- <<The file is used to create, update Data Hub Record entries in a MSA file.>>
-
- <<The DataHbsDlg is a dialog called to add or edit a Data Hub Record within a MSA file.>>
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- Package Name: Tools
- Module Name: FrameworkWizard
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.DataHubs.DataHubsIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update DataHub of the MSA file
- *
- * It extends IDialog
- *
- */
-public class DataHubsDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -3667906991966638892L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private JLabel jLabelDataHubRecord = null;
-
- private JTextField jTextFieldDataHubRecord = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private DataHubsIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- * This method initializes jTextFieldDataHubRecord
- *
- * @return javax.swing.JTextField jTextFieldDataHubRecord
- *
- */
- private JTextField getJTextFieldDataHubRecord() {
- if (jTextFieldDataHubRecord == null) {
- jTextFieldDataHubRecord = new JTextField();
- jTextFieldDataHubRecord.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jTextFieldDataHubRecord.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldDataHubRecord.setToolTipText("Enter the C Name of the Data Hub Record");
- }
- return jTextFieldDataHubRecord;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>Module always consumes a Data Hub Entry<br>via registering a filter driver.</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>Module will use a Data Hub Entry if it exists<br>via registering a filter driver</td></tr>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>Always logs data into the Data Hub</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>Log data into the Data Hub under<br>certain circumstances</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 62));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 162, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 162, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 235);
- this.setContentPane(getJScrollPane());
- this.setTitle("Data Hubs");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inDataHubsId
- *
- */
- private void init(DataHubsIdentification inDataHubsId, ModuleIdentification mid) {
- init();
- this.id = inDataHubsId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- if (this.id != null) {
- this.jTextFieldDataHubRecord.setText(id.getName());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inDataHubsIdentification
- * @param iFrame
- *
- */
- public DataHubsDlg(DataHubsIdentification inDataHubsIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inDataHubsIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldDataHubRecord.setEnabled(!isView);
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelDataHubRecord = new JLabel();
- jLabelDataHubRecord.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
- jLabelDataHubRecord.setText("Data Hub Record");
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelHelpText.setText("Help Text");
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 132, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 107, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 107, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(480, 180));
-
- jContentPane.add(jLabelDataHubRecord, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(jLabelArch, null);
-
- jContentPane.add(getJTextFieldDataHubRecord(), null);
- jContentPane.add(getJComboBoxUsage(), null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel2, null);
-
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVDataHubUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentDataHubs();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check DataHubRecord
- //
- if (isEmpty(this.jTextFieldDataHubRecord.getText())) {
- Log.wrn("Update Hubs", "Data Hub Record must be entered!");
- return false;
- }
-
- if (!isEmpty(this.jTextFieldDataHubRecord.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldDataHubRecord.getText())) {
- Log.wrn("Update Hubs", "Incorrect data type for Data Hub Record");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Hubs", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private DataHubsIdentification getCurrentDataHubs() {
- String arg0 = this.jTextFieldDataHubRecord.getText();
- String arg1 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg2 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
- String arg4 = this.jTextAreaHelpText.getText();
-
- id = new DataHubsIdentification(arg0, arg1, arg2, arg3, arg4);
- return id;
- }
-
- public DataHubsIdentification getId() {
- return id;
- }
-
- public void setId(DataHubsIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.java
deleted file mode 100644
index 10e3a174ca..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.java
+++ /dev/null
@@ -1,546 +0,0 @@
-/** @file
-
- The file is used to create, update Events section of the MSA file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Events.EventsIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Events section of the MSA file
- * It extends IDialog
- *
- * @since ModuleEditor 1.0
- *
- */
-public class EventsDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -4396143706422842331L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelEventType = null;
-
- private JLabel jLabelC_Name = null;
-
- private IComboBox iComboBoxGuidC_Name = null;
-
- private JLabel jLabelUsage = null;
-
- private JLabel jLabelGroup = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private JComboBox jComboBoxEventGroup = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private StarLabel jStarLabel4 = null;
-
- private JComboBox jComboBoxEventsType = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelArch = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private EventsIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- * This method initializes jComboBoxType
- *
- * @return javax.swing.JComboBox jComboBoxType
- *
- */
- private JComboBox getJComboBoxEventsType() {
- if (jComboBoxEventsType == null) {
- jComboBoxEventsType = new JComboBox();
- jComboBoxEventsType.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jComboBoxEventsType.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxEventsType
- .setToolTipText("<html>Select CreateEvents if the Module has an event that is waiting to be signaled.<br>"
- + "Select SignalEvents if the Module will signal all events in an event group.<br>"
- + "NOTE: Signal events are named by GUID.</html>");
- }
- return jComboBoxEventsType;
- }
-
- /**
- * This method initializes jTextFieldC_Name
- *
- * @return javax.swing.JTextField jTextFieldC_Name
- *
- */
- private IComboBox getIComboBoxGuidC_Name() {
- if (iComboBoxGuidC_Name == null) {
- iComboBoxGuidC_Name = new IComboBox();
- iComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- iComboBoxGuidC_Name.setPreferredSize(new java.awt.Dimension(320, 20));
- iComboBoxGuidC_Name.setToolTipText("Select the GUID C Name of the Event");
- }
- return iComboBoxGuidC_Name;
- }
-
- /**
- * This method initializes jComboBoxEventsType
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getJComboBoxEventGroup() {
- if (jComboBoxEventGroup == null) {
- jComboBoxEventGroup = new JComboBox();
- jComboBoxEventGroup.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jComboBoxEventGroup.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxEventGroup.setToolTipText("Select Type of Event: Guid or Timer.");
-
- }
- return jComboBoxEventGroup;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 87, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td colspan=2 align=center><b>Create Events</b></td></tr>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>Module registers a notification function and REQUIRES that it be<br>"
- + "executed for the module to fully function.</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>Module registers a notification function and calls the function<br>"
- + "when it is signaled</td></tr><tr><td colspan=2 align=center><b>Signal Events</b></td></tr>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>Module will Always signal the event</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>Module will sometimes signal the event</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 182, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 112));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 212, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 212, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 280);
- this.setContentPane(getJScrollPane());
- this.setTitle("Events");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inEventsId
- *
- */
- private void init(EventsIdentification inEventsId, ModuleIdentification mid) {
- init();
- this.id = inEventsId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined guids from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log
- .wrn("Init Guid",
- "This module hasn't defined any package dependency, so there is no guid value can be added for event");
- }
- //
- // Init guids drop down list
- //
- Tools
- .generateComboBoxByVector(iComboBoxGuidC_Name,
- wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_EVENT));
-
- this.iComboBoxGuidC_Name.insertItemAt(DataType.EMPTY_SELECT_ITEM, 0);
- this.iComboBoxGuidC_Name.setSelectedIndex(0);
-
- if (this.id != null) {
- String tmpName = id.getName();
- if (isEmpty(tmpName)) {
- tmpName = DataType.EMPTY_SELECT_ITEM;
- }
-
- this.iComboBoxGuidC_Name.setSelectedItem(tmpName);
- this.jComboBoxEventsType.setSelectedItem(id.getType());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
-
- jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- this.jComboBoxEventGroup.setSelectedItem(id.getGroup());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inEventsIdentification
- * @param iFrame
- *
- */
- public EventsDlg(EventsIdentification inEventsIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inEventsIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.iComboBoxGuidC_Name.setEnabled(!isView);
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelEventType = new JLabel();
- jLabelEventType.setText("Select Event Type");
- jLabelEventType.setBounds(new java.awt.Rectangle(12, 12, 168, 20));
-
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelC_Name = new JLabel();
- jLabelC_Name.setText("Guid C Name");
- jLabelC_Name.setBounds(new java.awt.Rectangle(12, 37, 168, 20));
-
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(2, 62));
- jLabelGroup = new JLabel();
- jLabelGroup.setText("Event Group Type");
- jLabelGroup.setBounds(new java.awt.Rectangle(12, 62, 168, 20));
-
- jStarLabel4 = new StarLabel();
- jStarLabel4.setLocation(new java.awt.Point(2, 87));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 87, 168, 20));
-
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 112, 168, 20));
- jLabelHelpText.setText("Help Text");
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 182, 168, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 157, 168, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 157, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(485, 235));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelEventType, null);
- jContentPane.add(getJComboBoxEventsType(), null);
- //jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelC_Name, null);
- jContentPane.add(getIComboBoxGuidC_Name(), null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jLabelGroup, null);
- jContentPane.add(getJComboBoxEventGroup(), null);
- jContentPane.add(jStarLabel4, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
-
- }
- return jContentPane;
- }
-
- /**
- * This method initializes events groups and usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxEventsType, ed.getVEventType());
- Tools.generateComboBoxByVector(jComboBoxEventGroup, ed.getVEventGroup());
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVEventUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentEvents();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check Name
- //
- String tmpName = this.iComboBoxGuidC_Name.getSelectedItem().toString();
- if (!tmpName.equals(DataType.EMPTY_SELECT_ITEM) && isEmpty(tmpName)) {
- if (!DataValidation.isC_NameType(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {
- Log.wrn("Update Events", "Incorrect data type for Event Name");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Events", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private EventsIdentification getCurrentEvents() {
- String arg0 = this.iComboBoxGuidC_Name.getSelectedItem().toString();
- String arg1 = this.jComboBoxEventsType.getSelectedItem().toString();
- String arg2 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg3 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();
- String arg5 = this.jTextAreaHelpText.getText();
- String arg6 = this.jComboBoxEventGroup.getSelectedItem().toString();
- id = new EventsIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
- return id;
- }
-
- public EventsIdentification getId() {
- return id;
- }
-
- public void setId(EventsIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java
deleted file mode 100644
index 3aa9b4a297..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java
+++ /dev/null
@@ -1,948 +0,0 @@
-/** @file
-
- The file is used to create, update Externs section of the MSA file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Externs.ExternsIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Externs section of the MSA file
- *
- * It extends IDialog
- *
- */
-public class ExternsDlg extends IDialog implements ItemListener {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -7382008402932047191L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelName = null;
-
- private JComboBox jComboBoxType = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelSpecification = null;
-
- private JTextField jTextFieldSpecification = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- private StarLabel jStarLabel1 = null;
-
- private JPanel jPanelSpecification = null;
-
- private JPanel jPanelImage = null;
-
- private JPanel jPanelDriver = null;
-
- private JPanel jPanelLibrary = null;
-
- private JPanel jPanelCallBack = null;
-
- private JLabel jLabelModuleEntryPoint = null;
-
- private JTextField jTextFieldModuleEntryPoint = null;
-
- private JLabel jLabelModuleUnloadImage = null;
-
- private JTextField jTextFieldModuleUnloadImage = null;
-
- private JLabel jLabelDriverBinding = null;
-
- private JTextField jTextFieldDriverBinding = null;
-
- private JLabel jLabelComponentName = null;
-
- private JTextField jTextFieldComponentName = null;
-
- private JLabel jLabelDriverConfig = null;
-
- private JTextField jTextFieldDriverConfig = null;
-
- private JLabel jLabelDriverDiagnostic = null;
-
- private JTextField jTextFieldDriverDiagnostic = null;
-
- private JLabel jLabelConstructor = null;
-
- private JTextField jTextFieldConstructor = null;
-
- private JLabel jLabelDestructor = null;
-
- private JTextField jTextFieldDestructor = null;
-
- private JLabel jLabelVirtualAddressMap = null;
-
- private JTextField jTextFieldVirtualAddressMap = null;
-
- private JLabel jLabelExitBootServices = null;
-
- private JTextField jTextFieldExitBootServices = null;
-
- //
- // Not used by UI
- //
- private ExternsIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private Vector<String> vArchList = new Vector<String>();
-
- /**
- This method initializes jComboBoxType
-
- @return javax.swing.JComboBox jComboBoxType
-
- **/
- private JComboBox getJComboBoxType() {
- if (jComboBoxType == null) {
- jComboBoxType = new JComboBox();
- jComboBoxType.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jComboBoxType.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxType.addItemListener(this);
- }
- return jComboBoxType;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jTextFieldC_Name
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldSpecification() {
- if (jTextFieldSpecification == null) {
- jTextFieldSpecification = new JTextField();
- jTextFieldSpecification.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldSpecification.setBounds(new java.awt.Rectangle(168, 0, 320, 20));
- }
- return jTextFieldSpecification;
- }
-
- /**
- This method initializes jTextFieldFeatureFlag
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 87, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- This method initializes jButtonOk
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(300, 187, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- This method initializes jButtonCancel
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(400, 187, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jPanelSpecification
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelSpecification() {
- if (jPanelSpecification == null) {
- jPanelSpecification = new JPanel();
- jPanelSpecification.setBounds(new java.awt.Rectangle(0, 37, 505, 20));
- jPanelSpecification.setLayout(null);
-
- jLabelSpecification = new JLabel();
- jLabelSpecification.setBounds(new java.awt.Rectangle(12, 0, 140, 20));
- jLabelSpecification.setText("Specification Name");
-
- jPanelSpecification.add(jLabelSpecification, null);
- jPanelSpecification.add(getJTextFieldSpecification(), null);
- }
- return jPanelSpecification;
- }
-
- /**
- * This method initializes jPanelImage
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelImage() {
- if (jPanelImage == null) {
- jLabelModuleUnloadImage = new JLabel();
- jLabelModuleUnloadImage.setBounds(new java.awt.Rectangle(12, 25, 140, 20));
- jLabelModuleUnloadImage.setText("Module Unload Image");
- jLabelModuleEntryPoint = new JLabel();
- jLabelModuleEntryPoint.setBounds(new java.awt.Rectangle(12, 0, 140, 20));
- jLabelModuleEntryPoint.setText("Module Entry Point");
- jPanelImage = new JPanel();
- jPanelImage.setBounds(new java.awt.Rectangle(0, 37, 505, 45));
- jPanelImage.setLayout(null);
- jPanelImage.add(jLabelModuleEntryPoint, null);
- jPanelImage.add(getJTextFieldModuleEntryPoint(), null);
- jPanelImage.add(jLabelModuleUnloadImage, null);
- jPanelImage.add(getJTextFieldModuleUnloadImage(), null);
- }
- return jPanelImage;
- }
-
- /**
- * This method initializes jPanelDriver
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelDriver() {
- if (jPanelDriver == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(0, 0));
- jLabelDriverDiagnostic = new JLabel();
- jLabelDriverDiagnostic.setBounds(new java.awt.Rectangle(12, 75, 140, 20));
- jLabelDriverDiagnostic.setText("Driver Diagnostic");
- jLabelDriverConfig = new JLabel();
- jLabelDriverConfig.setBounds(new java.awt.Rectangle(12, 50, 140, 20));
- jLabelDriverConfig.setText("Driver Config");
- jLabelComponentName = new JLabel();
- jLabelComponentName.setBounds(new java.awt.Rectangle(12, 25, 140, 20));
- jLabelComponentName.setText("Component Name");
- jLabelDriverBinding = new JLabel();
- jLabelDriverBinding.setBounds(new java.awt.Rectangle(12, 0, 140, 20));
- jLabelDriverBinding.setText("Driver Binding");
- jPanelDriver = new JPanel();
- jPanelDriver.setBounds(new java.awt.Rectangle(0, 37, 505, 95));
- jPanelDriver.setLayout(null);
- jPanelDriver.add(jStarLabel1, null);
- jPanelDriver.add(jLabelDriverBinding, null);
- jPanelDriver.add(getJTextFieldDriverBinding(), null);
- jPanelDriver.add(jLabelComponentName, null);
- jPanelDriver.add(getJTextFieldComponentName(), null);
- jPanelDriver.add(jLabelDriverConfig, null);
- jPanelDriver.add(getJTextFieldDriverConfig(), null);
- jPanelDriver.add(jLabelDriverDiagnostic, null);
- jPanelDriver.add(getJTextFieldDriverDiagnostic(), null);
- }
- return jPanelDriver;
- }
-
- /**
- * This method initializes jPanelLibrary
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelLibrary() {
- if (jPanelLibrary == null) {
- jLabelDestructor = new JLabel();
- jLabelDestructor.setBounds(new java.awt.Rectangle(12, 25, 140, 20));
- jLabelDestructor.setText("Destructor");
- jLabelConstructor = new JLabel();
- jLabelConstructor.setBounds(new java.awt.Rectangle(12, 0, 140, 20));
- jLabelConstructor.setText("Constructor");
- jPanelLibrary = new JPanel();
- jPanelLibrary.setBounds(new java.awt.Rectangle(0, 37, 505, 45));
- jPanelLibrary.setLayout(null);
- jPanelLibrary.add(jLabelConstructor, null);
- jPanelLibrary.add(getJTextFieldConstructor(), null);
- jPanelLibrary.add(jLabelDestructor, null);
- jPanelLibrary.add(getJTextFieldDestructor(), null);
- }
- return jPanelLibrary;
- }
-
- /**
- * This method initializes jPanelCallBack
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelCallBack() {
- if (jPanelCallBack == null) {
- jLabelExitBootServices = new JLabel();
- jLabelExitBootServices.setBounds(new java.awt.Rectangle(12, 25, 140, 20));
- jLabelExitBootServices.setText("Exit Boot Services");
- jLabelVirtualAddressMap = new JLabel();
- jLabelVirtualAddressMap.setBounds(new java.awt.Rectangle(12, 0, 140, 20));
- jLabelVirtualAddressMap.setText("Virtual Address Map");
- jPanelCallBack = new JPanel();
- jPanelCallBack.setBounds(new java.awt.Rectangle(0, 37, 505, 45));
- jPanelCallBack.setLayout(null);
- jPanelCallBack.add(jLabelVirtualAddressMap, null);
- jPanelCallBack.add(getJTextFieldVirtualAddressMap(), null);
- jPanelCallBack.add(jLabelExitBootServices, null);
- jPanelCallBack.add(getJTextFieldExitBootServices(), null);
- }
- return jPanelCallBack;
- }
-
- /**
- * This method initializes jTextFieldModuleEntryPoint
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldModuleEntryPoint() {
- if (jTextFieldModuleEntryPoint == null) {
- jTextFieldModuleEntryPoint = new JTextField();
- jTextFieldModuleEntryPoint.setBounds(new java.awt.Rectangle(168, 0, 320, 20));
- }
- return jTextFieldModuleEntryPoint;
- }
-
- /**
- * This method initializes jTextFieldModuleUnloadImage
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldModuleUnloadImage() {
- if (jTextFieldModuleUnloadImage == null) {
- jTextFieldModuleUnloadImage = new JTextField();
- jTextFieldModuleUnloadImage.setBounds(new java.awt.Rectangle(168, 25, 320, 20));
- }
- return jTextFieldModuleUnloadImage;
- }
-
- /**
- * This method initializes jTextFieldDriverBinding
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldDriverBinding() {
- if (jTextFieldDriverBinding == null) {
- jTextFieldDriverBinding = new JTextField();
- jTextFieldDriverBinding.setBounds(new java.awt.Rectangle(168, 0, 320, 20));
- }
- return jTextFieldDriverBinding;
- }
-
- /**
- * This method initializes jTextFieldComponentName
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldComponentName() {
- if (jTextFieldComponentName == null) {
- jTextFieldComponentName = new JTextField();
- jTextFieldComponentName.setBounds(new java.awt.Rectangle(168, 25, 320, 20));
- }
- return jTextFieldComponentName;
- }
-
- /**
- * This method initializes jTextFieldDriverConfig
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldDriverConfig() {
- if (jTextFieldDriverConfig == null) {
- jTextFieldDriverConfig = new JTextField();
- jTextFieldDriverConfig.setBounds(new java.awt.Rectangle(168, 50, 320, 20));
- }
- return jTextFieldDriverConfig;
- }
-
- /**
- * This method initializes jTextFieldDriverDiagnostic
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldDriverDiagnostic() {
- if (jTextFieldDriverDiagnostic == null) {
- jTextFieldDriverDiagnostic = new JTextField();
- jTextFieldDriverDiagnostic.setBounds(new java.awt.Rectangle(168, 75, 320, 20));
- }
- return jTextFieldDriverDiagnostic;
- }
-
- /**
- * This method initializes jTextFieldConstructor
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldConstructor() {
- if (jTextFieldConstructor == null) {
- jTextFieldConstructor = new JTextField();
- jTextFieldConstructor.setBounds(new java.awt.Rectangle(168, 0, 320, 20));
- }
- return jTextFieldConstructor;
- }
-
- /**
- * This method initializes jTextFieldDestructor
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldDestructor() {
- if (jTextFieldDestructor == null) {
- jTextFieldDestructor = new JTextField();
- jTextFieldDestructor.setBounds(new java.awt.Rectangle(168, 25, 320, 20));
- }
- return jTextFieldDestructor;
- }
-
- /**
- * This method initializes jTextFieldVirtualAddressMap
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldVirtualAddressMap() {
- if (jTextFieldVirtualAddressMap == null) {
- jTextFieldVirtualAddressMap = new JTextField();
- jTextFieldVirtualAddressMap.setBounds(new java.awt.Rectangle(168, 0, 320, 20));
- }
- return jTextFieldVirtualAddressMap;
- }
-
- /**
- * This method initializes jTextFieldExitBootServices
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldExitBootServices() {
- if (jTextFieldExitBootServices == null) {
- jTextFieldExitBootServices = new JTextField();
- jTextFieldExitBootServices.setBounds(new java.awt.Rectangle(168, 25, 320, 20));
- }
- return jTextFieldExitBootServices;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(515, 250);
- this.setContentPane(getJScrollPane());
- this.setTitle("Externs");
- initFrame();
- this.centerWindow();
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inExternsId
-
- **/
- private void init(ExternsIdentification inExternsId, ModuleIdentification mid) {
- init();
- this.id = inExternsId;
-
- //
- // Init arch with module's arch
- //
- this.vArchList = wt.getModuleArch(mid);
-
- if (this.id != null) {
- String type = id.getType();
- //
- // Filter the type to lock down the type
- //
- this.jComboBoxType.removeAllItems();
- this.jComboBoxType.addItem(type);
-
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
-
- //
- // Init specification
- //
- if (type.equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- this.jTextFieldSpecification.setText(id.getName0());
- }
-
- //
- // Init image
- //
- if (type.equals(EnumerationData.EXTERNS_IMAGE)) {
- this.jTextFieldModuleEntryPoint.setText(id.getName0());
- this.jTextFieldModuleUnloadImage.setText(id.getName1());
- }
-
- //
- // Init library
- //
- if (type.equals(EnumerationData.EXTERNS_LIBRARY)) {
- this.jTextFieldConstructor.setText(id.getName0());
- this.jTextFieldDestructor.setText(id.getName1());
- }
-
- //
- // Init driver
- //
- if (type.equals(EnumerationData.EXTERNS_DRIVER)) {
- this.jTextFieldDriverBinding.setText(id.getName0());
- this.jTextFieldComponentName.setText(id.getName1());
- this.jTextFieldDriverConfig.setText(id.getName2());
- this.jTextFieldDriverDiagnostic.setText(id.getName3());
- }
-
- //
- // Init library
- //
- if (type.equals(EnumerationData.EXTERNS_CALL_BACK)) {
- this.jTextFieldVirtualAddressMap.setText(id.getName0());
- this.jTextFieldExitBootServices.setText(id.getName1());
- }
- }
- }
-
- /**
- This is the override edit constructor
-
- @param inBootModesIdentification
- @param iFrame
-
- **/
- public ExternsDlg(ExternsIdentification inExternsIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inExternsIdentification, mid);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jLabelName = new JLabel();
- jLabelName.setText("Choose Extern Type");
- jLabelName.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 87, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(505, 200));
-
- jContentPane.add(jLabelName, null);
- jContentPane.add(getJComboBoxType(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
-
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
-
- jContentPane.add(getJPanelSpecification(), null);
- jContentPane.add(getJPanelImage(), null);
- jContentPane.add(getJPanelDriver(), null);
- jContentPane.add(getJPanelLibrary(), null);
- jContentPane.add(getJPanelCallBack(), null);
- }
- return jContentPane;
- }
-
- /**
- This method initializes Usage type and Externs type
-
- **/
- private void initFrame() {
- Tools.generateComboBoxByVector(this.jComboBoxType, ed.getVExternTypes());
- this.jPanelSpecification.setVisible(true);
- this.jPanelImage.setVisible(false);
- this.jPanelLibrary.setVisible(false);
- this.jPanelDriver.setVisible(false);
- this.jPanelCallBack.setVisible(false);
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- this.getCurrentExterns();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- Data validation for all fields
-
- @retval true - All datas are valid
- @retval false - At least one data is invalid
-
- **/
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check specification
- //
- if (this.jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- if (isEmpty(this.jTextFieldSpecification.getText())) {
- Log.wrn("Update Externs", "Please type specification's name");
- return false;
- }
- if (!DataValidation.isSentence(this.jTextFieldSpecification.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Specification");
- return false;
- }
-
- //
- // No need to check feature flag, return true directly here.
- //
- return true;
- }
-
- //
- // Check image
- //
- if (this.jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_IMAGE)) {
- if (isEmpty(this.jTextFieldModuleEntryPoint.getText())
- && isEmpty(this.jTextFieldModuleUnloadImage.getText())) {
- Log.wrn("Update Externs", "At least one of ModuleEntryPoint or ModuleUnloadImage should have a value");
- return false;
- }
- if (!isEmpty(this.jTextFieldModuleEntryPoint.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldModuleEntryPoint.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Module Entry Point");
- return false;
- }
- }
- if (!isEmpty(this.jTextFieldModuleUnloadImage.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldModuleUnloadImage.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Module Unload Image");
- return false;
- }
- }
- }
-
- //
- // Check library
- //
- if (this.jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_LIBRARY)) {
- if (isEmpty(this.jTextFieldConstructor.getText()) && isEmpty(this.jTextFieldDestructor.getText())) {
- Log.wrn("Update Externs", "At least one of Constructor or Destructor should have a value");
- return false;
- }
- if (isEmpty(this.jTextFieldConstructor.getText()) && !isEmpty(this.jTextFieldDestructor.getText())) {
- Log.wrn("Update Externs", "You must define a Constructor at the same time when you declare a Destructor");
- return false;
- }
- if (!isEmpty(this.jTextFieldConstructor.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldConstructor.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Constructor");
- return false;
- }
- }
- if (!isEmpty(this.jTextFieldDestructor.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldDestructor.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Destructor");
- return false;
- }
- }
- }
-
- //
- // Check driver
- //
- if (this.jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_DRIVER)) {
- if (isEmpty(this.jTextFieldDriverBinding.getText())) {
- Log.wrn("Update Externs", "DriverBinding must have a value");
- return false;
- }
- if (!isEmpty(this.jTextFieldDriverBinding.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldDriverBinding.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for DriverBinding");
- return false;
- }
- }
- if (!isEmpty(this.jTextFieldComponentName.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldComponentName.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for ComponentName");
- return false;
- }
- }
- if (!isEmpty(this.jTextFieldDriverConfig.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldDriverConfig.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for DriverConfig");
- return false;
- }
- }
- if (!isEmpty(this.jTextFieldDriverDiagnostic.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldDriverDiagnostic.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for DriverDiagnostic");
- return false;
- }
- }
- }
-
- //
- // Check call back
- //
- if (this.jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_CALL_BACK)) {
- if (isEmpty(this.jTextFieldVirtualAddressMap.getText())
- && isEmpty(this.jTextFieldExitBootServices.getText())) {
- Log.wrn("Update Externs", "At least one of VirtualAddressMap or ExitBootServices should have a value");
- return false;
- }
- if (!isEmpty(this.jTextFieldVirtualAddressMap.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldVirtualAddressMap.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Virtual Address Map");
- return false;
- }
- }
- if (!isEmpty(this.jTextFieldExitBootServices.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldExitBootServices.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Exit Boot Services");
- return false;
- }
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private ExternsIdentification getCurrentExterns() {
- String arg0 = "";
- String arg1 = "";
- String arg2 = "";
- String arg3 = "";
-
- String type = this.jComboBoxType.getSelectedItem().toString();
- String featureFlag = this.jTextFieldFeatureFlag.getText();
- Vector<String> arch = this.jArchCheckBox.getSelectedItemsVector();
-
- if (type.equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- arg0 = this.jTextFieldSpecification.getText();
- id = new ExternsIdentification(arg0, type);
- }
-
- if (type.equals(EnumerationData.EXTERNS_IMAGE)) {
- arg0 = this.jTextFieldModuleEntryPoint.getText();
- arg1 = this.jTextFieldModuleUnloadImage.getText();
- id = new ExternsIdentification(arg0, arg1, type, featureFlag, arch);
- }
-
- if (type.equals(EnumerationData.EXTERNS_LIBRARY)) {
- arg0 = this.jTextFieldConstructor.getText();
- arg1 = this.jTextFieldDestructor.getText();
- id = new ExternsIdentification(arg0, arg1, type, featureFlag, arch);
- }
-
- if (type.equals(EnumerationData.EXTERNS_DRIVER)) {
- arg0 = this.jTextFieldDriverBinding.getText();
- arg1 = this.jTextFieldComponentName.getText();
- arg2 = this.jTextFieldDriverConfig.getText();
- arg3 = this.jTextFieldDriverDiagnostic.getText();
- id = new ExternsIdentification(arg0, arg1, arg2, arg3, type, featureFlag, arch);
- }
-
- if (type.equals(EnumerationData.EXTERNS_CALL_BACK)) {
- arg0 = this.jTextFieldVirtualAddressMap.getText();
- arg1 = this.jTextFieldExitBootServices.getText();
- id = new ExternsIdentification(arg0, arg1, type, featureFlag, arch);
- }
-
- return id;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
- *
- * Reflesh the frame when selected item changed
- *
- */
- public void itemStateChanged(ItemEvent arg0) {
- if (arg0.getSource() == jComboBoxType && arg0.getStateChange() == ItemEvent.SELECTED) {
- if (jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- this.jPanelSpecification.setVisible(true);
- this.jPanelImage.setVisible(false);
- this.jPanelLibrary.setVisible(false);
- this.jPanelDriver.setVisible(false);
- this.jPanelCallBack.setVisible(false);
- this.jLabelArch.setEnabled(false);
- this.jArchCheckBox.setAllItemsEnabled(false);
- this.jLabelArch.setLocation(12, 62);
- this.jArchCheckBox.setLocation(168, 62);
- this.jLabelFeatureFlag.setLocation(12, 87);
- this.jTextFieldFeatureFlag.setLocation(168, 87);
- } else if (jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_IMAGE)) {
- this.jPanelSpecification.setVisible(false);
- this.jPanelImage.setVisible(true);
- this.jPanelLibrary.setVisible(false);
- this.jPanelDriver.setVisible(false);
- this.jPanelCallBack.setVisible(false);
- this.jLabelArch.setEnabled(true);
- this.jArchCheckBox.setEnabledItems(this.vArchList);
- this.jLabelArch.setLocation(12, 87);
- this.jArchCheckBox.setLocation(168, 87);
- this.jLabelFeatureFlag.setLocation(12, 112);
- this.jTextFieldFeatureFlag.setLocation(168, 112);
- } else if (jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_LIBRARY)) {
- this.jPanelSpecification.setVisible(false);
- this.jPanelImage.setVisible(false);
- this.jPanelLibrary.setVisible(true);
- this.jPanelDriver.setVisible(false);
- this.jPanelCallBack.setVisible(false);
- this.jLabelArch.setEnabled(true);
- this.jArchCheckBox.setEnabledItems(this.vArchList);
- this.jLabelArch.setLocation(12, 87);
- this.jArchCheckBox.setLocation(168, 87);
- this.jLabelFeatureFlag.setLocation(12, 112);
- this.jTextFieldFeatureFlag.setLocation(168, 112);
- } else if (jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_DRIVER)) {
- this.jPanelSpecification.setVisible(false);
- this.jPanelImage.setVisible(false);
- this.jPanelLibrary.setVisible(false);
- this.jPanelDriver.setVisible(true);
- this.jPanelCallBack.setVisible(false);
- this.jLabelArch.setEnabled(true);
- this.jArchCheckBox.setEnabledItems(this.vArchList);
- this.jLabelArch.setLocation(12, 137);
- this.jArchCheckBox.setLocation(168, 137);
- this.jLabelFeatureFlag.setLocation(12, 162);
- this.jTextFieldFeatureFlag.setLocation(168, 162);
- } else if (jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_CALL_BACK)) {
- this.jPanelSpecification.setVisible(false);
- this.jPanelImage.setVisible(false);
- this.jPanelLibrary.setVisible(false);
- this.jPanelDriver.setVisible(false);
- this.jPanelCallBack.setVisible(true);
- this.jLabelArch.setEnabled(true);
- this.jArchCheckBox.setEnabledItems(this.vArchList);
- this.jLabelArch.setLocation(12, 87);
- this.jArchCheckBox.setLocation(168, 87);
- this.jLabelFeatureFlag.setLocation(12, 112);
- this.jTextFieldFeatureFlag.setLocation(168, 112);
- }
- }
- }
-
- public ExternsIdentification getId() {
- return id;
- }
-
- public void setId(ExternsIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java
deleted file mode 100644
index cf22e2c102..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java
+++ /dev/null
@@ -1,465 +0,0 @@
-/** @file
- <<The file is used to create, update Guids of the MSA file>>
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Guids of the MSA file
- *
- * It extends IDialog
- *
- */
-public class GuidsDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = 6710858997766979803L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelC_Name = null;
-
- private IComboBox iComboBoxCName = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private GuidsIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- * This method initializes jTextFieldC_Name
- *
- * @return javax.swing.JTextField jTextFieldC_Name
- *
- */
- private IComboBox getIComboBoxCName() {
- if (iComboBoxCName == null) {
- iComboBoxCName = new IComboBox();
- iComboBoxCName.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- iComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20));
- iComboBoxCName.setToolTipText("Select the C Name of the GUID");
- }
- return iComboBoxCName;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>Module always consumes the GUID</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>Module will use the GUID only if it is present</td></tr>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>Module always produces the GUID</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>Module will sometimes produce the GUID</td></tr>"
- + "<tr><td>DEFAULT</td><td>Default is the the GUID that specified the<br>instance of the package</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- *
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- *
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane jScrollPaneHelpText
- *
- **/
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 62));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 162, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 162, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- *
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 235);
- this.setContentPane(getJScrollPane());
- this.setTitle("Guids");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- *
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inGuidsId
- *
- */
- private void init(GuidsIdentification inGuidsId, ModuleIdentification mid) {
- init();
- this.id = inGuidsId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined guids from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log.wrn("Init Guid", "This module hasn't defined any package dependency, so there is no guid can be added");
- }
-
- Tools.generateComboBoxByVector(this.iComboBoxCName,
- wt.getAllGuidDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid),
- EnumerationData.GUID_TYPE_GUID));
-
-
- if (this.id != null) {
- this.iComboBoxCName.setSelectedItem(id.getName());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inGuidsIdentification
- * @param iFrame
- *
- */
- public GuidsDlg(GuidsIdentification inGuidsIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inGuidsIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelC_Name = new JLabel();
- jLabelC_Name.setText("Select GUID's C Name");
- jLabelC_Name.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
-
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
-
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelHelpText.setText("Help Text");
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 132, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 107, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 107, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(480, 180));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelC_Name, null);
- jContentPane.add(getIComboBoxCName(), null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVGuidUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentGuids();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check Name
- //
- if (this.iComboBoxCName.getSelectedItem() == null) {
- Log.wrn("Update Guids", "Please select one Guid Name");
- return false;
- }
-
- if (!isEmpty(this.iComboBoxCName.getSelectedItem().toString())) {
- if (!DataValidation.isC_NameType(this.iComboBoxCName.getSelectedItem().toString())) {
- Log.wrn("Update Guids", "Incorrect data type for Guid Name");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Guids", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private GuidsIdentification getCurrentGuids() {
- String arg0 = this.iComboBoxCName.getSelectedItem().toString();
- String arg1 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg2 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
- String arg4 = this.jTextAreaHelpText.getText();
-
- id = new GuidsIdentification(arg0, arg1, arg2, arg3, arg4);
- return id;
- }
-
- public GuidsIdentification getId() {
- return id;
- }
-
- public void setId(GuidsIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HiiPackagesDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HiiPackagesDlg.java
deleted file mode 100644
index 906be0b9ff..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HiiPackagesDlg.java
+++ /dev/null
@@ -1,461 +0,0 @@
-/** @file
-
- The file is used to create, update Hii Packages section of the MSA file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.HiiPackages.HiiPackagesIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Hii Packages of the MSA file
- *
- * It extends IDialog
- *
- */
-public class HiiPackagesDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -6851574146786158116L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelName = null;
-
- private JTextField jTextFieldName = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private HiiPackagesIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- *
- * This method initializes jTextFieldName
- *
- * @return javax.swing.JTextField jTextFieldName
- *
- */
- private JTextField getJTextFieldName() {
- if (jTextFieldName == null) {
- jTextFieldName = new JTextField();
- jTextFieldName.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jTextFieldName.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldName.setToolTipText("Enter the C Name of the HII Package");
- }
- return jTextFieldName;
- }
-
- /**
- *
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>Hii is always registered</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>Some executions paths will require the Hii to be registered</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- *
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- *
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- *
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea jTextAreaHelpText
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- *
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 62));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- *
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 162, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- *
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 162, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- *
- * This method initializes this
- *
- **/
- private void init() {
- this.setSize(505, 235);
- this.setContentPane(getJScrollPane());
- this.setTitle("Hii Packages");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inHiiPackagesId
- *
- **/
- private void init(HiiPackagesIdentification inHiiPackagesId, ModuleIdentification mid) {
- init();
- this.id = inHiiPackagesId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- if (this.id != null) {
- this.jTextFieldName.setText(id.getName());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inHiiPackagesIdentification
- * @param iFrame
- *
- **/
- public HiiPackagesDlg(HiiPackagesIdentification inHiiPackagesIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inHiiPackagesIdentification, mid);
- }
-
- /**
- *
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- **/
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldName.setEnabled(!isView);
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- *
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelName = new JLabel();
- jLabelName.setText("Hii Package C Name");
- jLabelName.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelHelpText.setText("Help Text");
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 132, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 107, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 107, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(480, 180));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelName, null);
- jContentPane.add(getJTextFieldName(), null);
-
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
-
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
-
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
-
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
-
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- *
- * This method initializes Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVHiiPackageUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentHiiPackages();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- *
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check Hii Package Name
- //
- if (isEmpty(this.jTextFieldName.getText())) {
- Log.wrn("Update Hii Packages", "Hii Package Name Record must be entered!");
- return false;
- }
-
- if (!isEmpty(this.jTextFieldName.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldName.getText())) {
- Log.wrn("Update Hii Packages", "Incorrect data type for Hii Package Name");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Hii Packages", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private HiiPackagesIdentification getCurrentHiiPackages() {
- String arg0 = this.jTextFieldName.getText();
- String arg1 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg2 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
- String arg4 = this.jTextAreaHelpText.getText();
-
- id = new HiiPackagesIdentification(arg0, arg1, arg2, arg3, arg4);
- return id;
- }
-
- public HiiPackagesIdentification getId() {
- return id;
- }
-
- public void setId(HiiPackagesIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HobsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HobsDlg.java
deleted file mode 100644
index caf1649984..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HobsDlg.java
+++ /dev/null
@@ -1,511 +0,0 @@
-/** @file
-
- The file is used to create, update Hob section of the MSA file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Hobs.HobsIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Hob of the MSA file
- *
- * It extends IDialog
- *
- */
-public class HobsDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -553473437579358325L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelC_Name = null;
-
- private IComboBox iComboBoxGuidC_Name = null;
-
- private JLabel jLabelUsage = null;
-
- private JLabel jLabelHobType = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private JComboBox jComboBoxHobType = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private HobsIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField jTextFieldC_Name
- *
- */
- private IComboBox getIComboBoxGuidC_Name() {
- if (iComboBoxGuidC_Name == null) {
- iComboBoxGuidC_Name = new IComboBox();
- iComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- iComboBoxGuidC_Name.setPreferredSize(new java.awt.Dimension(320, 20));
- iComboBoxGuidC_Name.setToolTipText("Select the GUID C Name of the Hob");
- }
- return iComboBoxGuidC_Name;
- }
-
- /**
- * This method initializes jComboBoxHobType
- *
- * @return javax.swing.JComboBox jComboBoxHobType
- *
- */
- private JComboBox getJComboBoxHobType() {
- if (jComboBoxHobType == null) {
- jComboBoxHobType = new JComboBox();
- jComboBoxHobType.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxHobType.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxHobType
- .setToolTipText("<html><table>"
- + "<tr><td>PHIT</td><td>EFI_HOB_TYPE_HANDOFF</td></tr>"
- + "<tr><td>MEMORY_ALLOCATION</td><td>EFI_HOB_TYPE_MEMORY_ALLOCATION and $BaseName</td></tr>"
- + "<tr><td>RESOURCE_DESCRIPTOR</td><td>EFI_HOB_TYPE_RESOURCE_DESCRIPTOR</td></tr>"
- + "<tr><td>GUID_EXTENTION</td><td>EFI_HOB_TYPE_GUID_EXTENSION and BaseName of GUID</td></tr>"
- + "<tr><td>FIRMWARE_VOLUME</td><td>EFI_HOB_TYPE_FV</td></tr>"
- + "<tr><td>CPU</td><td>EFI_HOB_TYPE_CPU</td></tr>"
- + "<tr><td>POOL</td><td>EFI_HOB_TYPE_PEI_MEMORY_POOL</td></tr>"
- + "<tr><td>CAPSULE_VOLUME</td><td>EFI_HOB_TYPE_CV</td></tr>"
- + "</table></html>");
- }
- return jComboBoxHobType;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>HOB must be present in the system</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>HOB will be used if it's present</td></tr>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>HOB is always produced</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>HOB will sometimes be produced by the module</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 157, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jTextFieldHelpText
- *
- * @return javax.swing.JTextField
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 87));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 187, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 187, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 260);
- this.setContentPane(getJScrollPane());
- this.setTitle("Hobs");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inHobsId
- *
- */
- private void init(HobsIdentification inHobsId, ModuleIdentification mid) {
- init();
- this.id = inHobsId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined guids from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log
- .wrn("Init Guid",
- "This module hasn't defined any package dependency, so there is no guid value can be added for hob");
- }
- //
- // Init guids drop down list
- //
- Tools
- .generateComboBoxByVector(iComboBoxGuidC_Name,
- wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_HOB));
- this.iComboBoxGuidC_Name.insertItemAt(DataType.EMPTY_SELECT_ITEM, 0);
- this.iComboBoxGuidC_Name.setSelectedIndex(0);
-
-
- if (this.id != null) {
- String tmpName = id.getName();
- if (isEmpty(tmpName)) {
- tmpName = DataType.EMPTY_SELECT_ITEM;
- }
- this.iComboBoxGuidC_Name.setSelectedItem(tmpName);
- this.jComboBoxHobType.setSelectedItem(id.getType());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inHobsIdentification
- * @param iFrame
- *
- */
- public HobsDlg(HobsIdentification inHobsIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inHobsIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.iComboBoxGuidC_Name.setEnabled(!isView);
- this.jComboBoxUsage.setEnabled(!isView);
- this.jComboBoxHobType.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- public JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelC_Name = new JLabel();
- jLabelC_Name.setText("Hob's Guid C Name");
- jLabelC_Name.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
-
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelHobType = new JLabel();
- jLabelHobType.setText("Hob Type");
- jLabelHobType.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
-
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(2, 62));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
-
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 87, 155, 20));
- jLabelHelpText.setText("Help Text");
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 157, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 132, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(485, 215));
-
- jContentPane.add(jLabelC_Name, null);
- jContentPane.add(getIComboBoxGuidC_Name(), null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelHobType, null);
- jContentPane.add(getJComboBoxHobType(), null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes Usage type and Hob type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVHobUsage());
- Tools.generateComboBoxByVector(jComboBoxHobType, ed.getVHobType());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentHobs();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check Name
- //
- String tmpName = this.iComboBoxGuidC_Name.getSelectedItem().toString();
- if (!tmpName.equals(DataType.EMPTY_SELECT_ITEM) && isEmpty(tmpName)) {
- if (!DataValidation.isC_NameType(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {
- Log.wrn("Update Hobs", "Incorrect data type for Hob Name");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Hobs", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private HobsIdentification getCurrentHobs() {
- String arg0 = this.iComboBoxGuidC_Name.getSelectedItem().toString();
- String arg1 = this.jComboBoxHobType.getSelectedItem().toString();
- String arg2 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg3 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();
- String arg5 = this.jTextAreaHelpText.getText();
- id = new HobsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- return id;
- }
-
- public HobsIdentification getId() {
- return id;
- }
-
- public void setId(HobsIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/LibraryClassDefsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/LibraryClassDefsDlg.java
deleted file mode 100644
index 5c48303a26..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/LibraryClassDefsDlg.java
+++ /dev/null
@@ -1,589 +0,0 @@
-/** @file
-
- The file is used to create, update Library Class Definition section of the MSA file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.find.Find;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassVector;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Library Class Definition section of the MSA file
- *
- * It extends IDialog
- *
- */
-public class LibraryClassDefsDlg extends IDialog {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -1743248695411382857L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private IComboBox iComboBoxLibraryClassName = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private JLabel jLabelLibraryClassName = null;
-
- private JScrollPane jScrollPane = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private JLabel jLabelRecommendedInstanceVersion = null;
-
- private JTextField jTextFieldRecommendedInstanceVersion = null;
-
- private JLabel jLabelRecommendedInstanceGuid = null;
-
- private JTextField jTextFieldRecommendedInstanceGuid = null;
-
- private JButton jButtonGenerateGuid = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JLabel jLabelModuleList = null;
-
- private JScrollPane jScrollPaneModuleList = null;
-
- private ICheckBoxList iCheckBoxListModule = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextField jTextFieldHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not for UI
- //
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private LibraryClassIdentification lcid = null;
-
- /**
- This method initializes jComboBoxSelect
-
- @return javax.swing.JComboBox jComboBoxSelect
-
- **/
- private IComboBox getIComboBoxLibraryClassName() {
- if (iComboBoxLibraryClassName == null) {
- iComboBoxLibraryClassName = new IComboBox();
- iComboBoxLibraryClassName.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- iComboBoxLibraryClassName.setPreferredSize(new Dimension(320, 20));
- iComboBoxLibraryClassName.setEnabled(true);
- }
- return iComboBoxLibraryClassName;
- }
-
- /**
- This method initializes jComboBoxUsage
-
- @return javax.swing.JComboBox jComboBoxUsage
-
- **/
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxUsage.setPreferredSize(new Dimension(320, 20));
- }
- return jComboBoxUsage;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextFieldRecommendedInstanceVersion
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldRecommendedInstanceVersion() {
- if (jTextFieldRecommendedInstanceVersion == null) {
- jTextFieldRecommendedInstanceVersion = new JTextField();
- jTextFieldRecommendedInstanceVersion.setPreferredSize(new java.awt.Dimension(260, 20));
- jTextFieldRecommendedInstanceVersion.setSize(new java.awt.Dimension(260, 20));
- jTextFieldRecommendedInstanceVersion.setLocation(new java.awt.Point(220, 85));
- jTextFieldRecommendedInstanceVersion.setVisible(false);
- }
- return jTextFieldRecommendedInstanceVersion;
- }
-
- /**
- * This method initializes jTextFieldRecommendedInstanceGuid
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldRecommendedInstanceGuid() {
- if (jTextFieldRecommendedInstanceGuid == null) {
- jTextFieldRecommendedInstanceGuid = new JTextField();
- jTextFieldRecommendedInstanceGuid.setBounds(new java.awt.Rectangle(220, 110, 190, 20));
- jTextFieldRecommendedInstanceGuid.setPreferredSize(new java.awt.Dimension(190, 20));
- jTextFieldRecommendedInstanceGuid.setVisible(false);
- }
- return jTextFieldRecommendedInstanceGuid;
- }
-
- /**
- * This method initializes jButtonGenerateGuid
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonGenerateGuid() {
- if (jButtonGenerateGuid == null) {
- jButtonGenerateGuid = new JButton();
- jButtonGenerateGuid.setBounds(new java.awt.Rectangle(415, 112, 65, 20));
- jButtonGenerateGuid.setPreferredSize(new java.awt.Dimension(65, 20));
- jButtonGenerateGuid.setText("GEN");
- jButtonGenerateGuid.setVisible(false);
- jButtonGenerateGuid.addActionListener(this);
- }
- return jButtonGenerateGuid;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 197, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- This method initializes iCheckBoxListArch
-
- @return ICheckBoxList
- **/
- private ICheckBoxList getICheckBoxListSupModuleList() {
- if (iCheckBoxListModule == null) {
- iCheckBoxListModule = new ICheckBoxList();
- }
- return iCheckBoxListModule;
- }
-
- /**
- This method initializes jScrollPaneModuleList
-
- @return javax.swing.JScrollPane
-
- **/
- private JScrollPane getJScrollPaneModuleList() {
- if (jScrollPaneModuleList == null) {
- jScrollPaneModuleList = new JScrollPane();
- jScrollPaneModuleList.setBounds(new java.awt.Rectangle(168, 112, 320, 80));
- jScrollPaneModuleList.setPreferredSize(new java.awt.Dimension(320, 80));
- jScrollPaneModuleList.setViewportView(getICheckBoxListSupModuleList());
- }
- return jScrollPaneModuleList;
- }
-
- /**
- This method initializes jTextFieldHelpText
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldHelpText() {
- if (jTextFieldHelpText == null) {
- jTextFieldHelpText = new JTextField();
- jTextFieldHelpText.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jTextFieldHelpText.setPreferredSize(new java.awt.Dimension(320, 20));
- }
- return jTextFieldHelpText;
- }
-
- /**
- This method initializes jButtonOk
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(300, 232, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- This method initializes jButtonCancel
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(400, 232, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This is the default constructor
-
- **/
- public LibraryClassDefsDlg(LibraryClassIdentification inLibraryClassIdentification, IFrame iFrame,
- ModuleIdentification mid) {
- super(iFrame, true);
- init(inLibraryClassIdentification, mid);
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setContentPane(getJScrollPane());
- this.setTitle("Library Class Definitions");
- this.setBounds(new java.awt.Rectangle(0, 0, 505, 305));
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- This method initializes this
-
- **/
- private void init(LibraryClassIdentification inLibraryClassIdentification, ModuleIdentification mid) {
- init();
- this.lcid = inLibraryClassIdentification;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined library classes from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log.wrn("Init Library Class",
- "This module hasn't defined any package dependency, so there is no library class can be added");
- }
-
- Tools
- .generateComboBoxByVector(
- this.iComboBoxLibraryClassName,
- wt
- .getAllLibraryClassDefinitionsFromPackages(wt
- .getPackageDependenciesOfModule(mid)));
-
- if (lcid != null) {
- this.iComboBoxLibraryClassName.setSelectedItem(lcid.getLibraryClassName());
- this.jComboBoxUsage.setSelectedItem(lcid.getUsage());
- this.jTextFieldRecommendedInstanceVersion.setText(lcid.getRecommendedInstanceVersion());
- this.jTextFieldRecommendedInstanceGuid.setText(lcid.getRecommendedInstanceGuid());
- this.jTextFieldFeatureFlag.setText(lcid.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(lcid.getSupArchList());
- this.iCheckBoxListModule.setAllItemsUnchecked();
- this.iCheckBoxListModule.initCheckedItem(true, lcid.getSupModuleList());
- this.jTextFieldHelpText.setText(lcid.getHelp());
- }
- }
-
- /**
- Disable all components when the mode is view
-
- @param isView true - The view mode; false - The non-view mode
-
- **/
- public void setViewMode(boolean isView) {
- if (isView) {
- this.iComboBoxLibraryClassName.setEnabled(!isView);
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 87, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 168, 20));
- jLabelHelpText.setText("Help Text");
- jLabelModuleList = new JLabel();
- jLabelModuleList.setBounds(new java.awt.Rectangle(12, 112, 168, 20));
- jLabelModuleList.setText("Supported Module Types");
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 87, 168, 20));
- jLabelArch.setText("Supported Architectures");
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 197, 168, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
- jLabelRecommendedInstanceGuid = new JLabel();
- jLabelRecommendedInstanceGuid.setBounds(new java.awt.Rectangle(12, 87, 200, 20));
- jLabelRecommendedInstanceGuid.setText("Recommended Instance Guid");
- jLabelRecommendedInstanceGuid.setVisible(false);
- jLabelRecommendedInstanceVersion = new JLabel();
- jLabelRecommendedInstanceVersion.setBounds(new java.awt.Rectangle(12, 87, 200, 20));
- jLabelRecommendedInstanceVersion.setText("Recommended Instance Version");
- jLabelRecommendedInstanceVersion.setVisible(false);
- jLabelLibraryClassName = new JLabel();
- jLabelLibraryClassName.setBounds(new java.awt.Rectangle(12, 12, 168, 20));
- jLabelLibraryClassName.setText("Library Class Name");
- jLabelUsage = new JLabel();
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 37, 168, 20));
- jLabelUsage.setText("Usage");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(495, 255));
-
- jContentPane.add(getIComboBoxLibraryClassName(), null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
- jContentPane.add(jLabelLibraryClassName, null);
- jContentPane.add(jLabelRecommendedInstanceVersion, null);
- jContentPane.add(getJTextFieldRecommendedInstanceVersion(), null);
- jContentPane.add(jLabelRecommendedInstanceGuid, null);
- jContentPane.add(getJTextFieldRecommendedInstanceGuid(), null);
- jContentPane.add(getJButtonGenerateGuid(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 10));
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 35));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelModuleList, null);
- jContentPane.add(getJScrollPaneModuleList(), null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJTextFieldHelpText(), null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- This method initializes all existing libraries and usage types
-
- **/
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVLibraryUsage());
- this.iCheckBoxListModule.setAllItems(ed.getVFrameworkModuleTypes());
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonGenerateGuid) {
- this.jTextFieldRecommendedInstanceGuid.setText(Tools.generateUuidString());
- }
-
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentLibraryClass();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- Data validation for all fields
-
- @retval true - All datas are valid
- @retval false - At least one data is invalid
-
- **/
- public boolean checkAdd() {
- //
- // Check LibraryClass
- //
- if (this.iComboBoxLibraryClassName.getSelectedItem() == null) {
- Log.wrn("Update Library Class Definitions", "Please select one Library Class");
- return false;
- }
- if (!DataValidation.isLibraryClass(this.iComboBoxLibraryClassName.getSelectedItem().toString())) {
- Log.wrn("Update Library Class Definitions", "Incorrect data type for Library Class");
- return false;
- }
-
- //
- // Check RecommendedInstanceVersion
- //
- // if (!isEmpty(this.jTextFieldRecommendedInstanceVersion.getText())) {
- // if (!DataValidation.isRecommendedInstanceVersion(this.jTextFieldRecommendedInstanceVersion.getText())) {
- // Log.err("Incorrect data type for Recommended Instance Version");
- // return false;
- // }
- // }
-
- //
- // Check RecommendedInstanceGuid
- //
- // if (!isEmpty(this.jTextFieldRecommendedInstanceGuid.getText())) {
- // if (!DataValidation.isGuid(this.jTextFieldRecommendedInstanceGuid.getText())) {
- // Log.err("Incorrect data type for Recommended Instance Guid");
- // return false;
- // }
- // }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Library Class Definitions", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- //
- // Check if the library is produced
- //
- String strUsage = this.jComboBoxUsage.getSelectedItem().toString();
- //
- // Check only when the library class is consumed
- //
- if (strUsage.equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED) || strUsage.equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {
- LibraryClassVector v = Find.getAllLibraryClassVector();
- boolean isFind = false;
- for (int index = 0; index < v.size(); index++) {
- LibraryClassIdentification lid = v.getLibraryClass(index);
- if (lid.getLibraryClassName().equals(this.iComboBoxLibraryClassName.getSelectedItem().toString())) {
- if (lid.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)
- || lid.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {
- isFind = true;
- break;
- }
- }
- }
- if (!isFind) {
- Log.wrn("Update Library Class Definitions", "This Library Class has no instance yet. It may have some errors in build time.");
- //return false;
- }
- }
-
- return true;
- }
-
- private LibraryClassIdentification getCurrentLibraryClass() {
- String name = this.iComboBoxLibraryClassName.getSelectedItem().toString();
- String usage = this.jComboBoxUsage.getSelectedItem().toString();
- String version = this.jTextFieldRecommendedInstanceVersion.getText();
- String guid = this.jTextFieldRecommendedInstanceGuid.getText();
- String featureFlag = this.jTextFieldFeatureFlag.getText();
- Vector<String> arch = this.jArchCheckBox.getSelectedItemsVector();
- Vector<String> module = this.iCheckBoxListModule.getAllCheckedItemsString();
- String help = this.jTextFieldHelpText.getText();
- lcid = new LibraryClassIdentification(name, usage, version, guid, arch, featureFlag, module, help);
- return lcid;
- }
-
- public LibraryClassIdentification getLcid() {
- return lcid;
- }
-
- public void setLcid(LibraryClassIdentification lcid) {
- this.lcid = lcid;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PCDsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PCDsDlg.java
deleted file mode 100644
index fa3d4a4f33..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PCDsDlg.java
+++ /dev/null
@@ -1,611 +0,0 @@
-/** @file
-
- The file is used to create, update PcdCode section of the MSA file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdVector;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update PcdCoded section of the MSA file
- *
- * It extends IDialog
- *
- */
-public class PCDsDlg extends IDialog implements ItemListener {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = 2227717658188438696L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelItemType = null;
-
- private JLabel jLabelC_Name = null;
-
- private JComboBox jComboBoxItemType = null;
-
- private JComboBox jComboBoxCName = null;
-
- private JLabel jLabelDefaultValue = null;
-
- private JTextField jTextFieldDefaultValue = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelTokenSpaceGuid = null;
-
- private JTextField jTextFieldTokenSpaceGuid = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- //
- // Not used by UI
- //
- private PcdCodedIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private PcdVector pcd = wt.getAllPcdDeclarationsFromWorkspace();
-
- /**
- * This method initializes jComboBoxItemType
- *
- * @return javax.swing.JComboBox jComboBoxItemType
- *
- */
- private JComboBox getJComboBoxItemType() {
- if (jComboBoxItemType == null) {
- jComboBoxItemType = new JComboBox();
- jComboBoxItemType.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxItemType.setPreferredSize(new java.awt.Dimension(320, 20));
- }
- return jComboBoxItemType;
- }
-
- /**
- * This method initializes jTextFieldC_Name
- *
- * @return javax.swing.JTextField jTextFieldC_Name
- *
- */
- private JComboBox getJComboBoxCName() {
- if (jComboBoxCName == null) {
- jComboBoxCName = new JComboBox();
- jComboBoxCName.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxCName.addItemListener(this);
- }
- return jComboBoxCName;
- }
-
- /**
- * This method initializes jTextFieldDefaultValue
- *
- * @return javax.swing.JTextField jTextFieldDefaultValue
- *
- */
- private JTextField getJTextFieldDefaultValue() {
- if (jTextFieldDefaultValue == null) {
- jTextFieldDefaultValue = new JTextField();
- jTextFieldDefaultValue.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jTextFieldDefaultValue.setPreferredSize(new java.awt.Dimension(320, 20));
- }
- return jTextFieldDefaultValue;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 112));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextFieldTokenSpaceGuid
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldTokenSpaceGuid() {
- if (jTextFieldTokenSpaceGuid == null) {
- jTextFieldTokenSpaceGuid = new JTextField();
- jTextFieldTokenSpaceGuid.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jTextFieldTokenSpaceGuid.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldTokenSpaceGuid.setVisible(false);
- }
- return jTextFieldTokenSpaceGuid;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 182, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 212, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 212, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 87, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- }
- return jComboBoxUsage;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 280);
- this.setContentPane(getJScrollPane());
- this.setTitle("Pcd Coded");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inPcdCodedId
- *
- */
- private void init(PcdCodedIdentification inPcdCodedId, ModuleIdentification mid) {
- init();
- this.id = inPcdCodedId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined pcds from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log.wrn("Init Pcd", "This module hasn't defined any package dependency, so there is no pcd can be added");
- }
-
- pcd = wt.getAllPcdDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid));
- for (int index = 0; index < pcd.size(); index++) {
- jComboBoxCName.addItem(pcd.getPcd(index));
- }
-
- if (this.id != null) {
- for (int index = 0; index < this.jComboBoxCName.getItemCount(); index++) {
- if (this.jComboBoxCName.getItemAt(index).toString().equals(id.getName())) {
- this.jComboBoxCName.setSelectedIndex(index);
- break;
- }
- }
- this.jTextFieldTokenSpaceGuid.setText(id.getGuid());
- this.jTextFieldDefaultValue.setText(id.getValue());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jComboBoxItemType.setSelectedItem(id.getType());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inPcdCodedId
- * @param iFrame
- *
- */
- public PCDsDlg(PcdCodedIdentification inPcdCodedId, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inPcdCodedId, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldDefaultValue.setEnabled(!isView);
- this.jComboBoxItemType.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabelUsage = new JLabel();
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 87, 168, 20));
- jLabelUsage.setText("Usge");
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelC_Name = new JLabel();
- jLabelC_Name.setText("PCD C Name");
- jLabelC_Name.setBounds(new java.awt.Rectangle(12, 12, 168, 20));
-
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelItemType = new JLabel();
- jLabelItemType.setText("PCD Item Type");
- jLabelItemType.setBounds(new java.awt.Rectangle(12, 37, 168, 20));
-
- jLabelDefaultValue = new JLabel();
- jLabelDefaultValue.setText("Default Value");
- jLabelDefaultValue.setBounds(new java.awt.Rectangle(12, 62, 168, 20));
-
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(2, 112));
- jLabelHelpText = new JLabel();
- jLabelHelpText.setText("Help Text");
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 112, 168, 20));
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 182, 168, 20));
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelTokenSpaceGuid = new JLabel();
- jLabelTokenSpaceGuid.setText("Token Space C Name");
- jLabelTokenSpaceGuid.setVisible(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setText("Supported Architectures");
- jLabelArch.setBounds(new java.awt.Rectangle(12, 157, 168, 20));
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 157, 320, 20));
-
- // Hidden field
- jLabelTokenSpaceGuid.setBounds(new java.awt.Rectangle(12, 62, 140, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(485, 235));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelC_Name, null);
- jContentPane.add(getJComboBoxCName(), null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelItemType, null);
- jContentPane.add(getJComboBoxItemType(), null);
- jContentPane.add(jLabelDefaultValue, null);
- jContentPane.add(getJTextFieldDefaultValue(), null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- // Hidden
- jContentPane.add(getJTextFieldTokenSpaceGuid(), null);
- jContentPane.add(jLabelTokenSpaceGuid, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes Usage type, Item type and Datum type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPcdUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentPcdCoded();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check C_Name
- //
- if (this.jComboBoxCName.getSelectedItem() == null) {
- Log.wrn("Update Pcd", "Please select one Pcd Name");
- return false;
- }
-
- if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {
- if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {
- Log.wrn("Update PcdCoded", "Incorrect data type for C Name");
- return false;
- }
- }
-
- //
- // Check TokenSpaceGuid
- //
- if (!isEmpty(this.jTextFieldTokenSpaceGuid.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldTokenSpaceGuid.getText())) {
- Log.wrn("Update PcdCoded",
- "Incorrect data type for the selected pcd entry, please check the datatype specified in the spd file");
- return false;
- }
- }
-
- //
- // Check DefaultValue
- //
- if (!isEmpty(this.jTextFieldDefaultValue.getText())) {
- if (!DataValidation.isDefaultValueType(this.jTextFieldDefaultValue.getText())) {
- Log.wrn("Update PcdCoded", "Incorrect data type for Default Value");
- return false;
- }
- }
-
- //
- // Check HelpText
- //
- if (isEmpty(this.jTextAreaHelpText.getText())) {
- Log.wrn("Update PcdCoded", "Help Text should not be empty");
- return false;
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update PcdCoded", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private PcdCodedIdentification getCurrentPcdCoded() {
- String arg0 = this.jComboBoxCName.getSelectedItem().toString();
- String arg1 = this.jTextFieldTokenSpaceGuid.getText();
-
- String arg2 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
-
- String arg4 = this.jTextFieldDefaultValue.getText();
- String arg5 = this.jTextAreaHelpText.getText();
- String arg6 = this.jComboBoxItemType.getSelectedItem().toString();
- String arg7 = this.jComboBoxUsage.getSelectedItem().toString();
- if (arg7.equals(DataType.EMPTY_SELECT_ITEM)) {
- arg7 = "";
- }
-
- id = new PcdCodedIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
- return id;
- }
-
- public PcdCodedIdentification getId() {
- return id;
- }
-
- public void setId(PcdCodedIdentification id) {
- this.id = id;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
- *
- * Reflesh the frame when selected item changed
- *
- */
- public void itemStateChanged(ItemEvent arg0) {
- int index = this.jComboBoxCName.getSelectedIndex();
- if (arg0.getSource() == this.jComboBoxCName && arg0.getStateChange() == ItemEvent.SELECTED) {
- if (pcd.getPcd(index).getGuidCName() == null || isEmpty(pcd.getPcd(index).getGuidCName())
- || pcd.getPcd(index).getType() == null || pcd.getPcd(index).getHelp() == null
- || isEmpty(pcd.getPcd(index).getHelp())) {
- Log.wrn("select pcd entry when editing msa",
- "The selected value is defined incorrectly.\r\nPlease check it in the spd file");
- } else {
- this.jTextFieldTokenSpaceGuid.setText(pcd.getPcd(index).getGuidCName());
- Tools.generateComboBoxByVector(this.jComboBoxItemType, pcd.getPcd(index).getType());
- this.jTextAreaHelpText.setText(pcd.getPcd(index).getHelp());
- this.jTextAreaHelpText.setSelectionStart(0);
- this.jTextAreaHelpText.setSelectionEnd(0);
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PackageDepDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PackageDepDlg.java
deleted file mode 100644
index 00161b5ecb..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PackageDepDlg.java
+++ /dev/null
@@ -1,441 +0,0 @@
-/** @file
-
- The file is used to create, update Package Dependencies section of the MSA file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.PackageDependencies.PackageDependenciesIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Package Dependencies section of the MSA file
- *
- * It extends IDialog
- *
- */
-public class PackageDepDlg extends IDialog implements ItemListener {
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = 3465193035145152131L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelPackageName = null;
-
- private StarLabel jStarLabel1 = null;
-
- private JComboBox jComboBoxPackageName = null;
-
- private JLabel jLabelPackageGuid = null;
-
- private JTextField jTextFieldPackageGuid = null;
-
- private JLabel jLabelPackageVersion = null;
-
- private JTextField jTextFieldPackageVersion = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelArch = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private PackageDependenciesIdentification pdid = null;
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private Vector<PackageIdentification> vPackage = wt.getAllPackages();
-
- /**
- * This method initializes jComboBoxPackageName
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getJComboBoxPackageName() {
- if (jComboBoxPackageName == null) {
- jComboBoxPackageName = new JComboBox();
- jComboBoxPackageName.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jComboBoxPackageName.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxPackageName.setToolTipText("If your Module requires a package, list that here.");
- jComboBoxPackageName.addItemListener(this);
- }
- return jComboBoxPackageName;
- }
-
- /**
- * This method initializes jTextFieldPackageGuid
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldPackageGuid() {
- if (jTextFieldPackageGuid == null) {
- jTextFieldPackageGuid = new JTextField();
- jTextFieldPackageGuid.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jTextFieldPackageGuid.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldPackageGuid.setEditable(false);
- jTextFieldPackageGuid.setVisible(false);
- }
- return jTextFieldPackageGuid;
- }
-
- /**
- * This method initializes jTextFieldPackageVersion
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldPackageVersion() {
- if (jTextFieldPackageVersion == null) {
- jTextFieldPackageVersion = new JTextField();
- jTextFieldPackageVersion.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jTextFieldPackageVersion.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldPackageVersion
- .setToolTipText("<html>If this module depends on a specific version of a package, <br>"
- + "enter the package version here. <br>"
- + "If the module can use the latest version <br>"
- + "that does not break backward compatibility, <br>"
- + "leave this field blank</html>");
- }
- return jTextFieldPackageVersion;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 87, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 122, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 122, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 216);
- this.setContentPane(getJScrollPane());
- this.setTitle("Package Dependencies");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this
- *
- */
- private void init(PackageDependenciesIdentification inPackageDependenciesIdentification, ModuleIdentification mid) {
- init();
- this.pdid = inPackageDependenciesIdentification;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- if (pdid != null) {
- this.jComboBoxPackageName.setSelectedItem(pdid.getName());
- this.jTextFieldPackageVersion.setText(pdid.getVersion());
- this.jTextFieldPackageGuid.setText(pdid.getGuid());
- jTextFieldFeatureFlag.setText(pdid.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(pdid.getSupArchList());
- }
- }
-
- /**
- * This is the default constructor
- *
- */
- public PackageDepDlg(PackageDependenciesIdentification inPackageDependenciesIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inPackageDependenciesIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jComboBoxPackageName.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelPackageName = new JLabel();
- jLabelPackageName.setBounds(new java.awt.Rectangle(12, 12, 168, 20));
- jLabelPackageName.setText("Package Name");
-
- jLabelPackageVersion = new JLabel();
- jLabelPackageVersion.setBounds(new java.awt.Rectangle(12, 37, 168, 20));
- jLabelPackageVersion.setText("Package Version");
-
- jLabelPackageGuid = new JLabel();
- jLabelPackageGuid.setBounds(new java.awt.Rectangle(12, 37, 168, 20));
- jLabelPackageGuid.setText("Package Guid");
- jLabelPackageGuid.setVisible(false);
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 87, 168, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 62, 168, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(485, 170));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelPackageName, null);
- jContentPane.add(getJComboBoxPackageName(), null);
- jContentPane.add(jLabelPackageGuid, null);
- jContentPane.add(getJTextFieldPackageGuid(), null);
- jContentPane.add(jLabelPackageVersion, null);
- jContentPane.add(getJTextFieldPackageVersion(), null);
- // LAH Not Used here
- // jContentPane.add(getJButtonGenerateGuid(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentPackageDependencies();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * This method initializes Usage type, Package type and Arch type
- *
- */
- private void initFrame() {
- for (int index = 0; index < vPackage.size(); index++) {
- jComboBoxPackageName.addItem(vPackage.elementAt(index).getName());
- }
- }
-
- /**
- * Data validation for all fields before add current item to Vector
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check PackageGuid
- //
- // if (!isEmpty(this.jTextFieldPackageGuid.getText())) {
- // if (!DataValidation.isGuid(this.jTextFieldPackageGuid.getText())) {
- // Log.err("Incorrect data type for Package Guid");
- // return false;
- // }
- // }
-
- //
- // Check PackageVersion
- //
- if (!isEmpty(this.jTextFieldPackageVersion.getText())) {
- if (!DataValidation.isVersion(this.jTextFieldPackageVersion.getText())) {
- Log.wrn("Update Package Dependencies", "Incorrect data type for Package Version");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Package Dependencies", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private PackageDependenciesIdentification getCurrentPackageDependencies() {
- String arg0 = this.jComboBoxPackageName.getSelectedItem().toString();
- String arg1 = this.jTextFieldPackageVersion.getText();
- String arg2 = this.jTextFieldPackageGuid.getText();
-
- String arg3 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();
- pdid = new PackageDependenciesIdentification(arg0, arg1, arg2, arg3, arg4);
- return pdid;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
- *
- * Reflesh the frame when selected item changed
- *
- */
- public void itemStateChanged(ItemEvent arg0) {
- if (arg0.getSource() == this.jComboBoxPackageName && arg0.getStateChange() == ItemEvent.SELECTED) {
- for (int index = 0; index < vPackage.size(); index++) {
- if (this.jComboBoxPackageName.getSelectedItem().toString().equals(vPackage.get(index).getName())) {
- this.jTextFieldPackageGuid.setText(vPackage.get(index).getGuid());
- }
- }
- }
- }
-
- public PackageDependenciesIdentification getPdid() {
- return pdid;
- }
-
- public void setPdid(PackageDependenciesIdentification pdid) {
- this.pdid = pdid;
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PpisDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PpisDlg.java
deleted file mode 100644
index c649d13508..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PpisDlg.java
+++ /dev/null
@@ -1,493 +0,0 @@
-/** @file
-
- The file is used to create, update Ppi section of the MSA file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Ppi section of the MSA file
- *
- * It extends IDialog
- *
- */
-public class PpisDlg extends IDialog implements ItemListener {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -4284901202357037724L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelC_Name = null;
-
- private IComboBox iComboBoxCName = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private JLabel jLabelPpiType = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private JComboBox jComboBoxPpiType = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private PpisIdentification id = null;
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private EnumerationData ed = new EnumerationData();
-
- /**
- * This method initializes jComboBoxPpiType
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getJComboBoxPpiType() {
- if (jComboBoxPpiType == null) {
- jComboBoxPpiType = new JComboBox();
- jComboBoxPpiType.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jComboBoxPpiType.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxPpiType.addItemListener(this);
- jComboBoxPpiType
- .setToolTipText("<html>PPIs are named by GUID.<br>PPI Notify is consumed via a register PPI Notify mechanism</html>");
- }
- return jComboBoxPpiType;
- }
-
- /**
- * This method initializes jTextFieldC_Name
- *
- * @return javax.swing.JTextField jTextFieldC_Name
- *
- */
- private IComboBox getIComboBoxCName() {
- if (iComboBoxCName == null) {
- iComboBoxCName = new IComboBox();
- iComboBoxCName.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- iComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20));
- iComboBoxCName.setToolTipText("Select Guid C Name of PPI");
- }
- return iComboBoxCName;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .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>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField jTextFieldFeatureFlag
- *
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 157, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 87));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 187, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 187, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 260);
- this.setContentPane(getJScrollPane());
- this.setTitle("PPI Definitions");
- initFrame();
- this.centerWindow();
- }
-
- /**
- This method initializes this Fill values to all fields if these values are
- not empty
-
- @param inPpisId
- @param mid
-
- **/
- private void init(PpisIdentification inPpisId, ModuleIdentification mid) {
- init();
- this.id = inPpisId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined ppis from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log.wrn("Init Ppi", "This module hasn't defined any package dependency, so there is no ppi can be added");
- }
-
- Tools.generateComboBoxByVector(this.iComboBoxCName,
- wt.getAllPpiDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));
-
- if (this.id != null) {
- this.iComboBoxCName.setSelectedItem(id.getName());
- this.jComboBoxPpiType.setSelectedItem(id.getType());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inProtocolsIdentification
- * @param iFrame
- *
- */
- public PpisDlg(PpisIdentification inPpisIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inPpisIdentification, mid);
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelPpiType = new JLabel();
- jLabelPpiType.setBounds(new java.awt.Rectangle(12, 12, 168, 20));
- jLabelPpiType.setText("Select Ppi Type");
-
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelC_Name = new JLabel();
- jLabelC_Name.setText("PPI GUID C Name");
- jLabelC_Name.setBounds(new java.awt.Rectangle(12, 37, 168, 20));
-
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(2, 62));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 62, 168, 20));
-
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(14, 87, 168, 20));
- jLabelHelpText.setText("Help Text");
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 157, 168, 20));
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 132, 168, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(485, 215));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelPpiType, null);
- jContentPane.add(getJComboBoxPpiType(), null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelC_Name, null);
- jContentPane.add(getIComboBoxCName(), null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxPpiType, ed.getVPpiType());
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentPpis();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check Name
- //
- if (this.iComboBoxCName.getSelectedItem() == null) {
- Log.wrn("Update Ppis", "Please select one Ppi/PpiNotify Name");
- return false;
- }
-
- if (!isEmpty(this.iComboBoxCName.getSelectedItem().toString())) {
- if (!DataValidation.isC_NameType(this.iComboBoxCName.getSelectedItem().toString())) {
- Log.wrn("Update Ppis", "Incorrect data type for Ppi/PpiNotify Name");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Ppis", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private PpisIdentification getCurrentPpis() {
- String arg0 = this.iComboBoxCName.getSelectedItem().toString();
- String arg1 = this.jComboBoxPpiType.getSelectedItem().toString();
- String arg2 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg3 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();
- String arg5 = this.jTextAreaHelpText.getText();
-
- id = new PpisIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- return id;
- } /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
- *
- * Reflesh the frame when selected item changed
- *
- */
-
- public void itemStateChanged(ItemEvent arg0) {
- if (arg0.getSource() == this.jComboBoxPpiType && arg0.getStateChange() == ItemEvent.SELECTED) {
- if (this.jComboBoxPpiType.getSelectedItem().toString().equals(ed.getVPpiType().get(0))) {
- Tools.generateComboBoxByVector(this.jComboBoxUsage, ed.getVPpiUsage());
- } else {
- Tools.generateComboBoxByVector(this.jComboBoxUsage, ed.getVPpiNotifyUsage());
- }
- }
- }
-
- public PpisIdentification getId() {
- return id;
- }
-
- public void setId(PpisIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ProtocolsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ProtocolsDlg.java
deleted file mode 100644
index aa7c453290..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ProtocolsDlg.java
+++ /dev/null
@@ -1,523 +0,0 @@
-/** @file
-
- The file is used to create, update Protocol of section of the MSA file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Protocol of MSA file
- *
- * It extends IDialog
- *
- */
-public class ProtocolsDlg extends IDialog implements ItemListener {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -9084913640747858848L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelC_Name = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private JLabel jLabelProtocolType = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JComboBox jComboBoxProtocolType = null;
-
- private IComboBox iComboBoxCName = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private ProtocolsIdentification id = null;
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private EnumerationData ed = new EnumerationData();
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField jTextFieldFeatureFlag
- *
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 157, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxProtocolUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table><tr><td colspan=2 align=center><b>Protocol</b></td></tr>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>Module always consumes the protocol</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMES</td><td>Module sometimes consumes the protocol</td></tr>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>Module always produces the protocol</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>Module sometimes produces the protocol</td></tr>"
- + "<tr><td>TO_START</td><td>The protocol is consumed by a Driver Binding protocol <b>Start</b><br>function. The protocol is used in EFI 1.10 driver model</td></tr>"
- + "<tr><td>BY_START</td><td>Protocol is produced by a Driver Binding protocol <b>Start</b><br>function. The protocol is used in EFI 1.10 driver model</td></tr>"
- + "<tr><td colspan=2 align=center><b>Protocol Notify</b></td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>Module will consume the protocol if it is produced.<br>Consumption is defined by executing the protocol notify<br>function.</td></tr></table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jComboBoxProtocolType
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getJComboBoxProtocolType() {
- if (jComboBoxProtocolType == null) {
- jComboBoxProtocolType = new JComboBox();
- jComboBoxProtocolType.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jComboBoxProtocolType.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxProtocolType.addItemListener(this);
- jComboBoxProtocolType
- .setToolTipText("<html>Select Protocol Type<br>Protocol Notify is a register protocol notify mechanism.");
- }
- return jComboBoxProtocolType;
- }
-
- /**
- * This method initializes iComboBoxCName
- *
- * @return javax.swing.JComboBox
- */
- private IComboBox getIComboBoxCName() {
- if (iComboBoxCName == null) {
- iComboBoxCName = new IComboBox();
- iComboBoxCName.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- iComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20));
- iComboBoxCName.setToolTipText("Select Guid C Name of the Protocol");
-
- }
- return iComboBoxCName;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 87));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 187, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 187, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- // Width must be 20 larger than Content Pane PreferredSize width for MSFT
- // Height must be 45 larger than ContentPane PreferredSize height for MSFT
- this.setSize(505, 260);
- this.setContentPane(getJScrollPane());
- this.setTitle("Protocols");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inProtocolsId
- *
- */
- private void init(ProtocolsIdentification inProtocolsId, ModuleIdentification mid) {
- init();
- this.id = inProtocolsId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined protocols from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log.wrn("Init Protocol", "This module hasn't defined any package dependency, so there is no protocol can be added");
- }
-
- Tools.generateComboBoxByVector(this.iComboBoxCName,
- wt.getAllProtocolDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));
-
- if (this.id != null) {
- this.iComboBoxCName.setSelectedItem(id.getName());
- this.jComboBoxProtocolType.setSelectedItem(id.getType());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inProtocolsIdentification
- * @param iFrame
- *
- */
- public ProtocolsDlg(ProtocolsIdentification inProtocolsIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inProtocolsIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jComboBoxUsage.setEnabled(!isView);
- this.jTextFieldFeatureFlag.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelProtocolType = new JLabel();
- jLabelProtocolType.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
- jLabelProtocolType.setText("Select Protocol Type");
-
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelC_Name = new JLabel();
- jLabelC_Name.setText("Protocol Guid C Name");
- jLabelC_Name.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
-
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(2, 62));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
-
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 87, 155, 20));
- jLabelHelpText.setText("Help Text");
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 157, 155, 20));
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 132, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(485, 215));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelProtocolType, null);
- jContentPane.add(getJComboBoxProtocolType(), null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelC_Name, null);
- jContentPane.add(getIComboBoxCName(), null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxProtocolUsage(), null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxProtocolType, ed.getVProtocolType());
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVProtocolUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentProtocols();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check Name
- //
- if (this.iComboBoxCName.getSelectedItem() == null) {
- Log.wrn("Update protocols", "Please select one Protocol/ProtocolNotify Name");
- return false;
- }
-
- if (!isEmpty(this.iComboBoxCName.getSelectedItem().toString())) {
- if (!DataValidation.isC_NameType(this.iComboBoxCName.getSelectedItem().toString())) {
- Log.wrn("Update Protocols", "Incorrect data type for Protocol/ProtocolNotify Name");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Protocols", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private ProtocolsIdentification getCurrentProtocols() {
- String arg0 = this.iComboBoxCName.getSelectedItem().toString();
- String arg1 = this.jComboBoxProtocolType.getSelectedItem().toString();
- String arg2 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg3 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();
- String arg5 = this.jTextAreaHelpText.getText();
- id = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- return id;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
- *
- * Reflesh the frame when selected item changed
- *
- */
-
- public void itemStateChanged(ItemEvent arg0) {
- if (arg0.getSource() == this.jComboBoxProtocolType && arg0.getStateChange() == ItemEvent.SELECTED) {
- if (this.jComboBoxProtocolType.getSelectedItem().toString().equals(ed.getVProtocolType().get(0))) {
- Tools.generateComboBoxByVector(this.jComboBoxUsage, ed.getVProtocolUsage());
- } else {
- Tools.generateComboBoxByVector(this.jComboBoxUsage, ed.getVProtocolNotifyUsage());
- }
- }
- }
-
- public ProtocolsIdentification getId() {
- return id;
- }
-
- public void setId(ProtocolsIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java
deleted file mode 100644
index 238c000cde..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java
+++ /dev/null
@@ -1,547 +0,0 @@
-/** @file
-
- The file is used to create, update SourceFiles section of the MSA file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.io.File;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JFileChooser;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.SourceFiles.SourceFilesIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update SourceFiles section of the MSA file
- *
- * It extends IDialog
- *
- **/
-public class SourceFilesDlg extends IDialog {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -6765742852142775378L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelFileName = null;
-
- private JTextField jTextFieldFileName = null;
-
- private JButton jButtonOpenFile = null;
-
- private JLabel jLabelToolChainFamily = null;
-
- private StarLabel jStarLabel1 = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelTagName = null;
-
- private JTextField jTextFieldTagName = null;
-
- private JLabel jLabelToolCode = null;
-
- private JTextField jTextFieldToolCode = null;
-
- private IComboBox iComboBoxToolCode = null;
-
- private JTextField jTextFieldToolChainFamily = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private SourceFilesIdentification sfid[] = null;
-
- private String msaFileName = "";
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- This method initializes jTextFieldFileName
-
- @return javax.swing.JTextField jTextFieldFileName
-
- **/
- private JTextField getJTextFieldSourceFilesDirectory() {
- if (jTextFieldFileName == null) {
- jTextFieldFileName = new JTextField();
- jTextFieldFileName.setBounds(new java.awt.Rectangle(168, 12, 250, 20));
- jTextFieldFileName.setPreferredSize(new java.awt.Dimension(250, 20));
- jTextFieldFileName.setToolTipText("Path is relative to the MSA file and must include the file name");
- }
- return jTextFieldFileName;
- }
-
- /**
- This method initializes jButtonOpenFile
-
- @return javax.swing.JButton jButtonOpenFile
-
- **/
- private JButton getJButtonOpenFile() {
- if (jButtonOpenFile == null) {
- jButtonOpenFile = new JButton();
- jButtonOpenFile.setText("Browse");
- jButtonOpenFile.setBounds(new java.awt.Rectangle(422, 12, 85, 20));
- jButtonOpenFile.setPreferredSize(new java.awt.Dimension(85, 20));
- jButtonOpenFile.addActionListener(this);
- }
- return jButtonOpenFile;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextFieldTagName
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldTagName() {
- if (jTextFieldTagName == null) {
- jTextFieldTagName = new JTextField();
- jTextFieldTagName.setBounds(new java.awt.Rectangle(168, 37, 340, 20));
- jTextFieldTagName.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldTagName.setToolTipText("You may specify a specific tool chain tag name, such as BILL1");
- }
- return jTextFieldTagName;
- }
-
- private IComboBox getIComboBoxToolCode() {
- if (iComboBoxToolCode == null) {
- iComboBoxToolCode = new IComboBox();
- iComboBoxToolCode.setBounds(new java.awt.Rectangle(168, 62, 340, 20));
- iComboBoxToolCode.setPreferredSize(new java.awt.Dimension(340, 20));
- iComboBoxToolCode.setToolTipText("<html>You may select a specific tool command from drop down list,<br>"
- + "or you can DOUBLE-CLICK this field to enter your customized<br>"
- + "tool command.<br>"
- + "Press ENTER to save your input or press ESCAPE to quit</html>");
- }
- return iComboBoxToolCode;
- }
-
- /**
- * This method initializes jTextFieldToolCode
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldToolCode() {
- if (jTextFieldToolCode == null) {
- jTextFieldToolCode = new JTextField();
- jTextFieldToolCode.setBounds(new java.awt.Rectangle(168, 62, 340, 20));
- jTextFieldToolCode.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldToolCode.setToolTipText("You may specify a specific tool command, such as ASM");
- jTextFieldToolCode.setVisible(false);
- }
- return jTextFieldToolCode;
- }
-
- /**
- * This method initializes jTextFieldToolChainFamily
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldToolChainFamily() {
- if (jTextFieldToolChainFamily == null) {
- jTextFieldToolChainFamily = new JTextField();
- jTextFieldToolChainFamily.setBounds(new java.awt.Rectangle(168, 87, 340, 20));
- jTextFieldToolChainFamily.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldToolChainFamily.setToolTipText("You may specify a specific tool chain family, such as GCC");
- }
- return jTextFieldToolChainFamily;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 137, 340, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldFeatureFlag.setToolTipText("RESERVED FOR FUTURE USE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- This method initializes jButtonOk
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(317, 172, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- This method initializes jButtonCancel
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(412, 172, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This is the default constructor
-
- **/
- public SourceFilesDlg(SourceFilesIdentification inSourceFilesIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inSourceFilesIdentification, mid);
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(525, 240);
- this.setContentPane(getJScrollPane());
- this.setTitle("Source Files");
- this.setViewMode(false);
- this.centerWindow();
- Tools.generateComboBoxByVector(iComboBoxToolCode, ed.getVToolCode());
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
-
- @param inSourceFiles The input data of SourceFilesDocument.SourceFiles
-
- **/
- private void init(SourceFilesIdentification inSourceFilesIdentifications, ModuleIdentification mid) {
- init();
- this.msaFileName = mid.getPath();
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- if (inSourceFilesIdentifications != null) {
- this.jTextFieldFileName.setText(inSourceFilesIdentifications.getFilename());
- this.jTextFieldTagName.setText(inSourceFilesIdentifications.getTagName());
-
-// //
-// // Generate Tool Code selection list
-// //
-// Vector<String> v = ed.getVToolCode();
-// boolean isFind = false;
-// String strToolCode = inSourceFilesIdentifications.getToolCode();
-//
-// //
-// // If the input value is not in the default list, add it to the list
-// //
-// if (strToolCode != null) {
-// for (int index = 0; index < v.size(); index++) {
-// if (v.elementAt(index).equals(strToolCode)) {
-// isFind = true;
-// break;
-// }
-// }
-// if (!isFind && !isEmpty(strToolCode)) {
-// v.addElement(strToolCode);
-// }
-// }
-
- Tools.generateComboBoxByVector(iComboBoxToolCode, ed.getVToolCode());
- this.iComboBoxToolCode.setSelectedItem(inSourceFilesIdentifications.getToolCode());
-
- this.jTextFieldToolChainFamily.setText(inSourceFilesIdentifications.getToolChainFamily());
- jTextFieldFeatureFlag.setText(inSourceFilesIdentifications.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(inSourceFilesIdentifications.getSupArchList());
- }
- }
-
- /**
- Disable all components when the mode is view
-
- @param isView true - The view mode; false - The non-view mode
-
- **/
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldFileName.setEnabled(!isView);
- this.jButtonOpenFile.setEnabled(!isView);
- }
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 112, 340, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(340, 20));
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 137, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
- jLabelToolCode = new JLabel();
- jLabelToolCode.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelToolCode.setText("Tool Code");
- jLabelTagName = new JLabel();
- jLabelTagName.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
- jLabelTagName.setText("Tag Name");
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 112, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jLabelToolChainFamily = new JLabel();
- jLabelToolChainFamily.setBounds(new java.awt.Rectangle(12, 87, 155, 20));
- jLabelToolChainFamily.setText("Tool Chain Family");
- jLabelFileName = new JLabel();
- jLabelFileName.setText("File Name");
- jLabelFileName.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(505, 192));
-
- jContentPane.add(jLabelFileName, null);
- jContentPane.add(getJTextFieldSourceFilesDirectory(), null);
- jContentPane.add(getJButtonOpenFile(), null);
- jContentPane.add(jLabelToolChainFamily, null);
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(0, 10));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jLabelTagName, null);
- jContentPane.add(getJTextFieldTagName(), null);
- jContentPane.add(jLabelToolCode, null);
- jContentPane.add(getJTextFieldToolCode(), null);
- jContentPane.add(getIComboBoxToolCode(), null);
- jContentPane.add(getJTextFieldToolChainFamily(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOpenFile) {
- selectFile();
- }
-
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentSourceFiles();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- private SourceFilesIdentification[] getCurrentSourceFiles() {
- String name = this.jTextFieldFileName.getText();
- String s[] = name.split(";");
- String tagName = this.jTextFieldTagName.getText();
- String toolCode = this.iComboBoxToolCode.getSelectedItem().toString();
- if (toolCode.equals(DataType.EMPTY_SELECT_ITEM)) {
- toolCode = "";
- }
- String tcf = this.jTextFieldToolChainFamily.getText();
- String featureFlag = this.jTextFieldFeatureFlag.getText();
- Vector<String> arch = this.jArchCheckBox.getSelectedItemsVector();
- sfid = new SourceFilesIdentification[s.length];
- for (int index = 0; index < s.length; index++) {
- sfid[index] = new SourceFilesIdentification(s[index], tagName, toolCode, tcf, featureFlag, arch);
- }
- return sfid;
- }
-
- /**
- Data validation for all fields
-
- @retval true - All datas are valid
- @retval false - At least one data is invalid
-
- **/
- public boolean checkAdd() {
- //
- // Check Filename
- //
- if (isEmpty(this.jTextFieldFileName.getText())) {
- Log.wrn("Update Source Files", "File Name must be entered!");
- return false;
- }
- if (!DataValidation.isFilename(this.jTextFieldFileName.getText())) {
- Log.wrn("Update Source Files", "Incorrect data type for File Name");
- return false;
- }
-
- //
- // Check TagName
- //
- if (!isEmpty(this.jTextFieldTagName.getText())) {
- if (!DataValidation.isTagName(this.jTextFieldTagName.getText())) {
- Log.wrn("Update Source Files", "Incorrect data type for Tag Name");
- return false;
- }
- }
-
- //
- // Check ToolCode
- //
- if (!isEmpty(this.jTextFieldToolCode.getText())) {
- if (!DataValidation.isToolCode(this.jTextFieldToolCode.getText())) {
- Log.wrn("Update Source Files", "Incorrect data type for Tool Code");
- return false;
- }
- }
-
- //
- // Check ToolChainFamily
- //
- if (!isEmpty(this.jTextFieldToolChainFamily.getText())) {
- if (!DataValidation.isToolChainFamily(this.jTextFieldToolChainFamily.getText())) {
- Log.wrn("Update Source Files", "Incorrect data type for Tool Chain Family");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Source Files", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- /**
- Display a file open browser to let user select file
-
- **/
- private void selectFile() {
- JFileChooser fc = new JFileChooser();
- fc.setCurrentDirectory(new File(Tools.getFilePathOnly(msaFileName)));
- fc.setMultiSelectionEnabled(true);
- int result = fc.showOpenDialog(new JPanel());
- if (result == JFileChooser.APPROVE_OPTION) {
- File f[] = fc.getSelectedFiles();
- String s = "";
- for (int index = 0; index < f.length; index++) {
- String relativePath = "";
- relativePath = Tools.getRelativePath(Tools.getFilePathOnly(f[index].getPath()), Tools.getFilePathOnly(msaFileName));
- if (!Tools.isEmpty(relativePath)) {
- relativePath = relativePath + DataType.UNIX_FILE_SEPARATOR;
- }
- s = s + relativePath + f[index].getName() + ";";
- }
- this.jTextFieldFileName.setText(s);
- }
- }
-
- public SourceFilesIdentification[] getSfid() {
- return sfid;
- }
-
- public void setSfid(SourceFilesIdentification[] sfid) {
- this.sfid = sfid;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SystemTablesDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SystemTablesDlg.java
deleted file mode 100644
index 83d29cec2c..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SystemTablesDlg.java
+++ /dev/null
@@ -1,458 +0,0 @@
-/** @file
- <<The file is used to create, update SystemTable in the MSA file>>
-
- <<This dialog is used to add or edit a System Table entry in the MSA file.>>
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.SystemTables.SystemTablesIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update SystemTables section of the MSA file
- *
- * It extends IDialog
- *
- */
-public class SystemTablesDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = 7488769180379442276L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelEntry = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private IComboBox iComboBoxGuidC_Name = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private SystemTablesIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- * This method initializes iComboBoxGuidC_Name
- *
- * @return javax.swing.JComboBox iComboBoxGuidC_Name
- *
- */
- private IComboBox getIComboBoxGuidC_Name() {
- if (iComboBoxGuidC_Name == null) {
- iComboBoxGuidC_Name = new IComboBox();
- iComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- iComboBoxGuidC_Name.setPreferredSize(new java.awt.Dimension(320, 20));
- iComboBoxGuidC_Name.setToolTipText("Select the GUID C Name of the System Table");
- }
- return iComboBoxGuidC_Name;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>Module requires a GUIDed entry in the system table</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>Module consumes a GUIDed entry in the system<br>table if it is present</td>"
- + "</tr><tr><td>ALWAYS_PRODUCED</td><td>Module always produces a GUIDed entry in the system table</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>Module produces a GUIDed entry in the system table<br>for some of its execution flows.</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @returns javax.swing.JScrollPane jScrollPaneHelpText
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 62));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 162, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 162, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 235);
- this.setContentPane(getJScrollPane());
- this.setTitle("System Tables");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inSystemTablesId
- *
- */
- private void init(SystemTablesIdentification inSystemTablesId, ModuleIdentification mid) {
- init();
- this.id = inSystemTablesId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined guids from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log
- .wrn("Init Guid",
- "This module hasn't defined any package dependency, so there is no guid value can be added for system table");
- }
- //
- // Init guids drop down list
- //
- Tools
- .generateComboBoxByVector(iComboBoxGuidC_Name,
- wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_SYSTEM_CONFIGURATION_TABLE));
-
-
- if (this.id != null) {
- this.iComboBoxGuidC_Name.setSelectedItem(id.getName());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inBootModesIdentification
- * @param iFrame
- *
- */
- public SystemTablesDlg(SystemTablesIdentification inSystemTablesIdentification, IFrame iFrame,
- ModuleIdentification mid) {
- super(iFrame, true);
- init(inSystemTablesIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelEntry = new JLabel();
- jLabelEntry.setText("Table's GUID C Name");
- jLabelEntry.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelHelpText.setText("Help Text");
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 132, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 107, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 107, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(480, 180));
-
- jContentPane.add(jLabelEntry, null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(getIComboBoxGuidC_Name(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel2, null);
-
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVSystemTableUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentSystemTables();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check Name
- //
- if (this.iComboBoxGuidC_Name.getSelectedItem() == null) {
- Log.wrn("Update Guids", "Please select one System Table Name");
- return false;
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update System Tables", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private SystemTablesIdentification getCurrentSystemTables() {
- String arg0 = this.iComboBoxGuidC_Name.getSelectedItem().toString();
- String arg1 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg2 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
- String arg4 = this.jTextAreaHelpText.getText();
-
- id = new SystemTablesIdentification(arg0, arg1, arg2, arg3, arg4);
- return id;
- }
-
- public SystemTablesIdentification getId() {
- return id;
- }
-
- public void setId(SystemTablesIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java
deleted file mode 100644
index b906e9adff..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java
+++ /dev/null
@@ -1,498 +0,0 @@
-/** @file
-
- The file is used to create, update Variables section of the MSA file
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Variables.VariablesIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Variables section of the MSA file
- *
- * It extends IDialog
- *
- */
-public class VariablesDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -6998982978030439446L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelVariableName = null;
-
- private JTextField jTextFieldVariableName = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelGuidCName = null;
-
- private IComboBox iComboBoxGuidC_Name = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private VariablesIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- * This method initializes jTextFieldString
- *
- * @return javax.swing.JTextField jTextFieldString
- *
- */
- private JTextField getJTextFieldString() {
- if (jTextFieldVariableName == null) {
- jTextFieldVariableName = new JTextField();
- jTextFieldVariableName.setSize(new java.awt.Dimension(320, 20));
- jTextFieldVariableName.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldVariableName.setLocation(new java.awt.Point(168, 12));
- jTextFieldVariableName.setToolTipText("Enter a string; the tool will convert to Unicode hex");
- }
- return jTextFieldVariableName;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>The module requires the variable entry to be set</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>The module will use the variable entry if it is set.</td></tr>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>The module will always write the variable.</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>The module will sometimes write the variable.</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField jTextFieldFeatureFlag
- *
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 157, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jTextFieldHelpText
- *
- * @return javax.swing.JTextField
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- jTextAreaHelpText.setToolTipText("Enter information on how to use this Variable.");
- }
- return jTextAreaHelpText;
- }
-
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 87));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes iComboBoxGuidC_Name
- *
- * @return javax.swing.JComboBox iComboBoxGuidC_Name
- *
- */
- private IComboBox getIComboBoxGuidC_Name() {
- if (iComboBoxGuidC_Name == null) {
- iComboBoxGuidC_Name = new IComboBox();
- iComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- iComboBoxGuidC_Name.setPreferredSize(new java.awt.Dimension(320, 20));
- iComboBoxGuidC_Name.setToolTipText("Select the GUID C Name of the Variable.");
- }
- return iComboBoxGuidC_Name;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 187, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 187, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 260);
- this.setContentPane(getJScrollPane());
- this.setTitle("Variables");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inVariablesId
- *
- */
- private void init(VariablesIdentification inVariablesId, ModuleIdentification mid) {
- init();
- this.id = inVariablesId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined guids from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log
- .wrn("Init Guid",
- "This module hasn't defined any package dependency, so there is no guid value can be added for variable");
- }
- //
- // Init guids drop down list
- //
- Tools
- .generateComboBoxByVector(iComboBoxGuidC_Name,
- wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_VARIABLE));
-
- if (this.id != null) {
- this.jTextFieldVariableName.setText(id.getName());
- this.iComboBoxGuidC_Name.setSelectedItem(id.getGuid());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inVariablesIdentification
- * @param iFrame
- *
- */
- public VariablesDlg(VariablesIdentification inVariablesIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inVariablesIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldVariableName.setEnabled(!isView);
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelVariableName = new JLabel();
- jLabelVariableName.setText("Variable Name");
- jLabelVariableName.setBounds(new java.awt.Rectangle(12, 12, 168, 20));
-
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelGuidCName = new JLabel();
- jLabelGuidCName.setBounds(new java.awt.Rectangle(12, 37, 168, 20));
- jLabelGuidCName.setText("Variable Guid C Name");
-
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(2, 62));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 62, 168, 20));
-
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 87, 168, 20));
- jLabelHelpText.setText("Help Text");
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 157, 168, 20));
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 132, 168, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(485, 215));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelVariableName, null);
- jContentPane.add(getJTextFieldString(), null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelGuidCName, null);
- jContentPane.add(getIComboBoxGuidC_Name(), null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentVariables();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * This method initializes Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage());
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check VariableName
- //
- if (isEmpty(this.jTextFieldVariableName.getText())) {
- Log.wrn("Update Variables", "Variable Name must be entered!");
- return false;
- }
-
- //
- // Check Guid Value
- //
- if (this.iComboBoxGuidC_Name.getSelectedItem() == null) {
- Log.wrn("Update Guids", "Please select one Varibale Guid value");
- return false;
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Variables", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private VariablesIdentification getCurrentVariables() {
- String arg0 = this.jTextFieldVariableName.getText();
- String arg1 = this.iComboBoxGuidC_Name.getSelectedItem().toString();
- String arg2 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg3 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();
- String arg5 = this.jTextAreaHelpText.getText();
-
- id = new VariablesIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- return id;
- }
-
- public VariablesIdentification getId() {
- return id;
- }
-
- public void setId(VariablesIdentification id) {
- this.id = id;
- }
-}