summaryrefslogtreecommitdiff
path: root/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find
diff options
context:
space:
mode:
authorlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>2006-10-05 23:12:07 +0000
committerlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>2006-10-05 23:12:07 +0000
commitfeccee87a78e68d575dbdf44b34ca0cb5a21ea8d (patch)
treec70bdaea30cf92a8555e1013fc15565138203134 /Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find
parent214b0d1914b48d651b25e58f321ddb77a46903b8 (diff)
downloadedk2-platforms-feccee87a78e68d575dbdf44b34ca0cb5a21ea8d.tar.xz
Restructuring for better separation of Tool packages.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1674 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find')
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/Find.java877
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResult.java478
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/GuidId.java76
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/LibraryClassId.java76
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdId.java76
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PpiId.java76
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/ProtocolId.java76
7 files changed, 1735 insertions, 0 deletions
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/Find.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/Find.java
new file mode 100644
index 0000000000..b833ba68e8
--- /dev/null
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/Find.java
@@ -0,0 +1,877 @@
+/** @file
+
+ The file is used to provide Find funtions in workspace
+
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ **/
+package org.tianocore.frameworkwizard.common.find;
+
+import java.util.Vector;
+
+import org.tianocore.LibraryClassDefinitionsDocument.LibraryClassDefinitions;
+import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
+import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
+import org.tianocore.frameworkwizard.common.DataType;
+import org.tianocore.frameworkwizard.common.GlobalData;
+import org.tianocore.frameworkwizard.common.Sort;
+import org.tianocore.frameworkwizard.common.Tools;
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
+import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsIdentification;
+import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsVector;
+import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification;
+import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassVector;
+import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedIdentification;
+import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedVector;
+import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisIdentification;
+import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisVector;
+import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsIdentification;
+import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsVector;
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;
+
+public class Find {
+
+ private final static String SEPERATOR = ".";
+
+ /**
+ Get all ppi entries from workspace
+
+ @return
+
+ **/
+ public static PpisVector getAllPpisVector() {
+ PpisVector pv = new PpisVector();
+ ModuleSurfaceArea msa = null;
+ ModuleIdentification mid = null;
+ PpisIdentification pid = null;
+
+ //
+ // Go through each module one by one
+ //
+ if (GlobalData.openingModuleList.size() > 0) {
+ for (int indexOfModule = 0; indexOfModule < GlobalData.openingModuleList.size(); indexOfModule++) {
+ msa = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getXmlMsa();
+ mid = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getId();
+
+ if (msa.getPPIs() != null) {
+ if (msa.getPPIs().getPpiList().size() > 0) {
+ for (int index = 0; index < msa.getPPIs().getPpiList().size(); index++) {
+ String arg0 = msa.getPPIs().getPpiList().get(index).getPpiCName();
+ String arg1 = DataType.PPI_TYPE_PPI;
+ String arg2 = null;
+ if (msa.getPPIs().getPpiList().get(index).getUsage() != null) {
+ arg2 = msa.getPPIs().getPpiList().get(index).getUsage().toString();
+ }
+
+ String arg3 = msa.getPPIs().getPpiList().get(index).getFeatureFlag();
+ Vector<String> arg4 = Tools.convertListToVector(msa.getPPIs().getPpiList().get(index)
+ .getSupArchList());
+ String arg5 = msa.getPPIs().getPpiList().get(index).getHelpText();
+
+ pid = new PpisIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
+ pid.setBelongModule(mid);
+
+ //
+ // Find which package declares it
+ //
+ for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
+ PackageSurfaceArea spd = GlobalData.openingPackageList
+ .getOpeningPackageByIndex(
+ indexOfPackage)
+ .getXmlSpd();
+ PackageIdentification packageId = GlobalData.openingPackageList
+ .getOpeningPackageByIndex(
+ indexOfPackage)
+ .getId();
+ if (spd.getPpiDeclarations() != null) {
+ for (int indexOfPpis = 0; indexOfPpis < spd.getPpiDeclarations().getEntryList()
+ .size(); indexOfPpis++) {
+ if (spd.getPpiDeclarations().getEntryList().get(indexOfPpis).getCName()
+ .equals(arg0)) {
+ pid.setDeclaredBy(packageId);
+ break;
+ }
+ }
+ }
+ }
+ if (pid.getDeclaredBy() == null) {
+ pid.setDeclaredBy(new PackageIdentification("", "", "", ""));
+ }
+
+ pv.addPpis(pid);
+ }
+ }
+ if (msa.getPPIs().getPpiNotifyList().size() > 0) {
+ for (int index = 0; index < msa.getPPIs().getPpiNotifyList().size(); index++) {
+ String arg0 = msa.getPPIs().getPpiNotifyList().get(index).getPpiNotifyCName();
+ String arg1 = DataType.PPI_TYPE_PPI_NOTIFY;
+ String arg2 = null;
+ if (msa.getPPIs().getPpiNotifyList().get(index).getUsage() != null) {
+ arg2 = msa.getPPIs().getPpiNotifyList().get(index).getUsage().toString();
+ }
+
+ String arg3 = msa.getPPIs().getPpiNotifyList().get(index).getFeatureFlag();
+ Vector<String> arg4 = Tools.convertListToVector(msa.getPPIs().getPpiNotifyList().get(index)
+ .getSupArchList());
+ String arg5 = msa.getPPIs().getPpiNotifyList().get(index).getHelpText();
+
+ pid = new PpisIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
+ pid.setBelongModule(mid);
+
+ //
+ // Find which package declares it
+ //
+ for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
+ PackageSurfaceArea spd = GlobalData.openingPackageList
+ .getOpeningPackageByIndex(
+ indexOfPackage)
+ .getXmlSpd();
+ PackageIdentification packageId = GlobalData.openingPackageList
+ .getOpeningPackageByIndex(
+ indexOfPackage)
+ .getId();
+ if (spd.getPpiDeclarations() != null) {
+ for (int indexOfPpis = 0; indexOfPpis < spd.getPpiDeclarations().getEntryList()
+ .size(); indexOfPpis++) {
+ if (spd.getPpiDeclarations().getEntryList().get(indexOfPpis).getCName()
+ .equals(arg0)) {
+ pid.setDeclaredBy(packageId);
+ break;
+ }
+ }
+ }
+ }
+ if (pid.getDeclaredBy() == null) {
+ pid.setDeclaredBy(new PackageIdentification("", "", "", ""));
+ }
+
+ pv.addPpis(pid);
+ }
+ }
+ }
+ }
+ }
+ Sort.sortPpis(pv, DataType.SORT_TYPE_ASCENDING);
+ return pv;
+ }
+
+ /**
+ Re-org all ppi entries for find table
+
+ @return
+
+ **/
+ public static Vector<PpiId> getAllPpisForFind() {
+ Vector<PpiId> ppi = new Vector<PpiId>();
+ PpisVector pv = Find.getAllPpisVector();
+ boolean isAdded = false;
+ boolean isProduced = false;
+
+ //
+ // Go through pv to add item as new format to ppi one by one
+ //
+ for (int indexOfPv = 0; indexOfPv < pv.size(); indexOfPv++) {
+ isAdded = false;
+ PpisIdentification pvId = pv.getPpis(indexOfPv);
+
+ //
+ // First check if produced or not
+ //
+ if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)
+ || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {
+ isProduced = true;
+ } else if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED)
+ || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {
+ isProduced = false;
+ }
+
+ //
+ // Get the sting "PackageName.ModuleName"
+ //
+ String tmp = pvId.getBelongModule().getPackageId().getName() + SEPERATOR + pvId.getBelongModule().getName();
+
+ //
+ // Check if the item has been added in
+ // If added, append package name and new module name
+ // If not added, add a new one first
+ //
+ for (int indexOfPpi = 0; indexOfPpi < ppi.size(); indexOfPpi++) {
+ PpiId ppiId = ppi.get(indexOfPpi);
+
+ if (pvId.getName().equals(ppiId.getName())) {
+ if (isProduced) {
+ ppi.get(indexOfPpi).setProducedModules(ppiId.getProducedModules() + "<br>" + tmp);
+ } else if (!isProduced) {
+ ppi.get(indexOfPpi).setConsumedModules(ppiId.getConsumedModules() + "<br>" + tmp);
+ }
+ isAdded = true;
+ continue;
+ }
+ }
+
+ //
+ // Add a new one
+ //
+ if (!isAdded) {
+ if (isProduced) {
+ ppi
+ .addElement(new PpiId(pvId.getName(), pvId.getType(), tmp, null, pvId.getDeclaredBy().getName()));
+ } else if (!isProduced) {
+ ppi
+ .addElement(new PpiId(pvId.getName(), pvId.getType(), null, tmp, pvId.getDeclaredBy().getName()));
+ }
+ }
+ }
+
+ return ppi;
+ }
+
+ /**
+ Get all protocol entries from workspace
+
+ @return
+
+ **/
+ public static ProtocolsVector getAllProtocolsVector() {
+ ProtocolsVector pv = new ProtocolsVector();
+ ModuleSurfaceArea msa = null;
+ ModuleIdentification mid = null;
+ ProtocolsIdentification pid = null;
+
+ //
+ // Go through each module one by one
+ //
+ if (GlobalData.openingModuleList.size() > 0) {
+ for (int indexOfModule = 0; indexOfModule < GlobalData.openingModuleList.size(); indexOfModule++) {
+ msa = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getXmlMsa();
+ mid = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getId();
+
+ if (msa.getProtocols() != null) {
+ if (msa.getProtocols().getProtocolList().size() > 0) {
+ for (int index = 0; index < msa.getProtocols().getProtocolList().size(); index++) {
+ String arg0 = msa.getProtocols().getProtocolList().get(index).getProtocolCName();
+ String arg1 = DataType.PROTOCOL_TYPE_PROTOCOL;
+ String arg2 = null;
+ if (msa.getProtocols().getProtocolList().get(index).getUsage() != null) {
+ arg2 = msa.getProtocols().getProtocolList().get(index).getUsage().toString();
+ }
+
+ String arg3 = msa.getProtocols().getProtocolList().get(index).getFeatureFlag();
+ Vector<String> arg4 = Tools.convertListToVector(msa.getProtocols().getProtocolList()
+ .get(index).getSupArchList());
+ String arg5 = msa.getProtocols().getProtocolList().get(index).getHelpText();
+
+ pid = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
+ pid.setBelongModule(mid);
+
+ //
+ // Find which package declares it
+ //
+ for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
+ PackageSurfaceArea spd = GlobalData.openingPackageList
+ .getOpeningPackageByIndex(
+ indexOfPackage)
+ .getXmlSpd();
+ PackageIdentification packageId = GlobalData.openingPackageList
+ .getOpeningPackageByIndex(
+ indexOfPackage)
+ .getId();
+ if (spd.getProtocolDeclarations() != null) {
+ for (int indexOfProtocols = 0; indexOfProtocols < spd.getProtocolDeclarations()
+ .getEntryList().size(); indexOfProtocols++) {
+ if (spd.getProtocolDeclarations().getEntryList().get(indexOfProtocols)
+ .getCName().equals(arg0)) {
+ pid.setDeclaredBy(packageId);
+ break;
+ }
+ }
+ }
+ }
+ if (pid.getDeclaredBy() == null) {
+ pid.setDeclaredBy(new PackageIdentification("", "", "", ""));
+ }
+ pv.addProtocols(pid);
+ }
+ }
+ if (msa.getProtocols().getProtocolNotifyList().size() > 0) {
+ for (int index = 0; index < msa.getProtocols().getProtocolNotifyList().size(); index++) {
+ String arg0 = msa.getProtocols().getProtocolNotifyList().get(index)
+ .getProtocolNotifyCName();
+ String arg1 = DataType.PPI_TYPE_PPI_NOTIFY;
+ String arg2 = null;
+ if (msa.getProtocols().getProtocolNotifyList().get(index).getUsage() != null) {
+ arg2 = msa.getProtocols().getProtocolNotifyList().get(index).getUsage().toString();
+ }
+
+ String arg3 = msa.getProtocols().getProtocolNotifyList().get(index).getFeatureFlag();
+ Vector<String> arg4 = Tools.convertListToVector(msa.getProtocols().getProtocolNotifyList()
+ .get(index).getSupArchList());
+ String arg5 = msa.getProtocols().getProtocolNotifyList().get(index).getHelpText();
+
+ pid = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
+ pid.setBelongModule(mid);
+
+ //
+ // Find which package declares it
+ //
+ for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
+ PackageSurfaceArea spd = GlobalData.openingPackageList
+ .getOpeningPackageByIndex(
+ indexOfPackage)
+ .getXmlSpd();
+ PackageIdentification packageId = GlobalData.openingPackageList
+ .getOpeningPackageByIndex(
+ indexOfPackage)
+ .getId();
+ if (spd.getProtocolDeclarations() != null) {
+ for (int indexOfProtocols = 0; indexOfProtocols < spd.getProtocolDeclarations()
+ .getEntryList().size(); indexOfProtocols++) {
+ if (spd.getProtocolDeclarations().getEntryList().get(indexOfProtocols)
+ .getCName().equals(arg0)) {
+ pid.setDeclaredBy(packageId);
+ break;
+ }
+ }
+ }
+ }
+ if (pid.getDeclaredBy() == null) {
+ pid.setDeclaredBy(new PackageIdentification("", "", "", ""));
+ }
+
+ pv.addProtocols(pid);
+ }
+ }
+ }
+ }
+ }
+ Sort.sortProtocols(pv, DataType.SORT_TYPE_ASCENDING);
+ return pv;
+ }
+
+ /**
+ Re-org all protocol entries for find table
+
+ @return
+
+ **/
+ public static Vector<ProtocolId> getAllProtocolsForFind() {
+ Vector<ProtocolId> protocol = new Vector<ProtocolId>();
+ ProtocolsVector pv = Find.getAllProtocolsVector();
+ boolean isAdded = false;
+ boolean isProduced = false;
+
+ //
+ // Go through pv to add item as new format to ppi one by one
+ //
+ for (int indexOfPv = 0; indexOfPv < pv.size(); indexOfPv++) {
+ isAdded = false;
+ ProtocolsIdentification pvId = pv.getProtocols(indexOfPv);
+
+ //
+ // First check if produced or not
+ //
+ if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)
+ || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {
+ isProduced = true;
+ } else if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED)
+ || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {
+ isProduced = false;
+ }
+
+ //
+ // Get the sting "PackageName.ModuleName"
+ //
+ String tmp = pvId.getBelongModule().getPackageId().getName() + SEPERATOR + pvId.getBelongModule().getName();
+
+ //
+ // Check if the item has been added in
+ // If added, append package name and new module name
+ // If not added, add a new one first
+ //
+ for (int indexOfProtocol = 0; indexOfProtocol < protocol.size(); indexOfProtocol++) {
+ ProtocolId protocolId = protocol.get(indexOfProtocol);
+
+ if (pvId.getName().equals(protocolId.getName())) {
+ if (isProduced) {
+ protocol.get(indexOfProtocol)
+ .setProducedModules(protocolId.getProducedModules() + "<br>" + tmp);
+ } else if (!isProduced) {
+ protocol.get(indexOfProtocol)
+ .setConsumedModules(protocolId.getConsumedModules() + "<br>" + tmp);
+ }
+ isAdded = true;
+ continue;
+ }
+ }
+
+ //
+ // Add a new one
+ //
+ if (!isAdded) {
+ if (isProduced) {
+ protocol.addElement(new ProtocolId(pvId.getName(), pvId.getType(), tmp, null, pvId.getDeclaredBy()
+ .getName()));
+ } else if (!isProduced) {
+ protocol.addElement(new ProtocolId(pvId.getName(), pvId.getType(), null, tmp, pvId.getDeclaredBy()
+ .getName()));
+ }
+ }
+ }
+
+ return protocol;
+ }
+
+ /**
+ Get all protocol entries from workspace
+
+ @return
+
+ **/
+ public static GuidsVector getAllGuidsVector() {
+ GuidsVector gv = new GuidsVector();
+ ModuleSurfaceArea msa = null;
+ ModuleIdentification mid = null;
+ GuidsIdentification gid = null;
+
+ //
+ // Go through each module one by one
+ //
+ if (GlobalData.openingModuleList.size() > 0) {
+ for (int indexOfModule = 0; indexOfModule < GlobalData.openingModuleList.size(); indexOfModule++) {
+ msa = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getXmlMsa();
+ mid = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getId();
+
+ if (msa.getGuids() != null) {
+ if (msa.getGuids().getGuidCNamesList().size() > 0) {
+ for (int index = 0; index < msa.getGuids().getGuidCNamesList().size(); index++) {
+ String arg0 = msa.getGuids().getGuidCNamesList().get(index).getGuidCName();
+ String arg1 = null;
+ if (msa.getGuids().getGuidCNamesList().get(index).getUsage() != null) {
+ arg1 = msa.getGuids().getGuidCNamesList().get(index).getUsage().toString();
+ }
+
+ String arg2 = msa.getGuids().getGuidCNamesList().get(index).getFeatureFlag();
+ Vector<String> arg3 = Tools.convertListToVector(msa.getGuids().getGuidCNamesList()
+ .get(index).getSupArchList());
+ String arg4 = msa.getGuids().getGuidCNamesList().get(index).getHelpText();
+
+ gid = new GuidsIdentification(arg0, arg1, arg2, arg3, arg4);
+ gid.setBelongModule(mid);
+
+ //
+ // Find which package declares it
+ //
+ for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
+ PackageSurfaceArea spd = GlobalData.openingPackageList
+ .getOpeningPackageByIndex(
+ indexOfPackage)
+ .getXmlSpd();
+ PackageIdentification packageId = GlobalData.openingPackageList
+ .getOpeningPackageByIndex(
+ indexOfPackage)
+ .getId();
+ if (spd.getGuidDeclarations() != null) {
+ for (int indexOfGuids = 0; indexOfGuids < spd.getGuidDeclarations().getEntryList()
+ .size(); indexOfGuids++) {
+ if (spd.getGuidDeclarations().getEntryList().get(indexOfGuids).getCName()
+ .equals(arg0)) {
+ gid.setDeclaredBy(packageId);
+ break;
+ }
+ }
+ }
+ }
+ if (gid.getDeclaredBy() == null) {
+ gid.setDeclaredBy(new PackageIdentification("", "", "", ""));
+ }
+
+ gv.addGuids(gid);
+ }
+ }
+ }
+ }
+ }
+ Sort.sortGuids(gv, DataType.SORT_TYPE_ASCENDING);
+ return gv;
+ }
+
+ /**
+ Re-org all guid entries for find table
+
+ @return
+
+ **/
+ public static Vector<GuidId> getAllGuidsForFind() {
+ Vector<GuidId> guid = new Vector<GuidId>();
+ GuidsVector gv = Find.getAllGuidsVector();
+ boolean isAdded = false;
+ boolean isProduced = false;
+
+ //
+ // Go through pv to add item as new format to ppi one by one
+ //
+ for (int indexOfGv = 0; indexOfGv < gv.size(); indexOfGv++) {
+ isAdded = false;
+ GuidsIdentification gvId = gv.getGuids(indexOfGv);
+
+ //
+ // First check if produced or not
+ //
+ if (gvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)
+ || gvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {
+ isProduced = true;
+ } else if (gvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED)
+ || gvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {
+ isProduced = false;
+ }
+
+ //
+ // Get the sting "PackageName.ModuleName"
+ //
+ String tmp = gvId.getBelongModule().getPackageId().getName() + SEPERATOR + gvId.getBelongModule().getName();
+
+ //
+ // Check if the item has been added in
+ // If added, append package name and new module name
+ // If not added, add a new one first
+ //
+ for (int indexOfGuid = 0; indexOfGuid < guid.size(); indexOfGuid++) {
+ GuidId guidId = guid.get(indexOfGuid);
+
+ if (gvId.getName().equals(guidId.getName())) {
+ if (isProduced) {
+ guid.get(indexOfGuid).setProducedModules(guidId.getProducedModules() + "<br>" + tmp);
+ } else if (!isProduced) {
+ guid.get(indexOfGuid).setConsumedModules(guidId.getConsumedModules() + "<br>" + tmp);
+ }
+ isAdded = true;
+ continue;
+ }
+ }
+
+ //
+ // Add a new one
+ //
+ if (!isAdded) {
+ if (isProduced) {
+ guid.addElement(new GuidId(gvId.getName(), "GUID", tmp, null, gvId.getDeclaredBy().getName()));
+ } else if (!isProduced) {
+ guid.addElement(new GuidId(gvId.getName(), "GUID", null, tmp, gvId.getDeclaredBy().getName()));
+ }
+ }
+ }
+
+ return guid;
+ }
+
+ /**
+ Get all pcd coded entries from workspace
+
+ @return
+
+ **/
+ public static PcdCodedVector getAllPcdCodedVector() {
+ PcdCodedVector pv = new PcdCodedVector();
+ ModuleSurfaceArea msa = null;
+ ModuleIdentification mid = null;
+ PcdCodedIdentification pid = null;
+
+ //
+ // Go through each module one by one
+ //
+ if (GlobalData.openingModuleList.size() > 0) {
+ for (int indexOfModule = 0; indexOfModule < GlobalData.openingModuleList.size(); indexOfModule++) {
+ msa = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getXmlMsa();
+ mid = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getId();
+
+ if (msa.getPcdCoded() != null) {
+ if (msa.getPcdCoded().getPcdEntryList().size() > 0) {
+ for (int index = 0; index < msa.getPcdCoded().getPcdEntryList().size(); index++) {
+
+ String arg0 = msa.getPcdCoded().getPcdEntryList().get(index).getCName();
+ String arg1 = msa.getPcdCoded().getPcdEntryList().get(index).getTokenSpaceGuidCName();
+
+ String arg2 = msa.getPcdCoded().getPcdEntryList().get(index).getFeatureFlag();
+ Vector<String> arg3 = Tools.convertListToVector(msa.getPcdCoded().getPcdEntryList()
+ .get(index).getSupArchList());
+
+ String arg4 = msa.getPcdCoded().getPcdEntryList().get(index).getDefaultValue();
+ String arg5 = msa.getPcdCoded().getPcdEntryList().get(index).getHelpText();
+ String arg6 = null;
+ if (msa.getPcdCoded().getPcdEntryList().get(index).getPcdItemType() != null) {
+ arg6 = msa.getPcdCoded().getPcdEntryList().get(index).getPcdItemType().toString();
+ }
+ String arg7 = null;
+ if (msa.getPcdCoded().getPcdEntryList().get(index).getUsage() != null) {
+ arg7 = msa.getPcdCoded().getPcdEntryList().get(index).getUsage().toString();
+ }
+ pid = new PcdCodedIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+ pid.setBelongModule(mid);
+
+ //
+ // Find which package declares it
+ //
+ for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
+ PackageSurfaceArea spd = GlobalData.openingPackageList
+ .getOpeningPackageByIndex(
+ indexOfPackage)
+ .getXmlSpd();
+ PackageIdentification packageId = GlobalData.openingPackageList
+ .getOpeningPackageByIndex(
+ indexOfPackage)
+ .getId();
+ if (spd.getPcdDeclarations() != null) {
+ for (int indexOfPcds = 0; indexOfPcds < spd.getPcdDeclarations().getPcdEntryList()
+ .size(); indexOfPcds++) {
+ if (spd.getPcdDeclarations().getPcdEntryList().get(indexOfPcds).getCName()
+ .equals(arg0)) {
+ pid.setDeclaredBy(packageId);
+ break;
+ }
+ }
+ }
+ }
+ if (pid.getDeclaredBy() == null) {
+ pid.setDeclaredBy(new PackageIdentification("", "", "", ""));
+ }
+
+ pv.addPcdCoded(pid);
+ }
+ }
+ }
+ }
+ }
+ Sort.sortPcdCodeds(pv, DataType.SORT_TYPE_ASCENDING);
+ return pv;
+ }
+
+ /**
+ Re-org all guid entries for find table
+
+ @return
+
+ **/
+ public static Vector<PcdId> getAllPcdCodedForFind() {
+ Vector<PcdId> pcd = new Vector<PcdId>();
+ PcdCodedVector pv = Find.getAllPcdCodedVector();
+ boolean isAdded = false;
+ boolean isProduced = false;
+
+ //
+ // Go through pv to add item as new format to ppi one by one
+ //
+ for (int indexOfPv = 0; indexOfPv < pv.size(); indexOfPv++) {
+ isAdded = false;
+ PcdCodedIdentification pvId = pv.getPcdCoded(indexOfPv);
+
+ //
+ // First check if produced or not
+ //
+ if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)
+ || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {
+ isProduced = true;
+ } else if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED)
+ || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {
+ isProduced = false;
+ }
+
+ //
+ // Get the sting "PackageName.ModuleName"
+ //
+ String tmp = pvId.getBelongModule().getPackageId().getName() + SEPERATOR + pvId.getBelongModule().getName();
+
+ //
+ // Check if the item has been added in
+ // If added, append package name and new module name
+ // If not added, add a new one first
+ //
+ for (int indexOfGuid = 0; indexOfGuid < pcd.size(); indexOfGuid++) {
+ PcdId pcdId = pcd.get(indexOfGuid);
+
+ if (pvId.getName().equals(pcdId.getName())) {
+ if (isProduced) {
+ pcd.get(indexOfGuid).setProducedModules(pcdId.getProducedModules() + "<br>" + tmp);
+ } else if (!isProduced) {
+ pcd.get(indexOfGuid).setConsumedModules(pcdId.getConsumedModules() + "<br>" + tmp);
+ }
+ isAdded = true;
+ continue;
+ }
+ }
+
+ //
+ // Add a new one
+ //
+ if (!isAdded) {
+ if (isProduced) {
+ pcd
+ .addElement(new PcdId(pvId.getName(), pvId.getType(), tmp, null, pvId.getDeclaredBy().getName()));
+ } else if (!isProduced) {
+ pcd
+ .addElement(new PcdId(pvId.getName(), pvId.getType(), null, tmp, pvId.getDeclaredBy().getName()));
+ }
+ }
+ }
+
+ return pcd;
+ }
+
+ /**
+ Get all library class entries from workspace
+
+ @return
+
+ **/
+ public static LibraryClassVector getAllLibraryClassVector() {
+ LibraryClassVector lcv = new LibraryClassVector();
+ ModuleSurfaceArea msa = null;
+ ModuleIdentification mid = null;
+ LibraryClassIdentification lcid = null;
+
+ //
+ // Go through each module one by one
+ //
+ if (GlobalData.openingModuleList.size() > 0) {
+ for (int indexOfModule = 0; indexOfModule < GlobalData.openingModuleList.size(); indexOfModule++) {
+ msa = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getXmlMsa();
+ mid = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getId();
+
+ if (msa.getLibraryClassDefinitions() != null) {
+ LibraryClassDefinitions lcd = msa.getLibraryClassDefinitions();
+ if (lcd.getLibraryClassList().size() > 0) {
+ for (int index = 0; index < lcd.getLibraryClassList().size(); index++) {
+ String name = lcd.getLibraryClassList().get(index).getKeyword();
+ String usage = null;
+ if (lcd.getLibraryClassList().get(index).getUsage() != null) {
+ usage = lcd.getLibraryClassList().get(index).getUsage().toString();
+ }
+ String version = lcd.getLibraryClassList().get(index).getRecommendedInstanceVersion();
+ String guid = lcd.getLibraryClassList().get(index).getRecommendedInstanceGuid();
+ String featureFlag = lcd.getLibraryClassList().get(index).getFeatureFlag();
+ Vector<String> arch = Tools.convertListToVector(lcd.getLibraryClassList().get(index)
+ .getSupArchList());
+ Vector<String> module = Tools.convertListToVector(lcd.getLibraryClassList().get(index)
+ .getSupModuleList());
+ String help = lcd.getLibraryClassList().get(index).getHelpText();
+ lcid = new LibraryClassIdentification(name, usage, version, guid, arch, featureFlag,
+ module, help);
+ lcid.setBelongModule(mid);
+
+ //
+ // Find which package declares it
+ //
+ for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
+ PackageSurfaceArea spd = GlobalData.openingPackageList
+ .getOpeningPackageByIndex(
+ indexOfPackage)
+ .getXmlSpd();
+ PackageIdentification packageId = GlobalData.openingPackageList
+ .getOpeningPackageByIndex(
+ indexOfPackage)
+ .getId();
+ if (spd.getLibraryClassDeclarations() != null) {
+ for (int indexOfLibraryClass = 0; indexOfLibraryClass < spd
+ .getLibraryClassDeclarations()
+ .getLibraryClassList()
+ .size(); indexOfLibraryClass++) {
+ if (spd.getLibraryClassDeclarations().getLibraryClassList().get(indexOfLibraryClass)
+ .getName().equals(name)) {
+ lcid.setDeclaredBy(packageId);
+ break;
+ }
+ }
+ }
+ }
+ if (lcid.getDeclaredBy() == null) {
+ lcid.setDeclaredBy(new PackageIdentification("", "", "", ""));
+ }
+
+ lcv.addLibraryClass(lcid);
+ }
+ }
+ }
+ }
+ }
+ Sort.sortLibraryClass(lcv, DataType.SORT_TYPE_ASCENDING);
+ return lcv;
+ }
+
+ /**
+ Re-org all guid entries for find table
+
+ @return
+
+ **/
+ public static Vector<LibraryClassId> getAllLibraryClassForFind() {
+ Vector<LibraryClassId> libraryClass = new Vector<LibraryClassId>();
+ LibraryClassVector lcv = Find.getAllLibraryClassVector();
+ boolean isAdded = false;
+ boolean isProduced = false;
+
+ //
+ // Go through pv to add item as new format to ppi one by one
+ //
+ for (int indexOfLcv = 0; indexOfLcv < lcv.size(); indexOfLcv++) {
+ isAdded = false;
+ LibraryClassIdentification lcvId = lcv.getLibraryClass(indexOfLcv);
+
+ //
+ // First check if produced or not
+ //
+ if (lcvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)
+ || lcvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {
+ isProduced = true;
+ } else if (lcvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED)
+ || lcvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {
+ isProduced = false;
+ }
+
+ //
+ // Get the sting "PackageName.ModuleName"
+ //
+ String tmp = lcvId.getBelongModule().getPackageId().getName() + SEPERATOR
+ + lcvId.getBelongModule().getName();
+
+ //
+ // Check if the item has been added in
+ // If added, append package name and new module name
+ // If not added, add a new one first
+ //
+ for (int indexOfGuid = 0; indexOfGuid < libraryClass.size(); indexOfGuid++) {
+ LibraryClassId lcId = libraryClass.get(indexOfGuid);
+
+ if (lcvId.getLibraryClassName().equals(lcId.getName())) {
+ if (isProduced) {
+ libraryClass.get(indexOfGuid).setProducedModules(lcId.getProducedModules() + "<br>" + tmp);
+ } else if (!isProduced) {
+ libraryClass.get(indexOfGuid).setConsumedModules(lcId.getConsumedModules() + "<br>" + tmp);
+ }
+ isAdded = true;
+ continue;
+ }
+ }
+
+ //
+ // Add a new one
+ //
+ if (!isAdded) {
+ if (isProduced) {
+ libraryClass.addElement(new LibraryClassId(lcvId.getLibraryClassName(), "Library Class", tmp, null,
+ lcvId.getDeclaredBy().getName()));
+ } else if (!isProduced) {
+ libraryClass.addElement(new LibraryClassId(lcvId.getLibraryClassName(), "Library Class", null, tmp,
+ lcvId.getDeclaredBy().getName()));
+ }
+ }
+ }
+
+ return libraryClass;
+ }
+}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResult.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResult.java
new file mode 100644
index 0000000000..0033797bb9
--- /dev/null
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResult.java
@@ -0,0 +1,478 @@
+/** @file
+
+ The file is used to show a table with all defined PPIs
+
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ **/
+package org.tianocore.frameworkwizard.common.find;
+
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ComponentEvent;
+import java.awt.event.WindowEvent;
+import java.util.Vector;
+
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+import javax.swing.SwingConstants;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.DefaultTableCellRenderer;
+
+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.ui.IFrame;
+
+public class FindResult extends IFrame implements TableModelListener {
+
+ ///
+ /// Define class Serial Version UID
+ ///
+ private static final long serialVersionUID = -2448484533878401714L;
+
+ //
+ // Define class members
+ //
+ private JTable jTable = null;
+
+ private JPanel jContentPane = null;
+
+ private JScrollPane jScrollPane = null;
+
+ private JScrollPane jScrollPaneTable = null;
+
+ private JButton jButtonClose = null;
+
+ //
+ // Not used by UI
+ //
+ private IDefaultTableModel model = null;
+
+ private String method = "";
+
+ private static FindResult findPpisResult = null;
+
+ private static FindResult findProtocolsResult = null;
+
+ private static FindResult findGuidsResult = null;
+
+ private static FindResult findPcdsResult = null;
+
+ private static FindResult findLibraryClassResult = null;
+
+ /**
+ * This is the default constructor
+ */
+ public FindResult(String method) {
+ super();
+ init(method);
+ }
+
+ /**
+ * This method initializes this
+ *
+ * @return void
+ */
+ private void init(String method) {
+ this.setSize(600, 500);
+ this.setContentPane(getJScrollPane());
+ this.setTitle("Find Result");
+ this.setResizable(true);
+ this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
+ this.centerWindow();
+
+ //
+ // max the window
+ //
+ //this.setExtendedState(JFrame.MAXIMIZED_BOTH);
+ this.method = method;
+ this.showTable();
+ }
+
+ /**
+ * This method initializes jContentPane
+ *
+ * @return javax.swing.JPanel
+ */
+ private JPanel getJContentPane() {
+ if (jContentPane == null) {
+ jContentPane = new JPanel();
+ jContentPane.setLayout(null);
+ jContentPane.add(getJScrollPaneTable(), null);
+ jContentPane.add(getJButtonClose(), null);
+ jContentPane.setPreferredSize(new java.awt.Dimension(585, 445));
+ }
+ return jContentPane;
+ }
+
+ /**
+ 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(0, 0, 585, 395));
+ jScrollPaneTable.setPreferredSize(new Dimension(585, 395));
+ jScrollPaneTable.setViewportView(getJTable());
+ }
+ return jScrollPaneTable;
+ }
+
+ /**
+ This method initializes jTable
+
+ @return javax.swing.JTable
+ **/
+ private JTable getJTable() {
+ if (jTable == null) {
+ model = new IDefaultTableModel();
+ jTable = new JTable(model);
+
+ model.addColumn("Name");
+ model.addColumn("Type");
+ model.addColumn("Produced by");
+ model.addColumn("Consumed by");
+ model.addColumn("Declared by");
+
+ jTable.getColumn("Name").setCellRenderer(new MyTableCellRenderer());
+ jTable.getColumn("Type").setCellRenderer(new MyTableCellRenderer());
+ jTable.getColumn("Produced by").setCellRenderer(new MyTableCellRenderer());
+ jTable.getColumn("Consumed by").setCellRenderer(new MyTableCellRenderer());
+ jTable.getColumn("Declared by").setCellRenderer(new MyTableCellRenderer());
+
+ jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ jTable.getModel().addTableModelListener(this);
+ }
+ return jTable;
+ }
+
+ /**
+ This method initializes jButtonAdd
+
+ @return javax.swing.JButton jButtonAdd
+
+ **/
+ private JButton getJButtonClose() {
+ if (jButtonClose == null) {
+ jButtonClose = new JButton();
+ jButtonClose.setText("Close");
+ jButtonClose.addActionListener(this);
+ jButtonClose.setBounds(new java.awt.Rectangle(255, 415, 80, 20));
+ jButtonClose.setPreferredSize(new java.awt.Dimension(80, 20));
+ }
+ return jButtonClose;
+ }
+
+ public static FindResult getInstance(String method) {
+ if (method.equals("PPI")) {
+ if (findPpisResult == null) {
+ findPpisResult = new FindResult(method);
+ }
+ findPpisResult.init(method);
+ return findPpisResult;
+ }
+
+ if (method.equals("PROTOCOL")) {
+ if (findProtocolsResult == null) {
+ findProtocolsResult = new FindResult(method);
+ }
+ findProtocolsResult.init(method);
+ return findProtocolsResult;
+ }
+
+ if (method.equals("GUID")) {
+ if (findGuidsResult == null) {
+ findGuidsResult = new FindResult(method);
+ }
+ findGuidsResult.init(method);
+ return findGuidsResult;
+ }
+
+ if (method.equals("PCD")) {
+ if (findPcdsResult == null) {
+ findPcdsResult = new FindResult(method);
+ }
+ findPcdsResult.init(method);
+ return findPcdsResult;
+ }
+
+ if (method.equals("LIBRARY_CLASS")) {
+ if (findLibraryClassResult == null) {
+ findLibraryClassResult = new FindResult(method);
+ }
+ findLibraryClassResult.init(method);
+ return findLibraryClassResult;
+ }
+
+ return null;
+ }
+
+ /**
+ 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 (this.method.equals("PPI")) {
+ Vector<PpiId> vPpi = Find.getAllPpisForFind();
+
+ if (vPpi.size() > 0) {
+
+ for (int index = 0; index < vPpi.size(); index++) {
+ Vector<String> v = new Vector<String>();
+ v.addElement(vPpi.elementAt(index).getName());
+ v.addElement(vPpi.elementAt(index).getType());
+ String strProducedModules = vPpi.elementAt(index).getProducedModules();
+ if (strProducedModules.indexOf("<br>") == 0) {
+ strProducedModules = strProducedModules.substring("<br>".length());
+ }
+ int line1 = Tools.getSpecificStringCount(strProducedModules, "<br>");
+ v.addElement("<html>" + strProducedModules + "</html>");
+
+ String strConsumedModules = vPpi.elementAt(index).getConsumedModules();
+ if (strConsumedModules.indexOf("<br>") == 0) {
+ strConsumedModules = strConsumedModules.substring("<br>".length());
+ }
+ int line2 = Tools.getSpecificStringCount(strConsumedModules, "<br>");
+ v.addElement("<html>" + strConsumedModules + "</html>");
+
+ v.addElement(vPpi.elementAt(index).getDeclaredBy());
+
+ model.addRow(v);
+ jTable.setRowHeight(index, (Math.max(line1, line2) > 1 ? Math.max(line1, line2) : 1) * 18);
+ }
+ } else {
+ Log.wrn("Find PPIs", "No PPI found!!!");
+ }
+ }
+
+ if (this.method.equals("PROTOCOL")) {
+ Vector<ProtocolId> vProtocol = Find.getAllProtocolsForFind();
+
+ if (vProtocol.size() > 0) {
+
+ for (int index = 0; index < vProtocol.size(); index++) {
+ Vector<String> v = new Vector<String>();
+ v.addElement(vProtocol.elementAt(index).getName());
+ v.addElement(vProtocol.elementAt(index).getType());
+ String strProducedModules = vProtocol.elementAt(index).getProducedModules();
+ if (strProducedModules.indexOf("<br>") == 0) {
+ strProducedModules = strProducedModules.substring("<br>".length());
+ }
+ int line1 = Tools.getSpecificStringCount(strProducedModules, "<br>");
+ v.addElement("<html>" + strProducedModules + "</html>");
+
+ String strConsumedModules = vProtocol.elementAt(index).getConsumedModules();
+ if (strConsumedModules.indexOf("<br>") == 0) {
+ strConsumedModules = strConsumedModules.substring("<br>".length());
+ }
+ int line2 = Tools.getSpecificStringCount(strConsumedModules, "<br>");
+ v.addElement("<html>" + strConsumedModules + "</html>");
+
+ v.addElement(vProtocol.elementAt(index).getDeclaredBy());
+
+ model.addRow(v);
+ jTable.setRowHeight(index, (Math.max(line1, line2) > 1 ? Math.max(line1, line2) : 1) * 18);
+ }
+ } else {
+ Log.wrn("Find PROTOCOLs", "No PROTOCOL found!!!");
+ }
+ }
+
+ if (this.method.equals("GUID")) {
+ Vector<GuidId> vGuid = Find.getAllGuidsForFind();
+
+ if (vGuid.size() > 0) {
+
+ for (int index = 0; index < vGuid.size(); index++) {
+ Vector<String> v = new Vector<String>();
+ v.addElement(vGuid.elementAt(index).getName());
+ v.addElement("GUID");
+ String strProducedModules = vGuid.elementAt(index).getProducedModules();
+ if (strProducedModules.indexOf("<br>") == 0) {
+ strProducedModules = strProducedModules.substring("<br>".length());
+ }
+ int line1 = Tools.getSpecificStringCount(strProducedModules, "<br>");
+ v.addElement("<html>" + strProducedModules + "</html>");
+
+ String strConsumedModules = vGuid.elementAt(index).getConsumedModules();
+ if (strConsumedModules.indexOf("<br>") == 0) {
+ strConsumedModules = strConsumedModules.substring("<br>".length());
+ }
+ int line2 = Tools.getSpecificStringCount(strConsumedModules, "<br>");
+ v.addElement("<html>" + strConsumedModules + "</html>");
+
+ v.addElement(vGuid.elementAt(index).getDeclaredBy());
+
+ model.addRow(v);
+ jTable.setRowHeight(index, (Math.max(line1, line2) > 1 ? Math.max(line1, line2) : 1) * 18);
+ }
+ } else {
+ Log.wrn("Find GUIDs", "No GUID found!!!");
+ }
+ }
+
+ if (this.method.equals("PCD")) {
+ Vector<PcdId> vPcd = Find.getAllPcdCodedForFind();
+
+ if (vPcd.size() > 0) {
+
+ for (int index = 0; index < vPcd.size(); index++) {
+ Vector<String> v = new Vector<String>();
+ v.addElement(vPcd.elementAt(index).getName());
+ v.addElement(vPcd.elementAt(index).getType());
+ String strProducedModules = vPcd.elementAt(index).getProducedModules();
+ if (strProducedModules.indexOf("<br>") == 0) {
+ strProducedModules = strProducedModules.substring("<br>".length());
+ }
+ int line1 = Tools.getSpecificStringCount(strProducedModules, "<br>");
+ v.addElement("<html>" + strProducedModules + "</html>");
+
+ String strConsumedModules = vPcd.elementAt(index).getConsumedModules();
+ if (strConsumedModules.indexOf("<br>") == 0) {
+ strConsumedModules = strConsumedModules.substring("<br>".length());
+ }
+ int line2 = Tools.getSpecificStringCount(strConsumedModules, "<br>");
+ v.addElement("<html>" + strConsumedModules + "</html>");
+
+ v.addElement(vPcd.elementAt(index).getDeclaredBy());
+
+ model.addRow(v);
+ jTable.setRowHeight(index, (Math.max(line1, line2) > 1 ? Math.max(line1, line2) : 1) * 18);
+ }
+ } else {
+ Log.wrn("Find PCDs", "No PCD found!!!");
+ }
+ }
+
+ if (this.method.equals("LIBRARY_CLASS")) {
+ Vector<LibraryClassId> vLibraryClass = Find.getAllLibraryClassForFind();
+
+ if (vLibraryClass.size() > 0) {
+
+ for (int index = 0; index < vLibraryClass.size(); index++) {
+ Vector<String> v = new Vector<String>();
+ v.addElement(vLibraryClass.elementAt(index).getName());
+ v.addElement(vLibraryClass.elementAt(index).getType());
+ String strProducedModules = vLibraryClass.elementAt(index).getProducedModules();
+ if (strProducedModules.indexOf("<br>") == 0) {
+ strProducedModules = strProducedModules.substring("<br>".length());
+ }
+ int line1 = Tools.getSpecificStringCount(strProducedModules, "<br>");
+ v.addElement("<html>" + strProducedModules + "</html>");
+
+ String strConsumedModules = vLibraryClass.elementAt(index).getConsumedModules();
+ if (strConsumedModules.indexOf("<br>") == 0) {
+ strConsumedModules = strConsumedModules.substring("<br>".length());
+ }
+ int line2 = Tools.getSpecificStringCount(strConsumedModules, "<br>");
+ v.addElement("<html>" + strConsumedModules + "</html>");
+
+ v.addElement(vLibraryClass.elementAt(index).getDeclaredBy());
+
+ model.addRow(v);
+ jTable.setRowHeight(index, (Math.max(line1, line2) > 1 ? Math.max(line1, line2) : 1) * 18);
+ }
+ } else {
+ Log.wrn("Find Library Classes", "No Library Class found!!!");
+ }
+ }
+
+ this.jTable.repaint();
+ this.jTable.updateUI();
+ }
+
+ public void tableChanged(TableModelEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void actionPerformed(ActionEvent arg0) {
+ if (arg0.getSource() == this.jButtonClose) {
+
+ this.dispose();
+ }
+ }
+
+ /* (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.centerComponent(this.jButtonClose, intCurrentWidth, intCurrentHeight, intPreferredHeight,
+ DataType.SPACE_TO_BOTTOM_FOR_CLOSE_BUTTON);
+ }
+
+ /* (non-Javadoc)
+ * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)
+ *
+ * Override windowClosing to popup warning message to confirm quit
+ *
+ */
+ public void windowClosing(WindowEvent arg0) {
+ this.dispose();
+ }
+
+ class MyTableCellRenderer extends DefaultTableCellRenderer {
+ ///
+ ///
+ ///
+ private static final long serialVersionUID = -2082787479305255946L;
+
+ public void setValue(Object value) {
+ this.setVerticalAlignment(SwingConstants.TOP);
+ super.setValue(value);
+ }
+ }
+
+}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/GuidId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/GuidId.java
new file mode 100644
index 0000000000..2533108e4a
--- /dev/null
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/GuidId.java
@@ -0,0 +1,76 @@
+/** @file
+
+ The file is used to define GUID Identification used by find function
+
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ **/
+package org.tianocore.frameworkwizard.common.find;
+
+public class GuidId {
+
+ private String name = null;
+
+ private String type = null;
+
+ private String producedModules = null;
+
+ private String consumedModules = null;
+
+ private String declaredBy = null;
+
+ public GuidId(String arg0, String arg1, String arg2, String arg3, String arg4) {
+ this.name = (arg0 == null ? "" : arg0);
+ this.type = (arg1 == null ? "" : arg1);
+ this.producedModules = (arg2 == null ? "" : arg2);
+ this.consumedModules = (arg3 == null ? "" : arg3);
+ this.declaredBy = (arg4 == null ? "" : arg4);
+ }
+
+ public String getConsumedModules() {
+ return consumedModules;
+ }
+
+ public void setConsumedModules(String consumedModules) {
+ this.consumedModules = consumedModules;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getProducedModules() {
+ return producedModules;
+ }
+
+ public void setProducedModules(String producedModules) {
+ this.producedModules = producedModules;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDeclaredBy() {
+ return declaredBy;
+ }
+
+ public void setDeclaredBy(String declaredBy) {
+ this.declaredBy = declaredBy;
+ }
+}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/LibraryClassId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/LibraryClassId.java
new file mode 100644
index 0000000000..a31cb38ade
--- /dev/null
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/LibraryClassId.java
@@ -0,0 +1,76 @@
+/** @file
+
+ The file is used to define Library Class Identification used by find function
+
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ **/
+package org.tianocore.frameworkwizard.common.find;
+
+public class LibraryClassId {
+
+ private String name = null;
+
+ private String type = null;
+
+ private String producedModules = null;
+
+ private String consumedModules = null;
+
+ private String declaredBy = null;
+
+ public LibraryClassId(String arg0, String arg1, String arg2, String arg3, String arg4) {
+ this.name = (arg0 == null ? "" : arg0);
+ this.type = (arg1 == null ? "" : arg1);
+ this.producedModules = (arg2 == null ? "" : arg2);
+ this.consumedModules = (arg3 == null ? "" : arg3);
+ this.declaredBy = (arg4 == null ? "" : arg4);
+ }
+
+ public String getConsumedModules() {
+ return consumedModules;
+ }
+
+ public void setConsumedModules(String consumedModules) {
+ this.consumedModules = consumedModules;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getProducedModules() {
+ return producedModules;
+ }
+
+ public void setProducedModules(String producedModules) {
+ this.producedModules = producedModules;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDeclaredBy() {
+ return declaredBy;
+ }
+
+ public void setDeclaredBy(String declaredBy) {
+ this.declaredBy = declaredBy;
+ }
+}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdId.java
new file mode 100644
index 0000000000..4982109068
--- /dev/null
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdId.java
@@ -0,0 +1,76 @@
+/** @file
+
+ The file is used to define GUID Identification used by find function
+
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ **/
+package org.tianocore.frameworkwizard.common.find;
+
+public class PcdId {
+
+ private String name = null;
+
+ private String type = null;
+
+ private String producedModules = null;
+
+ private String consumedModules = null;
+
+ private String declaredBy = null;
+
+ public PcdId(String arg0, String arg1, String arg2, String arg3, String arg4) {
+ this.name = (arg0 == null ? "" : arg0);
+ this.type = (arg1 == null ? "" : arg1);
+ this.producedModules = (arg2 == null ? "" : arg2);
+ this.consumedModules = (arg3 == null ? "" : arg3);
+ this.declaredBy = (arg4 == null ? "" : arg4);
+ }
+
+ public String getConsumedModules() {
+ return consumedModules;
+ }
+
+ public void setConsumedModules(String consumedModules) {
+ this.consumedModules = consumedModules;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getProducedModules() {
+ return producedModules;
+ }
+
+ public void setProducedModules(String producedModules) {
+ this.producedModules = producedModules;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDeclaredBy() {
+ return declaredBy;
+ }
+
+ public void setDeclaredBy(String declaredBy) {
+ this.declaredBy = declaredBy;
+ }
+}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PpiId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PpiId.java
new file mode 100644
index 0000000000..d4782c4012
--- /dev/null
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PpiId.java
@@ -0,0 +1,76 @@
+/** @file
+
+ The file is used to define PPI Identification used by find function
+
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ **/
+package org.tianocore.frameworkwizard.common.find;
+
+public class PpiId {
+
+ private String name = null;
+
+ private String type = null;
+
+ private String producedModules = null;
+
+ private String consumedModules = null;
+
+ private String declaredBy = null;
+
+ public PpiId(String arg0, String arg1, String arg2, String arg3, String arg4) {
+ this.name = (arg0 == null ? "" : arg0);
+ this.type = (arg1 == null ? "" : arg1);
+ this.producedModules = (arg2 == null ? "" : arg2);
+ this.consumedModules = (arg3 == null ? "" : arg3);
+ this.declaredBy = (arg4 == null ? "" : arg4);
+ }
+
+ public String getConsumedModules() {
+ return consumedModules;
+ }
+
+ public void setConsumedModules(String consumedModules) {
+ this.consumedModules = consumedModules;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getProducedModules() {
+ return producedModules;
+ }
+
+ public void setProducedModules(String producedModules) {
+ this.producedModules = producedModules;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDeclaredBy() {
+ return declaredBy;
+ }
+
+ public void setDeclaredBy(String declaredBy) {
+ this.declaredBy = declaredBy;
+ }
+}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/ProtocolId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/ProtocolId.java
new file mode 100644
index 0000000000..69bcbec984
--- /dev/null
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/ProtocolId.java
@@ -0,0 +1,76 @@
+/** @file
+
+ The file is used to define PROTOCOL Identification used by find function
+
+ Copyright (c) 2006, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ **/
+package org.tianocore.frameworkwizard.common.find;
+
+public class ProtocolId {
+
+ private String name = null;
+
+ private String type = null;
+
+ private String producedModules = null;
+
+ private String consumedModules = null;
+
+ private String declaredBy = null;
+
+ public ProtocolId(String arg0, String arg1, String arg2, String arg3, String arg4) {
+ this.name = (arg0 == null ? "" : arg0);
+ this.type = (arg1 == null ? "" : arg1);
+ this.producedModules = (arg2 == null ? "" : arg2);
+ this.consumedModules = (arg3 == null ? "" : arg3);
+ this.declaredBy = (arg4 == null ? "" : arg4);
+ }
+
+ public String getConsumedModules() {
+ return consumedModules;
+ }
+
+ public void setConsumedModules(String consumedModules) {
+ this.consumedModules = consumedModules;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getProducedModules() {
+ return producedModules;
+ }
+
+ public void setProducedModules(String producedModules) {
+ this.producedModules = producedModules;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDeclaredBy() {
+ return declaredBy;
+ }
+
+ public void setDeclaredBy(String declaredBy) {
+ this.declaredBy = declaredBy;
+ }
+}