vPlatfromList = wt.getAllPlatforms();
+ if (vPlatfromList != null && vPlatfromList.size() > 0) {
+ for (int index = 0; index < vPlatfromList.size(); index++) {
+ if (vPlatfromList.get(index).getPath().equals(path)) {
+ Log.err("This platform is already existing in database");
+ return false;
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ Save file
+
+ **/
+ public void save() {
+ if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
+ this.saveModule();
+ }
+ if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
+ this.savePackage();
+ }
+ if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
+ this.savePlatform();
+ }
+ }
+
+ /**
+ Save all components of Msa Header
+
+ **/
+ private void saveModule() {
+ ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = null;
+ String path = Tools.convertPathToCurrentOsType(this.jTextFieldFilePath.getText());
+
+ //
+ // Save to memory
+ //
+ try {
+ MsaHeaderDocument.MsaHeader msaHeader = null;
+
+ msa = ModuleSurfaceAreaDocument.ModuleSurfaceArea.Factory.newInstance();
+ msaHeader = MsaHeaderDocument.MsaHeader.Factory.newInstance();
+
+ msaHeader.setModuleName(this.jTextFieldName.getText());
+ msaHeader.setGuidValue(this.jTextFieldGuid.getText());
+ msaHeader.setVersion(this.jTextFieldVersion.getText());
+
+ msa.setMsaHeader(msaHeader);
+ } catch (Exception e) {
+ Log.err("Save ModuleSurfaceArea Document", e.getMessage());
+ return;
+ }
+
+ //
+ // Save to real file
+ //
+ try {
+ SaveFile.saveMsaFile(path, msa);
+
+ } catch (Exception e) {
+ Log.err("Save Module to file system", e.getMessage());
+ return;
+ }
+
+ //
+ // Save to identification
+ //
+ mid = new ModuleIdentification(this.jTextFieldName.getText(), this.jTextFieldGuid.getText(),
+ this.jTextFieldVersion.getText(), path);
+ mid.setPackageId(packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()));
+ }
+
+ /**
+ Save all components of Spd Header
+
+ **/
+ private void savePackage() {
+ PackageSurfaceArea spd = null;
+ String path = Tools.convertPathToCurrentOsType(this.jTextFieldFilePath.getText());
+
+ //
+ // Save to memory
+ //
+ try {
+ SpdHeaderDocument.SpdHeader spdHeader = null;
+
+ spd = PackageSurfaceArea.Factory.newInstance();
+ spdHeader = SpdHeaderDocument.SpdHeader.Factory.newInstance();
+
+ spdHeader.setPackageName(this.jTextFieldName.getText());
+ spdHeader.setGuidValue(this.jTextFieldGuid.getText());
+ spdHeader.setVersion(this.jTextFieldVersion.getText());
+
+ spd.setSpdHeader(spdHeader);
+ } catch (Exception e) {
+ Log.err("Save PackageSurfaceArea Document", e.getMessage());
+ return;
+ }
+
+ //
+ // Save to real file
+ //
+ try {
+ SaveFile.saveSpdFile(path, spd);
+
+ } catch (Exception e) {
+ Log.err("Save Package to file system", e.getMessage());
+ return;
+ }
+
+ //
+ // Save to identification
+ //
+ pid = new PackageIdentification(this.jTextFieldName.getText(), this.jTextFieldGuid.getText(),
+ this.jTextFieldVersion.getText(), path);
+ }
+
+ /**
+ Save all components of Fpd Header
+
+ **/
+ private void savePlatform() {
+ PlatformSurfaceArea fpd = null;
+ String path = Tools.convertPathToCurrentOsType(this.jTextFieldFilePath.getText());
+
+ //
+ // Save to memory
+ //
+ try {
+ PlatformHeader fpdHeader = null;
+
+ fpd = PlatformSurfaceArea.Factory.newInstance();
+ fpdHeader = PlatformHeader.Factory.newInstance();
+
+ fpdHeader.setPlatformName(this.jTextFieldName.getText());
+ fpdHeader.setGuidValue(this.jTextFieldGuid.getText());
+ fpdHeader.setVersion(this.jTextFieldVersion.getText());
+
+ fpd.setPlatformHeader(fpdHeader);
+ } catch (Exception e) {
+ Log.err("Save FrameworkPlatformDescription Document", e.getMessage());
+ return;
+ }
+
+ //
+ // Save to real file
+ //
+ try {
+ SaveFile.saveFpdFile(path, fpd);
+
+ } catch (Exception e) {
+ Log.err("Save Platform to file system", e.getMessage());
+ return;
+ }
+
+ //
+ // Save to identification
+ //
+ fid = new PlatformIdentification(this.jTextFieldName.getText(), this.jTextFieldGuid.getText(),
+ this.jTextFieldVersion.getText(), path);
+ }
+
+ public ModuleIdentification getMid() {
+ return mid;
+ }
+
+ public void setMid(ModuleIdentification mid) {
+ this.mid = mid;
+ }
+
+ public PlatformIdentification getFid() {
+ return fid;
+ }
+
+ public void setFid(PlatformIdentification fid) {
+ this.fid = fid;
+ }
+
+ public PackageIdentification getPid() {
+ return pid;
+ }
+
+ public void setPid(PackageIdentification pid) {
+ this.pid = pid;
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java
new file mode 100644
index 0000000000..c096b72416
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java
@@ -0,0 +1,166 @@
+/** @file
+
+ The file is used to define all used final variables
+
+ 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.common;
+
+/**
+ The class is used to define all used final variables
+
+**/
+public class DataType {
+
+ /**
+
+ @param args
+
+ **/
+ public static void main(String[] args) {
+
+ }
+
+ //
+ // Define all return types
+ //
+ public static final int RETURN_TYPE_OK = 1;
+
+ public static final int RETURN_TYPE_CANCEL = 2;
+
+ public static final int RETURN_TYPE_NEXT = 3;
+
+ public static final int RETURN_TYPE_BACK = 4;
+
+ public static final int RETURN_TYPE_MODULE_SURFACE_AREA = 11;
+
+ public static final int RETURN_TYPE_PACKAGE_SURFACE_AREA = 12;
+
+ public static final int RETURN_TYPE_PLATFORM_SURFACE_AREA = 13;
+
+ public static final int RETURN_TYPE_BUILD_XML = 14;
+
+ public static final int RETURN_TYPE_WORKSPACE = 15;
+
+
+ //
+ // Define all used final variables
+ //
+ public static final String DOS_LINE_SEPARATOR = "\r\n";
+
+ public static final String UNIX_LINE_SEPARATOR = "\n";
+
+ public static final String EMPTY_SELECT_ITEM = "----";
+
+ public static final String DOS_FILE_SEPARATOR = "\\";
+
+ public static final String UNIX_FILE_SEPARATOR = "/";
+
+ //
+ // Define xml files ext
+ //
+ public static final String COPY_OF = "Copy of ";
+
+ public static final String FILE_EXT_SEPARATOR = ".";
+
+ public static final String WORKSPACE = "Workspace";
+
+ public static final String MODULE_SURFACE_AREA = "Module Surface Area Description";
+
+ public static final String MODULE_SURFACE_AREA_EXT = "msa";
+
+ public static final String MODULE_SURFACE_AREA_EXT_DESCRIPTION = MODULE_SURFACE_AREA + " (*." + MODULE_SURFACE_AREA_EXT + ")";
+
+ public static final String PACKAGE_SURFACE_AREA = "Package Surface Area Description";
+
+ public static final String PACKAGE_SURFACE_AREA_EXT = "spd";
+
+ public static final String PACKAGE_SURFACE_AREA_EXT_DESCRIPTION = PACKAGE_SURFACE_AREA + " (*." + PACKAGE_SURFACE_AREA_EXT + ")";
+
+ public static final String PLATFORM_SURFACE_AREA = "Platform Surface Area Description";
+
+ public static final String PLATFORM_SURFACE_AREA_EXT = "fpd";
+
+ public static final String PLATFORM_SURFACE_AREA_EXT_DESCRIPTION = PLATFORM_SURFACE_AREA + " (*." + PLATFORM_SURFACE_AREA_EXT + ")";
+
+ public static final String ANT_BUILD_FILE = "ANT Build File";
+
+ public static final String ANT_BUILD_FILE_EXT = "xml";
+
+ public static final String ANT_BUILD_FILE_EXT_DESCRIPTION = ANT_BUILD_FILE + " (*." + ANT_BUILD_FILE_EXT + ")";
+
+ //
+ // Define file separator for current OS
+ //
+ public static String FILE_SEPARATOR = System.getProperty("file.separator");
+
+ //
+ // Defien all used frame, container component's sizes
+ //
+ public static final int MAIN_FRAME_PREFERRED_SIZE_WIDTH = 800;
+ public static final int MAIN_FRAME_PREFERRED_SIZE_HEIGHT = 600;
+ public static final int MAIN_FRAME_MAX_SIZE_WIDTH = 1920;
+ public static final int MAIN_FRAME_MAX_SIZE_HEIGHT = 1200;
+
+ public static final int MAIN_FRAME_SPLIT_PANEL_PREFERRED_SIZE_WIDTH = 790;
+ public static final int MAIN_FRAME_SPLIT_PANEL_PREFERRED_SIZE_HEIGHT = 545;
+
+ public static final int MAIN_FRAME_WIDTH_SPACING = MAIN_FRAME_PREFERRED_SIZE_WIDTH - MAIN_FRAME_SPLIT_PANEL_PREFERRED_SIZE_WIDTH;
+ public static final int MAIN_FRAME_HEIGHT_SPACING = MAIN_FRAME_PREFERRED_SIZE_HEIGHT - MAIN_FRAME_SPLIT_PANEL_PREFERRED_SIZE_HEIGHT;
+
+ public static final int MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH = 273;
+ public static final int MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_HEIGHT = 545;
+
+ public static final int MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH = 515;
+ public static final int MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT = 545;
+ public static final int MAIN_FRAME_EDITOR_PANEL_LOCATION_X = 260;
+ public static final int MAIN_FRAME_EDITOR_PANEL_LOCATION_Y = 1;
+
+ public static final int SPACE_TO_RIGHT_FOR_GENERATE_BUTTON = 10;
+ public static final int SPACE_TO_RIGHT_FOR_OK_BUTTON = 10;
+ public static final int SPACE_TO_RIGHT_FOR_ADD_BUTTON = 180;
+ public static final int SPACE_TO_RIGHT_FOR_REMOVE_BUTTON = 95;
+ public static final int SPACE_TO_RIGHT_FOR_UPDATE_BUTTON = 10;
+ public static final int SPACE_TO_RIGHT_FOR_PROTOCOL_NOTIFY = 25;
+
+ public static final int LEFT_WIDTH = 160;
+ public static final int LEFT_HEIGHT = 20;
+
+ public static final int RIGHT_WIDTH = 320;
+ public static final int RIGHT_HEIGHT = 20;
+
+ public static final int RIGHT_MULTIPLE_HEIGHT = 4 * RIGHT_HEIGHT;
+
+ public static final int BUTTON_GEN_WIDTH = 65;
+ public static final int BUTTON_GEN_HEIGHT = 20;
+
+ public static final int BUTTON_BROWSE_WIDTH = 65;
+ public static final int BUTTON_BROWSE_HEIGHT = 20;
+
+ public static final int BUTTON_ADD_WIDTH = 80;
+ public static final int BUTTON_ADD_HEIGHT = 20;
+
+ public static final int BUTTON_UPDATE_WIDTH = 80;
+ public static final int BUTTON_UPDATE_HEIGHT = 20;
+
+ public static final int BUTTON_REMOVE_WIDTH = 80;
+ public static final int BUTTON_REMOVE_HEIGHT = 20;
+
+ public static final int SCROLLBAR_WIDTH = 18;
+ public static final int SCROLLBAR_HEIGHT = 18;
+
+ //
+ // Common Help Text
+ // First defined here
+ // Will be replaced by resource file later
+ //
+ public static final String SUP_ARCH_LIST_HELP_TEXT = "Deselecting a checkbox will restrict this module for use with the selected architectures, based on the list of items that are checked. If all boxes are checked, then the module will support all current AND FUTURE architectures";
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataValidation.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataValidation.java
new file mode 100644
index 0000000000..db568a6445
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataValidation.java
@@ -0,0 +1,712 @@
+/** @file
+
+ The file is used to provides all kinds of Data Validation interface
+
+ 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.common;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ The class is used to provides all kinds of data validation interface
+
+ All provided interfaces are in static mode
+
+ **/
+public class DataValidation {
+
+ /**
+ Reserved for test
+
+ @param args
+
+ **/
+ public static void main(String[] args) {
+
+ }
+
+ //
+ // The below is used to check common data types
+ //
+
+ /**
+ Check if the imput data is int
+
+ @param strInt The input string which needs validation
+
+ @retval true - The input is Int
+ @retval false - The input is not Int
+
+ **/
+ public static boolean isInt(String strInt) {
+ return isMatch("^-?[0-9]\\d*$", strInt);
+ }
+
+ /**
+ Check if the input data is int and it is in the valid scope
+ The scope is provided by String
+
+ @param strNumber The input string which needs validation
+ @param BeginNumber The left boundary of the scope
+ @param EndNumber The right boundary of the scope
+
+ @retval true - The input is Int and in the scope;
+ @retval false - The input is not Int or not in the scope
+
+ **/
+ public static boolean isInt(String strNumber, int BeginNumber, int EndNumber) {
+ //
+ //Check if the input data is int first
+ //
+ if (!isInt(strNumber)) {
+ return false;
+ }
+ //
+ //And then check if the data is between the scope
+ //
+ Integer intTemp = new Integer(strNumber);
+ if ((intTemp.intValue() < BeginNumber) || (intTemp.intValue() > EndNumber)) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ Check if the input data is int and it is in the valid scope
+ The scope is provided by String
+
+ @param strNumber The input string which needs validation
+ @param strBeginNumber The left boundary of the scope
+ @param strEndNumber The right boundary of the scope
+
+ @retval true - The input is Int and in the scope;
+ @retval false - The input is not Int or not in the scope
+
+ **/
+ public static boolean isInt(String strNumber, String strBeginNumber, String strEndNumber) {
+ //
+ //Check if all input data are int
+ //
+ if (!isInt(strNumber)) {
+ return false;
+ }
+ if (!isInt(strBeginNumber)) {
+ return false;
+ }
+ if (!isInt(strEndNumber)) {
+ return false;
+ }
+ //
+ //And then check if the data is between the scope
+ //
+ Integer intI = new Integer(strNumber);
+ Integer intJ = new Integer(strBeginNumber);
+ Integer intK = new Integer(strEndNumber);
+ if ((intI.intValue() < intJ.intValue()) || (intI.intValue() > intK.intValue())) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ Use regex to check if the input data is in valid format
+
+ @param strPattern The input regex
+ @param strMatcher The input data need be checked
+
+ @retval true - The data matches the regex
+ @retval false - The data doesn't match the regex
+
+ **/
+ public static boolean isMatch(String strPattern, String strMatcher) {
+ Pattern pattern = Pattern.compile(strPattern);
+ Matcher matcher = pattern.matcher(strMatcher);
+
+ return matcher.find();
+ }
+
+ //
+ // The below is used to check common customized data types
+ //
+
+ /**
+ Check if the input data is UiNameType
+
+ @param arg0 The input string need be checked
+
+ @retval true - The input is UiNameType
+ @retval false - The input is not UiNameType
+
+ **/
+ public static boolean isUiNameType(String arg0) {
+ if (arg0.length() < 1) {
+ return false;
+ }
+ return isMatch("[^ ].*", arg0);
+ }
+
+ /**
+ Check if the input data is GuidType2
+
+ @param arg0 The input string need be checked
+
+ @retval true - The input is GuidType2
+ @retval false - The input is not GuidType2
+
+ **/
+ public static boolean isGuidType2(String arg0) {
+ return isMatch("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", arg0);
+ }
+
+ /**
+ Check if the input data is Guid
+
+ @param strGuid The input string need be checked
+
+ @retval true - The input is Guid
+ @retval false - The input is not Guid
+
+ **/
+ public static boolean isGuid(String arg0) {
+ return isGuidType2(arg0);
+ }
+
+ /**
+ Check if the input data is Version
+
+ @param arg0 The input string need be checked
+
+ @retval true - The input is Version
+ @retval false - The input is not Version
+
+ **/
+ public static boolean isVersionDataType(String arg0) {
+ return isMatch("(\\d)+(.)?(\\d)+", arg0);
+ }
+
+ /**
+ Check if the input data is Sentence
+
+ @param strSentence The input string need be checked
+
+ @retval true - The input is Sentence
+ @retval false - The input is not Sentence
+
+ **/
+ public static boolean isSentence(String arg0) {
+ return isMatch("(\\w+\\W*)+( )+(\\W*\\w*\\W*\\s*)*", arg0);
+ }
+
+ /**
+ Check if the input data is FileNameConventio
+
+ @param strSentence The input string need be checked
+
+ @retval true - The input is FileNameConventio
+ @retval false - The input is not FileNameConventio
+
+ **/
+ public static boolean isFileNameConvention(String arg0) {
+ return isMatch("[a-zA-Z][a-zA-Z0-9]*((_)*(-)*(.)*[a-zA-Z0-9]*)*", arg0);
+ }
+
+ /**
+ Check if the input data is KeywordType
+
+ @param strSentence The input string need be checked
+
+ @retval true - The input is KeywordType
+ @retval false - The input is not KeywordType
+
+ **/
+ public static boolean isKeywordType(String arg0) {
+ return isMatch("[a-zA-Z]+(_*[a-zA-Z0-9]*)*", arg0);
+ }
+
+ /**
+ Check if the input data is FeatureFlagExpressionType
+
+ @param strSentence The input string need be checked
+
+ @retval true - The input is FeatureFlagExpressionType
+ @retval false - The input is not FeatureFlagExpressionType
+
+ **/
+ public static boolean isFeatureFlagExpressionType(String arg0) {
+ return (arg0.length() >= 1);
+ }
+
+ /**
+ Check if the input data is FeatureFlag
+
+ @param strSentence The input string need be checked
+
+ @retval true - The input is FeatureFlag
+ @retval false - The input is not FeatureFlag
+
+ **/
+ public static boolean isFeatureFlag(String arg0) {
+ return isFeatureFlagExpressionType(arg0);
+ }
+
+ /**
+ Check if the input data is PathAndFilename
+
+ @param strSentence The input string need be checked
+
+ @retval true - The input is PathAndFilename
+ @retval false - The input is not PathAndFilename
+
+ **/
+ public static boolean isPathAndFilename(String arg0) {
+ return !arg0.equals("");
+ }
+
+ /**
+ Check if the input data is ToolsNameConvention
+
+ @param strSentence The input string need be checked
+
+ @retval true - The input is ToolsNameConvention
+ @retval false - The input is not ToolsNameConvention
+
+ **/
+ public static boolean isToolsNameConvention(String arg0) {
+ return isMatch("[a-zA-Z][a-zA-Z0-9]*", arg0);
+ }
+
+ /**
+ Check if the input data is C_NameType
+
+ @param strSentence The input string need be checked
+
+ @retval true - The input is C_NameType
+ @retval false - The input is not C_NameType
+
+ **/
+ public static boolean isC_NameType(String arg0) {
+ return isMatch("(_)*[a-zA-Z]+((_)*[a-zA-Z0-9]*)*", arg0);
+ }
+
+ /**
+ Check if the input data is HexWordArrayType
+
+ @param strSentence The input string need be checked
+
+ @retval true - The input is HexWordArrayType
+ @retval false - The input is not HexWordArrayType
+
+ **/
+ public static boolean isHexWordArrayType(String arg0) {
+ return isMatch("((\\s)*0x([a-fA-F0-9]){4}(,)?(\\s)*)+", arg0);
+ }
+
+ /**
+ Check if the input data is Hex64BitDataType
+
+ @param strSentence The input string need be checked
+
+ @retval true - The input is Hex64BitDataType
+ @retval false - The input is not Hex64BitDataType
+
+ **/
+ public static boolean isHex64BitDataType(String arg0) {
+ return isMatch("(0x)?[a-fA-F0-9]{1,16}", arg0);
+ }
+
+ /**
+ Check if the input data is UnicodeString
+
+ @param strSentence The input string need be checked
+
+ @retval true - The input is UnicodeString
+ @retval false - The input is not UnicodeString
+
+ **/
+ public static boolean isUnicodeString(String arg0) {
+ return arg0.length() >= 3 && isMatch("(\\s)*L(\\:)?\"[^\"]*\"(\\s)*", arg0);
+ }
+
+ /**
+ Check if the input data is HexByteArrayType
+
+ @param strSentence The input string need be checked
+
+ @retval true - The input is HexByteArrayType
+ @retval false - The input is not HexByteArrayType
+
+ **/
+ public static boolean isHexByteArrayType(String arg0) {
+ return arg0.length() >= 4 && isMatch("((\\s)*0x([a-fA-F0-9]){2}(,)?(\\s)*)+", arg0);
+ }
+
+
+ /**
+ Check if the input data is DateType
+
+ @param strDateType The input string need be checked
+
+ @retval true - The input is DateType
+ @retval false - The input is not DateType
+
+ **/
+ public static boolean isDateType(String strDateType) {
+ return isMatch("[1-9][0-9][0-9][0-9]-[0-1][0-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]", strDateType);
+ }
+
+ /**
+ Check if the input data is DosPath
+
+ @param strDosPath The input string need be checked
+
+ @retval true - The input is DosPath
+ @retval false - The input is not DosPath
+
+ **/
+ public static boolean isDosPath(String strDosPath) {
+ return isMatch("([a-zA-Z]:\\\\)?(((\\\\?_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\\\)?)*", strDosPath);
+ }
+
+ /**
+ Check if the input data is UnixPath
+
+ @param strUnixPath The input string need be checked
+
+ @retval true - The input is UnixPath
+ @retval false - The input is not UnixPath
+
+ **/
+ public static boolean isUnixPath(String strUnixPath) {
+ return isMatch("(\\/)?(((_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\/)?)*", strUnixPath);
+ }
+
+ /**
+ Check if the input data is DirectoryNamingConvention
+
+ @param strDirectoryNamingConvention The input string need be checked
+
+ @retval true - The input is DirectoryNamingConvention
+ @retval false - The input is not DirectoryNamingConvention
+
+ **/
+ public static boolean isDirectoryNamingConvention(String strDirectoryNamingConvention) {
+ return (isDosPath(strDirectoryNamingConvention) || isUnixPath(strDirectoryNamingConvention));
+ }
+
+ /**
+ Check if the input data is HexDoubleWordDataType
+
+ @param strHexDoubleWordDataType The input string need be checked
+
+ @retval true - The input is HexDoubleWordDataType
+ @retval false - The input is not HexDoubleWordDataType
+
+ **/
+ public static boolean isHexDoubleWordDataType(String strHexDoubleWordDataType) {
+ return isMatch("0x[a-fA-F0-9]{1,8}", strHexDoubleWordDataType);
+ }
+
+ /**
+ Check if the input data is V1
+
+ @param strV1 The input string need be checked
+
+ @retval true - The input is V1
+ @retval false - The input is not V1
+
+ **/
+ public static boolean isV1(String strV1) {
+ return isMatch("((%[A-Z](_*[A-Z0-9]*)*%)+((((\\\\)?_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\\\)?)*)", strV1);
+ }
+
+ /**
+ Check if the input data is V2
+
+ @param strV2 The input string need be checked
+
+ @retval true - The input is V2
+ @retval false - The input is not V2
+
+ **/
+ public static boolean isV2(String strV2) {
+ return isMatch(
+ "(($[A-Z](_*[A-Z0-9]*)*)+||($\\([A-Z](_*[A-Z0-9]*)*\\))+||($\\{[A-Z](_*[A-Z0-9]*)*\\})+)+(\\/)?(((((_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\/)?)*)*)",
+ strV2);
+ }
+
+ /**
+ Check if the input data is VariableConvention
+
+ @param strVariableConvention The input string need be checked
+
+ @retval true - The input is VariableConvention
+ @retval false - The input is not VariableConvention
+
+ **/
+ public static boolean isVariableConvention(String strVariableConvention) {
+ return (isV1(strVariableConvention) || isV2(strVariableConvention));
+ }
+
+ /**
+ Check if the input data is UCName
+
+ @param strUCName The input string need be checked
+
+ @retval true - The input is UCName
+ @retval false - The input is not UCName
+
+ **/
+ public static boolean isUCName(String strUCName) {
+ return isMatch("[A-Z]+(_*[A-Z0-9]*( )*)*", strUCName);
+ }
+
+ /**
+ Check if the input data is HexByteDataType
+
+ @param strHex64BitDataType The input string need be checked
+
+ @retval true - The input is HexByteDataType
+ @retval false - The input is not HexByteDataType
+
+ **/
+ public static boolean isHexByteDataType(String strHex64BitDataType) {
+ return isMatch("(0x)?[a-fA-F0-9]{1,2}", strHex64BitDataType);
+ }
+
+ /**
+ Check if the input data is HexWordDataType
+
+ @param strHexWordDataType The input string need be checked
+
+ @retval true - The input is HexWordDataType
+ @retval false - The input is not HexWordDataType
+
+ **/
+ public static boolean isHexWordDataType(String strHexWordDataType) {
+ return isMatch("0x[a-fA-F0-9]{1,4}", strHexWordDataType);
+ }
+
+ /**
+ Check if the input data is OverrideID
+
+ @param strOverrideID The input string need be checked
+
+ @retval true - The input is OverrideID
+ @retval false - The input is not OverrideID
+
+ **/
+ public static boolean isOverrideID(String strOverrideID) {
+ return isInt(strOverrideID);
+ }
+
+ /**
+ Check if the input data is Supported Architectures
+
+ @param strSupportedArchitectures
+ @retval true - The input is Supported Architectures
+ @retval false - The input isn't Supported Architectures
+
+ */
+ public static boolean isSupportedArchitectures(String strSupportedArchitectures) {
+ return isMatch("(ALL){1}|(((IA32)|((X64)|(IPF)|(EBC)){1}((,((IA32)|(X64)|(IPF)|(EBC)){1} ){0,2}))){1}",
+ strSupportedArchitectures);
+ }
+
+ //
+ //The below is used to check msaheader data type
+ //
+
+ /**
+ Check if the input data is BaseName
+
+ @param strBaseName The input string need be checked
+
+ @retval true - The input is BaseName
+ @retval false - The input is not BaseName
+
+ **/
+ public static boolean isBaseName(String arg0) {
+ return isUiNameType(arg0);
+ }
+
+ /**
+ Check if the input data is Version
+
+ @param arg0 The input string need be checked
+
+ @retval true - The input is Version
+ @retval false - The input is not Version
+
+ **/
+ public static boolean isVersion(String arg0) {
+ return isVersionDataType(arg0);
+ }
+
+ /**
+ Check if the input data is Abstract
+
+ @param strAbstract The input string need be checked
+
+ @retval true - The input is Abstract
+ @retval false - The input is not Abstract
+
+ **/
+ public static boolean isAbstract(String arg0) {
+ return isSentence(arg0);
+ }
+
+ /**
+ Check if the input data is Copyright
+
+ @param strCopyright The input string need be checked
+
+ @retval true - The input is Copyright
+ @retval false - The input is not Copyright
+
+ **/
+ public static boolean isCopyright(String arg0) {
+ return !arg0.equals("");
+ }
+
+ /**
+ Check if the input data is Specification
+
+ @param strCopyright The input string need be checked
+
+ @retval true - The input is Specification
+ @retval false - The input is not Specification
+
+ **/
+ public static boolean isSpecification(String arg0) {
+ return isSentence(arg0);
+ }
+
+ //
+ // The below is used to check ModuleDefinitions data types
+ //
+ /**
+ Check if the input data is OutputFileBasename
+
+ @param strCopyright The input string need be checked
+
+ @retval true - The input is OutputFileBasename
+ @retval false - The input is not OutputFileBasename
+
+ **/
+ public static boolean isOutputFileBasename(String arg0) {
+ return isFileNameConvention(arg0);
+ }
+
+ //
+ // The below is used to check LibraryClass data types
+ //
+ /**
+ Check if the input data is LibraryClass
+
+ @param strCopyright The input string need be checked
+
+ @retval true - The input is LibraryClass
+ @retval false - The input is not LibraryClass
+
+ **/
+ public static boolean isLibraryClass(String arg0) {
+ return isKeywordType(arg0);
+ }
+
+ /**
+ Check if the input data is RecommendedInstanceVersion
+
+ @param strCopyright The input string need be checked
+
+ @retval true - The input is RecommendedInstanceVersion
+ @retval false - The input is not RecommendedInstanceVersion
+
+ **/
+ public static boolean isRecommendedInstanceVersion(String arg0) {
+ return isVersionDataType(arg0);
+ }
+
+ //
+ // The below is used to check sourcefiles data types
+ //
+
+ /**
+ Check if the input data is Filename
+
+ @param strPath The input string need be checked
+
+ @retval true - The input is Filename
+ @retval false - The input is not Filename
+
+ **/
+ public static boolean isFilename(String arg0) {
+ return isPathAndFilename(arg0);
+ }
+
+ /**
+ Check if the input data is TagName
+
+ @param strPath The input string need be checked
+
+ @retval true - The input is TagName
+ @retval false - The input is not TagName
+
+ **/
+ public static boolean isTagName(String arg0) {
+ return isToolsNameConvention(arg0);
+ }
+
+ /**
+ Check if the input data is ToolCode
+
+ @param strPath The input string need be checked
+
+ @retval true - The input is ToolCode
+ @retval false - The input is not ToolCode
+
+ **/
+ public static boolean isToolCode(String arg0) {
+ return isToolsNameConvention(arg0);
+ }
+
+ /**
+ Check if the input data is ToolChainFamily
+
+ @param strPath The input string need be checked
+
+ @retval true - The input is ToolChainFamily
+ @retval false - The input is not ToolChainFamily
+
+ **/
+ public static boolean isToolChainFamily(String arg0) {
+ return isToolsNameConvention(arg0);
+ }
+
+ //
+ // The below is used to check pcdcoded data types
+ //
+ /**
+ Check if the input data is DefaultValueType
+
+ @param strPath The input string need be checked
+
+ @retval true - The input is DefaultValueType
+ @retval false - The input is not DefaultValueType
+
+ **/
+ public static boolean isDefaultValueType(String arg0) {
+ return isHex64BitDataType(arg0) || isUnicodeString(arg0) || isHexByteArrayType(arg0);
+ }
+
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java
new file mode 100644
index 0000000000..2fc8b0268b
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java
@@ -0,0 +1,1006 @@
+/** @file
+
+ The file is used to init all JComboBox items
+
+ 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.common;
+
+import java.util.Vector;
+
+public class EnumerationData {
+ //
+ // Static data
+ //
+ public final static String EXTERNS_SPECIFICATION = "Specification";
+
+ public final static String EXTERNS_MODULE_ENTRY_POINT = "ModuleEntryPoint";
+ public final static String EXTERNS_MODULE_UNLOAD_IMAGE = "ModuleUnloadImage";
+
+ public final static String EXTERNS_CONSTRUCTOR = "Constructor";
+ public final static String EXTERNS_DESTRUCTOR = "Destructor";
+
+ public final static String EXTERNS_DRIVER_BINDING = "DriverBinding";
+ public final static String EXTERNS_COMPONENT_NAME = "ComponentName";
+ public final static String EXTERNS_DRIVER_CONFIG = "DriverConfig";
+ public final static String EXTERNS_DRIVER_DIAG = "DriverDiag";
+
+ public final static String EXTERNS_SET_VIRTUAL_ADDRESS_MAP_CALL_BACK = "SetVirtualAddressMapCallBack";
+ public final static String EXTERNS_EXIT_BOOT_SERVICES_CALL_BACK = "ExitBootServicesCallBack";
+
+ //
+ // Common data
+ //
+ public Vector vSupportedArchitectures = new Vector();
+
+ public Vector vEnabled = new Vector();
+
+ public Vector vBoolean = new Vector();
+
+ //
+ // Used by Msa Header
+ //
+ public Vector vModuleType = new Vector();
+
+ public Vector vCompontentType = new Vector();
+
+ //
+ // Used by Library Class Definitions
+ //
+ public Vector vLibraryUsage = new Vector();
+
+ public Vector vFrameworkModuleTypes = new Vector();
+
+ public Vector vLibClassDef = new Vector();
+
+ public Vector vLibClassDefBase = new Vector();
+
+ public Vector vLibClassDefPei = new Vector();
+
+ public Vector vLibClassDefPeim = new Vector();
+
+ public Vector vLibClassDefDxeCore = new Vector();
+
+ public Vector vLibClassDefDxeDriver = new Vector();
+
+ public Vector vLibClassDefDxeSmmDriver = new Vector();
+
+ public Vector vLibClassDefUefiDriver = new Vector();
+
+ //
+ // Used by Source Files
+ //
+ public Vector vSourceFilesToolChainFamily = new Vector();
+
+ public Vector vSourceFilesFileType = new Vector();
+
+ //
+ // Used by Package Dependencies
+ //
+ public Vector vPackageUsage = new Vector();
+
+ //
+ // Used by Protocols
+ //
+ public Vector vProtocolUsage = new Vector();
+
+ public Vector vProtocolNotifyUsage = new Vector();
+
+ public Vector vProtocolType = new Vector();
+
+ //
+ // Used by Events
+ //
+ public Vector vEventType = new Vector();
+
+ public Vector vEventUsage = new Vector();
+
+ public Vector vEventGroup = new Vector();
+
+ //
+ // Used by Hobs
+ //
+ public Vector vHobType = new Vector();
+
+ public Vector vHobUsage = new Vector();
+
+ //
+ // Used by Ppis
+ //
+ public Vector vPpiType = new Vector();
+
+ public Vector vPpiUsage = new Vector();
+
+ public Vector vPpiNotifyUsage = new Vector();
+
+ //
+ // Used by Variable
+ //
+ public Vector vVariableUsage = new Vector();
+
+ //
+ // Used by Boot Mode
+ //
+ public Vector vBootModeNames = new Vector();
+
+ public Vector vBootModeUsage = new Vector();
+
+ //
+ // Used by System Tables
+ //
+ public Vector vSystemTableUsage = new Vector();
+
+ //
+ // Used by Data Hubs
+ //
+ public Vector vDataHubUsage = new Vector();
+
+ //
+ // Used by Hii Packages
+ //
+ public Vector vHiiPackageUsage = new Vector();
+
+ //
+ // Used by Guid
+ //
+ public Vector vGuidUsage = new Vector();
+
+ //
+ // Used by Externs
+ //
+ public Vector vExternTypes = new Vector();
+
+ public Vector vPcdDriverTypes = new Vector();
+
+ //
+ // Used by Pcd
+ //
+ public Vector vPcdItemTypes = new Vector();
+
+ public EnumerationData() {
+ init();
+ }
+
+ private void init() {
+ //
+ // Init common data first
+ //
+ initSupportedArchitectures();
+ initEnabled();
+ initBoolean();
+
+ //
+ // Used by Msa header
+ //
+ initModuleType();
+
+ //
+ // Used by Library Class Definitions
+ //
+ initLibraryUsage();
+ initFrameworkModuleTypes();
+ initLibClassDefBase();
+ initLibClassDefPei();
+ initLibClassDefPeim();
+ initLibClassDefDxeCore();
+ initLibClassDefDxeDriver();
+ initLibClassDefDxeSmmDriver();
+ initLibClassDefUefiDriver();
+ initLibClassDef();
+
+ //
+ // Used by Library Class Definitions
+ //
+ initSourceFilesToolChainFamily();
+ initSourceFilesFileType();
+
+ //
+ // Used by Package Dependencies
+ //
+ initPackageUsage();
+
+ //
+ // Used by Protocols
+ //
+ initProtocolType();
+ initProtocolUsage();
+ initProtocolNotifyUsage();
+
+ //
+ // Used by Events
+ //
+ initEventType();
+ initEventUsage();
+ initEventGroup();
+
+ //
+ // Used by Hobs
+ //
+ initHobType();
+ initHobUsage();
+
+ //
+ // Used by Ppis
+ //
+ initPpiType();
+ initPpiUsage();
+ initPpiNotifyUsage();
+
+ //
+ // Used by Variable
+ //
+ initVariableUsage();
+
+ //
+ // Used by Boot Mode
+ //
+ initBootModeNames();
+ initBootModeUsage();
+
+ //
+ // Used by System Tables
+ //
+ initSystemTableUsage();
+
+ //
+ // Used by Data Hubs
+ //
+ initDataHubUsage();
+
+ //
+ // Used by Hii Packages
+ //
+ initHiiPackages();
+
+ //
+ // Used by Guid
+ //
+ initGuidUsage();
+
+ //
+ // Used by Externs
+ //
+ initExternTypes();
+ initPcdDriverTypes();
+
+ //
+ // Used by Pcd
+ //
+ initPcdItemTypes();
+
+ }
+
+ private void initEnabled() {
+ vEnabled.removeAllElements();
+ vEnabled.addElement("Disabled");
+ vEnabled.addElement("Enabled");
+ }
+
+ private void initBoolean() {
+ vBoolean.removeAllElements();
+ vBoolean.addElement("False");
+ vBoolean.addElement("True");
+ }
+
+ private void initModuleType() {
+ vModuleType.removeAllElements();
+ vModuleType.addElement("BASE");
+ vModuleType.addElement("SEC");
+ vModuleType.addElement("PEI_CORE");
+ vModuleType.addElement("PEIM");
+ vModuleType.addElement("DXE_CORE");
+ vModuleType.addElement("DXE_DRIVER");
+ vModuleType.addElement("DXE_RUNTIME_DRIVER");
+ vModuleType.addElement("DXE_SAL_DRIVER");
+ vModuleType.addElement("DXE_SMM_DRIVER");
+ vModuleType.addElement("TOOLS");
+ vModuleType.addElement("UEFI_DRIVER");
+ vModuleType.addElement("UEFI_APPLICATION");
+ vModuleType.addElement("USER_DEFINED");
+ }
+
+// private void initComponentType() {
+// vCompontentType.removeAllElements();
+// vCompontentType.addElement("APRIORI");
+// vCompontentType.addElement("LIBRARY");
+// vCompontentType.addElement("FV_IMAGE_FILE");
+// vCompontentType.addElement("BS_DRIVER");
+// vCompontentType.addElement("RT_DRIVER");
+// vCompontentType.addElement("SAL_RT_DRIVER");
+// vCompontentType.addElement("PE32_PEIM");
+// vCompontentType.addElement("PIC_PEIM");
+// vCompontentType.addElement("COMBINED_PEIM_DRIVER");
+// vCompontentType.addElement("PEI_CORE");
+// vCompontentType.addElement("DXE_CORE");
+// vCompontentType.addElement("APPLICATION");
+// vCompontentType.addElement("BS_DRIVER_EFI");
+// vCompontentType.addElement("SHELLAPP");
+// }
+
+ private void initSupportedArchitectures() {
+ vSupportedArchitectures.removeAllElements();
+ vSupportedArchitectures.addElement("EBC");
+ vSupportedArchitectures.addElement("IA32");
+ vSupportedArchitectures.addElement("X64");
+ vSupportedArchitectures.addElement("IPF");
+ vSupportedArchitectures.addElement("ARM");
+ vSupportedArchitectures.addElement("PPC");
+ }
+
+ private void initLibraryUsage() {
+ vLibraryUsage.removeAllElements();
+ vLibraryUsage.addElement("ALWAYS_CONSUMED");
+ vLibraryUsage.addElement("SOMETIMES_CONSUMED");
+ vLibraryUsage.addElement("ALWAYS_PRODUCED");
+ vLibraryUsage.addElement("SOMETIMES_PRODUCED");
+ vLibraryUsage.addElement("DEFAULT");
+ vLibraryUsage.addElement("PRIVATE");
+ }
+
+ private void initFrameworkModuleTypes() {
+ vFrameworkModuleTypes.removeAllElements();
+ vFrameworkModuleTypes.addElement("BASE");
+ vFrameworkModuleTypes.addElement("SEC");
+ vFrameworkModuleTypes.addElement("PEI_CORE");
+ vFrameworkModuleTypes.addElement("PEIM");
+ vFrameworkModuleTypes.addElement("DXE_CORE");
+ vFrameworkModuleTypes.addElement("DXE_DRIVER");
+ vFrameworkModuleTypes.addElement("DXE_RUNTIME_DRIVER");
+ vFrameworkModuleTypes.addElement("DXE_SAL_DRIVER");
+ vFrameworkModuleTypes.addElement("DXE_SMM_DRIVER");
+ vFrameworkModuleTypes.addElement("TOOLS");
+ vFrameworkModuleTypes.addElement("UEFI_DRIVER");
+ vFrameworkModuleTypes.addElement("UEFI_APPLICATION");
+ vFrameworkModuleTypes.addElement("USER_DEFINED");
+ }
+
+ private void initLibClassDef() {
+ vLibClassDef.removeAllElements();
+ for (int index = 0; index < vLibClassDefBase.size(); index++) {
+ vLibClassDef.addElement(vLibClassDefBase.elementAt(index));
+ }
+ for (int index = 0; index < vLibClassDefPei.size(); index++) {
+ vLibClassDef.addElement(vLibClassDefPei.elementAt(index));
+ }
+ for (int index = 0; index < vLibClassDefPeim.size(); index++) {
+ vLibClassDef.addElement(vLibClassDefPeim.elementAt(index));
+ }
+ for (int index = 0; index < vLibClassDefDxeCore.size(); index++) {
+ vLibClassDef.addElement(vLibClassDefDxeCore.elementAt(index));
+ }
+ for (int index = 0; index < vLibClassDefDxeDriver.size(); index++) {
+ vLibClassDef.addElement(vLibClassDefDxeDriver.elementAt(index));
+ }
+ for (int index = 0; index < vLibClassDefDxeSmmDriver.size(); index++) {
+ vLibClassDef.addElement(vLibClassDefDxeSmmDriver.elementAt(index));
+ }
+ for (int index = 0; index < vLibClassDefUefiDriver.size(); index++) {
+ vLibClassDef.addElement(vLibClassDefUefiDriver.elementAt(index));
+ }
+ }
+
+ private void initLibClassDefBase() {
+ vLibClassDefBase.removeAllElements();
+ vLibClassDefBase.addElement("BaseLib");
+ vLibClassDefBase.addElement("BaseMemoryLib");
+ vLibClassDefBase.addElement("CacheMaintenanceLib");
+ vLibClassDefBase.addElement("DebugLib");
+ vLibClassDefBase.addElement("IoLib");
+ vLibClassDefBase.addElement("PcdLib");
+ vLibClassDefBase.addElement("PciCf8Lib");
+ vLibClassDefBase.addElement("PciExpressLib");
+ vLibClassDefBase.addElement("PciLib");
+ vLibClassDefBase.addElement("PeCoffGetEntryPointLib");
+ vLibClassDefBase.addElement("PeCoffLib");
+ vLibClassDefBase.addElement("PerformanceLib");
+ vLibClassDefBase.addElement("PrintLib");
+ vLibClassDefBase.addElement("SmbusLib");
+ vLibClassDefBase.addElement("TimerLib");
+ }
+
+ private void initLibClassDefPei() {
+ vLibClassDefPei.removeAllElements();
+ vLibClassDefPei.addElement("PeiCoreEntryPoint");
+ }
+
+ private void initLibClassDefPeim() {
+ vLibClassDefPeim.removeAllElements();
+ vLibClassDefPeim.addElement("BaseMemoryLib");
+ vLibClassDefPeim.addElement("DebugLib");
+ vLibClassDefPeim.addElement("HobLib");
+ vLibClassDefPeim.addElement("IoLib");
+ vLibClassDefPeim.addElement("MemoryAllocationLib");
+ vLibClassDefPeim.addElement("PcdLib");
+ vLibClassDefPeim.addElement("PeiCoreLib");
+ vLibClassDefPeim.addElement("PeiServicesTablePointerLib");
+ vLibClassDefPeim.addElement("PeimEntryPoint");
+ vLibClassDefPeim.addElement("ReportStatusCodeLib");
+ vLibClassDefPeim.addElement("ResourcePublicationLib");
+ vLibClassDefPeim.addElement("SmbusLib");
+ }
+
+ private void initLibClassDefDxeCore() {
+ vLibClassDefDxeCore.removeAllElements();
+ vLibClassDefDxeCore.addElement("DxeCoreEntryPoint");
+ vLibClassDefDxeCore.addElement("HobLib");
+ }
+
+ private void initLibClassDefDxeDriver() {
+ vLibClassDefDxeDriver.removeAllElements();
+ vLibClassDefDxeDriver.addElement("DxeServicesTableLib");
+ vLibClassDefDxeDriver.addElement("HiiLib");
+ vLibClassDefDxeDriver.addElement("HobLib");
+ vLibClassDefDxeDriver.addElement("IoLib");
+ vLibClassDefDxeDriver.addElement("MemoryAllocationLib");
+ vLibClassDefDxeDriver.addElement("PcdLib");
+ vLibClassDefDxeDriver.addElement("ReportStatusCodeLib");
+ vLibClassDefDxeDriver.addElement("SmbusLib");
+ vLibClassDefDxeDriver.addElement("UefiBootServicesTableLib");
+ vLibClassDefDxeDriver.addElement("UefiDecompressLib");
+ vLibClassDefDxeDriver.addElement("UefiRuntimeServicesTableLib");
+ }
+
+ private void initLibClassDefDxeSmmDriver() {
+ vLibClassDefDxeSmmDriver.removeAllElements();
+ vLibClassDefDxeSmmDriver.addElement("DxeSmmDriverEntryPoint");
+ }
+
+ private void initLibClassDefUefiDriver() {
+ vLibClassDefUefiDriver.removeAllElements();
+ vLibClassDefUefiDriver.addElement("BaseMemoryLib");
+ vLibClassDefUefiDriver.addElement("DebugLib");
+ vLibClassDefUefiDriver.addElement("DevicePathLib");
+ vLibClassDefUefiDriver.addElement("UefiDriverEntryPoint");
+ vLibClassDefUefiDriver.addElement("UefiDriverModelLib");
+ vLibClassDefUefiDriver.addElement("UefiLib");
+ }
+
+ private void initSourceFilesToolChainFamily() {
+ vSourceFilesToolChainFamily.removeAllElements();
+ vSourceFilesToolChainFamily.addElement("MSFT");
+ vSourceFilesToolChainFamily.addElement("INTC");
+ vSourceFilesToolChainFamily.addElement("GCC");
+ }
+
+ private void initSourceFilesFileType() {
+ vSourceFilesFileType.removeAllElements();
+ vSourceFilesFileType.addElement("CCODE");
+ vSourceFilesFileType.addElement("CHEADER");
+ vSourceFilesFileType.addElement("ASMHEADER");
+ vSourceFilesFileType.addElement("ASM");
+ vSourceFilesFileType.addElement("UNI");
+ vSourceFilesFileType.addElement("TXT");
+ vSourceFilesFileType.addElement("DXS");
+ vSourceFilesFileType.addElement("BMP");
+ vSourceFilesFileType.addElement("VFR");
+ vSourceFilesFileType.addElement("BINARY");
+ vSourceFilesFileType.addElement("FV");
+ vSourceFilesFileType.addElement("FFS");
+ vSourceFilesFileType.addElement("EFI");
+ }
+
+ private void initPackageUsage() {
+ vPackageUsage.removeAllElements();
+ vPackageUsage.addElement("ALWAYS_CONSUMED");
+ vPackageUsage.addElement("ALWAYS_PRODUCED");
+ vPackageUsage.addElement("DEFAULT");
+ }
+
+ private void initProtocolUsage() {
+ vProtocolUsage.removeAllElements();
+ vProtocolUsage.addElement("ALWAYS_CONSUMED");
+ vProtocolUsage.addElement("SOMETIMES_CONSUMED");
+ vProtocolUsage.addElement("ALWAYS_PRODUCED");
+ vProtocolUsage.addElement("SOMETIMES_PRODUCED");
+ vProtocolUsage.addElement("TO_START");
+ vProtocolUsage.addElement("BY_START");
+ vProtocolUsage.addElement("PRIVATE");
+ }
+
+ private void initProtocolType() {
+ vProtocolType.removeAllElements();
+ vProtocolType.addElement("Protocol");
+ vProtocolType.addElement("Protocol Notify");
+ }
+
+ private void initEventType() {
+ vEventType.removeAllElements();
+ vEventType.addElement("CreateEvents");
+ vEventType.addElement("SignalEvents");
+ }
+
+ private void initEventUsage() {
+ vEventUsage.removeAllElements();
+ vEventUsage.addElement("ALWAYS_CONSUMED");
+ vEventUsage.addElement("SOMETIMES_CONSUMED");
+ vEventUsage.addElement("ALWAYS_PRODUCED");
+ vEventUsage.addElement("SOMETIMES_PRODUCED");
+ vEventUsage.addElement("PRIVATE");
+ }
+
+ private void initEventGroup() {
+ vEventGroup.removeAllElements();
+ vEventGroup.addElement("EVENT_GROUP_GUID");
+ vEventGroup.addElement("EVENT_TYPE_PERIODIC_TIMER");
+ vEventGroup.addElement("EVENT_TYPE_RELATIVE_TIMER");
+ }
+
+ private void initHobType() {
+ vHobType.removeAllElements();
+ vHobType.addElement("PHIT");
+ vHobType.addElement("MEMORY_ALLOCATION");
+ vHobType.addElement("RESOURCE_DESCRIPTOR");
+ vHobType.addElement("GUID_EXTENSION");
+ vHobType.addElement("FIRMWARE_VOLUME");
+ vHobType.addElement("CPU");
+ vHobType.addElement("POOL");
+ vHobType.addElement("CAPSULE_VOLUME");
+ }
+
+ private void initHobUsage() {
+ vHobUsage.removeAllElements();
+ vHobUsage.addElement("ALWAYS_CONSUMED");
+ vHobUsage.addElement("SOMETIMES_CONSUMED");
+ vHobUsage.addElement("ALWAYS_PRODUCED");
+ vHobUsage.addElement("SOMETIMES_PRODUCED");
+ vHobUsage.addElement("PRIVATE");
+ }
+
+ private void initPpiType() {
+ vPpiType.removeAllElements();
+ vPpiType.addElement("Ppi");
+ vPpiType.addElement("Ppi Notify");
+ }
+
+ private void initPpiUsage() {
+ vPpiUsage.removeAllElements();
+ vPpiUsage.addElement("ALWAYS_CONSUMED");
+ vPpiUsage.addElement("SOMETIMES_CONSUMED");
+ vPpiUsage.addElement("ALWAYS_PRODUCED");
+ vPpiUsage.addElement("SOMETIMES_PRODUCED");
+ vPpiUsage.addElement("PRIVATE");
+ }
+
+ private void initPpiNotifyUsage() {
+ vPpiNotifyUsage.removeAllElements();
+ vPpiNotifyUsage.addElement("SOMETIMES_CONSUMED");
+ }
+
+ private void initProtocolNotifyUsage() {
+ vProtocolNotifyUsage.addElement("SOMETIMES_CONSUMED");
+ }
+
+ private void initVariableUsage() {
+ vVariableUsage.removeAllElements();
+ vVariableUsage.addElement("ALWAYS_CONSUMED");
+ vVariableUsage.addElement("SOMETIMES_CONSUMED");
+ vVariableUsage.addElement("ALWAYS_PRODUCED");
+ vVariableUsage.addElement("SOMETIMES_PRODUCED");
+ vVariableUsage.addElement("PRIVATE");
+ }
+
+ private void initBootModeNames() {
+ vBootModeNames.removeAllElements();
+ vBootModeNames.addElement("FULL");
+ vBootModeNames.addElement("MINIMAL");
+ vBootModeNames.addElement("NO_CHANGE");
+ vBootModeNames.addElement("DIAGNOSTICS");
+ vBootModeNames.addElement("DEFAULT");
+ vBootModeNames.addElement("S2_RESUME");
+ vBootModeNames.addElement("S3_RESUME");
+ vBootModeNames.addElement("S4_RESUME");
+ vBootModeNames.addElement("S5_RESUME");
+ vBootModeNames.addElement("FLASH_UPDATE");
+ vBootModeNames.addElement("RECOVERY");
+ }
+
+ private void initBootModeUsage() {
+ vBootModeUsage.removeAllElements();
+ vBootModeUsage.addElement("ALWAYS_CONSUMED");
+ vBootModeUsage.addElement("SOMETIMES_CONSUMED");
+ vBootModeUsage.addElement("ALWAYS_PRODUCED");
+ vBootModeUsage.addElement("SOMETIMES_PRODUCED");
+ }
+
+ private void initSystemTableUsage() {
+ vSystemTableUsage.removeAllElements();
+ vSystemTableUsage.addElement("ALWAYS_CONSUMED");
+ vSystemTableUsage.addElement("SOMETIMES_CONSUMED");
+ vSystemTableUsage.addElement("ALWAYS_PRODUCED");
+ vSystemTableUsage.addElement("SOMETIMES_PRODUCED");
+ vSystemTableUsage.addElement("PRIVATE");
+ }
+
+ private void initDataHubUsage() {
+ vDataHubUsage.removeAllElements();
+ vDataHubUsage.addElement("ALWAYS_CONSUMED");
+ vDataHubUsage.addElement("SOMETIMES_CONSUMED");
+ vDataHubUsage.addElement("ALWAYS_PRODUCED");
+ vDataHubUsage.addElement("SOMETIMES_PRODUCED");
+ vDataHubUsage.addElement("PRIVATE");
+ }
+
+ private void initHiiPackages() {
+ vHiiPackageUsage.removeAllElements();
+ vHiiPackageUsage.addElement("ALWAYS_PRODUCED");
+ vHiiPackageUsage.addElement("SOMETIMES_PRODUCED");
+ vHiiPackageUsage.addElement("PRIVATE");
+ }
+
+ private void initGuidUsage() {
+ vGuidUsage.removeAllElements();
+ vGuidUsage.addElement("ALWAYS_CONSUMED");
+ vGuidUsage.addElement("SOMETIMES_CONSUMED");
+ vGuidUsage.addElement("ALWAYS_PRODUCED");
+ vGuidUsage.addElement("SOMETIMES_PRODUCED");
+ vGuidUsage.addElement("DEFAULT");
+ vGuidUsage.addElement("PRIVATE");
+ }
+
+ private void initExternTypes() {
+ vExternTypes.removeAllElements();
+ vExternTypes.addElement(EnumerationData.EXTERNS_SPECIFICATION);
+
+ vExternTypes.addElement(EnumerationData.EXTERNS_MODULE_ENTRY_POINT);
+ vExternTypes.addElement(EnumerationData.EXTERNS_MODULE_UNLOAD_IMAGE);
+
+ vExternTypes.addElement(EnumerationData.EXTERNS_CONSTRUCTOR);
+ vExternTypes.addElement(EnumerationData.EXTERNS_DESTRUCTOR);
+
+ vExternTypes.addElement(EnumerationData.EXTERNS_DRIVER_BINDING);
+ vExternTypes.addElement(EnumerationData.EXTERNS_COMPONENT_NAME);
+ vExternTypes.addElement(EnumerationData.EXTERNS_DRIVER_CONFIG);
+ vExternTypes.addElement(EnumerationData.EXTERNS_DRIVER_DIAG);
+
+ vExternTypes.addElement(EnumerationData.EXTERNS_SET_VIRTUAL_ADDRESS_MAP_CALL_BACK);
+ vExternTypes.addElement(EnumerationData.EXTERNS_EXIT_BOOT_SERVICES_CALL_BACK);
+ }
+
+ private void initPcdDriverTypes() {
+ vPcdDriverTypes.removeAllElements();
+ vPcdDriverTypes.addElement(DataType.EMPTY_SELECT_ITEM);
+ vPcdDriverTypes.addElement("PEI_PCD_DRIVER");
+ vPcdDriverTypes.addElement("DXE_PCD_DRIVER");
+ }
+
+ private void initPcdItemTypes() {
+ vPcdItemTypes.removeAllElements();
+ vPcdItemTypes.addElement("FEATURE_FLAG");
+ vPcdItemTypes.addElement("FIXED_AT_BUILD");
+ vPcdItemTypes.addElement("PATCHABLE_IN_MODULE");
+ vPcdItemTypes.addElement("DYNAMIC");
+ vPcdItemTypes.addElement("DYNAMIC_EX");
+ }
+
+ public Vector getvCompontentType() {
+ return vCompontentType;
+ }
+
+ public void setvCompontentType(Vector componentType) {
+ vCompontentType = componentType;
+ }
+
+ public Vector getVModuleType() {
+ return vModuleType;
+ }
+
+ public void setVModuleType(Vector moduleType) {
+ vModuleType = moduleType;
+ }
+
+ public Vector getVLibraryUsage() {
+ return vLibraryUsage;
+ }
+
+ public void setVLibClassDefUsage(Vector libClassDefUsage) {
+ vLibraryUsage = libClassDefUsage;
+ }
+
+ public Vector getVLibClassDef() {
+ return vLibClassDef;
+ }
+
+ public void setVLibClassDef(Vector libClassDef) {
+ vLibClassDef = libClassDef;
+ }
+
+ public Vector getVCompontentType() {
+ return vCompontentType;
+ }
+
+ public void setVCompontentType(Vector compontentType) {
+ vCompontentType = compontentType;
+ }
+
+ public Vector getVLibClassDefBase() {
+ return vLibClassDefBase;
+ }
+
+ public void setVLibClassDefBase(Vector libClassDefBase) {
+ vLibClassDefBase = libClassDefBase;
+ }
+
+ public Vector getVLibClassDefDxeCore() {
+ return vLibClassDefDxeCore;
+ }
+
+ public void setVLibClassDefDxeCore(Vector libClassDefDxeCore) {
+ vLibClassDefDxeCore = libClassDefDxeCore;
+ }
+
+ public Vector getVLibClassDefDxeDriver() {
+ return vLibClassDefDxeDriver;
+ }
+
+ public void setVLibClassDefDxeDriver(Vector libClassDefDxeDriver) {
+ vLibClassDefDxeDriver = libClassDefDxeDriver;
+ }
+
+ public Vector getVLibClassDefDxeSmmDriver() {
+ return vLibClassDefDxeSmmDriver;
+ }
+
+ public void setVLibClassDefDxeSmmDriver(Vector libClassDefDxeSmmDriver) {
+ vLibClassDefDxeSmmDriver = libClassDefDxeSmmDriver;
+ }
+
+ public Vector getVLibClassDefPei() {
+ return vLibClassDefPei;
+ }
+
+ public void setVLibClassDefPei(Vector libClassDefPei) {
+ vLibClassDefPei = libClassDefPei;
+ }
+
+ public Vector getVLibClassDefPeim() {
+ return vLibClassDefPeim;
+ }
+
+ public void setVLibClassDefPeim(Vector libClassDefPeim) {
+ vLibClassDefPeim = libClassDefPeim;
+ }
+
+ public Vector getVLibClassDefUefiDriver() {
+ return vLibClassDefUefiDriver;
+ }
+
+ public void setVLibClassDefUefiDriver(Vector libClassDefUefiDriver) {
+ vLibClassDefUefiDriver = libClassDefUefiDriver;
+ }
+
+ public Vector getVSourceFilesFileType() {
+ return vSourceFilesFileType;
+ }
+
+ public void setVSourceFilesFileType(Vector sourceFilesFileType) {
+ vSourceFilesFileType = sourceFilesFileType;
+ }
+
+ public Vector getVSourceFilesToolChainFamily() {
+ return vSourceFilesToolChainFamily;
+ }
+
+ public void setVSourceFilesToolChainFamily(Vector sourceFilesToolChainFamily) {
+ vSourceFilesToolChainFamily = sourceFilesToolChainFamily;
+ }
+
+ public void setVLibraryUsage(Vector libraryUsage) {
+ vLibraryUsage = libraryUsage;
+ }
+
+ public Vector getVProtocolNotifyUsage() {
+ return vProtocolNotifyUsage;
+ }
+
+ public void setVProtocolNotifyUsage(Vector protocolNotifyUsage) {
+ vProtocolNotifyUsage = protocolNotifyUsage;
+ }
+
+ public Vector getVProtocolUsage() {
+ return vProtocolUsage;
+ }
+
+ public void setVProtocolUsage(Vector protocolUsage) {
+ vProtocolUsage = protocolUsage;
+ }
+
+ public Vector getVSupportedArchitectures() {
+ return vSupportedArchitectures;
+ }
+
+ public void setVSupportedArchitectures(Vector supportedArchitectures) {
+ vSupportedArchitectures = supportedArchitectures;
+ }
+
+ public Vector getVProtocolType() {
+ return vProtocolType;
+ }
+
+ public void setVProtocolType(Vector protocolType) {
+ vProtocolType = protocolType;
+ }
+
+ public Vector getVEventGroup() {
+ return vEventGroup;
+ }
+
+ public void setVEventGroup(Vector eventGroup) {
+ vEventGroup = eventGroup;
+ }
+
+ public Vector getVEventType() {
+ return vEventType;
+ }
+
+ public void setVEventType(Vector eventType) {
+ vEventType = eventType;
+ }
+
+ public Vector getVEventUsage() {
+ return vEventUsage;
+ }
+
+ public void setVEventUsage(Vector eventUsage) {
+ vEventUsage = eventUsage;
+ }
+
+ public Vector getVEnabled() {
+ return vEnabled;
+ }
+
+ public void setVEnabled(Vector enabled) {
+ vEnabled = enabled;
+ }
+
+ public Vector getVHobType() {
+ return vHobType;
+ }
+
+ public void setVHobType(Vector hobType) {
+ vHobType = hobType;
+ }
+
+ public Vector getVHobUsage() {
+ return vHobUsage;
+ }
+
+ public void setVHobUsage(Vector hobUsage) {
+ vHobUsage = hobUsage;
+ }
+
+ public Vector getVPpiNotifyUsage() {
+ return vPpiNotifyUsage;
+ }
+
+ public void setVPpiNotifyUsage(Vector ppiNotifyUsage) {
+ vPpiNotifyUsage = ppiNotifyUsage;
+ }
+
+ public Vector getVPpiType() {
+ return vPpiType;
+ }
+
+ public void setVPpiType(Vector ppiType) {
+ vPpiType = ppiType;
+ }
+
+ public Vector getVPpiUsage() {
+ return vPpiUsage;
+ }
+
+ public void setVPpiUsage(Vector ppiUsage) {
+ vPpiUsage = ppiUsage;
+ }
+
+ public Vector getVVariableUsage() {
+ return vVariableUsage;
+ }
+
+ public void setVVariableUsage(Vector variableUsage) {
+ vVariableUsage = variableUsage;
+ }
+
+ public Vector getVBootModeNames() {
+ return vBootModeNames;
+ }
+
+ public void setVBootModeNames(Vector bootModeNames) {
+ vBootModeNames = bootModeNames;
+ }
+
+ public Vector getVBootModeUsage() {
+ return vBootModeUsage;
+ }
+
+ public void setVBootModeUsage(Vector bootModeUsage) {
+ vBootModeUsage = bootModeUsage;
+ }
+
+ public Vector getVSystemTableUsage() {
+ return vSystemTableUsage;
+ }
+
+ public void setVSystemTableUsage(Vector systemTableUsage) {
+ vSystemTableUsage = systemTableUsage;
+ }
+
+ public Vector getVDataHubUsage() {
+ return vDataHubUsage;
+ }
+
+ public void setVDataHubUsage(Vector dataHubUsage) {
+ vDataHubUsage = dataHubUsage;
+ }
+
+ public Vector getVGuidUsage() {
+ return vGuidUsage;
+ }
+
+ public void setVGuidUsage(Vector guidUsage) {
+ vGuidUsage = guidUsage;
+ }
+
+ public Vector getVHiiPackageUsage() {
+ return vHiiPackageUsage;
+ }
+
+ public void setVHiiPackageUsage(Vector hiiPackageUsage) {
+ vHiiPackageUsage = hiiPackageUsage;
+ }
+
+ public Vector getVPcdItemTypes() {
+ return vPcdItemTypes;
+ }
+
+ public void setVPcdItemTypes(Vector pcdItemTypes) {
+ vPcdItemTypes = pcdItemTypes;
+ }
+
+ public Vector getVExternTypes() {
+ return vExternTypes;
+ }
+
+ public void setVExternTypes(Vector externTypes) {
+ vExternTypes = externTypes;
+ }
+
+ public Vector getVPcdDriverTypes() {
+ return vPcdDriverTypes;
+ }
+
+ public void setVPcdDriverTypes(Vector pcdDriverTypes) {
+ vPcdDriverTypes = pcdDriverTypes;
+ }
+
+ public Vector getVBoolean() {
+ return vBoolean;
+ }
+
+ public void setVBoolean(Vector boolean1) {
+ vBoolean = boolean1;
+ }
+
+ public Vector getVFrameworkModuleTypes() {
+ return vFrameworkModuleTypes;
+ }
+
+ public void setVFrameworkModuleTypes(Vector frameworkModuleTypes) {
+ vFrameworkModuleTypes = frameworkModuleTypes;
+ }
+
+ public Vector getVPackageUsage() {
+ return vPackageUsage;
+ }
+
+ public void setVPackageUsage(Vector packageUsage) {
+ vPackageUsage = packageUsage;
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/FileOperation.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/FileOperation.java
new file mode 100644
index 0000000000..21d6cfa596
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/FileOperation.java
@@ -0,0 +1,203 @@
+/** @file
+
+ The file is used to provides interfaces for file operations
+
+ 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.common;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+
+public class FileOperation {
+
+ /**
+
+ @param args
+ * @throws Exception
+
+ **/
+ public static void main(String[] args) throws Exception {
+ FileOperation.newFolder("C:\\aaa\\bbb\\ccc\\ddd\\eee");
+ }
+
+ /**
+ To new a folder
+
+ @param folderPath The folder path to be created
+ @throws Exception
+
+ **/
+ public static void newFolder(String folderPath) throws Exception {
+ folderPath = Tools.convertPathToCurrentOsType(folderPath);
+ String temp = "";
+ while (folderPath.length() > 0) {
+ if (folderPath.indexOf(DataType.FILE_SEPARATOR) > -1) {
+ temp = temp + folderPath.substring(0, folderPath.indexOf(DataType.FILE_SEPARATOR));
+ if (temp.endsWith(":")) {
+ temp = temp + DataType.FILE_SEPARATOR;
+ folderPath = folderPath.substring(folderPath.indexOf(DataType.FILE_SEPARATOR) + DataType.FILE_SEPARATOR.length());
+ continue;
+ }
+ temp = temp + DataType.FILE_SEPARATOR;
+ folderPath = folderPath.substring(folderPath.indexOf(DataType.FILE_SEPARATOR) + DataType.FILE_SEPARATOR.length());
+ } else {
+ temp = temp + DataType.FILE_SEPARATOR + folderPath;
+ folderPath = "";
+ }
+ File f = new File(temp);
+ if (!f.exists()) {
+ f.mkdir();
+ }
+ }
+ }
+
+ /**
+ Delete a file
+
+ @param filePath The file path to be deleted
+ @throws Exception
+
+ **/
+ public static void delFile(String filePath) throws Exception {
+ File f = new File(filePath);
+ if (f.exists()) {
+ f.delete();
+ }
+ }
+
+ /**
+ Delete a folder and all its files
+
+ @param filePath The name of the folder which need be deleted
+ @throws Exception
+
+ **/
+ public static void delFolder(String filePath) throws Exception {
+ File f = new File(filePath);
+ if (!f.exists()) {
+ return;
+ }
+ if (!f.isDirectory()) {
+ return;
+ }
+ delFolder(f);
+ }
+
+ /**
+ Delete a folder and all its files
+
+ @param fleFolderName The name of the folder which need be deleted
+
+ @retval true - Delete successfully
+ @retval false - Delete successfully
+
+ **/
+ private static boolean delFolder(File fileName) throws Exception {
+ boolean blnIsDeleted = true;
+
+ File[] aryAllFiles = fileName.listFiles();
+
+ for (int indexI = 0; indexI < aryAllFiles.length; indexI++) {
+ if (blnIsDeleted) {
+ if (aryAllFiles[indexI].isDirectory()) {
+ //
+ //If is a directory, recursively call this function to delete sub folders
+ //
+ blnIsDeleted = delFolder(aryAllFiles[indexI]);
+ } else if (aryAllFiles[indexI].isFile()) {
+ //
+ //If is a file, delete it
+ //
+ if (!aryAllFiles[indexI].delete()) {
+ blnIsDeleted = false;
+ }
+ }
+ }
+ }
+ if (blnIsDeleted) {
+ fileName.delete();
+ }
+ return blnIsDeleted;
+ }
+
+ /**
+ Copy a file
+
+ @param oldPath
+ @param newPath
+ @throws Exception
+
+ **/
+ public static void copyFile(String oldPath, String newPath) throws Exception {
+ int byteCount = 0;
+ File oldFile = new File(oldPath);
+
+ if (oldFile.exists()) {
+ InputStream is = new FileInputStream(oldPath);
+ FileOutputStream fos = new FileOutputStream(newPath);
+ byte[] buffer = new byte[1024];
+
+ while ((byteCount = is.read(buffer)) != -1) {
+ fos.write(buffer, 0, byteCount);
+ }
+
+ is.close();
+ }
+ }
+
+ /**
+ Copy a folder
+
+ @param oldPath
+ @param newPath
+ @throws Exception
+
+ **/
+ public static void copyFolder(String oldPath, String newPath) throws Exception {
+ File oldFile = new File(oldPath);
+
+ //
+ // Create new file path first
+ //
+ newFolder(newPath);
+
+ String[] files = oldFile.list();
+ File temp = null;
+ for (int index = 0; index < files.length; index++) {
+ if (oldPath.endsWith(DataType.FILE_SEPARATOR)) {
+ temp = new File(oldPath + files[index]);
+ } else {
+ temp = new File(oldPath + DataType.FILE_SEPARATOR + files[index]);
+ }
+
+ if (temp.isFile()) {
+ FileInputStream fis = new FileInputStream(temp);
+ FileOutputStream fos = new FileOutputStream(newPath + DataType.FILE_SEPARATOR
+ + (temp.getName()).toString());
+ byte[] b = new byte[1024 * 5];
+ int len;
+ while ((len = fis.read(b)) != -1) {
+ fos.write(b, 0, len);
+ }
+ fos.flush();
+ fos.close();
+ fis.close();
+ }
+ if (temp.isDirectory()) {
+ copyFolder(oldPath + DataType.FILE_SEPARATOR + files[index], newPath + DataType.FILE_SEPARATOR
+ + files[index]);
+ }
+ }
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IFileFilter.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IFileFilter.java
new file mode 100644
index 0000000000..d13a8c48ef
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IFileFilter.java
@@ -0,0 +1,87 @@
+/** @file
+
+ The file is used to override FileFilter to provides customized interfaces
+
+ 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.common;
+
+import java.io.File;
+
+import javax.swing.filechooser.FileFilter;
+
+/**
+ The class is used to override FileFilter to provides customized interfaces
+
+ **/
+public class IFileFilter extends FileFilter {
+
+ private String strExt;
+
+ /**
+ Reserved for test
+
+ @param args
+
+ **/
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ This is the default constructor
+
+ @param ext
+
+ **/
+ public IFileFilter(String ext) {
+ this.strExt = ext;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
+ *
+ * Override method "accept"
+ *
+ */
+ public boolean accept(File file) {
+ if (file.isDirectory()) {
+ return true;
+ }
+ String strFileName = file.getName();
+ int intIndex = strFileName.lastIndexOf('.');
+ if (intIndex > 0 && intIndex < strFileName.length() - 1) {
+ String strExtension = strFileName.substring(intIndex + 1).toLowerCase();
+ if (strExtension.equals(strExt))
+ return true;
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.filechooser.FileFilter#getDescription()
+ *
+ * Override method "getDescription" to config description via different file type
+ *
+ */
+ public String getDescription() {
+ if (strExt.equals(DataType.MODULE_SURFACE_AREA_EXT))
+ return DataType.MODULE_SURFACE_AREA_EXT_DESCRIPTION;
+ if (strExt.equals(DataType.PACKAGE_SURFACE_AREA_EXT))
+ return DataType.PACKAGE_SURFACE_AREA_EXT_DESCRIPTION;
+ if (strExt.equals(DataType.PLATFORM_SURFACE_AREA_EXT))
+ return DataType.PLATFORM_SURFACE_AREA_EXT_DESCRIPTION;
+ return "";
+ }
+
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Log.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Log.java
new file mode 100644
index 0000000000..d85fbf5a96
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Log.java
@@ -0,0 +1,209 @@
+/** @file
+
+ The file is used to provides static interfaces to save log and error information
+
+ 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.common;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import javax.swing.JOptionPane;
+
+/**
+ The class is used to provides static interfaces to save log and error information
+
+ **/
+public class Log {
+
+ //
+ //Log file
+ //
+ private static File fleLogFile = null;
+
+ //
+ //Err file
+ //
+ private static File fleErrFile = null;
+
+ //
+ //Log file name
+ //
+ static String strLogFileName = "Log.log";
+
+ //
+ //Err file name
+ //
+ static String strErrFileName = "Err.log";
+
+ /**
+ Main class, used for test
+
+ @param args
+
+ **/
+ public static void main(String[] args) {
+ try {
+ Log.log("Test", "test");
+ Log.err("Test1", "test1");
+ Log.err("sdfsdfsd fsdfsdfsdfsdfj dsfksdjflsdjf sdkfjsdklfjsdkf dskfsjdkfjks dskfjsdklfjsdkf sdkfjsdlf sdkfjsdk kdfjskdf sdkfjsdkf ksdjfksdfjskdf sdkfsjdfksd fskdfjsdf", "dfsdf sdfksdf sd sdfksd fsdf");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ This is the default constructor
+ Do nothing
+
+ **/
+ public Log() {
+ }
+
+ /**
+ Call writeToLogFile to save log item and log information to log file
+
+ @param strItem The log item
+ @param strLog The log information
+
+ **/
+ public static void log(String strItem, String strLog) {
+ try {
+ writeToLogFile(strItem + ":" + strLog);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ Call writeToLogFile to save log information to log file
+
+ @param strLog The log information
+
+ **/
+ public static void log(String strLog) {
+ try {
+ writeToLogFile(strLog);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ Call writeToErrFile to save err item and err information to err file
+
+ @param strItem The err item
+ @param strLog The err information
+
+ **/
+ public static void err(String strItem, String strErr) {
+ try {
+ writeToErrFile("Error when " + strItem + "::" + strErr);
+ showErrMessage("Error when " + strItem + "::" + strErr);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ Call writeToErrFile to save err information to err file
+
+ @param strLog The err information
+
+ **/
+ public static void err(String strErr) {
+ try {
+ writeToErrFile("Error::" + strErr);
+ showErrMessage("Error::" + strErr);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ Brings up a dialog to show err message
+ When the message's length > defined max length, wrap the text to the next line.
+
+ @param strErr The input data of err message
+
+ **/
+ private static void showErrMessage(String strErr) {
+ int intMaxLength = 40;
+ String strReturn = "";
+ String strTemp = "";
+ while (strErr.length() > 0) {
+ if (strErr.length() > intMaxLength) {
+ strTemp = strErr.substring(0, intMaxLength);
+ strErr = strErr.substring(strTemp.length());
+ strReturn = strReturn + strTemp + DataType.UNIX_LINE_SEPARATOR;
+
+ } else if (strErr.length() <= intMaxLength) {
+ strReturn = strReturn + strErr;
+ strErr = "";
+ }
+ }
+ JOptionPane.showConfirmDialog(null, strReturn, "Error", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
+ }
+
+ /**
+ Open log file and write log information
+
+ @param strLog The log information
+ @throws IOException
+
+ **/
+ private static void writeToLogFile(String strLog) throws IOException {
+ try {
+ if (fleLogFile == null) {
+ fleLogFile = new File(strLogFileName);
+ fleLogFile.createNewFile();
+ }
+ FileOutputStream fos = new FileOutputStream(fleLogFile, true);
+ fos.write((Tools.getCurrentDateTime() + DataType.DOS_LINE_SEPARATOR).getBytes());
+ fos.write((strLog + DataType.DOS_LINE_SEPARATOR).getBytes());
+ fos.flush();
+ fos.close();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ Open err file and write err information
+
+ @param strLog The log information
+ @throws IOException
+
+ **/
+ private static void writeToErrFile(String strLog) throws IOException {
+ try {
+ if (fleErrFile == null) {
+ fleErrFile = new File(strErrFileName);
+ fleErrFile.createNewFile();
+ }
+ FileOutputStream fos = new FileOutputStream(fleErrFile, true);
+ fos.write((Tools.getCurrentDateTime() + DataType.DOS_LINE_SEPARATOR).getBytes());
+ fos.write((strLog + DataType.DOS_LINE_SEPARATOR).getBytes());
+ fos.flush();
+ fos.close();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/SaveFile.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/SaveFile.java
new file mode 100644
index 0000000000..ec587bb5be
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/SaveFile.java
@@ -0,0 +1,158 @@
+/** @file
+
+ The file provides interface to save xml 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.common;
+
+import java.io.File;
+
+import org.apache.xmlbeans.XmlCursor;
+import org.apache.xmlbeans.XmlOptions;
+import org.tianocore.FrameworkDatabaseDocument;
+import org.tianocore.ModuleSurfaceAreaDocument;
+import org.tianocore.PackageSurfaceAreaDocument;
+import org.tianocore.PlatformSurfaceAreaDocument;
+import org.tianocore.FrameworkDatabaseDocument.FrameworkDatabase;
+import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
+import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
+import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;
+
+public class SaveFile {
+
+ /**
+
+ @param args
+
+ **/
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ Save file as msa
+
+ **/
+ public static void saveMsaFile(String path, ModuleSurfaceArea msa) throws Exception {
+ ModuleSurfaceAreaDocument msaDoc = ModuleSurfaceAreaDocument.Factory.newInstance();
+ File f = new File(path);
+
+ //
+ //Init namespace
+ //
+ XmlCursor cursor = XmlConfig.setupXmlCursor(msa.newCursor());
+
+ //
+ //Config file format
+ //
+ XmlOptions options = XmlConfig.setupXmlOptions();
+
+ //
+ //Create finial doc
+ //
+ msaDoc.addNewModuleSurfaceArea();
+ msaDoc.setModuleSurfaceArea((ModuleSurfaceArea) cursor.getObject());
+ //
+ //Save the file
+ //
+ msaDoc.save(f, options);
+ }
+
+ /**
+ Save file as spd
+
+ **/
+ public static void saveSpdFile(String path, PackageSurfaceArea spd) throws Exception {
+ PackageSurfaceAreaDocument spdDoc = PackageSurfaceAreaDocument.Factory.newInstance();
+ File f = new File(path);
+
+ //
+ //Init namespace
+ //
+ XmlCursor cursor = XmlConfig.setupXmlCursor(spd.newCursor());
+
+ //
+ //Config file format
+ //
+ XmlOptions options = XmlConfig.setupXmlOptions();
+
+ //
+ //Create finial doc
+ //
+ spdDoc.addNewPackageSurfaceArea();
+ spdDoc.setPackageSurfaceArea((PackageSurfaceArea) cursor.getObject());
+ //
+ //Save the file
+ //
+ spdDoc.save(f, options);
+ }
+
+ /**
+ Save file as fpd
+
+ **/
+ public static void saveFpdFile(String path, PlatformSurfaceArea fpd) throws Exception {
+ PlatformSurfaceAreaDocument fpdDoc = PlatformSurfaceAreaDocument.Factory.newInstance();
+ File f = new File(path);
+
+ //
+ //Init namespace
+ //
+ XmlCursor cursor = XmlConfig.setupXmlCursor(fpd.newCursor());
+
+ //
+ //Config file format
+ //
+ XmlOptions options = XmlConfig.setupXmlOptions();
+
+ //
+ //Create finial doc
+ //
+ fpdDoc.addNewPlatformSurfaceArea();
+ fpdDoc.setPlatformSurfaceArea((PlatformSurfaceArea) cursor.getObject());
+ //
+ //Save the file
+ //
+ fpdDoc.save(f, options);
+ }
+
+ /**
+ Save file as framework db
+
+ **/
+ public static void saveDbFile(String path, FrameworkDatabase db) throws Exception {
+ FrameworkDatabaseDocument dbDoc = FrameworkDatabaseDocument.Factory.newInstance();
+ File f = new File(path);
+
+ //
+ //Init namespace
+ //
+ XmlCursor cursor = XmlConfig.setupXmlCursor(db.newCursor());
+
+ //
+ //Config file format
+ //
+ XmlOptions options = XmlConfig.setupXmlOptions();
+
+ //
+ //Create finial doc
+ //
+ dbDoc.addNewFrameworkDatabase();
+ dbDoc.setFrameworkDatabase((FrameworkDatabase) cursor.getObject());
+
+ //
+ //Save the file
+ //
+ dbDoc.save(f, options);
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
new file mode 100644
index 0000000000..e63a0f5cf9
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
@@ -0,0 +1,278 @@
+/** @file
+
+ The file is used to provides some useful interfaces
+
+ 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.common;
+
+import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+import java.util.Vector;
+
+import javax.swing.JComboBox;
+import javax.swing.JOptionPane;
+
+/**
+ The class is used to provides some useful interfaces
+
+ **/
+public class Tools {
+
+ //
+ // The dir user selected to create new package in
+ //
+ public static String dirForNewSpd = null;
+
+ /**
+ Used for test
+
+ @param args
+
+ **/
+ public static void main(String[] args) {
+ System.out.println(getCurrentDateTime());
+ }
+
+ /**
+ Get current date and time and format it as "yyyy-MM-dd HH:mm"
+
+ @return formatted current date and time
+
+ **/
+ public static String getCurrentDateTime() {
+ Date now = new Date(System.currentTimeMillis());
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+ return sdf.format(now);
+ }
+
+ /**
+ Generate a UUID
+
+ @return the created UUID
+
+ **/
+ public static String generateUuidString() {
+ return UUID.randomUUID().toString();
+ }
+
+ /**
+ Use current file separator in the path
+
+ @param strPath
+ @return
+
+ **/
+ public static String convertPathToCurrentOsType(String strPath) {
+ strPath = strPath.replace(DataType.DOS_FILE_SEPARATOR, DataType.FILE_SEPARATOR);
+ strPath = strPath.replace(DataType.UNIX_FILE_SEPARATOR, DataType.FILE_SEPARATOR);
+ return strPath;
+ }
+
+ /**
+ Use Unix file separator in the path
+
+ @param strPath
+ @return
+
+ **/
+ public static String convertPathToUnixType(String strPath) {
+ strPath = strPath.replace(DataType.DOS_FILE_SEPARATOR, DataType.UNIX_FILE_SEPARATOR);
+ return strPath;
+ }
+
+ /**
+ Use Dos file separator in the path
+
+ @param strPath
+ @return
+
+ **/
+ public static String convertPathToDosType(String strPath) {
+ strPath = strPath.replace(DataType.UNIX_FILE_SEPARATOR, DataType.DOS_FILE_SEPARATOR);
+ return strPath;
+ }
+
+ /**
+ Get all system properties and output to the console
+
+ **/
+ public static void getSystemProperties() {
+ System.out.println(System.getProperty("java.class.version"));
+ System.out.println(System.getProperty("java.class.path"));
+ System.out.println(System.getProperty("java.ext.dirs"));
+ System.out.println(System.getProperty("os.name"));
+ System.out.println(System.getProperty("os.arch"));
+ System.out.println(System.getProperty("os.version"));
+ System.out.println(System.getProperty("file.separator"));
+ System.out.println(System.getProperty("path.separator"));
+ System.out.println(System.getProperty("line.separator"));
+ System.out.println(System.getProperty("user.name"));
+ System.out.println(System.getProperty("user.home"));
+ System.out.println(System.getProperty("user.dir"));
+ System.out.println(System.getProperty("PATH"));
+
+ System.out.println(System.getenv("PROCESSOR_REVISION"));
+ }
+
+ /**
+ Generate selection items for JComboBox by input vector
+
+ **/
+ public static void generateComboBoxByVector(JComboBox jcb, Vector vector) {
+ if (jcb != null) {
+ jcb.removeAllItems();
+ }
+ if (vector != null) {
+ for (int index = 0; index < vector.size(); index++) {
+ jcb.addItem(vector.elementAt(index));
+ }
+ }
+ }
+
+ /**
+ Get path only from a path
+
+ @param filePath
+ @return
+
+ **/
+ public static String getFilePathOnly(String filePath) {
+ String path = filePath.substring(0, filePath.length() - getFileNameOnly(filePath).length());
+ if (path.endsWith(DataType.FILE_SEPARATOR)) {
+ path = path.substring(0, path.length() - DataType.FILE_SEPARATOR.length());
+ }
+
+ return path;
+ }
+
+
+ /**
+ Get file name from a path
+
+ @param filePath
+ @return
+
+ **/
+ public static String getFileNameOnly(String filePath) {
+ File f = new File(filePath);
+ return f.getAbsoluteFile().getName();
+ }
+
+ public static String getFileNameWithoutExt(String filePath) {
+ filePath = getFileNameOnly(filePath);
+ filePath = filePath.substring(0, filePath.lastIndexOf(DataType.FILE_EXT_SEPARATOR));
+ return filePath;
+ }
+
+ /**
+ Get relative path
+
+ @param wholePath
+ @param commonPath
+ @return wholePath - commonPath
+
+ **/
+ public static String getRelativePath(String wholePath, String commonPath) {
+ String path = "";
+ int i = 0;
+ i = wholePath.indexOf(commonPath);
+ if (i > -1) {
+ i = i + commonPath.length();
+ } else {
+ return "";
+ }
+ path = wholePath.substring(i);
+ //
+ // remove file separator of head
+ //
+ if (path.indexOf(DataType.DOS_FILE_SEPARATOR) == 0) {
+ path = path.substring(0 + DataType.DOS_FILE_SEPARATOR.length());
+ }
+ if (path.indexOf(DataType.UNIX_FILE_SEPARATOR) == 0) {
+ path = path.substring(0 + DataType.DOS_FILE_SEPARATOR.length());
+ }
+ //
+ // remove file separator of rear
+ //
+ if (path.indexOf(DataType.DOS_FILE_SEPARATOR) == path.length() - DataType.DOS_FILE_SEPARATOR.length()) {
+ path = path.substring(0, path.length() - DataType.DOS_FILE_SEPARATOR.length());
+ }
+ if (path.indexOf(DataType.UNIX_FILE_SEPARATOR) == path.length() - DataType.UNIX_FILE_SEPARATOR.length()) {
+ path = path.substring(0, path.length() - DataType.DOS_FILE_SEPARATOR.length());
+ }
+ //
+ // convert to UNIX format
+ //
+ path = Tools.convertPathToUnixType(path);
+ return path;
+ }
+
+ /**
+ Convert List ot Vector
+
+ @param list
+ @return
+
+ **/
+ public static Vector convertListToVector(List list) {
+ Vector v = new Vector();
+ if (list != null && list.size() > 0) {
+ for (int index = 0; index < list.size(); index++) {
+ v.addElement(list.get(index).toString());
+ }
+ }
+ return v;
+ }
+
+ /**
+ If the input path missing ext, append the ext to the path
+
+ @param path
+ @param type
+ @return
+
+ **/
+ public static String addPathExt(String path, int type) {
+ String match = "";
+ if (type == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
+ match = DataType.FILE_EXT_SEPARATOR + DataType.MODULE_SURFACE_AREA_EXT;
+ }
+ if (type == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
+ match = DataType.FILE_EXT_SEPARATOR + DataType.PACKAGE_SURFACE_AREA_EXT;
+ }
+ if (type == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
+ match = DataType.FILE_EXT_SEPARATOR + DataType.PLATFORM_SURFACE_AREA_EXT;
+ }
+ if (path.length() <= match.length()) {
+ path = path + match;
+ return path;
+ }
+ if (!(path.substring(path.length() - match.length())).equals(match)) {
+ path = path + match;
+ }
+ return path;
+ }
+
+ /**
+ Show a message box
+
+ @param arg0
+
+ **/
+ public static void showInformationMessage(String arg0) {
+ JOptionPane.showConfirmDialog(null, arg0, "Error", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE);
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/XmlConfig.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/XmlConfig.java
new file mode 100644
index 0000000000..db7b58d1d9
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/XmlConfig.java
@@ -0,0 +1,40 @@
+/** @file
+
+ The file is used to config XML file format
+
+ 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.common;
+
+import org.apache.xmlbeans.XmlCursor;
+import org.apache.xmlbeans.XmlOptions;
+
+public class XmlConfig {
+ public static XmlCursor setupXmlCursor(XmlCursor cursor) {
+ String uri = "http://www.TianoCore.org/2006/Edk2.0";
+ cursor.push();
+ cursor.toNextToken();
+ cursor.insertNamespace("", uri);
+ cursor.insertNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
+ cursor.pop();
+ return cursor;
+ }
+
+ public static XmlOptions setupXmlOptions() {
+ XmlOptions options = new XmlOptions();
+ options.setCharacterEncoding("UTF-8");
+ options.setSavePrettyPrint();
+ options.setSavePrettyPrintIndent(2);
+ return options;
+ }
+
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ExitConfirm.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ExitConfirm.java
new file mode 100644
index 0000000000..d5298df38b
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ExitConfirm.java
@@ -0,0 +1,263 @@
+/** @file
+
+ The file is used to popup a exit confirmation window when program exists
+
+ 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.common.ui;
+
+import java.awt.Dimension;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+/**
+ The class is used to popup a exit confirmation window when program exists
+ It extends JDialog and implements ActionListener and WindowListener
+
+ **/
+public class ExitConfirm extends JDialog implements ActionListener, WindowListener {
+
+ ///
+ /// Define class Serial Version UID
+ ///
+ private static final long serialVersionUID = -5875921789385911029L;
+
+ private JPanel jContentPane = null;
+
+ private JLabel jLabelMessage = null;
+
+ private JLabel jLabelResume = null;
+
+ private JLabel jLabelExit = null;
+
+ private JButton jButtonResume = null;
+
+ private JButton jButtonExit = null;
+
+ public boolean isCancel = false;
+
+ /**
+ This method initializes jButtonResume
+
+ @return javax.swing.JButton jButtonResume
+
+ **/
+ private JButton getJButtonResume() {
+ if (jButtonResume == null) {
+ jButtonResume = new JButton();
+ jButtonResume.setText("Resume");
+ jButtonResume.setSize(new java.awt.Dimension(90, 20));
+ jButtonResume.setLocation(new java.awt.Point(150, 105));
+ jButtonResume.setMnemonic('R');
+ jButtonResume.addActionListener(this);
+ }
+ return jButtonResume;
+ }
+
+ /**
+ This method initializes jButtonExit
+
+ @return javax.swing.JButton jButtonExit
+
+ **/
+ private JButton getJButtonExit() {
+ if (jButtonExit == null) {
+ jButtonExit = new JButton();
+ jButtonExit.setText("Exit");
+ jButtonExit.setSize(new java.awt.Dimension(90, 20));
+ jButtonExit.setLocation(new java.awt.Point(260, 105));
+ jButtonExit.setMnemonic('x');
+ jButtonExit.addActionListener(this);
+ }
+ return jButtonExit;
+ }
+
+ /**
+ Main clasee, reserved for test
+
+ @param args
+
+ **/
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ This is the default constructor
+
+ **/
+ public ExitConfirm(IFrame parentFrame, boolean modal) {
+ super(parentFrame, modal);
+ initialize();
+ }
+
+ /**
+ This method initializes this
+
+ @return void
+
+ **/
+ private void initialize() {
+ this.setSize(500, 170);
+ this.setTitle("Exit");
+ this.setResizable(false);
+ this.setContentPane(getJContentPane());
+ this.addWindowListener(this);
+ //
+ //Set DO_NOTHING_ON_CLOSE when click Close button on title bar
+ //
+ this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
+ centerWindow();
+ }
+
+ /**
+ This method initializes jContentPane
+
+ @return javax.swing.JPanel jContentPane
+
+ **/
+ private JPanel getJContentPane() {
+ if (jContentPane == null) {
+ jLabelExit = new JLabel();
+ jLabelExit.setSize(new java.awt.Dimension(450, 20));
+ jLabelExit.setLocation(new java.awt.Point(25, 70));
+ jLabelResume = new JLabel();
+ jLabelResume.setSize(new java.awt.Dimension(450, 20));
+ jLabelResume.setLocation(new java.awt.Point(25, 40));
+ jLabelMessage = new JLabel();
+ jLabelMessage.setSize(new java.awt.Dimension(450, 20));
+ jLabelMessage.setLocation(new java.awt.Point(25, 10));
+ jContentPane = new JPanel();
+ jContentPane.setLayout(null);
+ jContentPane.add(jLabelMessage, null);
+ jContentPane.add(jLabelResume, null);
+ jContentPane.add(jLabelExit, null);
+ jContentPane.add(getJButtonResume(), null);
+ jContentPane.add(getJButtonExit(), null);
+ }
+ return jContentPane;
+ }
+
+ /**
+ Call setWarningMessage to set messages of frame when it is used for Setup
+
+ **/
+ public void setSetupMessage() {
+ String strTitle = "Exit Setup";
+ String strMessage = "Setup is not complete. If you quit now, the program will not be installed.";
+ String strResume = "You may run the setup program at a later time to complete the installation.";
+ String strExit = "To continue installing, click Resume. To quit the Setup program, click Exit.";
+ setWarningMessage(strTitle, strMessage, strResume, strExit);
+ }
+
+ /**
+ Call setWarningMessage to set messages of frame when it is used for Module Main GUI
+
+ **/
+ public void setModuleMessage() {
+ String strTitle = "Exit";
+ String strMessage = "Do you really want to quit now?";
+ String strResume = "All unsaved module information will be lost.";
+ String strExit = "To continue editing module, click Resume. To quit the program, click Exit.";
+ setWarningMessage(strTitle, strMessage, strResume, strExit);
+ }
+
+ /**
+ Set message information via input data
+
+ @param strTitle The title value
+ @param strMessage The main message value
+ @param strResume The resume message value
+ @param strExit The exit message value
+
+ **/
+ private void setWarningMessage(String strTitle, String strMessage, String strResume, String strExit) {
+ this.setTitle(strTitle);
+ jLabelMessage.setText(strMessage);
+ jLabelResume.setText(strResume);
+ jLabelExit.setText(strExit);
+ }
+
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ *
+ * Override actionPerformed to listern all actions
+ *
+ */
+ public void actionPerformed(ActionEvent arg0) {
+ //
+ //Set isCancel true when click button "Exit"
+ //
+ Object obj = arg0.getSource();
+ if (obj == jButtonResume) {
+ isCancel = false;
+ }
+ if (obj == jButtonExit) {
+ isCancel = true;
+ }
+ this.setVisible(false);
+ }
+
+ /**
+ Make the window in the center of the screen
+
+ **/
+ private void centerWindow() {
+ Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
+ this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2);
+ }
+
+ public void windowActivated(WindowEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void windowClosed(WindowEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void windowClosing(WindowEvent arg0) {
+ isCancel = false;
+ this.setVisible(false);
+ }
+
+ public void windowDeactivated(WindowEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void windowDeiconified(WindowEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void windowIconified(WindowEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void windowOpened(WindowEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IComboBox.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IComboBox.java
new file mode 100644
index 0000000000..13d7771e3a
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IComboBox.java
@@ -0,0 +1,197 @@
+/** @file
+
+ The file is used to override JComboBox to provides customized interfaces
+
+ 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.common.ui;
+
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+
+/**
+ The class is used to override JComboBox to provides customized interfaces
+ It extends JComboBox implements KeyListener, MouseListener and FocusListener
+
+
+
+ **/
+public class IComboBox extends JComboBox implements KeyListener, MouseListener, FocusListener {
+
+ ///
+ /// Define class Serial Version UID
+ ///
+ private static final long serialVersionUID = -1940262568168458911L;
+
+ public void focusGained(FocusEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see java.awt.event.FocusListener#focusLost(java.awt.event.FocusEvent)
+ *
+ * Override focusLost to exit edit mode
+ *
+ */
+ public void focusLost(FocusEvent arg0) {
+ this.closeEdit();
+ }
+
+ /**
+ Main class, used for test
+
+ @param args
+
+ **/
+ public static void main(String[] args) {
+ JFrame jf = new JFrame();
+ jf.setSize(500, 200);
+ JPanel jp = new JPanel();
+ jp.setLayout(null);
+ IComboBox icb = new IComboBox();
+ jp.add(icb, null);
+ jf.setContentPane(jp);
+ jf.setVisible(true);
+ }
+
+ /**
+ This is the default constructor
+
+ **/
+ public IComboBox() {
+ super();
+ init();
+ }
+
+ /**
+ This method initializes this
+
+ **/
+ private void init() {
+ this.setSize(320, 20);
+ this.setEditable(false);
+ this.editor.addActionListener(this);
+ this.addMouseListener(this);
+ this.addKeyListener(this);
+ this.getEditor().getEditorComponent().addKeyListener(this);
+ this.getEditor().getEditorComponent().addFocusListener(this);
+ this.setToolTipText("Double Click to add an entry and finished by press ENTER. Press DELETE can remove selected entry.");
+ }
+
+ public void keyPressed(KeyEvent arg0) {
+ // TODO Auto-generated method stub
+ }
+
+ /* (non-Javadoc)
+ * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
+ *
+ * Override keyReleased to listen key action
+ *
+ */
+ public void keyReleased(KeyEvent arg0) {
+ //
+ //Add new item to list when press ENTER
+ //
+ if (arg0.getSource() == this.getEditor().getEditorComponent()) {
+ if (arg0.getKeyCode() == KeyEvent.VK_ENTER) {
+ String strCurrentText = this.getEditor().getItem().toString().trim();
+ if (strCurrentText.length() == 0) {
+ if (this.getItemCount() > 0) {
+ this.setSelectedIndex(0);
+ }
+ } else {
+ this.addItem(strCurrentText);
+ this.setSelectedItem(strCurrentText);
+ }
+ this.setEditable(false);
+ }
+ if (arg0.getKeyCode() == KeyEvent.VK_ESCAPE) {
+ closeEdit();
+ }
+ }
+
+ if (arg0.getSource() == this) {
+ //
+ //Remove item from the list when press DEL
+ //
+ if (arg0.getKeyCode() == KeyEvent.VK_DELETE) {
+ int intSelected = this.getSelectedIndex();
+ if (intSelected > -1) {
+ this.removeItemAt(this.getSelectedIndex());
+ if (this.getItemCount() > 0) {
+ this.setSelectedIndex(0);
+ } else {
+ this.removeAllItems();
+ }
+ }
+ }
+ }
+ }
+
+ public void keyTyped(KeyEvent arg0) {
+ // TODO Auto-generated method stub
+ }
+
+ /* (non-Javadoc)
+ * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
+ *
+ * Override mouseClicked to enter edit mode when double click mouse
+ *
+ */
+ public void mouseClicked(MouseEvent arg0) {
+ if (arg0.getClickCount() == 2) {
+ this.setEditable(true);
+ this.getEditor().setItem("");
+ }
+
+ }
+
+ public void mouseEntered(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void mouseExited(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void mousePressed(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void mouseReleased(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ Exit edit mode
+
+ **/
+ private void closeEdit() {
+ this.setEditable(false);
+ this.getEditor().setItem("");
+ if (this.getItemCount() > 0) {
+ this.setSelectedIndex(0);
+ }
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDefaultMutableTreeNode.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDefaultMutableTreeNode.java
new file mode 100644
index 0000000000..6814741a5c
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDefaultMutableTreeNode.java
@@ -0,0 +1,344 @@
+/** @file
+
+
+ The file is used to override DefaultMutableTreeNode to provides customized interfaces
+
+ 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.common.ui;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+
+import org.tianocore.frameworkwizard.common.Identification;
+
+/**
+ The class is used to override DefaultMutableTreeNode to provides customized interfaces
+ It extends DefaultMutableTreeNode
+
+
+
+ **/
+public class IDefaultMutableTreeNode extends DefaultMutableTreeNode {
+ ///
+ /// Define class Serial Version UID
+ ///
+ private static final long serialVersionUID = -1947340717458069548L;
+
+ //
+ // Static final definitions for all kinds of node
+ //
+ public static final int MSA_HEADER = 100;
+
+ public static final int MSA_LIBRARYCLASSDEFINITIONS = 101;
+
+ public static final int MSA_PACKAGEDEPENDENCIES = 102;
+
+ public static final int MSA_SOURCEFILES = 103;
+
+ public static final int MSA_PROTOCOLS = 104;
+
+ public static final int MSA_EVENTS = 105;
+
+ public static final int MSA_HOBS = 106;
+
+ public static final int MSA_PPIS = 107;
+
+ public static final int MSA_VARIABLES = 108;
+
+ public static final int MSA_BOOTMODES = 109;
+
+ public static final int MSA_SYSTEMTABLES = 110;
+
+ public static final int MSA_DATAHUBS = 111;
+
+ //public static final int MSA_FORMSETS = 112;
+
+ public static final int MSA_HIIPACKAGES = 112;
+
+ public static final int MSA_GUIDS = 113;
+
+ public static final int MSA_EXTERNS = 114;
+
+ public static final int MSA_PCDS = 115;
+
+ public static final int MSA_BUILDOPTIONS = 117;
+
+ public static final int MSA_USEREXTENSIONS = 118;
+
+ public static final int MSA_MODULEDEFINITIONS = 119;
+
+ public static final int SPD_HEADER = 200;
+
+ public static final int SPD_LIBRARYCLASSDECLARATIONS = 201;
+
+ public static final int SPD_MSAFILES = 202;
+
+ public static final int SPD_PACKAGEHEADERS = 203;
+
+ public static final int SPD_GUIDDECLARATIONS = 204;
+
+ public static final int SPD_PROTOCOLDECLARATIONS = 205;
+
+ public static final int SPD_PPIDECLARATIONS = 206;
+
+ public static final int SPD_PCDDECLARATIONS = 207;
+
+ public static final int SPD_PACKAGEDEFINITIONS = 208;
+
+ public static final int SPD_INDUSTRYSTDINCLUDES = 209;
+
+ public static final int FPD_PLATFORMHEADER = 300;
+
+ public static final int FPD_FLASH = 301;
+
+ public static final int FPD_FRAMEWORKMODULES = 302;
+
+ public static final int FPD_PCDDYNAMICBUILDDECLARATIONS = 303;
+
+ public static final int FPD_BUILDOPTIONS = 304;
+
+ public static final int FPD_PLATFORMDEFINITIONS = 305;
+
+ public static final int WORKSPACE = 0;
+
+ public static final int MODULE = 1;
+
+ public static final int PACKAGE = 2;
+
+ public static final int PLATFORM = 3;
+
+ //
+ //Static final definitions for operation
+ //
+ public static final int OPERATION_NULL = 0;
+
+ public static final int OPERATION_ADD = 1;
+
+ public static final int OPERATION_UPDATE = 2;
+
+ public static final int OPERATION_DELETE = 4;
+
+ public static final int OPERATION_ADD_UPDATE = 3;
+
+ public static final int OPERATION_ADD_DELETE = 5;
+
+ public static final int OPERATION_UPDATE_DELETE = 6;
+
+ public static final int OPERATION_ADD_UPDATE_DELETE = 7;
+
+ //
+ //Define 4 node attributes
+ //
+ private int category = 0;
+
+ private int operation = 0;
+
+ private int location = 0;
+
+ private String nodeName = "";
+
+ private boolean isOpening = false;
+
+ private Identification id = null;
+
+ /**
+ Main class, reserved for test
+
+ @param args
+
+ **/
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ This is the default constructor
+
+ **/
+ public IDefaultMutableTreeNode() {
+ super();
+ }
+
+ /**
+ This is the overrided constructor
+ Init clase members with input data
+
+ @param strNodeName The name of node
+ @param intCategory The category of node
+ @param bolIsOpened to identify if the node is opening or not
+ @param identification The Identification of node
+
+ **/
+ public IDefaultMutableTreeNode(String strNodeName, int intCategory, boolean bolIsOpening,
+ Identification identification) {
+ super(strNodeName);
+ this.nodeName = strNodeName;
+ this.category = intCategory;
+ this.isOpening = bolIsOpening;
+ this.id = identification;
+ }
+
+ /**
+ This is the overrided constructor
+ Init clase members with input data
+
+ @param strNodeName The name of node
+ @param intCategory The category of node
+ @param intOperation The operation of node
+
+ **/
+ public IDefaultMutableTreeNode(String strNodeName, int intCategory, int intOperation) {
+ super(strNodeName);
+ this.nodeName = strNodeName;
+ this.category = intCategory;
+ this.operation = intOperation;
+ }
+
+ /**
+ This is the overrided constructor
+ Init clase members with input data
+
+ @param strNodeName The name of node
+ @param intCategory The category of node
+ @param intOperation The operation of node
+ @param intLocation The location of node
+
+ **/
+ public IDefaultMutableTreeNode(String strNodeName, int intCategory, int intOperation, int intLocation) {
+ super(strNodeName);
+ this.nodeName = strNodeName;
+ this.category = intCategory;
+ this.operation = intOperation;
+ this.location = intLocation;
+ }
+
+ /**
+ Get category of node
+
+ @return The category of node
+
+ **/
+ public int getCategory() {
+ return category;
+ }
+
+ /**
+ Set category of node
+
+ @param category The input data of node category
+
+ **/
+ public void setCategory(int category) {
+ this.category = category;
+ }
+
+ /**
+ Get name of node
+
+ @return The name of node
+
+ **/
+ public String getNodeName() {
+ return nodeName;
+ }
+
+ /**
+ Set name of node
+
+ @param nodeName The input data of node name
+
+ **/
+ public void setNodeName(String nodeName) {
+ this.nodeName = nodeName;
+ }
+
+ /**
+ Get operation of node
+
+ @return The operation of node
+
+ **/
+ public int getOperation() {
+ return operation;
+ }
+
+ /**
+ Set operation of node
+
+ @param operation The input data of node operation
+
+ **/
+ public void setOperation(int operation) {
+ this.operation = operation;
+ }
+
+ /**
+ Get location of node
+
+ @return The location of node
+
+ **/
+ public int getLocation() {
+ return location;
+ }
+
+ /**
+ Set location of node
+
+ @param location The input data of node location
+
+ **/
+ public void setLocation(int location) {
+ this.location = location;
+ }
+
+ /**
+ Get identification of node
+
+ @return
+
+ **/
+ public Identification getId() {
+ return id;
+ }
+
+ /**
+ Set identification of node
+
+ @param id
+
+ **/
+ public void setId(Identification id) {
+ this.id = id;
+ }
+
+ /**
+ get isOpening of node
+
+ @return
+
+ **/
+ public boolean isOpening() {
+ return isOpening;
+ }
+
+ /**
+ Set isOpening of node
+
+ @param isOpening
+
+ **/
+ public void setOpening(boolean isOpening) {
+ this.isOpening = isOpening;
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDesktopManager.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDesktopManager.java
new file mode 100644
index 0000000000..dc668e7ed3
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDesktopManager.java
@@ -0,0 +1,76 @@
+/** @file
+
+ The file is used to override DefaultDesktopManager to provides customized interfaces
+
+ 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.common.ui;
+
+import javax.swing.DefaultDesktopManager;
+import javax.swing.JComponent;
+
+/**
+ The class is used to override DefaultDesktopManager to provides customized interfaces
+ It extends DefaultDesktopManager
+
+
+
+ **/
+public class IDesktopManager extends DefaultDesktopManager {
+
+ ///
+ /// Define class Serial Version UID
+ ///
+ private static final long serialVersionUID = -4596986878722011062L;
+
+ /**
+ Main class, reserved for test
+
+ @param args
+
+ **/
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.DesktopManager#dragFrame(javax.swing.JComponent, int, int)
+ *
+ * Override dragFrame to do nothing to forbid internalframe to be draged
+ *
+ */
+ public void dragFrame(JComponent f, int newX, int newY) {
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.DesktopManager#endDraggingFrame(javax.swing.JComponent)
+ *
+ * Override endDraggingFrame to do nothing to forbid internalframe to be draged
+ *
+ */
+ public void endDraggingFrame(JComponent f) {
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.DesktopManager#beginResizingFrame(javax.swing.JComponent, int)
+ *
+ * Override beginResizingFrame to do nothing to forbid internalframe to be draged
+ *
+ */
+ public void beginResizingFrame(JComponent f, int direction) {
+
+ }
+
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDialog.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDialog.java
new file mode 100644
index 0000000000..57f3b4e2dc
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDialog.java
@@ -0,0 +1,157 @@
+/** @file
+
+ The file is used to override Dialog to provides customized interfaces
+
+ 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.common.ui;
+
+import java.awt.Dimension;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JDialog;
+
+import org.tianocore.frameworkwizard.common.DataType;
+
+/**
+ The class is used to override Dialog to provides customized interfaces
+ It extends JDialog implements ActionListener
+
+
+
+ **/
+public class IDialog extends JDialog implements ActionListener {
+ ///
+ /// Define class Serial Version UID
+ ///
+ private static final long serialVersionUID = -7692623863358631984L;
+ //
+ //Define class members
+ //
+ private boolean isEdited = false;
+
+ public int returnType = DataType.RETURN_TYPE_CANCEL;
+
+ public void actionPerformed(ActionEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ Main class, used for test
+
+ @param args
+
+ **/
+ public static void main(String[] args) {
+ IDialog id = new IDialog();
+ id.setVisible(true);
+ }
+
+ /**
+ This is the default constructor
+ **/
+ public IDialog() {
+ super();
+ initialize();
+ }
+
+ /**
+ * This is the override constructor
+ */
+ /**
+ This is the override constructor
+
+ @param parentFrame The parent frame which open the dialog
+ @param modal true means the dialog is modal dialog; false means the dialog is not modal dialog
+ **/
+ public IDialog(IFrame parentFrame, boolean modal) {
+ super(parentFrame, modal);
+ initialize();
+ }
+
+ /**
+ This method initializes this
+
+ **/
+ private void initialize() {
+ this.setResizable(false);
+ }
+
+ /**
+ Start the dialog at the center of screen
+
+ @param intWidth The width of the dialog
+ @param intHeight The height of the dialog
+
+ **/
+ protected void centerWindow(int intWidth, int intHeight) {
+ Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
+ this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2);
+ }
+
+ /**
+ Start the dialog at the center of screen
+
+ **/
+ protected void centerWindow() {
+ centerWindow(this.getSize().width, this.getSize().height);
+ }
+
+ /**
+ Get if the dialog has been edited
+
+ @retval true - The dialog has been edited
+ @retval false - The dialog hasn't been edited
+
+ **/
+ public boolean isEdited() {
+ return isEdited;
+ }
+
+ /**
+ Set if the dialog has been edited
+
+ @param isEdited The input data which identify if the dialog has been edited
+
+ **/
+ public void setEdited(boolean isEdited) {
+ this.isEdited = isEdited;
+ }
+
+ /**
+ Check the input data is empty or not
+
+ @param strValue The input data which need be checked
+
+ @retval true - The input data is empty
+ @retval fals - The input data is not empty
+
+ **/
+ public boolean isEmpty(String strValue) {
+ if (strValue.length() > 0) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ Display the dialog
+
+ **/
+ public int showDialog() {
+ this.setVisible(true);
+ return returnType;
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IFrame.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IFrame.java
new file mode 100644
index 0000000000..4778133a41
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IFrame.java
@@ -0,0 +1,217 @@
+/** @file
+
+ The file is used to override Frame to provides customized interfaces
+
+ 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.common.ui;
+
+import java.awt.Dimension;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+
+/**
+ The class is used to override Frame to provides customized interfaces
+ It extends JFrame implements ActionListener and WindowListener
+
+ **/
+public class IFrame extends JFrame implements ActionListener, WindowListener {
+
+ ///
+ /// Define class Serial Version UID
+ ///
+ private static final long serialVersionUID = -3324138961029300427L;
+
+ //
+ //Define class members
+ //
+ private ExitConfirm ec = null;
+
+ //
+ // To indicate the status while quit
+ // 0 - When setup (Default)
+ // 1 - Whne editing module
+ //
+ private int intExitType = 0;
+
+ /**
+ Main class, used for test
+
+ @param args
+
+ **/
+ public static void main(String[] args) {
+ IFrame i = new IFrame();
+ i.setVisible(true);
+ }
+
+ /**
+ This is the default constructor
+
+ **/
+ public IFrame() {
+ super();
+ initialize();
+ }
+
+ /**
+ This method initializes this
+
+ **/
+ public void initialize() {
+ this.setResizable(false);
+ this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
+ this.addWindowListener(this);
+ }
+
+ /**
+ Start the dialog at the center of screen
+
+ @param intWidth The width of the dialog
+ @param intHeight The height of the dialog
+
+ **/
+ protected void centerWindow(int intWidth, int intHeight) {
+ Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
+ this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2);
+ }
+
+ /**
+ Start the window full of the screen
+
+ **/
+ protected void maxWindow() {
+ Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
+ this.setLocation(0, 0);
+ this.setSize(d);
+ }
+
+ /**
+ Start the dialog at the center of screen
+
+ **/
+ protected void centerWindow() {
+ centerWindow(this.getSize().width, this.getSize().height);
+ }
+
+ /**
+ Set the exit window type
+
+ @param ExitType The input data of ExitType
+
+ **/
+ protected void setExitType(int ExitType) {
+ this.intExitType = ExitType;
+ }
+
+ /* (non-Javadoc)
+ * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)
+ *
+ * Override windowClosing to call this.onDisvisible()
+ *
+ */
+ public void windowClosing(WindowEvent arg0) {
+ this.onDisvisible();
+ }
+
+ public void windowOpened(WindowEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void windowClosed(WindowEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void windowIconified(WindowEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void windowDeiconified(WindowEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void windowActivated(WindowEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void windowDeactivated(WindowEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void actionPerformed(ActionEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ Define the actions when exit
+
+ **/
+ public void onExit() {
+ ec = new ExitConfirm(this, true);
+ //
+ //Show different warning message via different ExitType
+ //
+ switch (intExitType) {
+ case 0:
+ ec.setSetupMessage();
+ break;
+ case 1:
+ ec.setModuleMessage();
+ break;
+ }
+ ec.setVisible(true);
+ if (ec.isCancel) {
+ this.dispose();
+ System.exit(0);
+ }
+ }
+
+ /**
+ Define the actions when disvisible
+
+ **/
+ public void onDisvisible() {
+ ec = new ExitConfirm(this, true);
+ //
+ //Show different warning message via different ExitType
+ //
+ switch (intExitType) {
+ case 0:
+ ec.setSetupMessage();
+ break;
+ case 1:
+ ec.setModuleMessage();
+ break;
+ }
+ ec.setVisible(true);
+ if (ec.isCancel) {
+ this.dispose();
+ }
+ }
+
+ public int showSaveDialog() {
+ return JOptionPane.showConfirmDialog(null, "Save all changed files?", "Save", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java
new file mode 100644
index 0000000000..0d15a014ee
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java
@@ -0,0 +1,275 @@
+/** @file
+
+ The file is used to override JInternalFrame to provides customized interfaces
+
+ 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.common.ui;
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+
+import javax.swing.JDesktopPane;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+import javax.swing.JPanel;
+
+import org.tianocore.frameworkwizard.common.DataType;
+
+/**
+ * The class is used to override JInternalFrame to provides customized
+ * interfaces It extends JInternalFrame implements ActionListener
+ *
+ *
+ *
+ */
+public class IInternalFrame extends JInternalFrame implements ActionListener, ComponentListener, ItemListener, FocusListener {
+
+ // /
+ // / Define class Serial Version UID
+ // /
+ private static final long serialVersionUID = -609841772384875886L;
+
+ //
+ // Define class members
+ //
+ private boolean isEdited = false;
+
+ /**
+ * Main class, used for test
+ *
+ * @param args
+ *
+ */
+ public static void main(String[] args) {
+ JFrame jf = new JFrame();
+ JPanel jp = new JPanel();
+ JDesktopPane jdp = new JDesktopPane();
+ IInternalFrame itf = new IInternalFrame();
+ jdp.add(itf, 1);
+ jf.setContentPane(jp);
+ jf.setVisible(true);
+ }
+
+ /**
+ * This is the default constructor
+ *
+ */
+ public IInternalFrame() {
+ super();
+ initialize();
+ }
+
+ /**
+ * This method initializes this
+ *
+ */
+ private void initialize() {
+ this.setBounds(new java.awt.Rectangle(0, 0, 520, 545));
+ this.setMinimumSize(new java.awt.Dimension(520, 545));
+ this.addComponentListener(this);
+ }
+
+ /**
+ * Get if the InternalFrame has been edited
+ *
+ * @retval true - The InternalFrame has been edited
+ * @retval false - The InternalFrame hasn't been edited
+ *
+ */
+ public boolean isEdited() {
+ return isEdited;
+ }
+
+ /**
+ * Set if the InternalFrame has been edited
+ *
+ * @param isEdited
+ * The input data which identify if the InternalFrame has been
+ * edited
+ *
+ */
+ public void setEdited(boolean isEdited) {
+ this.isEdited = isEdited;
+ }
+
+ /**
+ * Check the input data is empty or not
+ *
+ * @param strValue
+ * The input data which need be checked
+ *
+ * @retval true - The input data is empty
+ * @retval fals - The input data is not empty
+ *
+ */
+ public boolean isEmpty(String strValue) {
+ if (strValue.length() > 0) {
+ return false;
+ }
+ return true;
+ }
+
+ public void actionPerformed(ActionEvent arg0) {
+ // TODO Auto-generated method stub
+ }
+
+ public void componentHidden(ComponentEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void componentMoved(ComponentEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void componentResized(ComponentEvent arg0) {
+ // TODO Auto-generated method stub
+ }
+
+ public void componentShown(ComponentEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * To reset the width of input component via container width
+ *
+ * @param c
+ * @param containerWidth
+ *
+ */
+ public void resizeComponentWidth(Component c, int containerWidth, int preferredWidth) {
+ int newWidth = c.getPreferredSize().width
+ + (containerWidth - preferredWidth);
+ if (newWidth < c.getPreferredSize().width) {
+ newWidth = c.getPreferredSize().width;
+ }
+ c.setSize(new java.awt.Dimension(newWidth, c.getHeight()));
+ c.validate();
+ }
+
+ /**
+ * To reset the height of input component via container height
+ *
+ * @param c
+ * @param containerHeight
+ *
+ */
+ public void resizeComponentHeight(Component c, int containerHeight, int preferredHeight) {
+ int newHeight = c.getPreferredSize().height + (containerHeight - preferredHeight);
+ if (newHeight < c.getPreferredSize().height) {
+ newHeight = c.getPreferredSize().height;
+ }
+ c.setSize(new java.awt.Dimension(c.getWidth(), newHeight));
+ c.validate();
+ }
+
+ /**
+ * To reset the size of input component via container size
+ *
+ * @param c
+ * @param containerWidth
+ * @param containerHeight
+ *
+ */
+ public void resizeComponent(Component c, int containerWidth, int containerHeight, int preferredWidth, int preferredHeight) {
+ resizeComponentWidth(c, containerWidth, preferredWidth);
+ resizeComponentHeight(c, containerHeight, preferredHeight);
+ }
+
+ /**
+ * To relocate the input component
+ *
+ * @param c
+ * @param containerWidth
+ * @param spaceToRight
+ *
+ */
+ public void relocateComponentX(Component c, int containerWidth, int preferredWidth, int spaceToRight) {
+ int intGapToRight = spaceToRight + c.getPreferredSize().width;
+ int newLocationX = containerWidth - intGapToRight;
+ if (newLocationX < preferredWidth -intGapToRight) {
+ newLocationX = preferredWidth - intGapToRight;
+ }
+ c.setLocation(newLocationX, c.getLocation().y);
+ c.validate();
+ }
+
+ /**
+ * To relocate the input component
+ *
+ * @param c
+ * @param containerHeight
+ * @param spaceToBottom
+ *
+ */
+ public void relocateComponentY(Component c, int containerHeight, int spaceToBottom) {
+ int newLocationY = containerHeight - spaceToBottom;
+ if (newLocationY < DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT - spaceToBottom) {
+ newLocationY = DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT - spaceToBottom;
+ }
+ c.setLocation(c.getLocation().x, newLocationY);
+ c.validate();
+ }
+
+ /**
+ * To relocate the input component
+ *
+ * @param c
+ * @param containerWidth
+ * @param containerHeight
+ * @param spaceToBottom
+ * @param spaceToRight
+ *
+ */
+ public void relocateComponent(Component c, int containerWidth, int containerHeight, int spaceToBottom,
+ int spaceToRight, int preferredWidht, int preferredHeight) {
+ relocateComponentX(c, containerWidth, preferredWidht, spaceToBottom);
+ relocateComponentY(c, containerHeight, spaceToRight);
+ }
+
+ public void showStandard() {
+
+ }
+
+ public void showAdvanced() {
+
+ }
+
+ public void showXML() {
+
+ }
+
+ public void itemStateChanged(ItemEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void focusGained(FocusEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void focusLost(FocusEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ITree.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ITree.java
new file mode 100644
index 0000000000..3d6a65bb83
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ITree.java
@@ -0,0 +1,249 @@
+/** @file
+
+ The file is used to override JTree to provides customized interfaces
+
+ 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.common.ui;
+
+import javax.swing.JTree;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreeNode;
+import javax.swing.tree.TreePath;
+
+import org.tianocore.frameworkwizard.common.Identification;
+
+/**
+ The class is used to override JTree to provides customized interfaces
+ It extends JTree
+
+
+
+ **/
+public class ITree extends JTree {
+ ///
+ /// Define class Serial Version UID
+ ///
+ private static final long serialVersionUID = -7907086164518295327L;
+
+ //
+ // Define class members
+ //
+ DefaultTreeModel treeModel = null;
+
+ /**
+ This is the default constructor
+
+ **/
+ public ITree() {
+ super();
+ }
+
+ /**
+ This is the overrided constructor
+ Init class members with input data
+
+ @param iDmtRoot The root node of the tree
+
+ **/
+ public ITree(IDefaultMutableTreeNode iDmtRoot) {
+ super(iDmtRoot);
+ treeModel = (DefaultTreeModel)this.getModel();
+ }
+
+ /**
+ Get category of selected node
+
+ @return The category of selected node
+
+ **/
+ public int getSelectCategory() {
+ int intCategory = 0;
+ TreePath path = this.getSelectionPath();
+ IDefaultMutableTreeNode node = (IDefaultMutableTreeNode) path.getLastPathComponent();
+ intCategory = node.getCategory();
+ return intCategory;
+ }
+
+ /**
+ Get operation of selected node
+
+ @return The operation of selected node
+
+ **/
+ public int getSelectOperation() {
+ int intOperation = 0;
+ TreePath path = this.getSelectionPath();
+ IDefaultMutableTreeNode node = (IDefaultMutableTreeNode) path.getLastPathComponent();
+ intOperation = node.getOperation();
+ return intOperation;
+ }
+
+ /**
+ Get selectLoaction of selected node
+
+ @return The selectLoaction of selected node
+
+ **/
+ public int getSelectLoaction() {
+ int intLocation = 0;
+ TreePath path = this.getSelectionPath();
+ IDefaultMutableTreeNode node = (IDefaultMutableTreeNode) path.getLastPathComponent();
+ intLocation = node.getLocation();
+ return intLocation;
+ }
+
+ /**
+ Main class, reserved for test
+
+ @param args
+
+ **/
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+ }
+
+ /**
+ Add input node as child node for current selected node
+
+ @param strNewNode The name of the node which need be added
+
+ **/
+ public void addNode(String strNewNode) {
+ DefaultMutableTreeNode parentNode = null;
+ DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(strNewNode);
+ newNode.setAllowsChildren(true);
+ TreePath parentPath = this.getSelectionPath();
+
+ /**
+ * Get parent node of new node
+ */
+ parentNode = (DefaultMutableTreeNode) (parentPath.getLastPathComponent());
+
+ /**
+ * Insert new node
+ */
+ treeModel.insertNodeInto(newNode, parentNode, parentNode.getChildCount());
+ this.scrollPathToVisible(new TreePath(newNode.getPath()));
+ }
+
+ /**
+ Add input node as child node for current selected node
+
+ @param newNode The node need be added
+
+ **/
+ public void addNode(IDefaultMutableTreeNode newNode) {
+ IDefaultMutableTreeNode parentNode = null;
+ newNode.setAllowsChildren(true);
+ TreePath parentPath = this.getSelectionPath();
+ parentNode = (IDefaultMutableTreeNode) (parentPath.getLastPathComponent());
+ treeModel.insertNodeInto(newNode, parentNode, parentNode.getChildCount());
+ this.scrollPathToVisible(new TreePath(newNode.getPath()));
+ }
+
+ /**
+ Add input node as child node for current selected node
+
+ @param newNode The node need be added
+
+ **/
+ public void addNode(IDefaultMutableTreeNode parentNode, IDefaultMutableTreeNode newNode) {
+ treeModel.insertNodeInto(newNode, parentNode, parentNode.getChildCount());
+ this.scrollPathToVisible(new TreePath(newNode.getPath()));
+ }
+
+ /**
+ Remove the selected node
+
+ @param strRemovedNode
+
+ **/
+ public void removeSelectedNode() {
+ TreePath treePath = this.getSelectionPath();
+ removeNodeByPath(treePath);
+ }
+
+ /**
+ Remove the node by tree path
+
+ @param strRemovedNode
+
+ **/
+ public void removeNodeByPath(TreePath treePath) {
+ if (treePath != null) {
+ DefaultMutableTreeNode selectionNode = (DefaultMutableTreeNode) treePath.getLastPathComponent();
+ TreeNode parent = (TreeNode) selectionNode.getParent();
+ if (parent != null) {
+ treeModel.removeNodeFromParent(selectionNode);
+ }
+ }
+ }
+
+ /**
+ Remove all child nodes under current node
+
+ **/
+ public void removeNodeChildrenByPath(TreePath treePath) {
+ if (treePath != null) {
+ DefaultMutableTreeNode currentNode = (DefaultMutableTreeNode) treePath.getLastPathComponent();
+ for (int index = currentNode.getChildCount() - 1; index > -1; index--) {
+ treeModel.removeNodeFromParent((DefaultMutableTreeNode)currentNode.getChildAt(index));
+ }
+ }
+ }
+
+ /**
+ Remove all nodes of the tree
+
+ **/
+ public void removeAllNode() {
+ DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode) treeModel.getRoot();
+ rootNode.removeAllChildren();
+ treeModel.reload();
+ }
+
+ public IDefaultMutableTreeNode getSelectNode() {
+ TreePath treepath = this.getSelectionPath();
+ IDefaultMutableTreeNode selectionNode = null;
+ if (treepath != null) {
+ selectionNode = (IDefaultMutableTreeNode) treepath.getLastPathComponent();
+ }
+ return selectionNode;
+ }
+
+ public IDefaultMutableTreeNode getNodeById(IDefaultMutableTreeNode node, Identification id) {
+ for (int index = 0; index < node.getChildCount(); index++) {
+ IDefaultMutableTreeNode iNode = (IDefaultMutableTreeNode) node.getChildAt(index);
+ if (iNode.getId().equals(id)) {
+ return iNode;
+ }
+ }
+ return null;
+ }
+
+ public IDefaultMutableTreeNode getNodeById(IDefaultMutableTreeNode node, Identification id, int category) {
+ for (int index = 0; index < node.getChildCount(); index++) {
+ IDefaultMutableTreeNode iNode = (IDefaultMutableTreeNode) node.getChildAt(index);
+ if (iNode.getId().equals(id) && iNode.getCategory() == category) {
+ return iNode;
+ }
+ }
+ return null;
+ }
+
+ public TreePath getPathOfNode(IDefaultMutableTreeNode node) {
+ TreePath treePath = new TreePath(treeModel.getPathToRoot(node));
+ return treePath;
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/StarLabel.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/StarLabel.java
new file mode 100644
index 0000000000..3641df0373
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/StarLabel.java
@@ -0,0 +1,64 @@
+/** @file
+
+ The file is used to override JLabel to provides customized interfaces
+
+ 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.common.ui;
+
+import javax.swing.JLabel;
+
+/**
+ The class is used to override JLabel to provides customized interfaces
+
+
+
+ **/
+public class StarLabel extends JLabel {
+
+ ///
+ /// Define class Serial Version UID
+ ///
+ private static final long serialVersionUID = -6702981027831543919L;
+
+ /**
+ Main class, reserved for test
+
+ @param args
+
+ **/
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ This is the default constructor
+
+ **/
+ public StarLabel() {
+ super();
+ init();
+ }
+
+ /**
+ To create a RED, BOLD and 14 size "*"
+
+ **/
+ private void init() {
+ this.setText("*");
+ this.setSize(new java.awt.Dimension(10, 20));
+ this.setForeground(java.awt.Color.red);
+ this.setFont(new java.awt.Font("DialogInput", java.awt.Font.BOLD, 14));
+ this.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxList.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxList.java
new file mode 100644
index 0000000000..5ad0533eec
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxList.java
@@ -0,0 +1,162 @@
+/** @file
+
+ The file is used to override JList to create a List with CheckBox item
+
+ 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.common.ui.iCheckBoxList;
+
+import java.util.Vector;
+
+import javax.swing.JList;
+
+public class ICheckBoxList extends JList {
+ ///
+ /// Define class Serial Version UID
+ ///
+ private static final long serialVersionUID = -2843059688070447632L;
+
+ protected ICheckBoxListCellRenderer cellrenderer = new ICheckBoxListCellRenderer();
+
+ protected ICheckBoxListener listener = new ICheckBoxListener(this);
+
+ protected ICheckBoxListModel model = new ICheckBoxListModel();
+
+ /**
+ This the default Constructor
+
+ **/
+ public ICheckBoxList() {
+ this(null);
+ }
+
+ /**
+ This the override constructor to create checkbox item with input vector
+
+ @param options
+
+ **/
+ public ICheckBoxList(Vector items) {
+ if (items != null) {
+ for (int index = 0; index < items.size(); index++) {
+ model.addElement(items.elementAt(index));
+ }
+ }
+ this.setCellRenderer(cellrenderer);
+ this.setModel(model);
+ this.addMouseListener(listener);
+ this.addKeyListener(listener);
+ }
+
+ /**
+ Set all items of the CheckBoxList component.
+
+ @param items
+
+ **/
+ public void setAllItems(Vector items) {
+ if (items != null) {
+ model.removeAllElements();
+ for (int index = 0; index < items.size(); index++) {
+ model.addElement(new ICheckBoxListItem(items.elementAt(index)));
+ }
+ }
+ }
+
+ /**
+ Get All Checked Items of the CheckBoxList component.
+
+ @return All Checked Items
+ **/
+ public Vector getAllCheckedItems() {
+ Vector result = new Vector();
+
+ for (int i = 0; i < this.getModel().getSize(); i++) {
+ if (((ICheckBoxListItem) this.getModel().getElementAt(i)).isChecked()) {
+ result.addElement((ICheckBoxListItem) this.getModel().getElementAt(i));
+ }
+ }
+ return result;
+ }
+
+ /**
+ Get All Checked Items String of the CheckBoxList component.
+
+ @return Vector
+ **/
+ public Vector getAllCheckedItemsString() {
+ Vector result = new Vector();
+
+ for (int i = 0; i < this.getModel().getSize(); i++) {
+ if (((ICheckBoxListItem) this.getModel().getElementAt(i)).isChecked()) {
+ result.addElement(((ICheckBoxListItem) this.getModel().getElementAt(i)).text);
+ }
+ }
+ return result;
+ }
+
+ /**
+ Get All Items String of the CheckBoxList component.
+
+ @return Vector
+ **/
+ public Vector getAllItemsString() {
+ Vector result = new Vector();
+
+ for (int i = 0; i < this.getModel().getSize(); i++) {
+ result.addElement(((ICheckBoxListItem) this.getModel().getElementAt(i)).text);
+ }
+ return result;
+ }
+
+ /**
+ Set Checked status for all input items.
+
+ **/
+ public void initCheckedItem(boolean bool, Vector items) {
+ if (items != null && items.size() != 0) {
+ for (int indexI = 0; indexI < items.size(); indexI++) {
+ for (int indexJ = 0; indexJ < model.size(); indexJ++) {
+ if (items.elementAt(indexI).equals(model.getAllElements().elementAt(indexJ).getText())) {
+ ICheckBoxListItem listItem = (ICheckBoxListItem) model.get(indexJ);
+ listItem.setChecked(bool);
+ break;
+ }
+ }
+ }
+ }
+ this.validate();
+ }
+
+ /**
+ Set all items of the compontent checked
+
+ **/
+ public void setAllItemsChecked() {
+ initCheckedItem(true, this.getAllItemsString());
+ }
+
+ /**
+ Set all items of the compontent unchecked
+
+ **/
+ public void setAllItemsUnchecked() {
+ initCheckedItem(false, this.getAllItemsString());
+ }
+
+ /**
+ Remove all items of list
+
+ **/
+ public void removeAllItem() {
+ model.removeAllElements();
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListCellRenderer.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListCellRenderer.java
new file mode 100644
index 0000000000..1b022fc908
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListCellRenderer.java
@@ -0,0 +1,76 @@
+/** @file
+
+ The file is used to create cell renderer for CheckBoxList Item
+
+ 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.common.ui.iCheckBoxList;
+
+import java.awt.*;
+import javax.swing.*;
+import javax.swing.border.*;
+
+class ICheckBoxListCellRenderer extends JCheckBox implements ListCellRenderer {
+ ///
+ /// Define class Serial Version UID
+ ///
+ private static final long serialVersionUID = -1718072217181674870L;
+
+ protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
+
+ /**
+ This is the default Constructor
+
+ **/
+ public ICheckBoxListCellRenderer() {
+ super();
+ setOpaque(true);
+ setBorder(noFocusBorder);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList, java.lang.Object, int, boolean, boolean)
+ * Override to get attribute of the ICheckListCellRenderer
+ *
+ */
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
+ boolean cellHasFocus) {
+ ICheckBoxListItem item = (ICheckBoxListItem) value;
+
+ setComponentOrientation(list.getComponentOrientation());
+
+ if (item.isChecked()) {
+ setBackground(list.getSelectionBackground());
+ setForeground(list.getSelectionForeground());
+ } else {
+ if (isSelected) {
+ setBackground(Color.LIGHT_GRAY);
+ setForeground(list.getForeground());
+ } else {
+ setBackground(list.getBackground());
+ setForeground(list.getForeground());
+ }
+ }
+
+ if (value instanceof ICheckBoxListItem) {
+ setText(item.getText());
+ setSelected(item.isChecked());
+ } else {
+ setIcon(null);
+ setText((value == null) ? "" : value.toString());
+ }
+
+ setEnabled(list.isEnabled());
+ setFont(list.getFont());
+
+ return this;
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListItem.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListItem.java
new file mode 100644
index 0000000000..39fa641d0e
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListItem.java
@@ -0,0 +1,74 @@
+/** @file
+
+ The file is used to create list item for CheckBox list
+
+ 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.common.ui.iCheckBoxList;
+
+public class ICheckBoxListItem {
+
+ //
+ // Define Class Members
+ //
+ protected String text;
+
+ protected boolean checked;
+
+ /**
+ This is the default constructor to set check box item string
+
+ @param text
+
+ **/
+ public ICheckBoxListItem(String text) {
+ this.text = text;
+ }
+
+ /**
+ This is the override constructor to set check box item string and checked status
+
+ @param text
+ @param checked
+
+ **/
+ public ICheckBoxListItem(String text, boolean checked) {
+ this.text = text;
+ this.checked = checked;
+ }
+
+ /**
+ set the checked status
+ if true, set false
+ if false, set true
+
+ **/
+ public void invertChecked() {
+ checked = !checked;
+ }
+
+ public boolean isChecked() {
+ return checked;
+ }
+
+ public void setChecked(boolean checked) {
+ this.checked = checked;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListModel.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListModel.java
new file mode 100644
index 0000000000..f3bbe8a3a0
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListModel.java
@@ -0,0 +1,67 @@
+/** @file
+
+ The file is used to override DefaultListModel to create ICheckBoxListModel
+
+ 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.common.ui.iCheckBoxList;
+
+import javax.swing.*;
+import java.util.Vector;
+
+public class ICheckBoxListModel extends DefaultListModel {
+ ///
+ /// Define class Serial Version UID
+ ///
+ private static final long serialVersionUID = -8617800969723991017L;
+
+ /**
+ This is the default Constructor for the CheckBoxListModel object
+
+ **/
+ public ICheckBoxListModel() {
+ }
+
+ /**
+ override DefaultListModel's add method
+
+ @param index
+ @param item
+
+ **/
+ public void add(int index, ICheckBoxListItem item) {
+ super.add(index, item);
+ }
+
+ /**
+ Add one item at tail
+
+ @param item
+
+ **/
+ public void addElement(ICheckBoxListItem item) {
+ super.addElement(item);
+ }
+
+ /**
+ Get all elements of the list
+
+ **/
+ public Vector getAllElements() {
+ Vector items = new Vector();
+ ICheckBoxListItem[] objs = new ICheckBoxListItem[this.size()];
+ this.copyInto(objs);
+ for (int i = 0; i < size(); i++) {
+ items.addElement(objs[i]);
+ }
+ return items;
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListener.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListener.java
new file mode 100644
index 0000000000..e95d279e59
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListener.java
@@ -0,0 +1,104 @@
+/** @file
+
+ The file is used to create listener for Checkbox List
+
+ 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.common.ui.iCheckBoxList;
+
+import java.awt.event.*;
+
+class ICheckBoxListener implements MouseListener, KeyListener {
+
+ protected ICheckBoxList iCheckboxlist;
+
+ /**
+ This is the default constructor
+
+ @param parent
+
+ **/
+ public ICheckBoxListener(ICheckBoxList parent) {
+ iCheckboxlist = parent;
+ }
+
+ /* (non-Javadoc)
+ * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
+ * Override to deal with keyReleased event
+ *
+ *
+ */
+ public void keyReleased(KeyEvent e) {
+ Object[] selectedValues = iCheckboxlist.getSelectedValues();
+ int[] selectedIndices = iCheckboxlist.getSelectedIndices();
+
+ for (int index = 0; index < selectedValues.length; index++) {
+ ICheckBoxListItem item = (ICheckBoxListItem) selectedValues[index];
+
+ if (iCheckboxlist.isEnabled()) {
+ if (e.getKeyCode() == KeyEvent.VK_SPACE) {
+ //
+ //if press space key, then reverse all selected item.
+ //
+ item.invertChecked();
+ }
+ ((ICheckBoxListModel) iCheckboxlist.getModel()).setElementAt(item, selectedIndices[index]);
+ }
+ }
+ }
+
+
+ /* (non-Javadoc)
+ * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
+ * Override to deal with mouse clicked event
+ *
+ */
+ public void mouseClicked(MouseEvent e) {
+ int index = iCheckboxlist.locationToIndex(e.getPoint());
+ ICheckBoxListItem item = null;
+ item = (ICheckBoxListItem) iCheckboxlist.getModel().getElementAt(index);
+
+ if (item != null && iCheckboxlist.isEnabled()) {
+ item.invertChecked();
+ ((ICheckBoxListModel) iCheckboxlist.getModel()).setElementAt(item, index);
+ }
+ }
+
+ public void mousePressed(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void mouseReleased(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void mouseEntered(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void mouseExited(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void keyPressed(KeyEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void keyTyped(KeyEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/BootModes/BootModesIdentification.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/BootModes/BootModesIdentification.java
new file mode 100644
index 0000000000..45944d5771
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/BootModes/BootModesIdentification.java
@@ -0,0 +1,89 @@
+/** @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.Identification.BootModes;
+
+import java.util.Vector;
+
+public class BootModesIdentification {
+
+ //
+ // Define class members
+ //
+ private String name = null;
+
+ private String usage = null;
+
+ private Vector supArchList = null;
+
+ private String featureFlag = null;
+
+ private String help = null;
+
+ public BootModesIdentification(String arg0, String arg1, String arg2, Vector 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 getSupArchList() {
+ return supArchList;
+ }
+
+ public void setSupArchList(Vector 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/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/BootModes/BootModesVector.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/BootModes/BootModesVector.java
new file mode 100644
index 0000000000..c7c02e9f4b
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/BootModes/BootModesVector.java
@@ -0,0 +1,90 @@
+/** @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.Identification.BootModes;
+
+import java.util.Vector;
+
+public class BootModesVector {
+
+ private Vector vBootModes = new Vector();
+
+ 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 updateBootModes(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 getvBootModes() {
+ return vBootModes;
+ }
+
+ public void setvBootModes(Vector BootModes) {
+ vBootModes = BootModes;
+ }
+
+ public Vector getBootModesName() {
+ Vector v = new Vector();
+ for (int index = 0; index < this.vBootModes.size(); index++) {
+ v.addElement(vBootModes.get(index).getName());
+ }
+ return v;
+ }
+
+ public int size() {
+ return this.vBootModes.size();
+ }
+
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/DataHubs/DataHubsIdentification.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/DataHubs/DataHubsIdentification.java
new file mode 100644
index 0000000000..deb72d3479
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/DataHubs/DataHubsIdentification.java
@@ -0,0 +1,89 @@
+/** @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.Identification.DataHubs;
+
+import java.util.Vector;
+
+public class DataHubsIdentification {
+
+ //
+ // Define class members
+ //
+ private String name = null;
+
+ private String usage = null;
+
+ private Vector supArchList = null;
+
+ private String featureFlag = null;
+
+ private String help = null;
+
+ public DataHubsIdentification(String arg0, String arg1, String arg2, Vector 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 getSupArchList() {
+ return supArchList;
+ }
+
+ public void setSupArchList(Vector 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/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/DataHubs/DataHubsVector.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/DataHubs/DataHubsVector.java
new file mode 100644
index 0000000000..4348eb3697
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/DataHubs/DataHubsVector.java
@@ -0,0 +1,90 @@
+/** @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.Identification.DataHubs;
+
+import java.util.Vector;
+
+public class DataHubsVector {
+
+ private Vector vDataHubs = new Vector();
+
+ 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 updateDataHubs(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 getvDataHubs() {
+ return vDataHubs;
+ }
+
+ public void setvDataHubs(Vector DataHubs) {
+ vDataHubs = DataHubs;
+ }
+
+ public Vector getDataHubsName() {
+ Vector v = new Vector();
+ for (int index = 0; index < this.vDataHubs.size(); index++) {
+ v.addElement(vDataHubs.get(index).getName());
+ }
+ return v;
+ }
+
+ public int size() {
+ return this.vDataHubs.size();
+ }
+
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Events/EventsIdentification.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Events/EventsIdentification.java
new file mode 100644
index 0000000000..4258226af1
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Events/EventsIdentification.java
@@ -0,0 +1,100 @@
+/** @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.Identification.Events;
+
+import java.util.Vector;
+
+public class EventsIdentification {
+
+ //
+ // Define class members
+ //
+ private String name = null;
+
+ private String type = null;
+
+ private String usage = null;
+
+ private Vector supArchList = null;
+
+ private String featureFlag = null;
+
+ private String help = null;
+
+ public EventsIdentification(String arg0, String arg1, String arg2, String arg3, Vector 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 getSupArchList() {
+ return supArchList;
+ }
+
+ public void setSupArchList(Vector 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;
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Events/EventsVector.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Events/EventsVector.java
new file mode 100644
index 0000000000..a2f597a0e4
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Events/EventsVector.java
@@ -0,0 +1,90 @@
+/** @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.Identification.Events;
+
+import java.util.Vector;
+
+public class EventsVector {
+
+ private Vector vEvents = new Vector();
+
+ 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 updateEvents(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 getvEvents() {
+ return vEvents;
+ }
+
+ public void setvEvents(Vector Events) {
+ vEvents = Events;
+ }
+
+ public Vector getEventsName() {
+ Vector v = new Vector();
+ for (int index = 0; index < this.vEvents.size(); index++) {
+ v.addElement(vEvents.get(index).getName());
+ }
+ return v;
+ }
+
+ public int size() {
+ return this.vEvents.size();
+ }
+
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Externs/ExternsIdentification.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Externs/ExternsIdentification.java
new file mode 100644
index 0000000000..b925698109
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Externs/ExternsIdentification.java
@@ -0,0 +1,78 @@
+/** @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.Identification.Externs;
+
+import java.util.Vector;
+
+public class ExternsIdentification {
+
+ //
+ // Define class members
+ //
+ private String name = null;
+
+ private String type = null;
+
+ private Vector supArchList = null;
+
+ private String featureFlag = null;
+
+ public ExternsIdentification(String arg0, String arg1, String arg2, Vector arg3) {
+ this.name = (arg0 == null ? "" : arg0);
+ this.type = (arg1 == null ? "" : arg1);
+ this.featureFlag = (arg2 == null ? "" : arg2);
+ this.supArchList = arg3;
+ }
+
+ 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 getSupArchList() {
+ return supArchList;
+ }
+
+ public void setSupArchList(Vector supArchList) {
+ this.supArchList = supArchList;
+ }
+
+ public boolean equals(ExternsIdentification pi) {
+ if (this.name.equals(pi.name)) {
+ return true;
+ }
+ return false;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Externs/ExternsVector.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Externs/ExternsVector.java
new file mode 100644
index 0000000000..ac5ce34e16
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Externs/ExternsVector.java
@@ -0,0 +1,90 @@
+/** @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.Identification.Externs;
+
+import java.util.Vector;
+
+public class ExternsVector {
+
+ private Vector vExterns = new Vector();
+
+ public int findExterns(ExternsIdentification sfi) {
+ for (int index = 0; index < vExterns.size(); index++) {
+ if (vExterns.elementAt(index).equals(sfi)) {
+ return index;
+ }
+ }
+ return -1;
+ }
+
+ public int findExterns(String name) {
+ for (int index = 0; index < vExterns.size(); index++) {
+ if (vExterns.elementAt(index).getName().equals(name)) {
+ 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 updateExterns(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 getvExterns() {
+ return vExterns;
+ }
+
+ public void setvExterns(Vector Externs) {
+ vExterns = Externs;
+ }
+
+ public Vector getExternsName() {
+ Vector v = new Vector();
+ for (int index = 0; index < this.vExterns.size(); index++) {
+ v.addElement(vExterns.get(index).getName());
+ }
+ return v;
+ }
+
+ public int size() {
+ return this.vExterns.size();
+ }
+
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Guids/GuidsIdentification.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Guids/GuidsIdentification.java
new file mode 100644
index 0000000000..7b11e2ca3f
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Guids/GuidsIdentification.java
@@ -0,0 +1,89 @@
+/** @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.Identification.Guids;
+
+import java.util.Vector;
+
+public class GuidsIdentification {
+
+ //
+ // Define class members
+ //
+ private String name = null;
+
+ private String usage = null;
+
+ private Vector supArchList = null;
+
+ private String featureFlag = null;
+
+ private String help = null;
+
+ public GuidsIdentification(String arg0, String arg1, String arg2, Vector 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 getSupArchList() {
+ return supArchList;
+ }
+
+ public void setSupArchList(Vector 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;
+ }
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Guids/GuidsVector.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Guids/GuidsVector.java
new file mode 100644
index 0000000000..68c2d88592
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/Guids/GuidsVector.java
@@ -0,0 +1,90 @@
+/** @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.Identification.Guids;
+
+import java.util.Vector;
+
+public class GuidsVector {
+
+ private Vector vGuids = new Vector();
+
+ 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 updateGuids(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 getvGuids() {
+ return vGuids;
+ }
+
+ public void setvGuids(Vector Guids) {
+ vGuids = Guids;
+ }
+
+ public Vector getGuidsName() {
+ Vector v = new Vector();
+ for (int index = 0; index < this.vGuids.size(); index++) {
+ v.addElement(vGuids.get(index).getName());
+ }
+ return v;
+ }
+
+ public int size() {
+ return this.vGuids.size();
+ }
+
+}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/HiiPackages/HiiPackagesIdentification.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/HiiPackages/HiiPackagesIdentification.java
new file mode 100644
index 0000000000..546f4b809f
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/HiiPackages/HiiPackagesIdentification.java
@@ -0,0 +1,89 @@
+/** @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.Identification.HiiPackages;
+
+import java.util.Vector;
+
+public class HiiPackagesIdentification {
+
+ //
+ // Define class members
+ //
+ private String name = null;
+
+ private String usage = null;
+
+ private Vector supArchList = null;
+
+ private String featureFlag = null;
+
+ private String help = null;
+
+ public HiiPackagesIdentification(String arg0, String arg1, String arg2, Vector 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 getSupArchList() {
+ return supArchList;
+ }
+
+ public void setSupArchList(Vector 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/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/HiiPackages/HiiPackagesVector.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/HiiPackages/HiiPackagesVector.java
new file mode 100644
index 0000000000..c4a4bbbe3d
--- /dev/null
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identification/HiiPackages/HiiPackagesVector.java
@@ -0,0 +1,90 @@
+/** @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.Identification.HiiPackages;
+
+import java.util.Vector;
+
+public class HiiPackagesVector {
+
+ private Vector vHiiPackages = new Vector();
+
+ 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 updateHiiPackages(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 getvHiiPackages() {
+ return vHiiPackages;
+ }
+
+ public void setvHiiPackages(Vector HiiPackages) {
+ vHiiPackages = HiiPackages;
+ }
+
+ public Vector getHiiPackagesName() {
+ Vector v = new Vector