From 55e83b18d8d46470c05701cb410f1bc49e33ffc3 Mon Sep 17 00:00:00 2001 From: hche10x Date: Thu, 24 Aug 2006 20:58:25 +0000 Subject: [PATCH] 1. Provide "Find" function for Ppi/Protocol/Guid/Pcd/LibraryClass. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1382 6f19259b-4bc3-4df7-8a09-765794883524 --- .../FrameworkWizard/FrameworkWizard.msa | 7 + .../frameworkwizard/FrameworkWizardUI.java | 99 +- .../frameworkwizard/common/DataType.java | 27 + .../frameworkwizard/common/Sort.java | 139 +++ .../frameworkwizard/common/Tools.java | 59 +- .../frameworkwizard/common/find/Find.java | 877 ++++++++++++++++++ .../common/find/FindResult.java | 478 ++++++++++ .../frameworkwizard/common/find/GuidId.java | 76 ++ .../common/find/LibraryClassId.java | 76 ++ .../frameworkwizard/common/find/PcdId.java | 76 ++ .../frameworkwizard/common/find/PpiId.java | 76 ++ .../common/find/ProtocolId.java | 76 ++ .../Guids/GuidsIdentification.java | 23 + .../LibraryClassIdentification.java | 23 + .../PcdCoded/PcdCodedIdentification.java | 23 + .../Ppis/PpisIdentification.java | 23 + .../Identifications/Ppis/PpisVector.java | 1 - .../Protocols/ProtocolsIdentification.java | 23 + 18 files changed, 2142 insertions(+), 40 deletions(-) create mode 100644 Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/Find.java create mode 100644 Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResult.java create mode 100644 Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/GuidId.java create mode 100644 Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/LibraryClassId.java create mode 100644 Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdId.java create mode 100644 Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PpiId.java create mode 100644 Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/ProtocolId.java diff --git a/Tools/Source/FrameworkWizard/FrameworkWizard.msa b/Tools/Source/FrameworkWizard/FrameworkWizard.msa index 1d764e8b36..35b54851fc 100644 --- a/Tools/Source/FrameworkWizard/FrameworkWizard.msa +++ b/Tools/Source/FrameworkWizard/FrameworkWizard.msa @@ -59,6 +59,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. src/org/tianocore/frameworkwizard/common/Sort.java src/org/tianocore/frameworkwizard/common/Tools.java src/org/tianocore/frameworkwizard/common/XmlConfig.java + src/org/tianocore/frameworkwizard/common/find/Find.java + src/org/tianocore/frameworkwizard/common/find/FindResult.java + src/org/tianocore/frameworkwizard/common/find/GuidId.java + src/org/tianocore/frameworkwizard/common/find/LibraryClassId.java + src/org/tianocore/frameworkwizard/common/find/PcdId.java + src/org/tianocore/frameworkwizard/common/find/PpiId.java + src/org/tianocore/frameworkwizard/common/find/ProtocolId.java src/org/tianocore/frameworkwizard/common/Identifications/Identification.java src/org/tianocore/frameworkwizard/common/Identifications/OpeningFileType.java src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java index d72a00591a..decd2e5a37 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java @@ -54,7 +54,7 @@ import org.tianocore.frameworkwizard.common.Identifications.Identification; import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType; import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType; import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType; -//import org.tianocore.frameworkwizard.common.find.FindPPIsResult; +import org.tianocore.frameworkwizard.common.find.FindResult; import org.tianocore.frameworkwizard.common.ui.IDefaultMutableTreeNode; import org.tianocore.frameworkwizard.common.ui.IDesktopManager; import org.tianocore.frameworkwizard.common.ui.IFrame; @@ -241,9 +241,9 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele private JMenuItem jMenuItemToolsBuildPreferences = null; -// private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsDebug = null; + // private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsDebug = null; -// private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsRelease = null; + // private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsRelease = null; private JMenuItem jMenuItemToolsToolChainConfiguration = null; @@ -482,7 +482,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele jMenuEdit = new JMenu(); jMenuEdit.setText("Edit"); jMenuEdit.setMnemonic('E'); - jMenuEdit.setVisible(false); + jMenuEdit.setVisible(true); // // Add sub menu items @@ -751,7 +751,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele jMenuTools.add(getJMenuItemToolsClone()); jMenuTools.add(getJMenuItemToolsCodeScan()); jMenuTools.addSeparator(); - + jMenuTools.add(getJMenuItemToolsToolChainConfiguration()); jMenuTools.add(getJMenuItemToolsBuildPreferences()); } @@ -1630,8 +1630,6 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele jMenuEditFind.add(getJMenuItemEditFindProtocol()); jMenuEditFind.add(getJMenuItemEditFindGuid()); jMenuEditFind.add(getJMenuItemEditFindPcd()); - jMenuEditFind.addSeparator(); - jMenuEditFind.add(getJMenuItemEditFindLibraryClass()); jMenuEditFind.add(getJMenuItemEditFindLibraryInstance()); } @@ -1724,6 +1722,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele jMenuItemEditFindLibraryInstance.setText("All Library Instances"); jMenuItemEditFindLibraryInstance.setMnemonic('n'); jMenuItemEditFindLibraryInstance.addActionListener(this); + jMenuItemEditFindLibraryInstance.setVisible(false); } return jMenuItemEditFindLibraryInstance; } @@ -1848,9 +1847,29 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } if (arg0.getSource() == this.jMenuItemEditFindPpi) { -// this.findPpi(); + this.findPpi(); + } + + if (arg0.getSource() == this.jMenuItemEditFindProtocol) { + this.findProtocol(); + } + + if (arg0.getSource() == this.jMenuItemEditFindGuid) { + this.findGuid(); + } + + if (arg0.getSource() == this.jMenuItemEditFindPcd) { + this.findPcd(); + } + + if (arg0.getSource() == this.jMenuItemEditFindLibraryClass) { + this.findLibraryClass(); } + if (arg0.getSource() == this.jMenuItemEditFindLibraryInstance) { + this.findLibraryInstance(); + } + if (arg0.getSource() == jMenuItemToolsBuildPreferences) { configBuildPreferences(); } @@ -1967,8 +1986,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele // // Make Platform Description // - dmtnPlatformDescription = new IDefaultMutableTreeNode("Platforms", IDefaultMutableTreeNode.PLATFORM, - -1); + dmtnPlatformDescription = new IDefaultMutableTreeNode("Platforms", IDefaultMutableTreeNode.PLATFORM, -1); if (GlobalData.vPlatformList.size() > 0) { for (int index = 0; index < GlobalData.vPlatformList.size(); index++) { dmtnPlatformDescription.add(new IDefaultMutableTreeNode(GlobalData.vPlatformList.elementAt(index) @@ -2416,7 +2434,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele iTree.addNode(new IDefaultMutableTreeNode("Data Hubs", IDefaultMutableTreeNode.MSA_DATAHUBS, true, id)); iTree.addNode(new IDefaultMutableTreeNode("Hii Packages", IDefaultMutableTreeNode.MSA_HIIPACKAGES, true, id)); iTree.addNode(new IDefaultMutableTreeNode("Guids", IDefaultMutableTreeNode.MSA_GUIDS, true, id)); - iTree.addNode(new IDefaultMutableTreeNode("External Defintions", IDefaultMutableTreeNode.MSA_EXTERNS, true, id)); + iTree + .addNode(new IDefaultMutableTreeNode("External Defintions", IDefaultMutableTreeNode.MSA_EXTERNS, true, id)); iTree.addNode(new IDefaultMutableTreeNode("Pcd Coded", IDefaultMutableTreeNode.MSA_PCDS, true, id)); } @@ -3073,10 +3092,55 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele To find all defined PPIs in workspace **/ -// private void findPpi() { -// FindPPIsResult fpr = FindPPIsResult.getInstance(); -// fpr.setVisible(true); -// } + private void findPpi() { + FindResult fr = FindResult.getInstance("PPI"); + fr.setVisible(true); + } + + /** + To find all defined PROTOCOLs in workspace + + **/ + private void findProtocol() { + FindResult fr = FindResult.getInstance("PROTOCOL"); + fr.setVisible(true); + } + + /** + To find all defined PROTOCOLs in workspace + + **/ + private void findGuid() { + FindResult fr = FindResult.getInstance("GUID"); + fr.setVisible(true); + } + + /** + To find all defined PROTOCOLs in workspace + + **/ + private void findPcd() { + FindResult fr = FindResult.getInstance("PCD"); + fr.setVisible(true); + } + + /** + To find all defined Library Classes in workspace + + **/ + private void findLibraryClass() { + FindResult fr = FindResult.getInstance("LIBRARY_CLASS"); + fr.setVisible(true); + } + + /** + To find all defined Library Instances in workspace + + **/ + private void findLibraryInstance() { + FindResult fr = FindResult.getInstance("LIBRARY_INSTANCE"); + fr.setVisible(true); + } /** Switch current workspace to others @@ -3175,9 +3239,10 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele } private void configBuildPreferences() { - Preferences bt = Preferences.getInstance(); - bt.showDialog(); + Preferences bt = Preferences.getInstance(); + bt.showDialog(); } + /** Clone selected item diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java index 80af3239b3..dcf35617e6 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java @@ -248,4 +248,31 @@ public class DataType { public static final String TRUE = "True"; public static final String FALSE = "False"; + + // + // The Sting for USAGE type + // + public final static String USAGE_TYPE_ALWAYS_CONSUMED = "ALWAYS_CONSUMED"; + + public final static String USAGE_TYPE_SOMETIMES_CONSUMED = "SOMETIMES_CONSUMED"; + + public final static String USAGE_TYPE_ALWAYS_PRODUCED = "ALWAYS_PRODUCED"; + + public final static String USAGE_TYPE_SOMETIMES_PRODUCED = "SOMETIMES_PRODUCED"; + + public final static String USAGE_TYPE_PRIVATE = "PRIVATE"; + + // + // The String for PPI type + // + public final static String PPI_TYPE_PPI = "Ppi"; + + public final static String PPI_TYPE_PPI_NOTIFY = "Ppi Notify"; + + // + // The String for Protocol type + // + public final static String PROTOCOL_TYPE_PROTOCOL = "Protocol"; + + public final static String PROTOCOL_TYPE_PROTOCOL_NOTIFY = "Protocol Notify"; } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Sort.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Sort.java index 88fe64e4d9..65a345ab5b 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Sort.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Sort.java @@ -18,8 +18,18 @@ package org.tianocore.frameworkwizard.common; import java.util.Vector; 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.PcdCoded.PcdIdentification; import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdVector; +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; import org.tianocore.frameworkwizard.platform.PlatformIdentification; @@ -212,6 +222,135 @@ public class Sort { } } + /** + Sort all ppi entries + + @param v + @param mode + + **/ + public static void sortPpis(PpisVector v, int mode) { + if (v != null) { + // + // sort by name + // + for (int indexI = 0; indexI < v.size(); indexI++) { + for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) { + if ((v.getPpis(indexJ).getName().compareTo(v.getPpis(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING) + || (v.getPpis(indexI).getName().compareTo(v.getPpis(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) { + PpisIdentification temp = v.getPpis(indexI); + v.setPpis(v.getPpis(indexJ), indexI); + v.setPpis(temp, indexJ); + } + } + } + } + } + + /** + Sort all protocol entries + + @param v + @param mode + + **/ + public static void sortProtocols(ProtocolsVector v, int mode) { + if (v != null) { + // + // sort by name + // + for (int indexI = 0; indexI < v.size(); indexI++) { + for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) { + if ((v.getProtocols(indexJ).getName().compareTo(v.getProtocols(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING) + || (v.getProtocols(indexI).getName().compareTo(v.getProtocols(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) { + ProtocolsIdentification temp = v.getProtocols(indexI); + v.setProtocols(v.getProtocols(indexJ), indexI); + v.setProtocols(temp, indexJ); + } + } + } + } + } + + /** + Sort all guid entries + + @param v + @param mode + + **/ + public static void sortGuids(GuidsVector v, int mode) { + if (v != null) { + // + // sort by name + // + for (int indexI = 0; indexI < v.size(); indexI++) { + for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) { + if ((v.getGuids(indexJ).getName().compareTo(v.getGuids(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING) + || (v.getGuids(indexI).getName().compareTo(v.getGuids(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) { + GuidsIdentification temp = v.getGuids(indexI); + v.setGuids(v.getGuids(indexJ), indexI); + v.setGuids(temp, indexJ); + } + } + } + } + } + + /** + Sort all pcd coded entries + + @param v + @param mode + + **/ + public static void sortPcdCodeds(PcdCodedVector v, int mode) { + if (v != null) { + // + // sort by name + // + for (int indexI = 0; indexI < v.size(); indexI++) { + for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) { + if ((v.getPcdCoded(indexJ).getName().compareTo(v.getPcdCoded(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING) + || (v.getPcdCoded(indexI).getName().compareTo(v.getPcdCoded(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) { + PcdCodedIdentification temp = v.getPcdCoded(indexI); + v.setPcdCoded(v.getPcdCoded(indexJ), indexI); + v.setPcdCoded(temp, indexJ); + } + } + } + } + } + + /** + Sort all pcd coded entries + + @param v + @param mode + + **/ + public static void sortLibraryClass(LibraryClassVector v, int mode) { + if (v != null) { + // + // sort by name + // + for (int indexI = 0; indexI < v.size(); indexI++) { + for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) { + if ((v.getLibraryClass(indexJ).getLibraryClassName().compareTo( + v.getLibraryClass(indexI) + .getLibraryClassName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING) + || (v.getLibraryClass(indexI).getLibraryClassName().compareTo( + v.getLibraryClass(indexJ) + .getLibraryClassName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) { + LibraryClassIdentification temp = v.getLibraryClass(indexI); + v.setLibraryClass(v.getLibraryClass(indexJ), indexI); + v.setLibraryClass(temp, indexJ); + } + } + } + } + } + /** Sort all objects of a vector based on the object's "toString" diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java index 7a98afdb7b..4b32baa7ef 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java @@ -389,7 +389,7 @@ public class Tools { return strReturn; } - + public static String convertUnicodeHexStringToString(String str) { // // Handle if str is null or empty @@ -415,8 +415,8 @@ public class Tools { // Change hex to dec // int dec = Integer.parseInt(s, 16); - - returnString = returnString + (char)(dec); + + returnString = returnString + (char) (dec); } return returnString; } @@ -468,7 +468,7 @@ public class Tools { // return hexString.trim(); } - + public static ModuleIdentification getId(String path, ModuleSurfaceArea msa) { MsaHeader head = msa.getMsaHeader(); String name = head.getModuleName(); @@ -495,7 +495,7 @@ public class Tools { PlatformIdentification id = new PlatformIdentification(name, guid, version, path); return id; } - + /** * To reset the width of input component via container width * @@ -537,7 +537,7 @@ public class Tools { * */ public static void resizeComponent(Component c, int containerWidth, int containerHeight, int preferredWidth, - int preferredHeight) { + int preferredHeight) { resizeComponentWidth(c, containerWidth, preferredWidth); resizeComponentHeight(c, containerHeight, preferredHeight); } @@ -589,32 +589,47 @@ public class Tools { * */ public static void relocateComponent(Component c, int containerWidth, int containerHeight, int preferredWidht, - int preferredHeight, int spaceToRight, int spaceToBottom) { + int preferredHeight, int spaceToRight, int spaceToBottom) { relocateComponentX(c, containerWidth, preferredWidht, spaceToRight); relocateComponentY(c, containerHeight, preferredHeight, spaceToBottom); } - + /** Move the component to the center of screen - + @param c @param width - - **/ + + **/ public static void centerComponent(Component c, int width) { c.setLocation(width / 2 - c.getWidth() / 2, c.getLocation().y); c.validate(); } - + /** - Move the component to the center of screen and adjust the y location - - @param c - @param width - - **/ - public static void centerComponent(Component c, int width, int containerHeight, int preferredHeight, int spaceToBottom) { - relocateComponentY(c, containerHeight, preferredHeight, spaceToBottom); - centerComponent(c, width); - } + Move the component to the center of screen and adjust the y location + + @param c + @param width + + **/ + public static void centerComponent(Component c, int width, int containerHeight, int preferredHeight, + int spaceToBottom) { + relocateComponentY(c, containerHeight, preferredHeight, spaceToBottom); + centerComponent(c, width); + } + + /** + Find the count of searchString in wholeString + + @param wholeString + @param searchString + @return + + **/ + public static int getSpecificStringCount(String wholeString, String searchString) { + int count = 0; + count = wholeString.split(searchString).length; + return count; + } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/Find.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/Find.java new file mode 100644 index 0000000000..b833ba68e8 --- /dev/null +++ b/Tools/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 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 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 getAllPpisForFind() { + Vector ppi = new Vector(); + 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() + "
" + tmp); + } else if (!isProduced) { + ppi.get(indexOfPpi).setConsumedModules(ppiId.getConsumedModules() + "
" + 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 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 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 getAllProtocolsForFind() { + Vector protocol = new Vector(); + 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() + "
" + tmp); + } else if (!isProduced) { + protocol.get(indexOfProtocol) + .setConsumedModules(protocolId.getConsumedModules() + "
" + 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 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 getAllGuidsForFind() { + Vector guid = new Vector(); + 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() + "
" + tmp); + } else if (!isProduced) { + guid.get(indexOfGuid).setConsumedModules(guidId.getConsumedModules() + "
" + 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 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 getAllPcdCodedForFind() { + Vector pcd = new Vector(); + 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() + "
" + tmp); + } else if (!isProduced) { + pcd.get(indexOfGuid).setConsumedModules(pcdId.getConsumedModules() + "
" + 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 arch = Tools.convertListToVector(lcd.getLibraryClassList().get(index) + .getSupArchList()); + Vector 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 getAllLibraryClassForFind() { + Vector libraryClass = new Vector(); + 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() + "
" + tmp); + } else if (!isProduced) { + libraryClass.get(indexOfGuid).setConsumedModules(lcId.getConsumedModules() + "
" + 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/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResult.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResult.java new file mode 100644 index 0000000000..0033797bb9 --- /dev/null +++ b/Tools/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 vPpi = Find.getAllPpisForFind(); + + if (vPpi.size() > 0) { + + for (int index = 0; index < vPpi.size(); index++) { + Vector v = new Vector(); + v.addElement(vPpi.elementAt(index).getName()); + v.addElement(vPpi.elementAt(index).getType()); + String strProducedModules = vPpi.elementAt(index).getProducedModules(); + if (strProducedModules.indexOf("
") == 0) { + strProducedModules = strProducedModules.substring("
".length()); + } + int line1 = Tools.getSpecificStringCount(strProducedModules, "
"); + v.addElement("" + strProducedModules + ""); + + String strConsumedModules = vPpi.elementAt(index).getConsumedModules(); + if (strConsumedModules.indexOf("
") == 0) { + strConsumedModules = strConsumedModules.substring("
".length()); + } + int line2 = Tools.getSpecificStringCount(strConsumedModules, "
"); + v.addElement("" + strConsumedModules + ""); + + 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 vProtocol = Find.getAllProtocolsForFind(); + + if (vProtocol.size() > 0) { + + for (int index = 0; index < vProtocol.size(); index++) { + Vector v = new Vector(); + v.addElement(vProtocol.elementAt(index).getName()); + v.addElement(vProtocol.elementAt(index).getType()); + String strProducedModules = vProtocol.elementAt(index).getProducedModules(); + if (strProducedModules.indexOf("
") == 0) { + strProducedModules = strProducedModules.substring("
".length()); + } + int line1 = Tools.getSpecificStringCount(strProducedModules, "
"); + v.addElement("" + strProducedModules + ""); + + String strConsumedModules = vProtocol.elementAt(index).getConsumedModules(); + if (strConsumedModules.indexOf("
") == 0) { + strConsumedModules = strConsumedModules.substring("
".length()); + } + int line2 = Tools.getSpecificStringCount(strConsumedModules, "
"); + v.addElement("" + strConsumedModules + ""); + + 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 vGuid = Find.getAllGuidsForFind(); + + if (vGuid.size() > 0) { + + for (int index = 0; index < vGuid.size(); index++) { + Vector v = new Vector(); + v.addElement(vGuid.elementAt(index).getName()); + v.addElement("GUID"); + String strProducedModules = vGuid.elementAt(index).getProducedModules(); + if (strProducedModules.indexOf("
") == 0) { + strProducedModules = strProducedModules.substring("
".length()); + } + int line1 = Tools.getSpecificStringCount(strProducedModules, "
"); + v.addElement("" + strProducedModules + ""); + + String strConsumedModules = vGuid.elementAt(index).getConsumedModules(); + if (strConsumedModules.indexOf("
") == 0) { + strConsumedModules = strConsumedModules.substring("
".length()); + } + int line2 = Tools.getSpecificStringCount(strConsumedModules, "
"); + v.addElement("" + strConsumedModules + ""); + + 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 vPcd = Find.getAllPcdCodedForFind(); + + if (vPcd.size() > 0) { + + for (int index = 0; index < vPcd.size(); index++) { + Vector v = new Vector(); + v.addElement(vPcd.elementAt(index).getName()); + v.addElement(vPcd.elementAt(index).getType()); + String strProducedModules = vPcd.elementAt(index).getProducedModules(); + if (strProducedModules.indexOf("
") == 0) { + strProducedModules = strProducedModules.substring("
".length()); + } + int line1 = Tools.getSpecificStringCount(strProducedModules, "
"); + v.addElement("" + strProducedModules + ""); + + String strConsumedModules = vPcd.elementAt(index).getConsumedModules(); + if (strConsumedModules.indexOf("
") == 0) { + strConsumedModules = strConsumedModules.substring("
".length()); + } + int line2 = Tools.getSpecificStringCount(strConsumedModules, "
"); + v.addElement("" + strConsumedModules + ""); + + 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 vLibraryClass = Find.getAllLibraryClassForFind(); + + if (vLibraryClass.size() > 0) { + + for (int index = 0; index < vLibraryClass.size(); index++) { + Vector v = new Vector(); + v.addElement(vLibraryClass.elementAt(index).getName()); + v.addElement(vLibraryClass.elementAt(index).getType()); + String strProducedModules = vLibraryClass.elementAt(index).getProducedModules(); + if (strProducedModules.indexOf("
") == 0) { + strProducedModules = strProducedModules.substring("
".length()); + } + int line1 = Tools.getSpecificStringCount(strProducedModules, "
"); + v.addElement("" + strProducedModules + ""); + + String strConsumedModules = vLibraryClass.elementAt(index).getConsumedModules(); + if (strConsumedModules.indexOf("
") == 0) { + strConsumedModules = strConsumedModules.substring("
".length()); + } + int line2 = Tools.getSpecificStringCount(strConsumedModules, "
"); + v.addElement("" + strConsumedModules + ""); + + 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/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/GuidId.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/GuidId.java new file mode 100644 index 0000000000..2533108e4a --- /dev/null +++ b/Tools/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/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/LibraryClassId.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/LibraryClassId.java new file mode 100644 index 0000000000..a31cb38ade --- /dev/null +++ b/Tools/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/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdId.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdId.java new file mode 100644 index 0000000000..4982109068 --- /dev/null +++ b/Tools/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/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PpiId.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PpiId.java new file mode 100644 index 0000000000..d4782c4012 --- /dev/null +++ b/Tools/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/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/ProtocolId.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/ProtocolId.java new file mode 100644 index 0000000000..69bcbec984 --- /dev/null +++ b/Tools/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; + } +} diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsIdentification.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsIdentification.java index d167e06fe5..4affae9797 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsIdentification.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsIdentification.java @@ -17,6 +17,9 @@ package org.tianocore.frameworkwizard.module.Identifications.Guids; import java.util.Vector; +import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification; +import org.tianocore.frameworkwizard.packaging.PackageIdentification; + public class GuidsIdentification { // @@ -31,6 +34,10 @@ public class GuidsIdentification { private String featureFlag = null; private String help = null; + + private ModuleIdentification belongModule = null; + + private PackageIdentification declaredBy = null; public GuidsIdentification(String arg0, String arg1, String arg2, Vector arg3, String arg4) { this.name = (arg0 == null ? "" : arg0); @@ -86,4 +93,20 @@ public class GuidsIdentification { public void setHelp(String help) { this.help = help; } + + public ModuleIdentification getBelongModule() { + return belongModule; + } + + public void setBelongModule(ModuleIdentification belongModule) { + this.belongModule = belongModule; + } + + public PackageIdentification getDeclaredBy() { + return declaredBy; + } + + public void setDeclaredBy(PackageIdentification declaredBy) { + this.declaredBy = declaredBy; + } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassIdentification.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassIdentification.java index b5d7ead044..d47fa74208 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassIdentification.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassIdentification.java @@ -17,6 +17,9 @@ package org.tianocore.frameworkwizard.module.Identifications.LibraryClass; import java.util.Vector; +import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification; +import org.tianocore.frameworkwizard.packaging.PackageIdentification; + public class LibraryClassIdentification { private String libraryClassName = null; @@ -33,6 +36,10 @@ public class LibraryClassIdentification { private Vector supModuleList = null; private String help = null; + + private ModuleIdentification belongModule = null; + + private PackageIdentification declaredBy = null; public LibraryClassIdentification() { @@ -121,4 +128,20 @@ public class LibraryClassIdentification { public void setHelp(String help) { this.help = help; } + + public ModuleIdentification getBelongModule() { + return belongModule; + } + + public void setBelongModule(ModuleIdentification belongModule) { + this.belongModule = belongModule; + } + + public PackageIdentification getDeclaredBy() { + return declaredBy; + } + + public void setDeclaredBy(PackageIdentification declaredBy) { + this.declaredBy = declaredBy; + } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedIdentification.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedIdentification.java index 02ae08d4d7..cf4b5bb16f 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedIdentification.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedIdentification.java @@ -17,6 +17,9 @@ package org.tianocore.frameworkwizard.module.Identifications.PcdCoded; import java.util.Vector; +import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification; +import org.tianocore.frameworkwizard.packaging.PackageIdentification; + public class PcdCodedIdentification { // @@ -37,6 +40,10 @@ public class PcdCodedIdentification { private String type = null; private String usage = null; + + private ModuleIdentification belongModule = null; + + private PackageIdentification declaredBy = null; public PcdCodedIdentification(String arg0, String arg1, String arg2, Vector arg3, String arg4, String arg5, String arg6, String arg7) { this.name = (arg0 == null ? "" : arg0); @@ -119,4 +126,20 @@ public class PcdCodedIdentification { public void setUsage(String usage) { this.usage = usage; } + + public ModuleIdentification getBelongModule() { + return belongModule; + } + + public void setBelongModule(ModuleIdentification belongModule) { + this.belongModule = belongModule; + } + + public PackageIdentification getDeclaredBy() { + return declaredBy; + } + + public void setDeclaredBy(PackageIdentification declaredBy) { + this.declaredBy = declaredBy; + } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisIdentification.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisIdentification.java index 8d0198ea49..a871f628db 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisIdentification.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisIdentification.java @@ -17,6 +17,9 @@ package org.tianocore.frameworkwizard.module.Identifications.Ppis; import java.util.Vector; +import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification; +import org.tianocore.frameworkwizard.packaging.PackageIdentification; + public class PpisIdentification { // @@ -33,6 +36,10 @@ public class PpisIdentification { private String featureFlag = null; private String help = null; + + private ModuleIdentification belongModule = null; + + private PackageIdentification declaredBy = null; public PpisIdentification(String arg0, String arg1, String arg2, String arg3, Vector arg4, String arg5) { this.name = (arg0 == null ? "" : arg0); @@ -97,4 +104,20 @@ public class PpisIdentification { public void setHelp(String help) { this.help = help; } + + public ModuleIdentification getBelongModule() { + return belongModule; + } + + public void setBelongModule(ModuleIdentification belongModule) { + this.belongModule = belongModule; + } + + public PackageIdentification getDeclaredBy() { + return declaredBy; + } + + public void setDeclaredBy(PackageIdentification declaredBy) { + this.declaredBy = declaredBy; + } } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisVector.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisVector.java index 5baa0a0af6..9c6f343ee7 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisVector.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisVector.java @@ -94,5 +94,4 @@ public class PpisVector { v.addElement(getPpis(index).getUsage()); return v; } - } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsIdentification.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsIdentification.java index deaa71dd09..685c6d1b6e 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsIdentification.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsIdentification.java @@ -17,6 +17,9 @@ package org.tianocore.frameworkwizard.module.Identifications.Protocols; import java.util.Vector; +import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification; +import org.tianocore.frameworkwizard.packaging.PackageIdentification; + public class ProtocolsIdentification { // @@ -33,6 +36,10 @@ public class ProtocolsIdentification { private String featureFlag = null; private String help = null; + + private ModuleIdentification belongModule = null; + + private PackageIdentification declaredBy = null; public ProtocolsIdentification(String arg0, String arg1, String arg2, String arg3, Vector arg4, String arg5) { this.name = (arg0 == null ? "" : arg0); @@ -97,4 +104,20 @@ public class ProtocolsIdentification { public void setHelp(String help) { this.help = help; } + + public ModuleIdentification getBelongModule() { + return belongModule; + } + + public void setBelongModule(ModuleIdentification belongModule) { + this.belongModule = belongModule; + } + + public PackageIdentification getDeclaredBy() { + return declaredBy; + } + + public void setDeclaredBy(PackageIdentification declaredBy) { + this.declaredBy = declaredBy; + } } -- 2.39.2