1. Fix EDKT323 (Only dependent packages' ppis can be added to module's ppi section)

2. Fix EDKT324 (Only dependent packages' protocols can be added to module's protocol section.)
3. Fix EDKT325 (Only dependent packages' pcds can be added to module's pcd section.)
4. Fix EDKT326 (Only dependent packages' guids can be added to module's guid section.)
5. Fix EDKT327 (Only dependent packages' library can be added to module's library section.)

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1599 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
hche10x 2006-09-22 08:48:00 +00:00
parent c493be6c9d
commit c25ad66ccb
12 changed files with 217 additions and 40 deletions

View File

@ -171,6 +171,22 @@ public class OpeningPackageList {
return null; return null;
} }
public PackageIdentification getIdByGuidVersion(String guid, String version) {
for (int index = 0; index < vOpeningPackageList.size(); index++) {
PackageIdentification id = vOpeningPackageList.elementAt(index).getId();
if (version != null) {
if (id.getGuid().equals(guid) && id.getVersion().equals(version)) {
return id;
}
} else {
if (id.getGuid().equals(guid)) {
return id;
}
}
}
return null;
}
public void setNew(PackageIdentification id, boolean isNew) { public void setNew(PackageIdentification id, boolean isNew) {
int index = findIndexOfListById(id); int index = findIndexOfListById(id);
if (index > -1) { if (index > -1) {

View File

@ -283,7 +283,7 @@ public class ModuleGuids extends IInternalFrame {
} }
private void showEdit(int index) { private void showEdit(int index) {
GuidsDlg dlg = new GuidsDlg(vid.getGuids(index), new IFrame()); GuidsDlg dlg = new GuidsDlg(vid.getGuids(index), new IFrame(), omt.getId());
int result = dlg.showDialog(); int result = dlg.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -340,7 +340,7 @@ public class ModuleLibraryClassDefinitions extends IInternalFrame {
} }
private void showEdit(int index) { private void showEdit(int index) {
LibraryClassDefsDlg mcdd = new LibraryClassDefsDlg(vLibraryClass.getLibraryClass(index), new IFrame()); LibraryClassDefsDlg mcdd = new LibraryClassDefsDlg(vLibraryClass.getLibraryClass(index), new IFrame(), omt.getId());
int result = mcdd.showDialog(); int result = mcdd.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -293,7 +293,7 @@ public class ModulePCDs extends IInternalFrame {
} }
private void showEdit(int index) { private void showEdit(int index) {
PCDsDlg dlg = new PCDsDlg(vid.getPcdCoded(index), new IFrame()); PCDsDlg dlg = new PCDsDlg(vid.getPcdCoded(index), new IFrame(), omt.getId());
int result = dlg.showDialog(); int result = dlg.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -308,7 +308,7 @@ public class ModulePpis extends IInternalFrame {
} }
private void showEdit(int index) { private void showEdit(int index) {
PpisDlg dlg = new PpisDlg(vid.getPpis(index), new IFrame()); PpisDlg dlg = new PpisDlg(vid.getPpis(index), new IFrame(), omt.getId());
int result = dlg.showDialog(); int result = dlg.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -309,7 +309,7 @@ public class ModuleProtocols extends IInternalFrame {
} }
private void showEdit(int index) { private void showEdit(int index) {
ProtocolsDlg dlg = new ProtocolsDlg(vid.getProtocols(index), new IFrame()); ProtocolsDlg dlg = new ProtocolsDlg(vid.getProtocols(index), new IFrame(), omt.getId());
int result = dlg.showDialog(); int result = dlg.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -33,7 +33,9 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsIdentification; import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsIdentification;
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
@ -255,10 +257,18 @@ public class GuidsDlg extends IDialog {
* @param inGuidsId * @param inGuidsId
* *
*/ */
private void init(GuidsIdentification inGuidsId) { private void init(GuidsIdentification inGuidsId, ModuleIdentification mid) {
init(); init();
this.id = inGuidsId; this.id = inGuidsId;
Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
if (vpid.size() <= 0) {
Log.wrn("Init Guid", "This module hasn't defined any package dependency, so there is no guid can be added");
}
Tools.generateComboBoxByVector(this.jComboBoxCName,
wt.getAllGuidDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));
if (this.id != null) { if (this.id != null) {
this.jComboBoxCName.setSelectedItem(id.getName()); this.jComboBoxCName.setSelectedItem(id.getName());
this.jComboBoxUsage.setSelectedItem(id.getUsage()); this.jComboBoxUsage.setSelectedItem(id.getUsage());
@ -275,9 +285,9 @@ public class GuidsDlg extends IDialog {
* @param iFrame * @param iFrame
* *
*/ */
public GuidsDlg(GuidsIdentification inGuidsIdentification, IFrame iFrame) { public GuidsDlg(GuidsIdentification inGuidsIdentification, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inGuidsIdentification); init(inGuidsIdentification, mid);
} }
/** /**
@ -356,7 +366,6 @@ public class GuidsDlg extends IDialog {
* *
*/ */
private void initFrame() { private void initFrame() {
Tools.generateComboBoxByVector(jComboBoxCName, wt.getAllGuidDeclarationsFromWorkspace());
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVGuidUsage()); Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVGuidUsage());
} }
@ -398,6 +407,11 @@ public class GuidsDlg extends IDialog {
// //
// Check Name // Check Name
// //
if (this.jComboBoxCName.getSelectedItem() == null) {
Log.wrn("Update Guids", "Please select one Guid Name");
return false;
}
if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) { if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {
if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) { if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {
Log.wrn("Update Guids", "Incorrect data type for Guid Name"); Log.wrn("Update Guids", "Incorrect data type for Guid Name");

View File

@ -35,7 +35,9 @@ import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList; import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification; import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification;
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
@ -302,9 +304,9 @@ public class LibraryClassDefsDlg extends IDialog {
This is the default constructor This is the default constructor
**/ **/
public LibraryClassDefsDlg(LibraryClassIdentification inLibraryClassIdentification, IFrame iFrame) { public LibraryClassDefsDlg(LibraryClassIdentification inLibraryClassIdentification, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inLibraryClassIdentification); init(inLibraryClassIdentification, mid);
} }
/** /**
@ -324,9 +326,18 @@ public class LibraryClassDefsDlg extends IDialog {
This method initializes this This method initializes this
**/ **/
private void init(LibraryClassIdentification inLibraryClassIdentification) { private void init(LibraryClassIdentification inLibraryClassIdentification, ModuleIdentification mid) {
init(); init();
this.lcid = inLibraryClassIdentification; this.lcid = inLibraryClassIdentification;
Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
if (vpid.size() <= 0) {
Log.wrn("Init Library Class", "This module hasn't defined any package dependency, so there is no library class can be added");
}
Tools.generateComboBoxByVector(this.jComboBoxLibraryClassName,
wt.getAllLibraryClassDefinitionsFromPackages(wt.getPackageDependenciesOfModule(mid)));
if (lcid != null) { if (lcid != null) {
this.jComboBoxLibraryClassName.setSelectedItem(lcid.getLibraryClassName()); this.jComboBoxLibraryClassName.setSelectedItem(lcid.getLibraryClassName());
this.jComboBoxUsage.setSelectedItem(lcid.getUsage()); this.jComboBoxUsage.setSelectedItem(lcid.getUsage());
@ -430,7 +441,6 @@ public class LibraryClassDefsDlg extends IDialog {
**/ **/
private void initFrame() { private void initFrame() {
Tools.generateComboBoxByVector(jComboBoxLibraryClassName, wt.getAllLibraryClassDefinitionsFromWorkspace());
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVLibraryUsage()); Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVLibraryUsage());
this.iCheckBoxListModule.setAllItems(ed.getVFrameworkModuleTypes()); this.iCheckBoxListModule.setAllItems(ed.getVFrameworkModuleTypes());
} }
@ -472,7 +482,7 @@ public class LibraryClassDefsDlg extends IDialog {
// Check LibraryClass // Check LibraryClass
// //
if (this.jComboBoxLibraryClassName.getSelectedItem() == null) { if (this.jComboBoxLibraryClassName.getSelectedItem() == null) {
Log.wrn("Update Library Class Definitions", "No Library Class can be added"); Log.wrn("Update Library Class Definitions", "Please select one Library Class");
return false; return false;
} }
if (!DataValidation.isLibraryClass(this.jComboBoxLibraryClassName.getSelectedItem().toString())) { if (!DataValidation.isLibraryClass(this.jComboBoxLibraryClassName.getSelectedItem().toString())) {

View File

@ -36,8 +36,10 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedIdentification; import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedIdentification;
import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdVector; import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdVector;
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
@ -307,10 +309,20 @@ public class PCDsDlg extends IDialog implements ItemListener {
* @param inPcdCodedId * @param inPcdCodedId
* *
*/ */
private void init(PcdCodedIdentification inPcdCodedId) { private void init(PcdCodedIdentification inPcdCodedId, ModuleIdentification mid) {
init(); init();
this.id = inPcdCodedId; this.id = inPcdCodedId;
Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
if (vpid.size() <= 0) {
Log.wrn("Init Pcd", "This module hasn't defined any package dependency, so there is no pcd can be added");
}
pcd = wt.getAllPcdDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid));
for (int index = 0; index < pcd.size(); index++) {
jComboBoxCName.addItem(pcd.getPcd(index));
}
if (this.id != null) { if (this.id != null) {
for (int index = 0; index < this.jComboBoxCName.getItemCount(); index++) { for (int index = 0; index < this.jComboBoxCName.getItemCount(); index++) {
if (this.jComboBoxCName.getItemAt(index).toString().equals(id.getName())) { if (this.jComboBoxCName.getItemAt(index).toString().equals(id.getName())) {
@ -335,9 +347,9 @@ public class PCDsDlg extends IDialog implements ItemListener {
* @param iFrame * @param iFrame
* *
*/ */
public PCDsDlg(PcdCodedIdentification inPcdCodedId, IFrame iFrame) { public PCDsDlg(PcdCodedIdentification inPcdCodedId, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inPcdCodedId); init(inPcdCodedId, mid);
} }
/** /**
@ -441,10 +453,6 @@ public class PCDsDlg extends IDialog implements ItemListener {
* *
*/ */
private void initFrame() { private void initFrame() {
for (int index = 0; index < pcd.size(); index++) {
jComboBoxCName.addItem(pcd.getPcd(index));
}
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPcdUsage()); Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPcdUsage());
} }
@ -486,6 +494,11 @@ public class PCDsDlg extends IDialog implements ItemListener {
// //
// Check C_Name // Check C_Name
// //
if (this.jComboBoxCName.getSelectedItem() == null) {
Log.wrn("Update Pcd", "Please select one Pcd Name");
return false;
}
if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) { if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {
if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) { if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {
Log.wrn("Update PcdCoded", "Incorrect data type for C Name"); Log.wrn("Update PcdCoded", "Incorrect data type for C Name");

View File

@ -36,7 +36,9 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisIdentification; import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisIdentification;
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
@ -249,10 +251,6 @@ public class PpisDlg extends IDialog implements ItemListener {
return jButtonCancel; return jButtonCancel;
} }
public static void main(String[] args) {
}
/** /**
* This method initializes this * This method initializes this
* *
@ -266,16 +264,25 @@ public class PpisDlg extends IDialog implements ItemListener {
} }
/** /**
* This method initializes this Fill values to all fields if these values are This method initializes this Fill values to all fields if these values are
* not empty not empty
*
* @param inProtocolsId @param inPpisId
* @param mid
*/
private void init(PpisIdentification inPpisId) { **/
private void init(PpisIdentification inPpisId, ModuleIdentification mid) {
init(); init();
this.id = inPpisId; this.id = inPpisId;
Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
if (vpid.size() <= 0) {
Log.wrn("Init Ppi", "This module hasn't defined any package dependency, so there is no ppi can be added");
}
Tools.generateComboBoxByVector(this.jComboBoxCName,
wt.getAllPpiDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));
if (this.id != null) { if (this.id != null) {
this.jComboBoxCName.setSelectedItem(id.getName()); this.jComboBoxCName.setSelectedItem(id.getName());
this.jComboBoxPpiType.setSelectedItem(id.getType()); this.jComboBoxPpiType.setSelectedItem(id.getType());
@ -293,9 +300,9 @@ public class PpisDlg extends IDialog implements ItemListener {
* @param iFrame * @param iFrame
* *
*/ */
public PpisDlg(PpisIdentification inPpisIdentification, IFrame iFrame) { public PpisDlg(PpisIdentification inPpisIdentification, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inPpisIdentification); init(inPpisIdentification, mid);
} }
/** /**
@ -370,7 +377,6 @@ public class PpisDlg extends IDialog implements ItemListener {
* *
*/ */
private void initFrame() { private void initFrame() {
Tools.generateComboBoxByVector(jComboBoxCName, wt.getAllPpiDeclarationsFromWorkspace());
Tools.generateComboBoxByVector(jComboBoxPpiType, ed.getVPpiType()); Tools.generateComboBoxByVector(jComboBoxPpiType, ed.getVPpiType());
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage()); Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage());
} }
@ -413,6 +419,11 @@ public class PpisDlg extends IDialog implements ItemListener {
// //
// Check Name // Check Name
// //
if (this.jComboBoxCName.getSelectedItem() == null) {
Log.wrn("Update Ppis", "Please select one Ppi/PpiNotify Name");
return false;
}
if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) { if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {
if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) { if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {
Log.wrn("Update Ppis", "Incorrect data type for Ppi/PpiNotify Name"); Log.wrn("Update Ppis", "Incorrect data type for Ppi/PpiNotify Name");

View File

@ -37,7 +37,9 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsIdentification; import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsIdentification;
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
@ -284,10 +286,18 @@ public class ProtocolsDlg extends IDialog implements ItemListener {
* @param inProtocolsId * @param inProtocolsId
* *
*/ */
private void init(ProtocolsIdentification inProtocolsId) { private void init(ProtocolsIdentification inProtocolsId, ModuleIdentification mid) {
init(); init();
this.id = inProtocolsId; this.id = inProtocolsId;
Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
if (vpid.size() <= 0) {
Log.wrn("Init Protocol", "This module hasn't defined any package dependency, so there is no protocol can be added");
}
Tools.generateComboBoxByVector(this.jComboBoxCName,
wt.getAllProtocolDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));
if (this.id != null) { if (this.id != null) {
this.jComboBoxCName.setSelectedItem(id.getName()); this.jComboBoxCName.setSelectedItem(id.getName());
this.jComboBoxProtocolType.setSelectedItem(id.getType()); this.jComboBoxProtocolType.setSelectedItem(id.getType());
@ -305,9 +315,9 @@ public class ProtocolsDlg extends IDialog implements ItemListener {
* @param iFrame * @param iFrame
* *
*/ */
public ProtocolsDlg(ProtocolsIdentification inProtocolsIdentification, IFrame iFrame) { public ProtocolsDlg(ProtocolsIdentification inProtocolsIdentification, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inProtocolsIdentification); init(inProtocolsIdentification, mid);
} }
/** /**
@ -397,7 +407,6 @@ public class ProtocolsDlg extends IDialog implements ItemListener {
*/ */
private void initFrame() { private void initFrame() {
Tools.generateComboBoxByVector(jComboBoxProtocolType, ed.getVProtocolType()); Tools.generateComboBoxByVector(jComboBoxProtocolType, ed.getVProtocolType());
Tools.generateComboBoxByVector(jComboBoxCName, wt.getAllProtocolDeclarationsFromWorkspace());
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVProtocolUsage()); Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVProtocolUsage());
} }
@ -439,6 +448,11 @@ public class ProtocolsDlg extends IDialog implements ItemListener {
// //
// Check Name // Check Name
// //
if (this.jComboBoxCName.getSelectedItem() == null) {
Log.wrn("Update protocols", "Please select one Protocol/ProtocolNotify Name");
return false;
}
if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) { if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {
if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) { if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {
Log.wrn("Update Protocols", "Incorrect data type for Protocol/ProtocolNotify Name"); Log.wrn("Update Protocols", "Incorrect data type for Protocol/ProtocolNotify Name");

View File

@ -25,6 +25,7 @@ import org.tianocore.DbPathAndFilename;
import org.tianocore.IndustryStdIncludesDocument.IndustryStdIncludes; import org.tianocore.IndustryStdIncludesDocument.IndustryStdIncludes;
import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea; import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
import org.tianocore.MsaFilesDocument.MsaFiles; import org.tianocore.MsaFilesDocument.MsaFiles;
import org.tianocore.PackageDependenciesDocument.PackageDependencies;
import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea; import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea; import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;
import org.tianocore.SourceFilesDocument.SourceFiles; import org.tianocore.SourceFilesDocument.SourceFiles;
@ -467,6 +468,20 @@ public class WorkspaceTools {
return vector; return vector;
} }
public Vector<String> getAllLibraryClassDefinitionsFromPackages(Vector<PackageIdentification> vpid) {
Vector<String> vector = new Vector<String>();
for (int index = 0; index < vpid.size(); index++) {
Vector<String> v = getAllLibraryClassDefinitionsFromPackage(GlobalData.openingPackageList
.getPackageSurfaceAreaFromId(vpid.get(index)));
if (v != null && v.size() > 0) {
vector.addAll(v);
}
}
Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
return vector;
}
public Vector<String> getAllProtocolDeclarationsFromWorkspace() { public Vector<String> getAllProtocolDeclarationsFromWorkspace() {
Vector<String> vector = new Vector<String>(); Vector<String> vector = new Vector<String>();
for (int index = 0; index < GlobalData.vPackageList.size(); index++) { for (int index = 0; index < GlobalData.vPackageList.size(); index++) {
@ -481,6 +496,20 @@ public class WorkspaceTools {
return vector; return vector;
} }
public Vector<String> getAllProtocolDeclarationsFromPackages(Vector<PackageIdentification> vpid) {
Vector<String> vector = new Vector<String>();
for (int index = 0; index < vpid.size(); index++) {
Vector<String> v = getAllProtocolDeclarationsFromPackage(GlobalData.openingPackageList
.getPackageSurfaceAreaFromId(vpid
.get(index)));
if (v != null && v.size() > 0) {
vector.addAll(v);
}
}
Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
return vector;
}
public Vector<String> getAllPpiDeclarationsFromWorkspace() { public Vector<String> getAllPpiDeclarationsFromWorkspace() {
Vector<String> vector = new Vector<String>(); Vector<String> vector = new Vector<String>();
for (int index = 0; index < GlobalData.vPackageList.size(); index++) { for (int index = 0; index < GlobalData.vPackageList.size(); index++) {
@ -495,6 +524,20 @@ public class WorkspaceTools {
return vector; return vector;
} }
public Vector<String> getAllPpiDeclarationsFromPackages(Vector<PackageIdentification> vpid) {
Vector<String> vector = new Vector<String>();
for (int index = 0; index < vpid.size(); index++) {
Vector<String> v = getAllPpiDeclarationsFromPackage(GlobalData.openingPackageList
.getPackageSurfaceAreaFromId(vpid
.get(index)));
if (v != null && v.size() > 0) {
vector.addAll(v);
}
}
Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
return vector;
}
public Vector<String> getAllGuidDeclarationsFromWorkspace() { public Vector<String> getAllGuidDeclarationsFromWorkspace() {
Vector<String> vector = new Vector<String>(); Vector<String> vector = new Vector<String>();
for (int index = 0; index < GlobalData.vPackageList.size(); index++) { for (int index = 0; index < GlobalData.vPackageList.size(); index++) {
@ -510,6 +553,21 @@ public class WorkspaceTools {
return vector; return vector;
} }
public Vector<String> getAllGuidDeclarationsFromPackages(Vector<PackageIdentification> vpid) {
Vector<String> vector = new Vector<String>();
for (int index = 0; index < vpid.size(); index++) {
Vector<String> v = getAllGuidDeclarationsFromPackage(GlobalData.openingPackageList
.getPackageSurfaceAreaFromId(vpid
.get(index)));
if (v != null && v.size() > 0) {
vector.addAll(v);
}
}
Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
return vector;
}
public PcdVector getAllPcdDeclarationsFromWorkspace() { public PcdVector getAllPcdDeclarationsFromWorkspace() {
PcdVector vector = new PcdVector(); PcdVector vector = new PcdVector();
for (int index = 0; index < GlobalData.openingPackageList.size(); index++) { for (int index = 0; index < GlobalData.openingPackageList.size(); index++) {
@ -525,6 +583,21 @@ public class WorkspaceTools {
return vector; return vector;
} }
public PcdVector getAllPcdDeclarationsFromPackages(Vector<PackageIdentification> vpid) {
PcdVector vector = new PcdVector();
for (int index = 0; index < vpid.size(); index++) {
PcdVector v = getAllPcdDeclarationsFromPackage(GlobalData.openingPackageList
.getPackageSurfaceAreaFromId(vpid
.get(index)));
if (v != null && v.size() > 0) {
vector.addAll(v);
}
}
Sort.sortPcds(vector, DataType.SORT_TYPE_ASCENDING);
return vector;
}
/** /**
Find a module's package's id Find a module's package's id
@ -705,4 +778,30 @@ public class WorkspaceTools {
return v; return v;
} }
/**
Get a module's all package dependencies
@param mid The module id
@return A vector of all package dependency ids
**/
public Vector<PackageIdentification> getPackageDependenciesOfModule(ModuleIdentification mid) {
Vector<PackageIdentification> vpid = new Vector<PackageIdentification>();
ModuleSurfaceArea msa = GlobalData.openingModuleList.getModuleSurfaceAreaFromId(mid);
if (msa != null) {
PackageDependencies pd = msa.getPackageDependencies();
if (pd != null) {
for (int index = 0; index < pd.getPackageList().size(); index++) {
String guid = pd.getPackageList().get(index).getPackageGuid();
String version = pd.getPackageList().get(index).getPackageVersion();
PackageIdentification pid = GlobalData.openingPackageList.getIdByGuidVersion(guid, version);
if (pid != null) {
vpid.addElement(pid);
}
}
}
}
return vpid;
}
} }