return null;\r
}\r
\r
+ public PackageIdentification getIdByGuidVersion(String guid, String version) {\r
+ for (int index = 0; index < vOpeningPackageList.size(); index++) {\r
+ PackageIdentification id = vOpeningPackageList.elementAt(index).getId();\r
+ if (version != null) {\r
+ if (id.getGuid().equals(guid) && id.getVersion().equals(version)) {\r
+ return id;\r
+ }\r
+ } else {\r
+ if (id.getGuid().equals(guid)) {\r
+ return id;\r
+ }\r
+ }\r
+ }\r
+ return null;\r
+ }\r
+ \r
public void setNew(PackageIdentification id, boolean isNew) {\r
int index = findIndexOfListById(id);\r
if (index > -1) {\r
}\r
\r
private void showEdit(int index) {\r
- GuidsDlg dlg = new GuidsDlg(vid.getGuids(index), new IFrame());\r
+ GuidsDlg dlg = new GuidsDlg(vid.getGuids(index), new IFrame(), omt.getId());\r
int result = dlg.showDialog();\r
if (result == DataType.RETURN_TYPE_OK) {\r
if (index == -1) {\r
}\r
\r
private void showEdit(int index) {\r
- LibraryClassDefsDlg mcdd = new LibraryClassDefsDlg(vLibraryClass.getLibraryClass(index), new IFrame());\r
+ LibraryClassDefsDlg mcdd = new LibraryClassDefsDlg(vLibraryClass.getLibraryClass(index), new IFrame(), omt.getId());\r
int result = mcdd.showDialog();\r
if (result == DataType.RETURN_TYPE_OK) {\r
if (index == -1) {\r
}\r
\r
private void showEdit(int index) {\r
- PCDsDlg dlg = new PCDsDlg(vid.getPcdCoded(index), new IFrame());\r
+ PCDsDlg dlg = new PCDsDlg(vid.getPcdCoded(index), new IFrame(), omt.getId());\r
int result = dlg.showDialog();\r
if (result == DataType.RETURN_TYPE_OK) {\r
if (index == -1) {\r
}\r
\r
private void showEdit(int index) {\r
- PpisDlg dlg = new PpisDlg(vid.getPpis(index), new IFrame());\r
+ PpisDlg dlg = new PpisDlg(vid.getPpis(index), new IFrame(), omt.getId());\r
int result = dlg.showDialog();\r
if (result == DataType.RETURN_TYPE_OK) {\r
if (index == -1) {\r
}\r
\r
private void showEdit(int index) {\r
- ProtocolsDlg dlg = new ProtocolsDlg(vid.getProtocols(index), new IFrame());\r
+ ProtocolsDlg dlg = new ProtocolsDlg(vid.getProtocols(index), new IFrame(), omt.getId());\r
int result = dlg.showDialog();\r
if (result == DataType.RETURN_TYPE_OK) {\r
if (index == -1) {\r
import org.tianocore.frameworkwizard.common.ui.IDialog;\r
import org.tianocore.frameworkwizard.common.ui.IFrame;\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
\r
/**\r
* @param inGuidsId\r
* \r
*/\r
- private void init(GuidsIdentification inGuidsId) {\r
+ private void init(GuidsIdentification inGuidsId, ModuleIdentification mid) {\r
init();\r
this.id = inGuidsId;\r
+ \r
+ Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+ if (vpid.size() <= 0) {\r
+ Log.wrn("Init Guid", "This module hasn't defined any package dependency, so there is no guid can be added");\r
+ }\r
+\r
+ Tools.generateComboBoxByVector(this.jComboBoxCName,\r
+ wt.getAllGuidDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));\r
\r
if (this.id != null) {\r
this.jComboBoxCName.setSelectedItem(id.getName());\r
* @param iFrame\r
* \r
*/\r
- public GuidsDlg(GuidsIdentification inGuidsIdentification, IFrame iFrame) {\r
+ public GuidsDlg(GuidsIdentification inGuidsIdentification, IFrame iFrame, ModuleIdentification mid) {\r
super(iFrame, true);\r
- init(inGuidsIdentification);\r
+ init(inGuidsIdentification, mid);\r
}\r
\r
/**\r
* \r
*/\r
private void initFrame() {\r
- Tools.generateComboBoxByVector(jComboBoxCName, wt.getAllGuidDeclarationsFromWorkspace());\r
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVGuidUsage());\r
}\r
\r
//\r
// Check Name\r
//\r
+ if (this.jComboBoxCName.getSelectedItem() == null) {\r
+ Log.wrn("Update Guids", "Please select one Guid Name");\r
+ return false;\r
+ }\r
+\r
if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {\r
if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {\r
Log.wrn("Update Guids", "Incorrect data type for Guid Name");\r
import org.tianocore.frameworkwizard.common.ui.IFrame;\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
\r
/**\r
This is the default constructor\r
\r
**/\r
- public LibraryClassDefsDlg(LibraryClassIdentification inLibraryClassIdentification, IFrame iFrame) {\r
+ public LibraryClassDefsDlg(LibraryClassIdentification inLibraryClassIdentification, IFrame iFrame, ModuleIdentification mid) {\r
super(iFrame, true);\r
- init(inLibraryClassIdentification);\r
+ init(inLibraryClassIdentification, mid);\r
}\r
\r
/**\r
This method initializes this\r
\r
**/\r
- private void init(LibraryClassIdentification inLibraryClassIdentification) {\r
+ private void init(LibraryClassIdentification inLibraryClassIdentification, ModuleIdentification mid) {\r
init();\r
this.lcid = inLibraryClassIdentification;\r
+ \r
+ Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+ if (vpid.size() <= 0) {\r
+ Log.wrn("Init Library Class", "This module hasn't defined any package dependency, so there is no library class can be added");\r
+ }\r
+ \r
+ Tools.generateComboBoxByVector(this.jComboBoxLibraryClassName,\r
+ wt.getAllLibraryClassDefinitionsFromPackages(wt.getPackageDependenciesOfModule(mid)));\r
+\r
if (lcid != null) {\r
this.jComboBoxLibraryClassName.setSelectedItem(lcid.getLibraryClassName());\r
this.jComboBoxUsage.setSelectedItem(lcid.getUsage());\r
\r
**/\r
private void initFrame() {\r
- Tools.generateComboBoxByVector(jComboBoxLibraryClassName, wt.getAllLibraryClassDefinitionsFromWorkspace());\r
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVLibraryUsage());\r
this.iCheckBoxListModule.setAllItems(ed.getVFrameworkModuleTypes());\r
}\r
// Check LibraryClass\r
//\r
if (this.jComboBoxLibraryClassName.getSelectedItem() == null) {\r
- Log.wrn("Update Library Class Definitions", "No Library Class can be added");\r
+ Log.wrn("Update Library Class Definitions", "Please select one Library Class");\r
return false;\r
}\r
if (!DataValidation.isLibraryClass(this.jComboBoxLibraryClassName.getSelectedItem().toString())) {\r
import org.tianocore.frameworkwizard.common.ui.IDialog;\r
import org.tianocore.frameworkwizard.common.ui.IFrame;\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdVector;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
\r
/**\r
* @param inPcdCodedId\r
* \r
*/\r
- private void init(PcdCodedIdentification inPcdCodedId) {\r
+ private void init(PcdCodedIdentification inPcdCodedId, ModuleIdentification mid) {\r
init();\r
this.id = inPcdCodedId;\r
+ \r
+ Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+ if (vpid.size() <= 0) {\r
+ Log.wrn("Init Pcd", "This module hasn't defined any package dependency, so there is no pcd can be added");\r
+ }\r
+\r
+ pcd = wt.getAllPcdDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid));\r
+ for (int index = 0; index < pcd.size(); index++) {\r
+ jComboBoxCName.addItem(pcd.getPcd(index));\r
+ }\r
\r
if (this.id != null) {\r
for (int index = 0; index < this.jComboBoxCName.getItemCount(); index++) {\r
* @param iFrame\r
* \r
*/\r
- public PCDsDlg(PcdCodedIdentification inPcdCodedId, IFrame iFrame) {\r
+ public PCDsDlg(PcdCodedIdentification inPcdCodedId, IFrame iFrame, ModuleIdentification mid) {\r
super(iFrame, true);\r
- init(inPcdCodedId);\r
+ init(inPcdCodedId, mid);\r
}\r
\r
/**\r
* \r
*/\r
private void initFrame() {\r
- for (int index = 0; index < pcd.size(); index++) {\r
- jComboBoxCName.addItem(pcd.getPcd(index));\r
- }\r
-\r
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPcdUsage());\r
}\r
\r
//\r
// Check C_Name\r
//\r
+ if (this.jComboBoxCName.getSelectedItem() == null) {\r
+ Log.wrn("Update Pcd", "Please select one Pcd Name");\r
+ return false;\r
+ }\r
+\r
if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {\r
if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {\r
Log.wrn("Update PcdCoded", "Incorrect data type for C Name");\r
import org.tianocore.frameworkwizard.common.ui.IDialog;\r
import org.tianocore.frameworkwizard.common.ui.IFrame;\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
\r
/**\r
return jButtonCancel;\r
}\r
\r
- public static void main(String[] args) {\r
-\r
- }\r
-\r
/**\r
* This method initializes this\r
* \r
}\r
\r
/**\r
- * This method initializes this Fill values to all fields if these values are\r
- * not empty\r
- * \r
- * @param inProtocolsId\r
- * \r
- */\r
- private void init(PpisIdentification inPpisId) {\r
+ This method initializes this Fill values to all fields if these values are\r
+ not empty\r
+ \r
+ @param inPpisId\r
+ @param mid\r
+ \r
+ **/\r
+ private void init(PpisIdentification inPpisId, ModuleIdentification mid) {\r
init();\r
this.id = inPpisId;\r
\r
+ Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+ if (vpid.size() <= 0) {\r
+ Log.wrn("Init Ppi", "This module hasn't defined any package dependency, so there is no ppi can be added");\r
+ }\r
+\r
+ Tools.generateComboBoxByVector(this.jComboBoxCName,\r
+ wt.getAllPpiDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));\r
+\r
if (this.id != null) {\r
this.jComboBoxCName.setSelectedItem(id.getName());\r
this.jComboBoxPpiType.setSelectedItem(id.getType());\r
* @param iFrame\r
* \r
*/\r
- public PpisDlg(PpisIdentification inPpisIdentification, IFrame iFrame) {\r
+ public PpisDlg(PpisIdentification inPpisIdentification, IFrame iFrame, ModuleIdentification mid) {\r
super(iFrame, true);\r
- init(inPpisIdentification);\r
+ init(inPpisIdentification, mid);\r
}\r
\r
/**\r
* \r
*/\r
private void initFrame() {\r
- Tools.generateComboBoxByVector(jComboBoxCName, wt.getAllPpiDeclarationsFromWorkspace());\r
Tools.generateComboBoxByVector(jComboBoxPpiType, ed.getVPpiType());\r
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage());\r
}\r
//\r
// Check Name\r
//\r
+ if (this.jComboBoxCName.getSelectedItem() == null) {\r
+ Log.wrn("Update Ppis", "Please select one Ppi/PpiNotify Name");\r
+ return false;\r
+ }\r
+\r
if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {\r
if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {\r
Log.wrn("Update Ppis", "Incorrect data type for Ppi/PpiNotify Name");\r
import org.tianocore.frameworkwizard.common.ui.IDialog;\r
import org.tianocore.frameworkwizard.common.ui.IFrame;\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
\r
/**\r
* @param inProtocolsId\r
* \r
*/\r
- private void init(ProtocolsIdentification inProtocolsId) {\r
+ private void init(ProtocolsIdentification inProtocolsId, ModuleIdentification mid) {\r
init();\r
this.id = inProtocolsId;\r
+ \r
+ Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+ if (vpid.size() <= 0) {\r
+ Log.wrn("Init Protocol", "This module hasn't defined any package dependency, so there is no protocol can be added");\r
+ }\r
+\r
+ Tools.generateComboBoxByVector(this.jComboBoxCName,\r
+ wt.getAllProtocolDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));\r
\r
if (this.id != null) {\r
this.jComboBoxCName.setSelectedItem(id.getName());\r
* @param iFrame\r
* \r
*/\r
- public ProtocolsDlg(ProtocolsIdentification inProtocolsIdentification, IFrame iFrame) {\r
+ public ProtocolsDlg(ProtocolsIdentification inProtocolsIdentification, IFrame iFrame, ModuleIdentification mid) {\r
super(iFrame, true);\r
- init(inProtocolsIdentification);\r
+ init(inProtocolsIdentification, mid);\r
}\r
\r
/**\r
*/\r
private void initFrame() {\r
Tools.generateComboBoxByVector(jComboBoxProtocolType, ed.getVProtocolType());\r
- Tools.generateComboBoxByVector(jComboBoxCName, wt.getAllProtocolDeclarationsFromWorkspace());\r
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVProtocolUsage());\r
}\r
\r
//\r
// Check Name\r
//\r
+ if (this.jComboBoxCName.getSelectedItem() == null) {\r
+ Log.wrn("Update protocols", "Please select one Protocol/ProtocolNotify Name");\r
+ return false;\r
+ }\r
+\r
if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {\r
if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {\r
Log.wrn("Update Protocols", "Incorrect data type for Protocol/ProtocolNotify Name");\r
import org.tianocore.IndustryStdIncludesDocument.IndustryStdIncludes;\r
import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;\r
import org.tianocore.MsaFilesDocument.MsaFiles;\r
+import org.tianocore.PackageDependenciesDocument.PackageDependencies;\r
import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;\r
import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;\r
import org.tianocore.SourceFilesDocument.SourceFiles;\r
}\r
}\r
if (!isFind) {\r
- v.addElement(id); \r
+ v.addElement(id);\r
}\r
}\r
}\r
Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
return vector;\r
}\r
+ \r
+ public Vector<String> getAllLibraryClassDefinitionsFromPackages(Vector<PackageIdentification> vpid) {\r
+ Vector<String> vector = new Vector<String>();\r
+ for (int index = 0; index < vpid.size(); index++) {\r
+ Vector<String> v = getAllLibraryClassDefinitionsFromPackage(GlobalData.openingPackageList\r
+ .getPackageSurfaceAreaFromId(vpid.get(index)));\r
+ if (v != null && v.size() > 0) {\r
+ vector.addAll(v);\r
+ }\r
+\r
+ }\r
+ Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+ return vector;\r
+ }\r
\r
public Vector<String> getAllProtocolDeclarationsFromWorkspace() {\r
Vector<String> vector = new Vector<String>();\r
return vector;\r
}\r
\r
+ public Vector<String> getAllProtocolDeclarationsFromPackages(Vector<PackageIdentification> vpid) {\r
+ Vector<String> vector = new Vector<String>();\r
+ for (int index = 0; index < vpid.size(); index++) {\r
+ Vector<String> v = getAllProtocolDeclarationsFromPackage(GlobalData.openingPackageList\r
+ .getPackageSurfaceAreaFromId(vpid\r
+ .get(index)));\r
+ if (v != null && v.size() > 0) {\r
+ vector.addAll(v);\r
+ }\r
+ }\r
+ Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+ return vector;\r
+ }\r
+\r
public Vector<String> getAllPpiDeclarationsFromWorkspace() {\r
Vector<String> vector = new Vector<String>();\r
for (int index = 0; index < GlobalData.vPackageList.size(); index++) {\r
return vector;\r
}\r
\r
+ public Vector<String> getAllPpiDeclarationsFromPackages(Vector<PackageIdentification> vpid) {\r
+ Vector<String> vector = new Vector<String>();\r
+ for (int index = 0; index < vpid.size(); index++) {\r
+ Vector<String> v = getAllPpiDeclarationsFromPackage(GlobalData.openingPackageList\r
+ .getPackageSurfaceAreaFromId(vpid\r
+ .get(index)));\r
+ if (v != null && v.size() > 0) {\r
+ vector.addAll(v);\r
+ }\r
+ }\r
+ Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+ return vector;\r
+ }\r
+\r
public Vector<String> getAllGuidDeclarationsFromWorkspace() {\r
Vector<String> vector = new Vector<String>();\r
for (int index = 0; index < GlobalData.vPackageList.size(); index++) {\r
return vector;\r
}\r
\r
+ public Vector<String> getAllGuidDeclarationsFromPackages(Vector<PackageIdentification> vpid) {\r
+ Vector<String> vector = new Vector<String>();\r
+ for (int index = 0; index < vpid.size(); index++) {\r
+ Vector<String> v = getAllGuidDeclarationsFromPackage(GlobalData.openingPackageList\r
+ .getPackageSurfaceAreaFromId(vpid\r
+ .get(index)));\r
+ if (v != null && v.size() > 0) {\r
+ vector.addAll(v);\r
+ }\r
+\r
+ }\r
+ Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);\r
+ return vector;\r
+ }\r
+\r
public PcdVector getAllPcdDeclarationsFromWorkspace() {\r
PcdVector vector = new PcdVector();\r
for (int index = 0; index < GlobalData.openingPackageList.size(); index++) {\r
return vector;\r
}\r
\r
+ public PcdVector getAllPcdDeclarationsFromPackages(Vector<PackageIdentification> vpid) {\r
+ PcdVector vector = new PcdVector();\r
+ for (int index = 0; index < vpid.size(); index++) {\r
+ PcdVector v = getAllPcdDeclarationsFromPackage(GlobalData.openingPackageList\r
+ .getPackageSurfaceAreaFromId(vpid\r
+ .get(index)));\r
+ if (v != null && v.size() > 0) {\r
+ vector.addAll(v);\r
+ }\r
+\r
+ }\r
+ Sort.sortPcds(vector, DataType.SORT_TYPE_ASCENDING);\r
+ return vector;\r
+ }\r
+\r
/**\r
Find a module's package's id\r
\r
\r
return v;\r
}\r
+\r
+ /**\r
+ Get a module's all package dependencies\r
+ \r
+ @param mid The module id\r
+ @return A vector of all package dependency ids\r
+ \r
+ **/\r
+ public Vector<PackageIdentification> getPackageDependenciesOfModule(ModuleIdentification mid) {\r
+ Vector<PackageIdentification> vpid = new Vector<PackageIdentification>();\r
+ ModuleSurfaceArea msa = GlobalData.openingModuleList.getModuleSurfaceAreaFromId(mid);\r
+ if (msa != null) {\r
+ PackageDependencies pd = msa.getPackageDependencies();\r
+ if (pd != null) {\r
+ for (int index = 0; index < pd.getPackageList().size(); index++) {\r
+ String guid = pd.getPackageList().get(index).getPackageGuid();\r
+ String version = pd.getPackageList().get(index).getPackageVersion();\r
+ PackageIdentification pid = GlobalData.openingPackageList.getIdByGuidVersion(guid, version);\r
+ if (pid != null) {\r
+ vpid.addElement(pid);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return vpid;\r
+ }\r
}\r