1. Fix EDKT461 [Framework Wizard] Can't change ModuleBuildOptions for MSA file

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1938 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
hche10x 2006-11-13 08:11:53 +00:00
parent 3e97cd8b87
commit b3cb8ee7d0
8 changed files with 1358 additions and 143 deletions

View File

@ -73,6 +73,7 @@ import org.tianocore.frameworkwizard.far.installui.InstallStepOne;
import org.tianocore.frameworkwizard.far.updateui.UpdateStepOne;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.ui.ModuleBootModes;
import org.tianocore.frameworkwizard.module.ui.ModuleBuildOptions;
import org.tianocore.frameworkwizard.module.ui.ModuleDataHubs;
import org.tianocore.frameworkwizard.module.ui.ModuleEvents;
import org.tianocore.frameworkwizard.module.ui.ModuleExterns;
@ -2535,6 +2536,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
iTree.addNode(new IDefaultMutableTreeNode("External Defintions", IDefaultMutableTreeNode.MSA_EXTERNS, true, id,
belongNode));
iTree.addNode(new IDefaultMutableTreeNode("Pcd Coded", IDefaultMutableTreeNode.MSA_PCDS, true, id, belongNode));
iTree.addNode(new IDefaultMutableTreeNode("Build Options", IDefaultMutableTreeNode.MSA_BUILDOPTIONS, true, id, belongNode));
}
private void insertPackageTreeNode(Identification id) {
@ -2882,6 +2884,10 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
ModulePCDs frmPcd = new ModulePCDs(msa);
getJDesktopPaneModule().add(frmPcd, 1);
break;
case IDefaultMutableTreeNode.MSA_BUILDOPTIONS:
ModuleBuildOptions frmMbo = new ModuleBuildOptions(msa);
getJDesktopPaneModule().add(frmMbo, 1);
break;
}
this.jTabbedPaneEditor.setSelectedIndex(0);
resizeDesktopPanel();

View File

@ -21,183 +21,205 @@ public class EnumerationData {
// Static data for externs definitions
//
public final static String EXTERNS_PCD_IS_DRIVER = "Pcd Is Driver";
public final static String EXTERNS_SPECIFICATION = "Specification";
public final static String EXTERNS_IMAGE = "Image";
public final static String EXTERNS_MODULE_ENTRY_POINT = "ModuleEntryPoint";
public final static String EXTERNS_MODULE_UNLOAD_IMAGE = "ModuleUnloadImage";
public final static String EXTERNS_LIBRARY = "Library";
public final static String EXTERNS_CONSTRUCTOR = "Constructor";
public final static String EXTERNS_DESTRUCTOR = "Destructor";
public final static String EXTERNS_DRIVER = "Driver";
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_CALL_BACK = "Call Back";
public final static String EXTERNS_VIRTUAL_ADDRESS_MAP_CALL_BACK = "VirtualAddressMap";
public final static String EXTERNS_EXIT_BOOT_SERVICES_CALL_BACK = "ExitBootServices";
//
// Static data for guid type
//
public final static String GUID_TYPE_DATA_HUB_RECORD = "DATA_HUB_RECORD";
public final static String GUID_TYPE_EFI_EVENT = "EFI_EVENT";
public final static String GUID_TYPE_EFI_SYSTEM_CONFIGURATION_TABLE = "EFI_SYSTEM_CONFIGURATION_TABLE";
public final static String GUID_TYPE_EFI_VARIABLE = "EFI_VARIABLE";
public final static String GUID_TYPE_GUID = "GUID";
public final static String GUID_TYPE_HII_PACKAGE_LIST = "HII_PACKAGE_LIST";
public final static String GUID_TYPE_HOB = "HOB";
public final static String GUID_TYPE_TOKEN_SPACE_GUID = "TOKEN_SPACE_GUID";
//
// Static data for build targets
//
public final static String BUILD_TARGET_DEBUG = "DEBUG";
public final static String BUILD_TARGET_RELEASE = "RELEASE";
//
// Common data
//
public Vector<String> vSupportedArchitectures = new Vector<String>();
public Vector<String> vEnabled = new Vector<String>();
public Vector<String> vBoolean = new Vector<String>();
//
// Used by Msa Header
//
public Vector<String> vModuleType = new Vector<String>();
public Vector<String> vCompontentType = new Vector<String>();
//
// Used by Library Class Definitions
//
public Vector<String> vLibraryUsage = new Vector<String>();
public Vector<String> vFrameworkModuleTypes = new Vector<String>();
public Vector<String> vLibClassDef = new Vector<String>();
public Vector<String> vLibClassDefBase = new Vector<String>();
public Vector<String> vLibClassDefPei = new Vector<String>();
public Vector<String> vLibClassDefPeim = new Vector<String>();
public Vector<String> vLibClassDefDxeCore = new Vector<String>();
public Vector<String> vLibClassDefDxeDriver = new Vector<String>();
public Vector<String> vLibClassDefDxeSmmDriver = new Vector<String>();
public Vector<String> vLibClassDefUefiDriver = new Vector<String>();
//
// Used by Source Files
//
public Vector<String> vSourceFilesToolChainFamily = new Vector<String>();
public Vector<String> vSourceFilesFileType = new Vector<String>();
public Vector<String> vToolCode = new Vector<String>();
//
// Used by Package Dependencies
//
public Vector<String> vPackageUsage = new Vector<String>();
//
// Used by Protocols
//
public Vector<String> vProtocolUsage = new Vector<String>();
public Vector<String> vProtocolNotifyUsage = new Vector<String>();
public Vector<String> vProtocolType = new Vector<String>();
//
// Used by Events
//
public Vector<String> vEventType = new Vector<String>();
public Vector<String> vEventUsage = new Vector<String>();
public Vector<String> vEventGroup = new Vector<String>();
//
// Used by Hobs
//
public Vector<String> vHobType = new Vector<String>();
public Vector<String> vHobUsage = new Vector<String>();
//
// Used by Ppis
//
public Vector<String> vPpiType = new Vector<String>();
public Vector<String> vPpiUsage = new Vector<String>();
public Vector<String> vPpiNotifyUsage = new Vector<String>();
//
// Used by Variable
//
public Vector<String> vVariableUsage = new Vector<String>();
//
// Used by Boot Mode
//
public Vector<String> vBootModeNames = new Vector<String>();
public Vector<String> vBootModeUsage = new Vector<String>();
//
// Used by System Tables
//
public Vector<String> vSystemTableUsage = new Vector<String>();
//
// Used by Data Hubs
//
public Vector<String> vDataHubUsage = new Vector<String>();
//
// Used by Hii Packages
//
public Vector<String> vHiiPackageUsage = new Vector<String>();
//
// Used by Guid
//
public Vector<String> vGuidUsage = new Vector<String>();
//
// Used by Externs
//
public Vector<String> vExternTypes = new Vector<String>();
public Vector<String> vPcdDriverTypes = new Vector<String>();
//
// Used by Pcd
//
public Vector<String> vPcdItemTypes = new Vector<String>();
public Vector<String> vPcdUsage = new Vector<String>();
//
// Used by Build Options
//
public Vector<String> vBuildTargets = new Vector<String>();
public EnumerationData() {
init();
}
private void init() {
//
// Init common data first
@ -205,12 +227,12 @@ public class EnumerationData {
initSupportedArchitectures();
initEnabled();
initBoolean();
//
// Used by Msa header
//
initModuleType();
//
// Used by Library Class Definitions
//
@ -231,95 +253,100 @@ public class EnumerationData {
initSourceFilesToolChainFamily();
initSourceFilesFileType();
initToolCode();
//
// 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();
initPcdUsage();
//
// Used by Build Option
//
initBuildTargets();
}
private void initEnabled() {
vEnabled.removeAllElements();
vEnabled.addElement("Disabled");
vEnabled.addElement("Enabled");
}
private void initBoolean() {
vBoolean.removeAllElements();
vBoolean.addElement(DataType.FALSE);
vBoolean.addElement(DataType.TRUE);
}
private void initModuleType() {
vModuleType.removeAllElements();
vModuleType.addElement("BASE");
@ -337,25 +364,25 @@ public class EnumerationData {
vModuleType.addElement("USER_DEFINED");
Sort.sortVectorString(vModuleType, DataType.SORT_TYPE_ASCENDING);
}
// 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 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");
@ -365,7 +392,7 @@ public class EnumerationData {
vSupportedArchitectures.addElement("ARM");
vSupportedArchitectures.addElement("PPC");
}
private void initLibraryUsage() {
vLibraryUsage.removeAllElements();
vLibraryUsage.addElement("ALWAYS_CONSUMED");
@ -374,7 +401,7 @@ public class EnumerationData {
vLibraryUsage.addElement("SOMETIMES_PRODUCED");
vLibraryUsage.addElement("PRIVATE");
}
private void initFrameworkModuleTypes() {
vFrameworkModuleTypes.removeAllElements();
vFrameworkModuleTypes.addElement("BASE");
@ -416,7 +443,7 @@ public class EnumerationData {
vLibClassDef.addElement(vLibClassDefUefiDriver.elementAt(index));
}
}
private void initLibClassDefBase() {
vLibClassDefBase.removeAllElements();
vLibClassDefBase.addElement("BaseLib");
@ -435,12 +462,12 @@ public class EnumerationData {
vLibClassDefBase.addElement("SmbusLib");
vLibClassDefBase.addElement("TimerLib");
}
private void initLibClassDefPei() {
vLibClassDefPei.removeAllElements();
vLibClassDefPei.addElement("PeiCoreEntryPoint");
}
private void initLibClassDefPeim() {
vLibClassDefPeim.removeAllElements();
vLibClassDefPeim.addElement("BaseMemoryLib");
@ -456,13 +483,13 @@ public class EnumerationData {
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");
@ -477,12 +504,12 @@ public class EnumerationData {
vLibClassDefDxeDriver.addElement("UefiDecompressLib");
vLibClassDefDxeDriver.addElement("UefiRuntimeServicesTableLib");
}
private void initLibClassDefDxeSmmDriver() {
vLibClassDefDxeSmmDriver.removeAllElements();
vLibClassDefDxeSmmDriver.addElement("DxeSmmDriverEntryPoint");
}
private void initLibClassDefUefiDriver() {
vLibClassDefUefiDriver.removeAllElements();
vLibClassDefUefiDriver.addElement("BaseMemoryLib");
@ -492,14 +519,14 @@ public class EnumerationData {
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");
@ -516,23 +543,23 @@ public class EnumerationData {
vSourceFilesFileType.addElement("FFS");
vSourceFilesFileType.addElement("EFI");
}
private void initToolCode() {
vToolCode.removeAllElements();
vToolCode.addElement(DataType.EMPTY_SELECT_ITEM);
// vToolCode.addElement("Build_CCode");
// vToolCode.addElement("Build_AUTOGEN");
// vToolCode.addElement("Build_DPX");
// vToolCode.addElement("Build_ASM");
// vToolCode.addElement("Build_Assembly");
// vToolCode.addElement("Build_Gcc_Assembly");
// vToolCode.addElement("Build_IPF_Assembly_Code");
// vToolCode.addElement("Build_IPF_PP_Code");
// vToolCode.addElement("Build_Library");
// vToolCode.addElement("Build_UNI");
// vToolCode.addElement("Build_Unicode_Database");
// vToolCode.addElement("Build_VFR");
// vToolCode.addElement("Build_DUMMY");
// vToolCode.addElement("Build_CCode");
// vToolCode.addElement("Build_AUTOGEN");
// vToolCode.addElement("Build_DPX");
// vToolCode.addElement("Build_ASM");
// vToolCode.addElement("Build_Assembly");
// vToolCode.addElement("Build_Gcc_Assembly");
// vToolCode.addElement("Build_IPF_Assembly_Code");
// vToolCode.addElement("Build_IPF_PP_Code");
// vToolCode.addElement("Build_Library");
// vToolCode.addElement("Build_UNI");
// vToolCode.addElement("Build_Unicode_Database");
// vToolCode.addElement("Build_VFR");
// vToolCode.addElement("Build_DUMMY");
vToolCode.addElement("CC");
vToolCode.addElement("DLINK");
vToolCode.addElement("SLINK");
@ -541,13 +568,13 @@ public class EnumerationData {
vToolCode.addElement("ASMLINK");
vToolCode.addElement("ASL");
}
private void initPackageUsage() {
vPackageUsage.removeAllElements();
vPackageUsage.addElement("ALWAYS_CONSUMED");
vPackageUsage.addElement("ALWAYS_PRODUCED");
}
private void initProtocolUsage() {
vProtocolUsage.removeAllElements();
vProtocolUsage.addElement("ALWAYS_CONSUMED");
@ -558,19 +585,19 @@ public class EnumerationData {
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");
@ -579,14 +606,14 @@ public class EnumerationData {
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");
@ -598,7 +625,7 @@ public class EnumerationData {
vHobType.addElement("POOL");
vHobType.addElement("CAPSULE_VOLUME");
}
private void initHobUsage() {
vHobUsage.removeAllElements();
vHobUsage.addElement("ALWAYS_CONSUMED");
@ -607,13 +634,13 @@ public class EnumerationData {
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");
@ -622,16 +649,16 @@ public class EnumerationData {
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");
@ -640,7 +667,7 @@ public class EnumerationData {
vVariableUsage.addElement("SOMETIMES_PRODUCED");
vVariableUsage.addElement("PRIVATE");
}
private void initBootModeNames() {
vBootModeNames.removeAllElements();
vBootModeNames.addElement("FULL");
@ -664,7 +691,7 @@ public class EnumerationData {
vBootModeNames.addElement("RECOVERY_S5_RESUME");
vBootModeNames.addElement("RECOVERY_FLASH_UPDATE");
}
private void initBootModeUsage() {
vBootModeUsage.removeAllElements();
vBootModeUsage.addElement("ALWAYS_CONSUMED");
@ -672,7 +699,7 @@ public class EnumerationData {
vBootModeUsage.addElement("ALWAYS_PRODUCED");
vBootModeUsage.addElement("SOMETIMES_PRODUCED");
}
private void initSystemTableUsage() {
vSystemTableUsage.removeAllElements();
vSystemTableUsage.addElement("ALWAYS_CONSUMED");
@ -681,7 +708,7 @@ public class EnumerationData {
vSystemTableUsage.addElement("SOMETIMES_PRODUCED");
vSystemTableUsage.addElement("PRIVATE");
}
private void initDataHubUsage() {
vDataHubUsage.removeAllElements();
vDataHubUsage.addElement("ALWAYS_CONSUMED");
@ -690,14 +717,14 @@ public class EnumerationData {
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");
@ -706,23 +733,23 @@ public class EnumerationData {
vGuidUsage.addElement("SOMETIMES_PRODUCED");
vGuidUsage.addElement("PRIVATE");
}
private void initExternTypes() {
vExternTypes.removeAllElements();
vExternTypes.addElement(EnumerationData.EXTERNS_SPECIFICATION);
vExternTypes.addElement(EnumerationData.EXTERNS_IMAGE);
vExternTypes.addElement(EnumerationData.EXTERNS_DRIVER);
vExternTypes.addElement(EnumerationData.EXTERNS_LIBRARY);
vExternTypes.addElement(EnumerationData.EXTERNS_CALL_BACK);
}
private void initPcdDriverTypes() {
vPcdDriverTypes.removeAllElements();
vPcdDriverTypes.removeAllElements();
vPcdDriverTypes.addElement("PEI_PCD_DRIVER");
vPcdDriverTypes.addElement("DXE_PCD_DRIVER");
}
private void initPcdItemTypes() {
vPcdItemTypes.removeAllElements();
vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_FEATURE_FLAG);
@ -731,7 +758,7 @@ public class EnumerationData {
vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_DYNAMIC);
vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_DYNAMIC_EX);
}
private void initPcdUsage() {
vPcdUsage.removeAllElements();
vPcdUsage.addElement("ALWAYS_CONSUMED");
@ -740,6 +767,12 @@ public class EnumerationData {
vPcdUsage.addElement("SOMETIMES_PRODUCED");
}
private void initBuildTargets() {
vBuildTargets.removeAllElements();
vBuildTargets.addElement(EnumerationData.BUILD_TARGET_DEBUG);
vBuildTargets.addElement(EnumerationData.BUILD_TARGET_RELEASE);
}
public Vector<String> getvCompontentType() {
return vCompontentType;
}
@ -1079,4 +1112,12 @@ public class EnumerationData {
public void setVPcdUsage(Vector<String> pcdUsage) {
vPcdUsage = pcdUsage;
}
public Vector<String> getVBuildTargets() {
return vBuildTargets;
}
public void setVBuildTargets(Vector<String> buildTargets) {
vBuildTargets = buildTargets;
}
}

View File

@ -1,6 +1,6 @@
/** @file
The file is used to define Package Dependencies Identification
The file is used to define Boot Modes Identification
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials

View File

@ -1,6 +1,6 @@
/** @file
The file is used to define Package Dependencies Vector
The file is used to define Boot Modes Vector
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials

View File

@ -0,0 +1,93 @@
/** @file
The file is used to define Build Options Identification
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
package org.tianocore.frameworkwizard.module.Identifications.BuildOptions;
import java.util.Vector;
public class BuildOptionsIdentification {
//
// Define class members
//
private String option = null;
private Vector<String> buildTargets = null;
private String toolChainFamily = null;
private String tagName = null;
private String toolCode = null;
private Vector<String> supArchList = null;
public BuildOptionsIdentification(String arg0, Vector<String> arg1, String arg2, String arg3, String arg4, Vector<String> arg5) {
this.option = (arg0 == null ? "" : arg0);
this.buildTargets = arg1;
this.toolChainFamily = (arg2 == null ? "" : arg2);
this.tagName = (arg3 == null ? "" : arg3);
this.toolCode = (arg4 == null ? "" : arg4);
this.supArchList = arg5;
}
public String getOption() {
return option;
}
public void setOption(String option) {
this.option = option;
}
public Vector<String> getSupArchList() {
return supArchList;
}
public void setSupArchList(Vector<String> supArchList) {
this.supArchList = supArchList;
}
public String getTagName() {
return tagName;
}
public void setTagName(String tagName) {
this.tagName = tagName;
}
public String getToolChainFamily() {
return toolChainFamily;
}
public void setToolChainFamily(String toolChainFamily) {
this.toolChainFamily = toolChainFamily;
}
public String getToolCode() {
return toolCode;
}
public void setToolCode(String toolCode) {
this.toolCode = toolCode;
}
public Vector<String> getBuildTargets() {
return buildTargets;
}
public void setBuildTargets(Vector<String> buildTargets) {
this.buildTargets = buildTargets;
}
}

View File

@ -0,0 +1,95 @@
/** @file
The file is used to define Build Options Vector
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
package org.tianocore.frameworkwizard.module.Identifications.BuildOptions;
import java.util.Vector;
public class BuildOptionsVector {
private Vector<BuildOptionsIdentification> vBuildOptions = new Vector<BuildOptionsIdentification>();
public int findBuildOptions(BuildOptionsIdentification sfi) {
for (int index = 0; index < vBuildOptions.size(); index++) {
if (vBuildOptions.elementAt(index).equals(sfi)) {
return index;
}
}
return -1;
}
public int findBuildOptions(String name) {
for (int index = 0; index < vBuildOptions.size(); index++) {
if (vBuildOptions.elementAt(index).getOption().equals(name)) {
return index;
}
}
return -1;
}
public BuildOptionsIdentification getBuildOptions(int index) {
if (index > -1) {
return vBuildOptions.elementAt(index);
} else {
return null;
}
}
public void addBuildOptions(BuildOptionsIdentification arg0) {
vBuildOptions.addElement(arg0);
}
public void setBuildOptions(BuildOptionsIdentification arg0, int arg1) {
vBuildOptions.setElementAt(arg0, arg1);
}
public void removeBuildOptions(BuildOptionsIdentification arg0) {
int index = findBuildOptions(arg0);
if (index > -1) {
vBuildOptions.removeElementAt(index);
}
}
public void removeBuildOptions(int index) {
if (index > -1 && index < this.size()) {
vBuildOptions.removeElementAt(index);
}
}
public Vector<BuildOptionsIdentification> getvBuildOptions() {
return vBuildOptions;
}
public void setvBuildOptions(Vector<BuildOptionsIdentification> BuildOptions) {
vBuildOptions = BuildOptions;
}
public Vector<String> getBuildOptionsName() {
Vector<String> v = new Vector<String>();
for (int index = 0; index < this.vBuildOptions.size(); index++) {
v.addElement(vBuildOptions.get(index).getOption());
}
return v;
}
public int size() {
return this.vBuildOptions.size();
}
public Vector<String> toStringVector(int index) {
Vector<String> v = new Vector<String>();
v.addElement(getBuildOptions(index).getOption());
return v;
}
}

View File

@ -0,0 +1,485 @@
/** @file
The file is used to create, update BuildOptions of MSA/MBD file
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
package org.tianocore.frameworkwizard.module.ui;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ComponentEvent;
import java.awt.event.MouseEvent;
import java.util.List;
import java.util.Vector;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import org.tianocore.ModuleBuildOptionsDocument;
import org.tianocore.UserExtensionsDocument;
import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
import org.tianocore.OptionDocument.Option;
import org.tianocore.frameworkwizard.common.DataType;
import org.tianocore.frameworkwizard.common.IDefaultTableModel;
import org.tianocore.frameworkwizard.common.Log;
import org.tianocore.frameworkwizard.common.Tools;
import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import org.tianocore.frameworkwizard.module.Identifications.BuildOptions.BuildOptionsIdentification;
import org.tianocore.frameworkwizard.module.Identifications.BuildOptions.BuildOptionsVector;
import org.tianocore.frameworkwizard.module.ui.dialog.BuildOptionsDlg;
/**
The class is used to create, update BuildOptions of MSA/MBD file
It extends IInternalFrame
**/
public class ModuleBuildOptions extends IInternalFrame {
///
/// Define class Serial Version UID
///
private static final long serialVersionUID = -3888558623432442561L;
//
//Define class members
//
private JPanel jContentPane = null;
private JButton jButtonAdd = null;
private JButton jButtonRemove = null;
private JButton jButtonUpdate = null;
private JScrollPane jScrollPane = null;
private JScrollPane jScrollPaneTable = null;
private JTable jTable = null;
//
// Not used by UI
//
private OpeningModuleType omt = null;
private ModuleSurfaceArea msa = null;
private ModuleBuildOptionsDocument.ModuleBuildOptions mbo = null;
private List<UserExtensionsDocument.UserExtensions> ue = null;
private BuildOptionsIdentification id = null;
private BuildOptionsVector vid = new BuildOptionsVector();
private IDefaultTableModel model = null;
private int selectedRow = -1;
/**
This method initializes jButtonAdd
@return javax.swing.JButton jButtonAdd
**/
private JButton getJButtonAdd() {
if (jButtonAdd == null) {
jButtonAdd = new JButton();
jButtonAdd.setBounds(new java.awt.Rectangle(210, 195, 90, 20));
jButtonAdd.setText("Add");
jButtonAdd.addActionListener(this);
jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
}
return jButtonAdd;
}
/**
This method initializes jButtonRemove
@return javax.swing.JButton jButtonRemove
**/
private JButton getJButtonRemove() {
if (jButtonRemove == null) {
jButtonRemove = new JButton();
jButtonRemove.setBounds(new java.awt.Rectangle(390, 195, 90, 20));
jButtonRemove.setText("Remove");
jButtonRemove.addActionListener(this);
jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
}
return jButtonRemove;
}
/**
This method initializes jButtonUpdate
@return javax.swing.JButton jButtonUpdate
**/
private JButton getJButtonUpdate() {
if (jButtonUpdate == null) {
jButtonUpdate = new JButton();
jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 90, 20));
jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
jButtonUpdate.setText("Edit");
jButtonUpdate.addActionListener(this);
}
return jButtonUpdate;
}
/**
This method initializes jScrollPane
@return javax.swing.JScrollPane
*/
private JScrollPane getJScrollPane() {
if (jScrollPane == null) {
jScrollPane = new JScrollPane();
jScrollPane.setViewportView(getJContentPane());
}
return jScrollPane;
}
/**
This method initializes jScrollPaneTable
@return javax.swing.JScrollPane
**/
private JScrollPane getJScrollPaneTable() {
if (jScrollPaneTable == null) {
jScrollPaneTable = new JScrollPane();
jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
jScrollPaneTable.setViewportView(getJTable());
}
return jScrollPaneTable;
}
/**
This method initializes jTable
@return javax.swing.JTable
**/
private JTable getJTable() {
if (jTable == null) {
jTable = new JTable();
model = new IDefaultTableModel();
jTable = new JTable(model);
jTable.setRowHeight(20);
model.addColumn("Option String Value");
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.getSelectionModel().addListSelectionListener(this);
jTable.getModel().addTableModelListener(this);
jTable.addMouseListener(this);
}
return jTable;
}
public static void main(String[] args) {
}
/**
This method initializes this
**/
private void init() {
this.setSize(500, 515);
this.setContentPane(getJScrollPane());
this.setTitle("Boot Modes");
}
/**
This method initializes this
Fill values to all fields if these values are not empty
@param inBuildOptions
**/
private void init(ModuleBuildOptionsDocument.ModuleBuildOptions inModuleBuildOptions) {
init();
this.mbo = inModuleBuildOptions;
if (this.mbo != null) {
//
// Save User Extensitions
//
if (this.mbo.getUserExtensionsList() != null) {
this.ue = this.mbo.getUserExtensionsList();
}
if (this.mbo.getOptions() != null) {
if (this.mbo.getOptions().getOptionList() != null) {
for (int index = 0; index < this.mbo.getOptions().getOptionList().size(); index++) {
Option o = this.mbo.getOptions().getOptionList().get(index);
if (o != null) {
String arg0 = o.getStringValue();
Vector<String> arg1 = Tools.convertListToVector(o.getBuildTargets());
String arg2 = o.getToolChainFamily();
String arg3 = o.getTagName();
String arg4 = o.getToolCode();
Vector<String> arg5 = Tools.convertListToVector(o.getSupArchList());
id = new BuildOptionsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
vid.addBuildOptions(id);
}
}
}
}
}
showTable();
}
/**
This is the default constructor
**/
public ModuleBuildOptions() {
super();
init();
this.setVisible(true);
}
/**
This is the override edit constructor
@param inBuildOptions The input BuildOptionsDocument.BuildOptions
**/
public ModuleBuildOptions(OpeningModuleType inOmt) {
super();
this.omt = inOmt;
this.msa = omt.getXmlMsa();
init(msa.getModuleBuildOptions());
this.setVisible(true);
}
/**
This method initializes jContentPane
@return javax.swing.JPanel jContentPane
**/
private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
jContentPane.add(getJButtonAdd(), null);
jContentPane.add(getJButtonRemove(), null);
jContentPane.add(getJButtonUpdate(), null);
jContentPane.add(getJScrollPaneTable(), null);
}
return jContentPane;
}
private void showEdit(int index) {
BuildOptionsDlg dlg = new BuildOptionsDlg(vid.getBuildOptions(index), new IFrame(), omt.getId());
int result = dlg.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) {
this.vid.addBuildOptions(dlg.getId());
} else {
this.vid.setBuildOptions(dlg.getId(), index);
}
this.showTable();
this.save();
dlg.dispose();
}
if (result == DataType.RETURN_TYPE_CANCEL) {
dlg.dispose();
}
}
/**
Clear all table rows
**/
private void clearAll() {
if (model != null) {
for (int index = model.getRowCount() - 1; index >= 0; index--) {
model.removeRow(index);
}
}
}
/**
Read content of vector and put then into table
**/
private void showTable() {
clearAll();
if (vid.size() > 0) {
for (int index = 0; index < vid.size(); index++) {
model.addRow(vid.toStringVector(index));
}
}
this.jTable.repaint();
this.jTable.updateUI();
}
/* (non-Javadoc)
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*
* Override actionPerformed to listen all actions
*
*/
public void actionPerformed(ActionEvent arg0) {
if (arg0.getSource() == jButtonAdd) {
showEdit(-1);
}
if (arg0.getSource() == jButtonUpdate) {
if (this.selectedRow < 0) {
Log.wrn("Update Boot Modes", "Please select one record first.");
return;
}
showEdit(selectedRow);
}
if (arg0.getSource() == jButtonRemove) {
if (jTable.isEditing()) {
jTable.getCellEditor().stopCellEditing();
}
if (selectedRow > -1) {
this.model.removeRow(selectedRow);
this.vid.removeBuildOptions(selectedRow);
selectedRow = -1;
this.save();
}
}
}
/**
Save all components of Mbd Header
if exists BuildOptions, set the value directly
if not exists BuildOptions, new an instance first
**/
public void save() {
try {
int count = this.vid.size();
this.mbo = ModuleBuildOptionsDocument.ModuleBuildOptions.Factory.newInstance();
this.mbo.addNewOptions();
//
// Restore User Extensions Data
//
if (this.ue != null) {
for (int index = 0; index < this.ue.size(); index++) {
this.mbo.addNewUserExtensions();
this.mbo.setUserExtensionsArray(index, ue.get(index));
}
}
if (count > 0) {
for (int index = 0; index < count; index++) {
Option o = Option.Factory.newInstance();
if (!isEmpty(vid.getBuildOptions(index).getOption())) {
o.setStringValue(vid.getBuildOptions(index).getOption());
}
if (vid.getBuildOptions(index).getBuildTargets() != null
&& vid.getBuildOptions(index).getBuildTargets().size() > 0) {
o.setBuildTargets(vid.getBuildOptions(index).getBuildTargets());
}
if (!isEmpty(vid.getBuildOptions(index).getToolChainFamily())) {
o.setToolChainFamily(vid.getBuildOptions(index).getToolChainFamily());
}
if (!isEmpty(vid.getBuildOptions(index).getTagName())) {
o.setTagName(vid.getBuildOptions(index).getTagName());
}
if (!isEmpty(vid.getBuildOptions(index).getToolCode())) {
o.setToolCode(vid.getBuildOptions(index).getToolCode());
}
if (vid.getBuildOptions(index).getSupArchList() != null
&& vid.getBuildOptions(index).getSupArchList().size() > 0) {
o.setSupArchList(vid.getBuildOptions(index).getSupArchList());
}
this.mbo.getOptions().addNewOption();
this.mbo.getOptions().setOptionArray(this.mbo.getOptions().getOptionList().size() - 1, o);
}
}
this.msa.setModuleBuildOptions(this.mbo);
this.omt.setSaved(false);
} catch (Exception e) {
Log.wrn("Update Module Build Options", e.getMessage());
Log.err("Update Module Build Options", e.getMessage());
}
}
/* (non-Javadoc)
* @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
*
*/
public void valueChanged(ListSelectionEvent arg0) {
if (arg0.getValueIsAdjusting()) {
return;
}
ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
if (lsm.isSelectionEmpty()) {
return;
} else {
selectedRow = lsm.getMinSelectionIndex();
}
}
/* (non-Javadoc)
* @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
*
*/
public void mouseClicked(MouseEvent arg0) {
if (arg0.getClickCount() == 2) {
if (this.selectedRow < 0) {
return;
} else {
showEdit(selectedRow);
}
}
}
/* (non-Javadoc)
* @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
*
* Override componentResized to resize all components when frame's size is changed
*/
public void componentResized(ComponentEvent arg0) {
int intCurrentWidth = this.getJContentPane().getWidth();
int intCurrentHeight = this.getJContentPane().getHeight();
int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
intPreferredHeight);
Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
}
}

View File

@ -0,0 +1,495 @@
/** @file
The file is used to create, update SourceFiles section of the MSA file
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
package org.tianocore.frameworkwizard.module.ui.dialog;
import java.awt.event.ActionEvent;
import java.util.Vector;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import org.tianocore.frameworkwizard.common.DataType;
import org.tianocore.frameworkwizard.common.DataValidation;
import org.tianocore.frameworkwizard.common.EnumerationData;
import org.tianocore.frameworkwizard.common.Log;
import org.tianocore.frameworkwizard.common.Tools;
import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IComboBox;
import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.BuildOptions.BuildOptionsIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/**
* The class is used to create, update SourceFiles section of the MSA file
*
* It extends IDialog
*
**/
public class BuildOptionsDlg extends IDialog {
///
/// Define class Serial Version UID
///
private static final long serialVersionUID = -6765742852142775378L;
//
// Define class members
//
private JPanel jContentPane = null;
private JLabel jLabelFileName = null;
private JTextField jTextFieldFileOption = null;
private JLabel jLabelToolChainFamily = null;
private StarLabel jStarLabel1 = null;
private JLabel jLabelArch = null;
private JScrollPane jScrollPane = null;
private JLabel jLabelTagName = null;
private JTextField jTextFieldTagName = null;
private JLabel jLabelToolCode = null;
private JTextField jTextFieldToolCode = null;
private IComboBox iComboBoxToolCode = null;
private JTextField jTextFieldToolChainFamily = null;
private ArchCheckBox jArchCheckBox = null;
private JButton jButtonOk = null;
private JButton jButtonCancel = null;
private JScrollPane jScrollPaneBuildTargets = null;
private ICheckBoxList iCheckBoxListBuildTargets = null;
//
// Not used by UI
//
private BuildOptionsIdentification id = null;
private EnumerationData ed = new EnumerationData();
private WorkspaceTools wt = new WorkspaceTools();
private JLabel jLabelBuildTargets = null;
/**
This method initializes jTextFieldFileOption
@return javax.swing.JTextField jTextFieldFileOption
**/
private JTextField getJTextFieldSourceFilesDirectory() {
if (jTextFieldFileOption == null) {
jTextFieldFileOption = new JTextField();
jTextFieldFileOption.setBounds(new java.awt.Rectangle(168, 12, 340, 20));
jTextFieldFileOption.setPreferredSize(new java.awt.Dimension(340, 20));
jTextFieldFileOption.setToolTipText("Path is relative to the MSA file and must include the file name");
}
return jTextFieldFileOption;
}
/**
This method initializes jScrollPane
@return javax.swing.JScrollPane
*/
private JScrollPane getJScrollPane() {
if (jScrollPane == null) {
jScrollPane = new JScrollPane();
jScrollPane.setViewportView(getJContentPane());
}
return jScrollPane;
}
/**
* This method initializes jTextFieldTagName
*
* @return javax.swing.JTextField
*/
private JTextField getJTextFieldTagName() {
if (jTextFieldTagName == null) {
jTextFieldTagName = new JTextField();
jTextFieldTagName.setBounds(new java.awt.Rectangle(168, 37, 340, 20));
jTextFieldTagName.setPreferredSize(new java.awt.Dimension(340, 20));
jTextFieldTagName.setToolTipText("You may specify a specific tool chain tag name, such as BILL1");
}
return jTextFieldTagName;
}
private IComboBox getIComboBoxToolCode() {
if (iComboBoxToolCode == null) {
iComboBoxToolCode = new IComboBox();
iComboBoxToolCode.setBounds(new java.awt.Rectangle(168, 62, 340, 20));
iComboBoxToolCode.setPreferredSize(new java.awt.Dimension(340, 20));
iComboBoxToolCode.setToolTipText("<html>You may select a specific tool command from drop down list,<br>"
+ "or you can DOUBLE-CLICK this field to enter your customized<br>"
+ "tool command.<br>"
+ "Press ENTER to save your input or press ESCAPE to quit</html>");
}
return iComboBoxToolCode;
}
/**
* This method initializes jTextFieldToolCode
*
* @return javax.swing.JTextField
*/
private JTextField getJTextFieldToolCode() {
if (jTextFieldToolCode == null) {
jTextFieldToolCode = new JTextField();
jTextFieldToolCode.setBounds(new java.awt.Rectangle(168, 62, 340, 20));
jTextFieldToolCode.setPreferredSize(new java.awt.Dimension(340, 20));
jTextFieldToolCode.setToolTipText("You may specify a specific tool command, such as ASM");
jTextFieldToolCode.setVisible(false);
}
return jTextFieldToolCode;
}
/**
* This method initializes jTextFieldToolChainFamily
*
* @return javax.swing.JTextField
*/
private JTextField getJTextFieldToolChainFamily() {
if (jTextFieldToolChainFamily == null) {
jTextFieldToolChainFamily = new JTextField();
jTextFieldToolChainFamily.setBounds(new java.awt.Rectangle(168, 87, 340, 20));
jTextFieldToolChainFamily.setPreferredSize(new java.awt.Dimension(340, 20));
jTextFieldToolChainFamily.setToolTipText("You may specify a specific tool chain family, such as GCC");
}
return jTextFieldToolChainFamily;
}
/**
This method initializes jButtonOk
@return javax.swing.JButton
**/
private JButton getJButtonOk() {
if (jButtonOk == null) {
jButtonOk = new JButton();
jButtonOk.setBounds(new java.awt.Rectangle(317, 202, 90, 20));
jButtonOk.setText("Ok");
jButtonOk.addActionListener(this);
}
return jButtonOk;
}
/**
This method initializes jButtonCancel
@return javax.swing.JButton
**/
private JButton getJButtonCancel() {
if (jButtonCancel == null) {
jButtonCancel = new JButton();
jButtonCancel.setBounds(new java.awt.Rectangle(412, 202, 90, 20));
jButtonCancel.setText("Cancel");
jButtonCancel.addActionListener(this);
}
return jButtonCancel;
}
/**
This method initializes iCheckBoxListArch
@return ICheckBoxList
**/
private ICheckBoxList getICheckBoxListSupModuleList() {
if (iCheckBoxListBuildTargets == null) {
iCheckBoxListBuildTargets = new ICheckBoxList();
}
return iCheckBoxListBuildTargets;
}
/**
This method initializes jScrollPaneBuildTargets
@return javax.swing.JScrollPane
**/
private JScrollPane getJScrollPaneBuildTargets() {
if (jScrollPaneBuildTargets == null) {
jScrollPaneBuildTargets = new JScrollPane();
jScrollPaneBuildTargets.setBounds(new java.awt.Rectangle(168, 137, 340, 40));
jScrollPaneBuildTargets.setPreferredSize(new java.awt.Dimension(340, 40));
jScrollPaneBuildTargets.setViewportView(getICheckBoxListSupModuleList());
}
return jScrollPaneBuildTargets;
}
public static void main(String[] args) {
}
/**
This is the default constructor
**/
public BuildOptionsDlg(BuildOptionsIdentification inBuildOptionsIdentification, IFrame iFrame,
ModuleIdentification mid) {
super(iFrame, true);
init(inBuildOptionsIdentification, mid);
}
/**
This method initializes this
**/
private void init() {
this.setSize(525, 270);
this.setContentPane(getJScrollPane());
this.setTitle("Source Files");
this.setViewMode(false);
this.centerWindow();
Tools.generateComboBoxByVector(iComboBoxToolCode, ed.getVToolCode());
this.iCheckBoxListBuildTargets.setAllItems(ed.getVBuildTargets());
}
/**
This method initializes this
Fill values to all fields if these values are not empty
@param inSourceFiles The input data of SourceFilesDocument.SourceFiles
**/
private void init(BuildOptionsIdentification inBuildOptionsIdentification, ModuleIdentification mid) {
init();
//
// Init arch with module's arch
//
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
if (inBuildOptionsIdentification != null) {
this.jTextFieldFileOption.setText(inBuildOptionsIdentification.getOption());
this.jTextFieldTagName.setText(inBuildOptionsIdentification.getTagName());
//
// Generate Tool Code selection list
//
Vector<String> v = ed.getVToolCode();
boolean isFind = false;
String strToolCode = inBuildOptionsIdentification.getToolCode();
//
// If the input value is not in the default list, add it to the list
//
if (strToolCode != null) {
for (int index = 0; index < v.size(); index++) {
if (v.elementAt(index).equals(strToolCode)) {
isFind = true;
break;
}
}
if (!isFind && !isEmpty(strToolCode)) {
v.addElement(strToolCode);
}
}
Tools.generateComboBoxByVector(iComboBoxToolCode, v);
this.iComboBoxToolCode.setSelectedItem(strToolCode);
this.jTextFieldToolChainFamily.setText(inBuildOptionsIdentification.getToolChainFamily());
this.jArchCheckBox.setSelectedItems(inBuildOptionsIdentification.getSupArchList());
this.iCheckBoxListBuildTargets.setAllItemsUnchecked();
this.iCheckBoxListBuildTargets.initCheckedItem(true, inBuildOptionsIdentification.getBuildTargets());
}
}
/**
Disable all components when the mode is view
@param isView true - The view mode; false - The non-view mode
**/
public void setViewMode(boolean isView) {
if (isView) {
this.jTextFieldFileOption.setEnabled(!isView);
}
}
/**
This method initializes jContentPane
@return javax.swing.JPanel jContentPane
**/
private JPanel getJContentPane() {
if (jContentPane == null) {
jLabelBuildTargets = new JLabel();
jLabelBuildTargets.setBounds(new java.awt.Rectangle(12, 137, 155, 20));
jLabelBuildTargets.setText("Build Targets");
jArchCheckBox = new ArchCheckBox();
jArchCheckBox.setBounds(new java.awt.Rectangle(168, 112, 340, 20));
jArchCheckBox.setPreferredSize(new java.awt.Dimension(340, 20));
jLabelToolCode = new JLabel();
jLabelToolCode.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
jLabelToolCode.setText("Tool Code");
jLabelTagName = new JLabel();
jLabelTagName.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
jLabelTagName.setText("Tag Name");
jLabelArch = new JLabel();
jLabelArch.setBounds(new java.awt.Rectangle(12, 112, 155, 20));
jLabelArch.setText("Supported Architectures");
jLabelToolChainFamily = new JLabel();
jLabelToolChainFamily.setBounds(new java.awt.Rectangle(12, 87, 155, 20));
jLabelToolChainFamily.setText("Tool Chain Family");
jLabelFileName = new JLabel();
jLabelFileName.setText("Option String");
jLabelFileName.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.setPreferredSize(new java.awt.Dimension(505, 222));
jContentPane.add(jLabelFileName, null);
jContentPane.add(getJTextFieldSourceFilesDirectory(), null);
jContentPane.add(jLabelToolChainFamily, null);
jStarLabel1 = new StarLabel();
jStarLabel1.setLocation(new java.awt.Point(0, 10));
jContentPane.add(jStarLabel1, null);
jContentPane.add(jLabelArch, null);
jContentPane.add(jLabelTagName, null);
jContentPane.add(getJTextFieldTagName(), null);
jContentPane.add(jLabelToolCode, null);
jContentPane.add(getJTextFieldToolCode(), null);
jContentPane.add(getIComboBoxToolCode(), null);
jContentPane.add(getJTextFieldToolChainFamily(), null);
jContentPane.add(jArchCheckBox, null);
jContentPane.add(getJButtonOk(), null);
jContentPane.add(getJButtonCancel(), null);
jContentPane.add(jLabelBuildTargets, null);
jContentPane.add(getJScrollPaneBuildTargets(), null);
}
return jContentPane;
}
/* (non-Javadoc)
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*
* Override actionPerformed to listen all actions
*
*/
public void actionPerformed(ActionEvent arg0) {
if (arg0.getSource() == jButtonOk) {
if (checkAdd()) {
getCurrentId();
this.returnType = DataType.RETURN_TYPE_OK;
this.setVisible(false);
}
}
if (arg0.getSource() == jButtonCancel) {
this.returnType = DataType.RETURN_TYPE_CANCEL;
this.setVisible(false);
}
}
private BuildOptionsIdentification getCurrentId() {
String arg0 = this.jTextFieldFileOption.getText();
Vector<String> arg1 = this.iCheckBoxListBuildTargets.getAllCheckedItemsString();
String arg2 = this.jTextFieldToolChainFamily.getText();
String arg3 = this.jTextFieldTagName.getText();
String arg4 = this.iComboBoxToolCode.getSelectedItem().toString();
if (arg4.equals(DataType.EMPTY_SELECT_ITEM)) {
arg4 = "";
}
Vector<String> arg5 = this.jArchCheckBox.getSelectedItemsVector();
id = new BuildOptionsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
return id;
}
/**
Data validation for all fields
@retval true - All datas are valid
@retval false - At least one data is invalid
**/
public boolean checkAdd() {
//
// Check Option
//
if (isEmpty(this.jTextFieldFileOption.getText())) {
Log.wrn("Update Build Options", "Option String must be entered!");
return false;
}
//
// Check TagName
//
if (!isEmpty(this.jTextFieldTagName.getText())) {
if (!DataValidation.isTagName(this.jTextFieldTagName.getText())) {
Log.wrn("Update Build Options", "Incorrect data type for Tag Name");
return false;
}
}
//
// Check ToolCode
//
if (!isEmpty(this.jTextFieldToolCode.getText())) {
if (!DataValidation.isToolCode(this.jTextFieldToolCode.getText())) {
Log.wrn("Update Build Options", "Incorrect data type for Tool Code");
return false;
}
}
//
// Check ToolChainFamily
//
if (!isEmpty(this.jTextFieldToolChainFamily.getText())) {
if (!DataValidation.isToolChainFamily(this.jTextFieldToolChainFamily.getText())) {
Log.wrn("Update Build Options", "Incorrect data type for Tool Chain Family");
return false;
}
}
return true;
}
public BuildOptionsIdentification getId() {
return id;
}
public void setId(BuildOptionsIdentification id) {
this.id = id;
}
}