<Filename>src/org/tianocore/frameworkwizard/common/Sort.java</Filename>\r
<Filename>src/org/tianocore/frameworkwizard/common/Tools.java</Filename>\r
<Filename>src/org/tianocore/frameworkwizard/common/XmlConfig.java</Filename>\r
+ <Filename>src/org/tianocore/frameworkwizard/common/find/Find.java</Filename>\r
+ <Filename>src/org/tianocore/frameworkwizard/common/find/FindResult.java</Filename>\r
+ <Filename>src/org/tianocore/frameworkwizard/common/find/GuidId.java</Filename>\r
+ <Filename>src/org/tianocore/frameworkwizard/common/find/LibraryClassId.java</Filename>\r
+ <Filename>src/org/tianocore/frameworkwizard/common/find/PcdId.java</Filename>\r
+ <Filename>src/org/tianocore/frameworkwizard/common/find/PpiId.java</Filename>\r
+ <Filename>src/org/tianocore/frameworkwizard/common/find/ProtocolId.java</Filename>\r
<Filename>src/org/tianocore/frameworkwizard/common/Identifications/Identification.java</Filename>\r
<Filename>src/org/tianocore/frameworkwizard/common/Identifications/OpeningFileType.java</Filename>\r
<Filename>src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java</Filename>\r
import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;\r
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;\r
import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;\r
-//import org.tianocore.frameworkwizard.common.find.FindPPIsResult;\r
+import org.tianocore.frameworkwizard.common.find.FindResult;\r
import org.tianocore.frameworkwizard.common.ui.IDefaultMutableTreeNode;\r
import org.tianocore.frameworkwizard.common.ui.IDesktopManager;\r
import org.tianocore.frameworkwizard.common.ui.IFrame;\r
\r
private JMenuItem jMenuItemToolsBuildPreferences = null;\r
\r
-// private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsDebug = null;\r
+ // private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsDebug = null;\r
\r
-// private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsRelease = null;\r
+ // private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsRelease = null;\r
\r
private JMenuItem jMenuItemToolsToolChainConfiguration = null;\r
\r
jMenuEdit = new JMenu();\r
jMenuEdit.setText("Edit");\r
jMenuEdit.setMnemonic('E');\r
- jMenuEdit.setVisible(false);\r
+ jMenuEdit.setVisible(true);\r
\r
//\r
// Add sub menu items\r
jMenuTools.add(getJMenuItemToolsClone());\r
jMenuTools.add(getJMenuItemToolsCodeScan());\r
jMenuTools.addSeparator();\r
- \r
+\r
jMenuTools.add(getJMenuItemToolsToolChainConfiguration());\r
jMenuTools.add(getJMenuItemToolsBuildPreferences());\r
}\r
jMenuEditFind.add(getJMenuItemEditFindProtocol());\r
jMenuEditFind.add(getJMenuItemEditFindGuid());\r
jMenuEditFind.add(getJMenuItemEditFindPcd());\r
- jMenuEditFind.addSeparator();\r
-\r
jMenuEditFind.add(getJMenuItemEditFindLibraryClass());\r
jMenuEditFind.add(getJMenuItemEditFindLibraryInstance());\r
}\r
jMenuItemEditFindLibraryInstance.setText("All Library Instances");\r
jMenuItemEditFindLibraryInstance.setMnemonic('n');\r
jMenuItemEditFindLibraryInstance.addActionListener(this);\r
+ jMenuItemEditFindLibraryInstance.setVisible(false);\r
}\r
return jMenuItemEditFindLibraryInstance;\r
}\r
}\r
\r
if (arg0.getSource() == this.jMenuItemEditFindPpi) {\r
-// this.findPpi();\r
+ this.findPpi();\r
+ }\r
+\r
+ if (arg0.getSource() == this.jMenuItemEditFindProtocol) {\r
+ this.findProtocol();\r
+ }\r
+\r
+ if (arg0.getSource() == this.jMenuItemEditFindGuid) {\r
+ this.findGuid();\r
+ }\r
+\r
+ if (arg0.getSource() == this.jMenuItemEditFindPcd) {\r
+ this.findPcd();\r
+ }\r
+\r
+ if (arg0.getSource() == this.jMenuItemEditFindLibraryClass) {\r
+ this.findLibraryClass();\r
}\r
\r
+ if (arg0.getSource() == this.jMenuItemEditFindLibraryInstance) {\r
+ this.findLibraryInstance();\r
+ }\r
+\r
if (arg0.getSource() == jMenuItemToolsBuildPreferences) {\r
configBuildPreferences();\r
}\r
//\r
// Make Platform Description\r
//\r
- dmtnPlatformDescription = new IDefaultMutableTreeNode("Platforms", IDefaultMutableTreeNode.PLATFORM,\r
- -1);\r
+ dmtnPlatformDescription = new IDefaultMutableTreeNode("Platforms", IDefaultMutableTreeNode.PLATFORM, -1);\r
if (GlobalData.vPlatformList.size() > 0) {\r
for (int index = 0; index < GlobalData.vPlatformList.size(); index++) {\r
dmtnPlatformDescription.add(new IDefaultMutableTreeNode(GlobalData.vPlatformList.elementAt(index)\r
iTree.addNode(new IDefaultMutableTreeNode("Data Hubs", IDefaultMutableTreeNode.MSA_DATAHUBS, true, id));\r
iTree.addNode(new IDefaultMutableTreeNode("Hii Packages", IDefaultMutableTreeNode.MSA_HIIPACKAGES, true, id));\r
iTree.addNode(new IDefaultMutableTreeNode("Guids", IDefaultMutableTreeNode.MSA_GUIDS, true, id));\r
- iTree.addNode(new IDefaultMutableTreeNode("External Defintions", IDefaultMutableTreeNode.MSA_EXTERNS, true, id));\r
+ iTree\r
+ .addNode(new IDefaultMutableTreeNode("External Defintions", IDefaultMutableTreeNode.MSA_EXTERNS, true, id));\r
iTree.addNode(new IDefaultMutableTreeNode("Pcd Coded", IDefaultMutableTreeNode.MSA_PCDS, true, id));\r
}\r
\r
To find all defined PPIs in workspace\r
\r
**/\r
-// private void findPpi() {\r
-// FindPPIsResult fpr = FindPPIsResult.getInstance();\r
-// fpr.setVisible(true);\r
-// }\r
+ private void findPpi() {\r
+ FindResult fr = FindResult.getInstance("PPI");\r
+ fr.setVisible(true);\r
+ }\r
+\r
+ /**\r
+ To find all defined PROTOCOLs in workspace\r
+ \r
+ **/\r
+ private void findProtocol() {\r
+ FindResult fr = FindResult.getInstance("PROTOCOL");\r
+ fr.setVisible(true);\r
+ }\r
+\r
+ /**\r
+ To find all defined PROTOCOLs in workspace\r
+ \r
+ **/\r
+ private void findGuid() {\r
+ FindResult fr = FindResult.getInstance("GUID");\r
+ fr.setVisible(true);\r
+ }\r
+\r
+ /**\r
+ To find all defined PROTOCOLs in workspace\r
+ \r
+ **/\r
+ private void findPcd() {\r
+ FindResult fr = FindResult.getInstance("PCD");\r
+ fr.setVisible(true);\r
+ }\r
+\r
+ /**\r
+ To find all defined Library Classes in workspace\r
+ \r
+ **/\r
+ private void findLibraryClass() {\r
+ FindResult fr = FindResult.getInstance("LIBRARY_CLASS");\r
+ fr.setVisible(true);\r
+ }\r
+\r
+ /**\r
+ To find all defined Library Instances in workspace\r
+ \r
+ **/\r
+ private void findLibraryInstance() {\r
+ FindResult fr = FindResult.getInstance("LIBRARY_INSTANCE");\r
+ fr.setVisible(true);\r
+ }\r
\r
/**\r
Switch current workspace to others\r
}\r
\r
private void configBuildPreferences() {\r
- Preferences bt = Preferences.getInstance();\r
- bt.showDialog();\r
+ Preferences bt = Preferences.getInstance();\r
+ bt.showDialog();\r
}\r
+\r
/**\r
Clone selected item\r
\r
public static final String TRUE = "True";\r
\r
public static final String FALSE = "False";\r
+ \r
+ //\r
+ // The Sting for USAGE type\r
+ //\r
+ public final static String USAGE_TYPE_ALWAYS_CONSUMED = "ALWAYS_CONSUMED";\r
+ \r
+ public final static String USAGE_TYPE_SOMETIMES_CONSUMED = "SOMETIMES_CONSUMED";\r
+ \r
+ public final static String USAGE_TYPE_ALWAYS_PRODUCED = "ALWAYS_PRODUCED";\r
+ \r
+ public final static String USAGE_TYPE_SOMETIMES_PRODUCED = "SOMETIMES_PRODUCED";\r
+ \r
+ public final static String USAGE_TYPE_PRIVATE = "PRIVATE";\r
+ \r
+ //\r
+ // The String for PPI type\r
+ //\r
+ public final static String PPI_TYPE_PPI = "Ppi";\r
+ \r
+ public final static String PPI_TYPE_PPI_NOTIFY = "Ppi Notify";\r
+ \r
+ //\r
+ // The String for Protocol type\r
+ //\r
+ public final static String PROTOCOL_TYPE_PROTOCOL = "Protocol";\r
+ \r
+ public final static String PROTOCOL_TYPE_PROTOCOL_NOTIFY = "Protocol Notify";\r
}\r
import java.util.Vector;\r
\r
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsVector;\r
+import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassVector;\r
+import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedVector;\r
import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdVector;\r
+import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisVector;\r
+import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsVector;\r
import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
import org.tianocore.frameworkwizard.platform.PlatformIdentification;\r
\r
}\r
}\r
\r
+ /**\r
+ Sort all ppi entries\r
+ \r
+ @param v\r
+ @param mode\r
+ \r
+ **/\r
+ public static void sortPpis(PpisVector v, int mode) {\r
+ if (v != null) {\r
+ //\r
+ // sort by name\r
+ //\r
+ for (int indexI = 0; indexI < v.size(); indexI++) {\r
+ for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {\r
+ if ((v.getPpis(indexJ).getName().compareTo(v.getPpis(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)\r
+ || (v.getPpis(indexI).getName().compareTo(v.getPpis(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {\r
+ PpisIdentification temp = v.getPpis(indexI);\r
+ v.setPpis(v.getPpis(indexJ), indexI);\r
+ v.setPpis(temp, indexJ);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ Sort all protocol entries\r
+ \r
+ @param v\r
+ @param mode\r
+ \r
+ **/\r
+ public static void sortProtocols(ProtocolsVector v, int mode) {\r
+ if (v != null) {\r
+ //\r
+ // sort by name\r
+ //\r
+ for (int indexI = 0; indexI < v.size(); indexI++) {\r
+ for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {\r
+ if ((v.getProtocols(indexJ).getName().compareTo(v.getProtocols(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)\r
+ || (v.getProtocols(indexI).getName().compareTo(v.getProtocols(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {\r
+ ProtocolsIdentification temp = v.getProtocols(indexI);\r
+ v.setProtocols(v.getProtocols(indexJ), indexI);\r
+ v.setProtocols(temp, indexJ);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ Sort all guid entries\r
+ \r
+ @param v\r
+ @param mode\r
+ \r
+ **/\r
+ public static void sortGuids(GuidsVector v, int mode) {\r
+ if (v != null) {\r
+ //\r
+ // sort by name\r
+ //\r
+ for (int indexI = 0; indexI < v.size(); indexI++) {\r
+ for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {\r
+ if ((v.getGuids(indexJ).getName().compareTo(v.getGuids(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)\r
+ || (v.getGuids(indexI).getName().compareTo(v.getGuids(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {\r
+ GuidsIdentification temp = v.getGuids(indexI);\r
+ v.setGuids(v.getGuids(indexJ), indexI);\r
+ v.setGuids(temp, indexJ);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ Sort all pcd coded entries\r
+ \r
+ @param v\r
+ @param mode\r
+ \r
+ **/\r
+ public static void sortPcdCodeds(PcdCodedVector v, int mode) {\r
+ if (v != null) {\r
+ //\r
+ // sort by name\r
+ //\r
+ for (int indexI = 0; indexI < v.size(); indexI++) {\r
+ for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {\r
+ if ((v.getPcdCoded(indexJ).getName().compareTo(v.getPcdCoded(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)\r
+ || (v.getPcdCoded(indexI).getName().compareTo(v.getPcdCoded(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {\r
+ PcdCodedIdentification temp = v.getPcdCoded(indexI);\r
+ v.setPcdCoded(v.getPcdCoded(indexJ), indexI);\r
+ v.setPcdCoded(temp, indexJ);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ Sort all pcd coded entries\r
+ \r
+ @param v\r
+ @param mode\r
+ \r
+ **/\r
+ public static void sortLibraryClass(LibraryClassVector v, int mode) {\r
+ if (v != null) {\r
+ //\r
+ // sort by name\r
+ //\r
+ for (int indexI = 0; indexI < v.size(); indexI++) {\r
+ for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {\r
+ if ((v.getLibraryClass(indexJ).getLibraryClassName().compareTo(\r
+ v.getLibraryClass(indexI)\r
+ .getLibraryClassName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)\r
+ || (v.getLibraryClass(indexI).getLibraryClassName().compareTo(\r
+ v.getLibraryClass(indexJ)\r
+ .getLibraryClassName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {\r
+ LibraryClassIdentification temp = v.getLibraryClass(indexI);\r
+ v.setLibraryClass(v.getLibraryClass(indexJ), indexI);\r
+ v.setLibraryClass(temp, indexJ);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
/**\r
Sort all objects of a vector based on the object's "toString"\r
\r
\r
return strReturn;\r
}\r
- \r
+\r
public static String convertUnicodeHexStringToString(String str) {\r
//\r
// Handle if str is null or empty\r
// Change hex to dec\r
//\r
int dec = Integer.parseInt(s, 16);\r
- \r
- returnString = returnString + (char)(dec);\r
+\r
+ returnString = returnString + (char) (dec);\r
}\r
return returnString;\r
}\r
//\r
return hexString.trim();\r
}\r
- \r
+\r
public static ModuleIdentification getId(String path, ModuleSurfaceArea msa) {\r
MsaHeader head = msa.getMsaHeader();\r
String name = head.getModuleName();\r
PlatformIdentification id = new PlatformIdentification(name, guid, version, path);\r
return id;\r
}\r
- \r
+\r
/**\r
* To reset the width of input component via container width\r
* \r
* \r
*/\r
public static void resizeComponent(Component c, int containerWidth, int containerHeight, int preferredWidth,\r
- int preferredHeight) {\r
+ int preferredHeight) {\r
resizeComponentWidth(c, containerWidth, preferredWidth);\r
resizeComponentHeight(c, containerHeight, preferredHeight);\r
}\r
* \r
*/\r
public static void relocateComponent(Component c, int containerWidth, int containerHeight, int preferredWidht,\r
- int preferredHeight, int spaceToRight, int spaceToBottom) {\r
+ int preferredHeight, int spaceToRight, int spaceToBottom) {\r
relocateComponentX(c, containerWidth, preferredWidht, spaceToRight);\r
relocateComponentY(c, containerHeight, preferredHeight, spaceToBottom);\r
}\r
- \r
+\r
/**\r
Move the component to the center of screen \r
- \r
+ \r
@param c\r
@param width\r
- \r
- **/\r
+ \r
+ **/\r
public static void centerComponent(Component c, int width) {\r
c.setLocation(width / 2 - c.getWidth() / 2, c.getLocation().y);\r
c.validate();\r
}\r
- \r
+\r
/**\r
- Move the component to the center of screen and adjust the y location \r
- \r
- @param c\r
- @param width\r
- \r
- **/\r
- public static void centerComponent(Component c, int width, int containerHeight, int preferredHeight, int spaceToBottom) {\r
- relocateComponentY(c, containerHeight, preferredHeight, spaceToBottom);\r
- centerComponent(c, width);\r
- }\r
+ Move the component to the center of screen and adjust the y location \r
+ \r
+ @param c\r
+ @param width\r
+ \r
+ **/\r
+ public static void centerComponent(Component c, int width, int containerHeight, int preferredHeight,\r
+ int spaceToBottom) {\r
+ relocateComponentY(c, containerHeight, preferredHeight, spaceToBottom);\r
+ centerComponent(c, width);\r
+ }\r
+\r
+ /**\r
+ Find the count of searchString in wholeString\r
+ \r
+ @param wholeString\r
+ @param searchString\r
+ @return\r
+\r
+ **/\r
+ public static int getSpecificStringCount(String wholeString, String searchString) {\r
+ int count = 0;\r
+ count = wholeString.split(searchString).length;\r
+ return count;\r
+ }\r
}\r
--- /dev/null
+/** @file\r
+\r
+ The file is used to provide Find funtions in workspace\r
+\r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ **/\r
+package org.tianocore.frameworkwizard.common.find;\r
+\r
+import java.util.Vector;\r
+\r
+import org.tianocore.LibraryClassDefinitionsDocument.LibraryClassDefinitions;\r
+import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;\r
+import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;\r
+import org.tianocore.frameworkwizard.common.DataType;\r
+import org.tianocore.frameworkwizard.common.GlobalData;\r
+import org.tianocore.frameworkwizard.common.Sort;\r
+import org.tianocore.frameworkwizard.common.Tools;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsVector;\r
+import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassVector;\r
+import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedVector;\r
+import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisVector;\r
+import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsVector;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
+\r
+public class Find {\r
+\r
+ private final static String SEPERATOR = ".";\r
+\r
+ /**\r
+ Get all ppi entries from workspace\r
+ \r
+ @return\r
+ \r
+ **/\r
+ public static PpisVector getAllPpisVector() {\r
+ PpisVector pv = new PpisVector();\r
+ ModuleSurfaceArea msa = null;\r
+ ModuleIdentification mid = null;\r
+ PpisIdentification pid = null;\r
+\r
+ //\r
+ // Go through each module one by one\r
+ //\r
+ if (GlobalData.openingModuleList.size() > 0) {\r
+ for (int indexOfModule = 0; indexOfModule < GlobalData.openingModuleList.size(); indexOfModule++) {\r
+ msa = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getXmlMsa();\r
+ mid = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getId();\r
+\r
+ if (msa.getPPIs() != null) {\r
+ if (msa.getPPIs().getPpiList().size() > 0) {\r
+ for (int index = 0; index < msa.getPPIs().getPpiList().size(); index++) {\r
+ String arg0 = msa.getPPIs().getPpiList().get(index).getPpiCName();\r
+ String arg1 = DataType.PPI_TYPE_PPI;\r
+ String arg2 = null;\r
+ if (msa.getPPIs().getPpiList().get(index).getUsage() != null) {\r
+ arg2 = msa.getPPIs().getPpiList().get(index).getUsage().toString();\r
+ }\r
+\r
+ String arg3 = msa.getPPIs().getPpiList().get(index).getFeatureFlag();\r
+ Vector<String> arg4 = Tools.convertListToVector(msa.getPPIs().getPpiList().get(index)\r
+ .getSupArchList());\r
+ String arg5 = msa.getPPIs().getPpiList().get(index).getHelpText();\r
+\r
+ pid = new PpisIdentification(arg0, arg1, arg2, arg3, arg4, arg5);\r
+ pid.setBelongModule(mid);\r
+\r
+ //\r
+ // Find which package declares it\r
+ //\r
+ for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {\r
+ PackageSurfaceArea spd = GlobalData.openingPackageList\r
+ .getOpeningPackageByIndex(\r
+ indexOfPackage)\r
+ .getXmlSpd();\r
+ PackageIdentification packageId = GlobalData.openingPackageList\r
+ .getOpeningPackageByIndex(\r
+ indexOfPackage)\r
+ .getId();\r
+ if (spd.getPpiDeclarations() != null) {\r
+ for (int indexOfPpis = 0; indexOfPpis < spd.getPpiDeclarations().getEntryList()\r
+ .size(); indexOfPpis++) {\r
+ if (spd.getPpiDeclarations().getEntryList().get(indexOfPpis).getCName()\r
+ .equals(arg0)) {\r
+ pid.setDeclaredBy(packageId);\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ if (pid.getDeclaredBy() == null) {\r
+ pid.setDeclaredBy(new PackageIdentification("", "", "", ""));\r
+ }\r
+\r
+ pv.addPpis(pid);\r
+ }\r
+ }\r
+ if (msa.getPPIs().getPpiNotifyList().size() > 0) {\r
+ for (int index = 0; index < msa.getPPIs().getPpiNotifyList().size(); index++) {\r
+ String arg0 = msa.getPPIs().getPpiNotifyList().get(index).getPpiNotifyCName();\r
+ String arg1 = DataType.PPI_TYPE_PPI_NOTIFY;\r
+ String arg2 = null;\r
+ if (msa.getPPIs().getPpiNotifyList().get(index).getUsage() != null) {\r
+ arg2 = msa.getPPIs().getPpiNotifyList().get(index).getUsage().toString();\r
+ }\r
+\r
+ String arg3 = msa.getPPIs().getPpiNotifyList().get(index).getFeatureFlag();\r
+ Vector<String> arg4 = Tools.convertListToVector(msa.getPPIs().getPpiNotifyList().get(index)\r
+ .getSupArchList());\r
+ String arg5 = msa.getPPIs().getPpiNotifyList().get(index).getHelpText();\r
+\r
+ pid = new PpisIdentification(arg0, arg1, arg2, arg3, arg4, arg5);\r
+ pid.setBelongModule(mid);\r
+\r
+ //\r
+ // Find which package declares it\r
+ //\r
+ for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {\r
+ PackageSurfaceArea spd = GlobalData.openingPackageList\r
+ .getOpeningPackageByIndex(\r
+ indexOfPackage)\r
+ .getXmlSpd();\r
+ PackageIdentification packageId = GlobalData.openingPackageList\r
+ .getOpeningPackageByIndex(\r
+ indexOfPackage)\r
+ .getId();\r
+ if (spd.getPpiDeclarations() != null) {\r
+ for (int indexOfPpis = 0; indexOfPpis < spd.getPpiDeclarations().getEntryList()\r
+ .size(); indexOfPpis++) {\r
+ if (spd.getPpiDeclarations().getEntryList().get(indexOfPpis).getCName()\r
+ .equals(arg0)) {\r
+ pid.setDeclaredBy(packageId);\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ if (pid.getDeclaredBy() == null) {\r
+ pid.setDeclaredBy(new PackageIdentification("", "", "", ""));\r
+ }\r
+\r
+ pv.addPpis(pid);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ Sort.sortPpis(pv, DataType.SORT_TYPE_ASCENDING);\r
+ return pv;\r
+ }\r
+\r
+ /**\r
+ Re-org all ppi entries for find table\r
+ \r
+ @return\r
+ \r
+ **/\r
+ public static Vector<PpiId> getAllPpisForFind() {\r
+ Vector<PpiId> ppi = new Vector<PpiId>();\r
+ PpisVector pv = Find.getAllPpisVector();\r
+ boolean isAdded = false;\r
+ boolean isProduced = false;\r
+\r
+ //\r
+ // Go through pv to add item as new format to ppi one by one\r
+ //\r
+ for (int indexOfPv = 0; indexOfPv < pv.size(); indexOfPv++) {\r
+ isAdded = false;\r
+ PpisIdentification pvId = pv.getPpis(indexOfPv);\r
+\r
+ //\r
+ // First check if produced or not\r
+ //\r
+ if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)\r
+ || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {\r
+ isProduced = true;\r
+ } else if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED)\r
+ || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {\r
+ isProduced = false;\r
+ }\r
+\r
+ //\r
+ // Get the sting "PackageName.ModuleName" \r
+ //\r
+ String tmp = pvId.getBelongModule().getPackageId().getName() + SEPERATOR + pvId.getBelongModule().getName();\r
+\r
+ //\r
+ // Check if the item has been added in\r
+ // If added, append package name and new module name\r
+ // If not added, add a new one first\r
+ //\r
+ for (int indexOfPpi = 0; indexOfPpi < ppi.size(); indexOfPpi++) {\r
+ PpiId ppiId = ppi.get(indexOfPpi);\r
+\r
+ if (pvId.getName().equals(ppiId.getName())) {\r
+ if (isProduced) {\r
+ ppi.get(indexOfPpi).setProducedModules(ppiId.getProducedModules() + "<br>" + tmp);\r
+ } else if (!isProduced) {\r
+ ppi.get(indexOfPpi).setConsumedModules(ppiId.getConsumedModules() + "<br>" + tmp);\r
+ }\r
+ isAdded = true;\r
+ continue;\r
+ }\r
+ }\r
+\r
+ //\r
+ // Add a new one\r
+ //\r
+ if (!isAdded) {\r
+ if (isProduced) {\r
+ ppi\r
+ .addElement(new PpiId(pvId.getName(), pvId.getType(), tmp, null, pvId.getDeclaredBy().getName()));\r
+ } else if (!isProduced) {\r
+ ppi\r
+ .addElement(new PpiId(pvId.getName(), pvId.getType(), null, tmp, pvId.getDeclaredBy().getName()));\r
+ }\r
+ }\r
+ }\r
+\r
+ return ppi;\r
+ }\r
+\r
+ /**\r
+ Get all protocol entries from workspace\r
+ \r
+ @return\r
+ \r
+ **/\r
+ public static ProtocolsVector getAllProtocolsVector() {\r
+ ProtocolsVector pv = new ProtocolsVector();\r
+ ModuleSurfaceArea msa = null;\r
+ ModuleIdentification mid = null;\r
+ ProtocolsIdentification pid = null;\r
+\r
+ //\r
+ // Go through each module one by one\r
+ //\r
+ if (GlobalData.openingModuleList.size() > 0) {\r
+ for (int indexOfModule = 0; indexOfModule < GlobalData.openingModuleList.size(); indexOfModule++) {\r
+ msa = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getXmlMsa();\r
+ mid = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getId();\r
+\r
+ if (msa.getProtocols() != null) {\r
+ if (msa.getProtocols().getProtocolList().size() > 0) {\r
+ for (int index = 0; index < msa.getProtocols().getProtocolList().size(); index++) {\r
+ String arg0 = msa.getProtocols().getProtocolList().get(index).getProtocolCName();\r
+ String arg1 = DataType.PROTOCOL_TYPE_PROTOCOL;\r
+ String arg2 = null;\r
+ if (msa.getProtocols().getProtocolList().get(index).getUsage() != null) {\r
+ arg2 = msa.getProtocols().getProtocolList().get(index).getUsage().toString();\r
+ }\r
+\r
+ String arg3 = msa.getProtocols().getProtocolList().get(index).getFeatureFlag();\r
+ Vector<String> arg4 = Tools.convertListToVector(msa.getProtocols().getProtocolList()\r
+ .get(index).getSupArchList());\r
+ String arg5 = msa.getProtocols().getProtocolList().get(index).getHelpText();\r
+\r
+ pid = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);\r
+ pid.setBelongModule(mid);\r
+\r
+ //\r
+ // Find which package declares it\r
+ //\r
+ for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {\r
+ PackageSurfaceArea spd = GlobalData.openingPackageList\r
+ .getOpeningPackageByIndex(\r
+ indexOfPackage)\r
+ .getXmlSpd();\r
+ PackageIdentification packageId = GlobalData.openingPackageList\r
+ .getOpeningPackageByIndex(\r
+ indexOfPackage)\r
+ .getId();\r
+ if (spd.getProtocolDeclarations() != null) {\r
+ for (int indexOfProtocols = 0; indexOfProtocols < spd.getProtocolDeclarations()\r
+ .getEntryList().size(); indexOfProtocols++) {\r
+ if (spd.getProtocolDeclarations().getEntryList().get(indexOfProtocols)\r
+ .getCName().equals(arg0)) {\r
+ pid.setDeclaredBy(packageId);\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ if (pid.getDeclaredBy() == null) {\r
+ pid.setDeclaredBy(new PackageIdentification("", "", "", ""));\r
+ }\r
+ pv.addProtocols(pid);\r
+ }\r
+ }\r
+ if (msa.getProtocols().getProtocolNotifyList().size() > 0) {\r
+ for (int index = 0; index < msa.getProtocols().getProtocolNotifyList().size(); index++) {\r
+ String arg0 = msa.getProtocols().getProtocolNotifyList().get(index)\r
+ .getProtocolNotifyCName();\r
+ String arg1 = DataType.PPI_TYPE_PPI_NOTIFY;\r
+ String arg2 = null;\r
+ if (msa.getProtocols().getProtocolNotifyList().get(index).getUsage() != null) {\r
+ arg2 = msa.getProtocols().getProtocolNotifyList().get(index).getUsage().toString();\r
+ }\r
+\r
+ String arg3 = msa.getProtocols().getProtocolNotifyList().get(index).getFeatureFlag();\r
+ Vector<String> arg4 = Tools.convertListToVector(msa.getProtocols().getProtocolNotifyList()\r
+ .get(index).getSupArchList());\r
+ String arg5 = msa.getProtocols().getProtocolNotifyList().get(index).getHelpText();\r
+\r
+ pid = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);\r
+ pid.setBelongModule(mid);\r
+\r
+ //\r
+ // Find which package declares it\r
+ //\r
+ for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {\r
+ PackageSurfaceArea spd = GlobalData.openingPackageList\r
+ .getOpeningPackageByIndex(\r
+ indexOfPackage)\r
+ .getXmlSpd();\r
+ PackageIdentification packageId = GlobalData.openingPackageList\r
+ .getOpeningPackageByIndex(\r
+ indexOfPackage)\r
+ .getId();\r
+ if (spd.getProtocolDeclarations() != null) {\r
+ for (int indexOfProtocols = 0; indexOfProtocols < spd.getProtocolDeclarations()\r
+ .getEntryList().size(); indexOfProtocols++) {\r
+ if (spd.getProtocolDeclarations().getEntryList().get(indexOfProtocols)\r
+ .getCName().equals(arg0)) {\r
+ pid.setDeclaredBy(packageId);\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ if (pid.getDeclaredBy() == null) {\r
+ pid.setDeclaredBy(new PackageIdentification("", "", "", ""));\r
+ }\r
+\r
+ pv.addProtocols(pid);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ Sort.sortProtocols(pv, DataType.SORT_TYPE_ASCENDING);\r
+ return pv;\r
+ }\r
+\r
+ /**\r
+ Re-org all protocol entries for find table\r
+ \r
+ @return\r
+ \r
+ **/\r
+ public static Vector<ProtocolId> getAllProtocolsForFind() {\r
+ Vector<ProtocolId> protocol = new Vector<ProtocolId>();\r
+ ProtocolsVector pv = Find.getAllProtocolsVector();\r
+ boolean isAdded = false;\r
+ boolean isProduced = false;\r
+\r
+ //\r
+ // Go through pv to add item as new format to ppi one by one\r
+ //\r
+ for (int indexOfPv = 0; indexOfPv < pv.size(); indexOfPv++) {\r
+ isAdded = false;\r
+ ProtocolsIdentification pvId = pv.getProtocols(indexOfPv);\r
+\r
+ //\r
+ // First check if produced or not\r
+ //\r
+ if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)\r
+ || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {\r
+ isProduced = true;\r
+ } else if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED)\r
+ || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {\r
+ isProduced = false;\r
+ }\r
+\r
+ //\r
+ // Get the sting "PackageName.ModuleName" \r
+ //\r
+ String tmp = pvId.getBelongModule().getPackageId().getName() + SEPERATOR + pvId.getBelongModule().getName();\r
+\r
+ //\r
+ // Check if the item has been added in\r
+ // If added, append package name and new module name\r
+ // If not added, add a new one first\r
+ //\r
+ for (int indexOfProtocol = 0; indexOfProtocol < protocol.size(); indexOfProtocol++) {\r
+ ProtocolId protocolId = protocol.get(indexOfProtocol);\r
+\r
+ if (pvId.getName().equals(protocolId.getName())) {\r
+ if (isProduced) {\r
+ protocol.get(indexOfProtocol)\r
+ .setProducedModules(protocolId.getProducedModules() + "<br>" + tmp);\r
+ } else if (!isProduced) {\r
+ protocol.get(indexOfProtocol)\r
+ .setConsumedModules(protocolId.getConsumedModules() + "<br>" + tmp);\r
+ }\r
+ isAdded = true;\r
+ continue;\r
+ }\r
+ }\r
+\r
+ //\r
+ // Add a new one\r
+ //\r
+ if (!isAdded) {\r
+ if (isProduced) {\r
+ protocol.addElement(new ProtocolId(pvId.getName(), pvId.getType(), tmp, null, pvId.getDeclaredBy()\r
+ .getName()));\r
+ } else if (!isProduced) {\r
+ protocol.addElement(new ProtocolId(pvId.getName(), pvId.getType(), null, tmp, pvId.getDeclaredBy()\r
+ .getName()));\r
+ }\r
+ }\r
+ }\r
+\r
+ return protocol;\r
+ }\r
+\r
+ /**\r
+ Get all protocol entries from workspace\r
+ \r
+ @return\r
+ \r
+ **/\r
+ public static GuidsVector getAllGuidsVector() {\r
+ GuidsVector gv = new GuidsVector();\r
+ ModuleSurfaceArea msa = null;\r
+ ModuleIdentification mid = null;\r
+ GuidsIdentification gid = null;\r
+\r
+ //\r
+ // Go through each module one by one\r
+ //\r
+ if (GlobalData.openingModuleList.size() > 0) {\r
+ for (int indexOfModule = 0; indexOfModule < GlobalData.openingModuleList.size(); indexOfModule++) {\r
+ msa = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getXmlMsa();\r
+ mid = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getId();\r
+\r
+ if (msa.getGuids() != null) {\r
+ if (msa.getGuids().getGuidCNamesList().size() > 0) {\r
+ for (int index = 0; index < msa.getGuids().getGuidCNamesList().size(); index++) {\r
+ String arg0 = msa.getGuids().getGuidCNamesList().get(index).getGuidCName();\r
+ String arg1 = null;\r
+ if (msa.getGuids().getGuidCNamesList().get(index).getUsage() != null) {\r
+ arg1 = msa.getGuids().getGuidCNamesList().get(index).getUsage().toString();\r
+ }\r
+\r
+ String arg2 = msa.getGuids().getGuidCNamesList().get(index).getFeatureFlag();\r
+ Vector<String> arg3 = Tools.convertListToVector(msa.getGuids().getGuidCNamesList()\r
+ .get(index).getSupArchList());\r
+ String arg4 = msa.getGuids().getGuidCNamesList().get(index).getHelpText();\r
+\r
+ gid = new GuidsIdentification(arg0, arg1, arg2, arg3, arg4);\r
+ gid.setBelongModule(mid);\r
+\r
+ //\r
+ // Find which package declares it\r
+ //\r
+ for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {\r
+ PackageSurfaceArea spd = GlobalData.openingPackageList\r
+ .getOpeningPackageByIndex(\r
+ indexOfPackage)\r
+ .getXmlSpd();\r
+ PackageIdentification packageId = GlobalData.openingPackageList\r
+ .getOpeningPackageByIndex(\r
+ indexOfPackage)\r
+ .getId();\r
+ if (spd.getGuidDeclarations() != null) {\r
+ for (int indexOfGuids = 0; indexOfGuids < spd.getGuidDeclarations().getEntryList()\r
+ .size(); indexOfGuids++) {\r
+ if (spd.getGuidDeclarations().getEntryList().get(indexOfGuids).getCName()\r
+ .equals(arg0)) {\r
+ gid.setDeclaredBy(packageId);\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ if (gid.getDeclaredBy() == null) {\r
+ gid.setDeclaredBy(new PackageIdentification("", "", "", ""));\r
+ }\r
+\r
+ gv.addGuids(gid);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ Sort.sortGuids(gv, DataType.SORT_TYPE_ASCENDING);\r
+ return gv;\r
+ }\r
+\r
+ /**\r
+ Re-org all guid entries for find table\r
+ \r
+ @return\r
+ \r
+ **/\r
+ public static Vector<GuidId> getAllGuidsForFind() {\r
+ Vector<GuidId> guid = new Vector<GuidId>();\r
+ GuidsVector gv = Find.getAllGuidsVector();\r
+ boolean isAdded = false;\r
+ boolean isProduced = false;\r
+\r
+ //\r
+ // Go through pv to add item as new format to ppi one by one\r
+ //\r
+ for (int indexOfGv = 0; indexOfGv < gv.size(); indexOfGv++) {\r
+ isAdded = false;\r
+ GuidsIdentification gvId = gv.getGuids(indexOfGv);\r
+\r
+ //\r
+ // First check if produced or not\r
+ //\r
+ if (gvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)\r
+ || gvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {\r
+ isProduced = true;\r
+ } else if (gvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED)\r
+ || gvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {\r
+ isProduced = false;\r
+ }\r
+\r
+ //\r
+ // Get the sting "PackageName.ModuleName" \r
+ //\r
+ String tmp = gvId.getBelongModule().getPackageId().getName() + SEPERATOR + gvId.getBelongModule().getName();\r
+\r
+ //\r
+ // Check if the item has been added in\r
+ // If added, append package name and new module name\r
+ // If not added, add a new one first\r
+ //\r
+ for (int indexOfGuid = 0; indexOfGuid < guid.size(); indexOfGuid++) {\r
+ GuidId guidId = guid.get(indexOfGuid);\r
+\r
+ if (gvId.getName().equals(guidId.getName())) {\r
+ if (isProduced) {\r
+ guid.get(indexOfGuid).setProducedModules(guidId.getProducedModules() + "<br>" + tmp);\r
+ } else if (!isProduced) {\r
+ guid.get(indexOfGuid).setConsumedModules(guidId.getConsumedModules() + "<br>" + tmp);\r
+ }\r
+ isAdded = true;\r
+ continue;\r
+ }\r
+ }\r
+\r
+ //\r
+ // Add a new one\r
+ //\r
+ if (!isAdded) {\r
+ if (isProduced) {\r
+ guid.addElement(new GuidId(gvId.getName(), "GUID", tmp, null, gvId.getDeclaredBy().getName()));\r
+ } else if (!isProduced) {\r
+ guid.addElement(new GuidId(gvId.getName(), "GUID", null, tmp, gvId.getDeclaredBy().getName()));\r
+ }\r
+ }\r
+ }\r
+\r
+ return guid;\r
+ }\r
+\r
+ /**\r
+ Get all pcd coded entries from workspace\r
+ \r
+ @return\r
+ \r
+ **/\r
+ public static PcdCodedVector getAllPcdCodedVector() {\r
+ PcdCodedVector pv = new PcdCodedVector();\r
+ ModuleSurfaceArea msa = null;\r
+ ModuleIdentification mid = null;\r
+ PcdCodedIdentification pid = null;\r
+\r
+ //\r
+ // Go through each module one by one\r
+ //\r
+ if (GlobalData.openingModuleList.size() > 0) {\r
+ for (int indexOfModule = 0; indexOfModule < GlobalData.openingModuleList.size(); indexOfModule++) {\r
+ msa = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getXmlMsa();\r
+ mid = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getId();\r
+\r
+ if (msa.getPcdCoded() != null) {\r
+ if (msa.getPcdCoded().getPcdEntryList().size() > 0) {\r
+ for (int index = 0; index < msa.getPcdCoded().getPcdEntryList().size(); index++) {\r
+\r
+ String arg0 = msa.getPcdCoded().getPcdEntryList().get(index).getCName();\r
+ String arg1 = msa.getPcdCoded().getPcdEntryList().get(index).getTokenSpaceGuidCName();\r
+\r
+ String arg2 = msa.getPcdCoded().getPcdEntryList().get(index).getFeatureFlag();\r
+ Vector<String> arg3 = Tools.convertListToVector(msa.getPcdCoded().getPcdEntryList()\r
+ .get(index).getSupArchList());\r
+\r
+ String arg4 = msa.getPcdCoded().getPcdEntryList().get(index).getDefaultValue();\r
+ String arg5 = msa.getPcdCoded().getPcdEntryList().get(index).getHelpText();\r
+ String arg6 = null;\r
+ if (msa.getPcdCoded().getPcdEntryList().get(index).getPcdItemType() != null) {\r
+ arg6 = msa.getPcdCoded().getPcdEntryList().get(index).getPcdItemType().toString();\r
+ }\r
+ String arg7 = null;\r
+ if (msa.getPcdCoded().getPcdEntryList().get(index).getUsage() != null) {\r
+ arg7 = msa.getPcdCoded().getPcdEntryList().get(index).getUsage().toString();\r
+ }\r
+ pid = new PcdCodedIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);\r
+ pid.setBelongModule(mid);\r
+\r
+ //\r
+ // Find which package declares it\r
+ //\r
+ for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {\r
+ PackageSurfaceArea spd = GlobalData.openingPackageList\r
+ .getOpeningPackageByIndex(\r
+ indexOfPackage)\r
+ .getXmlSpd();\r
+ PackageIdentification packageId = GlobalData.openingPackageList\r
+ .getOpeningPackageByIndex(\r
+ indexOfPackage)\r
+ .getId();\r
+ if (spd.getPcdDeclarations() != null) {\r
+ for (int indexOfPcds = 0; indexOfPcds < spd.getPcdDeclarations().getPcdEntryList()\r
+ .size(); indexOfPcds++) {\r
+ if (spd.getPcdDeclarations().getPcdEntryList().get(indexOfPcds).getCName()\r
+ .equals(arg0)) {\r
+ pid.setDeclaredBy(packageId);\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ if (pid.getDeclaredBy() == null) {\r
+ pid.setDeclaredBy(new PackageIdentification("", "", "", ""));\r
+ }\r
+\r
+ pv.addPcdCoded(pid);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ Sort.sortPcdCodeds(pv, DataType.SORT_TYPE_ASCENDING);\r
+ return pv;\r
+ }\r
+\r
+ /**\r
+ Re-org all guid entries for find table\r
+ \r
+ @return\r
+ \r
+ **/\r
+ public static Vector<PcdId> getAllPcdCodedForFind() {\r
+ Vector<PcdId> pcd = new Vector<PcdId>();\r
+ PcdCodedVector pv = Find.getAllPcdCodedVector();\r
+ boolean isAdded = false;\r
+ boolean isProduced = false;\r
+\r
+ //\r
+ // Go through pv to add item as new format to ppi one by one\r
+ //\r
+ for (int indexOfPv = 0; indexOfPv < pv.size(); indexOfPv++) {\r
+ isAdded = false;\r
+ PcdCodedIdentification pvId = pv.getPcdCoded(indexOfPv);\r
+\r
+ //\r
+ // First check if produced or not\r
+ //\r
+ if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)\r
+ || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {\r
+ isProduced = true;\r
+ } else if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED)\r
+ || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {\r
+ isProduced = false;\r
+ }\r
+\r
+ //\r
+ // Get the sting "PackageName.ModuleName" \r
+ //\r
+ String tmp = pvId.getBelongModule().getPackageId().getName() + SEPERATOR + pvId.getBelongModule().getName();\r
+\r
+ //\r
+ // Check if the item has been added in\r
+ // If added, append package name and new module name\r
+ // If not added, add a new one first\r
+ //\r
+ for (int indexOfGuid = 0; indexOfGuid < pcd.size(); indexOfGuid++) {\r
+ PcdId pcdId = pcd.get(indexOfGuid);\r
+\r
+ if (pvId.getName().equals(pcdId.getName())) {\r
+ if (isProduced) {\r
+ pcd.get(indexOfGuid).setProducedModules(pcdId.getProducedModules() + "<br>" + tmp);\r
+ } else if (!isProduced) {\r
+ pcd.get(indexOfGuid).setConsumedModules(pcdId.getConsumedModules() + "<br>" + tmp);\r
+ }\r
+ isAdded = true;\r
+ continue;\r
+ }\r
+ }\r
+\r
+ //\r
+ // Add a new one\r
+ //\r
+ if (!isAdded) {\r
+ if (isProduced) {\r
+ pcd\r
+ .addElement(new PcdId(pvId.getName(), pvId.getType(), tmp, null, pvId.getDeclaredBy().getName()));\r
+ } else if (!isProduced) {\r
+ pcd\r
+ .addElement(new PcdId(pvId.getName(), pvId.getType(), null, tmp, pvId.getDeclaredBy().getName()));\r
+ }\r
+ }\r
+ }\r
+\r
+ return pcd;\r
+ }\r
+\r
+ /**\r
+ Get all library class entries from workspace\r
+ \r
+ @return\r
+ \r
+ **/\r
+ public static LibraryClassVector getAllLibraryClassVector() {\r
+ LibraryClassVector lcv = new LibraryClassVector();\r
+ ModuleSurfaceArea msa = null;\r
+ ModuleIdentification mid = null;\r
+ LibraryClassIdentification lcid = null;\r
+\r
+ //\r
+ // Go through each module one by one\r
+ //\r
+ if (GlobalData.openingModuleList.size() > 0) {\r
+ for (int indexOfModule = 0; indexOfModule < GlobalData.openingModuleList.size(); indexOfModule++) {\r
+ msa = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getXmlMsa();\r
+ mid = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getId();\r
+\r
+ if (msa.getLibraryClassDefinitions() != null) {\r
+ LibraryClassDefinitions lcd = msa.getLibraryClassDefinitions();\r
+ if (lcd.getLibraryClassList().size() > 0) {\r
+ for (int index = 0; index < lcd.getLibraryClassList().size(); index++) {\r
+ String name = lcd.getLibraryClassList().get(index).getKeyword();\r
+ String usage = null;\r
+ if (lcd.getLibraryClassList().get(index).getUsage() != null) {\r
+ usage = lcd.getLibraryClassList().get(index).getUsage().toString();\r
+ }\r
+ String version = lcd.getLibraryClassList().get(index).getRecommendedInstanceVersion();\r
+ String guid = lcd.getLibraryClassList().get(index).getRecommendedInstanceGuid();\r
+ String featureFlag = lcd.getLibraryClassList().get(index).getFeatureFlag();\r
+ Vector<String> arch = Tools.convertListToVector(lcd.getLibraryClassList().get(index)\r
+ .getSupArchList());\r
+ Vector<String> module = Tools.convertListToVector(lcd.getLibraryClassList().get(index)\r
+ .getSupModuleList());\r
+ String help = lcd.getLibraryClassList().get(index).getHelpText();\r
+ lcid = new LibraryClassIdentification(name, usage, version, guid, arch, featureFlag,\r
+ module, help);\r
+ lcid.setBelongModule(mid);\r
+\r
+ //\r
+ // Find which package declares it\r
+ //\r
+ for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {\r
+ PackageSurfaceArea spd = GlobalData.openingPackageList\r
+ .getOpeningPackageByIndex(\r
+ indexOfPackage)\r
+ .getXmlSpd();\r
+ PackageIdentification packageId = GlobalData.openingPackageList\r
+ .getOpeningPackageByIndex(\r
+ indexOfPackage)\r
+ .getId();\r
+ if (spd.getLibraryClassDeclarations() != null) {\r
+ for (int indexOfLibraryClass = 0; indexOfLibraryClass < spd\r
+ .getLibraryClassDeclarations()\r
+ .getLibraryClassList()\r
+ .size(); indexOfLibraryClass++) {\r
+ if (spd.getLibraryClassDeclarations().getLibraryClassList().get(indexOfLibraryClass)\r
+ .getName().equals(name)) {\r
+ lcid.setDeclaredBy(packageId);\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ if (lcid.getDeclaredBy() == null) {\r
+ lcid.setDeclaredBy(new PackageIdentification("", "", "", ""));\r
+ }\r
+\r
+ lcv.addLibraryClass(lcid);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ Sort.sortLibraryClass(lcv, DataType.SORT_TYPE_ASCENDING);\r
+ return lcv;\r
+ }\r
+\r
+ /**\r
+ Re-org all guid entries for find table\r
+ \r
+ @return\r
+ \r
+ **/\r
+ public static Vector<LibraryClassId> getAllLibraryClassForFind() {\r
+ Vector<LibraryClassId> libraryClass = new Vector<LibraryClassId>();\r
+ LibraryClassVector lcv = Find.getAllLibraryClassVector();\r
+ boolean isAdded = false;\r
+ boolean isProduced = false;\r
+\r
+ //\r
+ // Go through pv to add item as new format to ppi one by one\r
+ //\r
+ for (int indexOfLcv = 0; indexOfLcv < lcv.size(); indexOfLcv++) {\r
+ isAdded = false;\r
+ LibraryClassIdentification lcvId = lcv.getLibraryClass(indexOfLcv);\r
+\r
+ //\r
+ // First check if produced or not\r
+ //\r
+ if (lcvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)\r
+ || lcvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {\r
+ isProduced = true;\r
+ } else if (lcvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED)\r
+ || lcvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {\r
+ isProduced = false;\r
+ }\r
+\r
+ //\r
+ // Get the sting "PackageName.ModuleName" \r
+ //\r
+ String tmp = lcvId.getBelongModule().getPackageId().getName() + SEPERATOR\r
+ + lcvId.getBelongModule().getName();\r
+\r
+ //\r
+ // Check if the item has been added in\r
+ // If added, append package name and new module name\r
+ // If not added, add a new one first\r
+ //\r
+ for (int indexOfGuid = 0; indexOfGuid < libraryClass.size(); indexOfGuid++) {\r
+ LibraryClassId lcId = libraryClass.get(indexOfGuid);\r
+\r
+ if (lcvId.getLibraryClassName().equals(lcId.getName())) {\r
+ if (isProduced) {\r
+ libraryClass.get(indexOfGuid).setProducedModules(lcId.getProducedModules() + "<br>" + tmp);\r
+ } else if (!isProduced) {\r
+ libraryClass.get(indexOfGuid).setConsumedModules(lcId.getConsumedModules() + "<br>" + tmp);\r
+ }\r
+ isAdded = true;\r
+ continue;\r
+ }\r
+ }\r
+\r
+ //\r
+ // Add a new one\r
+ //\r
+ if (!isAdded) {\r
+ if (isProduced) {\r
+ libraryClass.addElement(new LibraryClassId(lcvId.getLibraryClassName(), "Library Class", tmp, null,\r
+ lcvId.getDeclaredBy().getName()));\r
+ } else if (!isProduced) {\r
+ libraryClass.addElement(new LibraryClassId(lcvId.getLibraryClassName(), "Library Class", null, tmp,\r
+ lcvId.getDeclaredBy().getName()));\r
+ }\r
+ }\r
+ }\r
+\r
+ return libraryClass;\r
+ }\r
+}\r
--- /dev/null
+/** @file\r
+\r
+ The file is used to show a table with all defined PPIs\r
+\r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ **/\r
+package org.tianocore.frameworkwizard.common.find;\r
+\r
+import java.awt.Dimension;\r
+import java.awt.event.ActionEvent;\r
+import java.awt.event.ComponentEvent;\r
+import java.awt.event.WindowEvent;\r
+import java.util.Vector;\r
+\r
+import javax.swing.JButton;\r
+import javax.swing.JFrame;\r
+import javax.swing.JPanel;\r
+import javax.swing.JScrollPane;\r
+import javax.swing.JTable;\r
+import javax.swing.ListSelectionModel;\r
+import javax.swing.SwingConstants;\r
+import javax.swing.event.TableModelEvent;\r
+import javax.swing.event.TableModelListener;\r
+import javax.swing.table.DefaultTableCellRenderer;\r
+\r
+import org.tianocore.frameworkwizard.common.DataType;\r
+import org.tianocore.frameworkwizard.common.IDefaultTableModel;\r
+import org.tianocore.frameworkwizard.common.Log;\r
+import org.tianocore.frameworkwizard.common.Tools;\r
+import org.tianocore.frameworkwizard.common.ui.IFrame;\r
+\r
+public class FindResult extends IFrame implements TableModelListener {\r
+\r
+ ///\r
+ /// Define class Serial Version UID\r
+ ///\r
+ private static final long serialVersionUID = -2448484533878401714L;\r
+\r
+ //\r
+ // Define class members\r
+ //\r
+ private JTable jTable = null;\r
+\r
+ private JPanel jContentPane = null;\r
+\r
+ private JScrollPane jScrollPane = null;\r
+\r
+ private JScrollPane jScrollPaneTable = null;\r
+\r
+ private JButton jButtonClose = null;\r
+\r
+ //\r
+ // Not used by UI\r
+ //\r
+ private IDefaultTableModel model = null;\r
+\r
+ private String method = "";\r
+\r
+ private static FindResult findPpisResult = null;\r
+\r
+ private static FindResult findProtocolsResult = null;\r
+\r
+ private static FindResult findGuidsResult = null;\r
+\r
+ private static FindResult findPcdsResult = null;\r
+\r
+ private static FindResult findLibraryClassResult = null;\r
+\r
+ /**\r
+ * This is the default constructor\r
+ */\r
+ public FindResult(String method) {\r
+ super();\r
+ init(method);\r
+ }\r
+\r
+ /**\r
+ * This method initializes this\r
+ * \r
+ * @return void\r
+ */\r
+ private void init(String method) {\r
+ this.setSize(600, 500);\r
+ this.setContentPane(getJScrollPane());\r
+ this.setTitle("Find Result");\r
+ this.setResizable(true);\r
+ this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);\r
+ this.centerWindow();\r
+\r
+ //\r
+ // max the window\r
+ //\r
+ //this.setExtendedState(JFrame.MAXIMIZED_BOTH);\r
+ this.method = method;\r
+ this.showTable();\r
+ }\r
+\r
+ /**\r
+ * This method initializes jContentPane\r
+ * \r
+ * @return javax.swing.JPanel\r
+ */\r
+ private JPanel getJContentPane() {\r
+ if (jContentPane == null) {\r
+ jContentPane = new JPanel();\r
+ jContentPane.setLayout(null);\r
+ jContentPane.add(getJScrollPaneTable(), null);\r
+ jContentPane.add(getJButtonClose(), null);\r
+ jContentPane.setPreferredSize(new java.awt.Dimension(585, 445));\r
+ }\r
+ return jContentPane;\r
+ }\r
+\r
+ /**\r
+ This method initializes jScrollPane \r
+ \r
+ @return javax.swing.JScrollPane \r
+ */\r
+ private JScrollPane getJScrollPane() {\r
+ if (jScrollPane == null) {\r
+ jScrollPane = new JScrollPane();\r
+ jScrollPane.setViewportView(getJContentPane());\r
+ }\r
+ return jScrollPane;\r
+ }\r
+\r
+ /**\r
+ This method initializes jScrollPaneTable \r
+ \r
+ @return javax.swing.JScrollPane \r
+ **/\r
+ private JScrollPane getJScrollPaneTable() {\r
+ if (jScrollPaneTable == null) {\r
+ jScrollPaneTable = new JScrollPane();\r
+ jScrollPaneTable.setBounds(new java.awt.Rectangle(0, 0, 585, 395));\r
+ jScrollPaneTable.setPreferredSize(new Dimension(585, 395));\r
+ jScrollPaneTable.setViewportView(getJTable());\r
+ }\r
+ return jScrollPaneTable;\r
+ }\r
+\r
+ /**\r
+ This method initializes jTable \r
+ \r
+ @return javax.swing.JTable \r
+ **/\r
+ private JTable getJTable() {\r
+ if (jTable == null) {\r
+ model = new IDefaultTableModel();\r
+ jTable = new JTable(model);\r
+\r
+ model.addColumn("Name");\r
+ model.addColumn("Type");\r
+ model.addColumn("Produced by");\r
+ model.addColumn("Consumed by");\r
+ model.addColumn("Declared by");\r
+\r
+ jTable.getColumn("Name").setCellRenderer(new MyTableCellRenderer());\r
+ jTable.getColumn("Type").setCellRenderer(new MyTableCellRenderer());\r
+ jTable.getColumn("Produced by").setCellRenderer(new MyTableCellRenderer());\r
+ jTable.getColumn("Consumed by").setCellRenderer(new MyTableCellRenderer());\r
+ jTable.getColumn("Declared by").setCellRenderer(new MyTableCellRenderer());\r
+\r
+ jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
+ jTable.getModel().addTableModelListener(this);\r
+ }\r
+ return jTable;\r
+ }\r
+\r
+ /**\r
+ This method initializes jButtonAdd \r
+ \r
+ @return javax.swing.JButton jButtonAdd\r
+ \r
+ **/\r
+ private JButton getJButtonClose() {\r
+ if (jButtonClose == null) {\r
+ jButtonClose = new JButton();\r
+ jButtonClose.setText("Close");\r
+ jButtonClose.addActionListener(this);\r
+ jButtonClose.setBounds(new java.awt.Rectangle(255, 415, 80, 20));\r
+ jButtonClose.setPreferredSize(new java.awt.Dimension(80, 20));\r
+ }\r
+ return jButtonClose;\r
+ }\r
+\r
+ public static FindResult getInstance(String method) {\r
+ if (method.equals("PPI")) {\r
+ if (findPpisResult == null) {\r
+ findPpisResult = new FindResult(method);\r
+ }\r
+ findPpisResult.init(method);\r
+ return findPpisResult;\r
+ }\r
+\r
+ if (method.equals("PROTOCOL")) {\r
+ if (findProtocolsResult == null) {\r
+ findProtocolsResult = new FindResult(method);\r
+ }\r
+ findProtocolsResult.init(method);\r
+ return findProtocolsResult;\r
+ }\r
+\r
+ if (method.equals("GUID")) {\r
+ if (findGuidsResult == null) {\r
+ findGuidsResult = new FindResult(method);\r
+ }\r
+ findGuidsResult.init(method);\r
+ return findGuidsResult;\r
+ }\r
+\r
+ if (method.equals("PCD")) {\r
+ if (findPcdsResult == null) {\r
+ findPcdsResult = new FindResult(method);\r
+ }\r
+ findPcdsResult.init(method);\r
+ return findPcdsResult;\r
+ }\r
+\r
+ if (method.equals("LIBRARY_CLASS")) {\r
+ if (findLibraryClassResult == null) {\r
+ findLibraryClassResult = new FindResult(method);\r
+ }\r
+ findLibraryClassResult.init(method);\r
+ return findLibraryClassResult;\r
+ }\r
+\r
+ return null;\r
+ }\r
+\r
+ /**\r
+ Clear all table rows\r
+ \r
+ **/\r
+ private void clearAll() {\r
+ if (model != null) {\r
+ for (int index = model.getRowCount() - 1; index >= 0; index--) {\r
+ model.removeRow(index);\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ Read content of vector and put then into table\r
+ \r
+ **/\r
+ private void showTable() {\r
+ clearAll();\r
+\r
+ if (this.method.equals("PPI")) {\r
+ Vector<PpiId> vPpi = Find.getAllPpisForFind();\r
+\r
+ if (vPpi.size() > 0) {\r
+\r
+ for (int index = 0; index < vPpi.size(); index++) {\r
+ Vector<String> v = new Vector<String>();\r
+ v.addElement(vPpi.elementAt(index).getName());\r
+ v.addElement(vPpi.elementAt(index).getType());\r
+ String strProducedModules = vPpi.elementAt(index).getProducedModules();\r
+ if (strProducedModules.indexOf("<br>") == 0) {\r
+ strProducedModules = strProducedModules.substring("<br>".length());\r
+ }\r
+ int line1 = Tools.getSpecificStringCount(strProducedModules, "<br>");\r
+ v.addElement("<html>" + strProducedModules + "</html>");\r
+\r
+ String strConsumedModules = vPpi.elementAt(index).getConsumedModules();\r
+ if (strConsumedModules.indexOf("<br>") == 0) {\r
+ strConsumedModules = strConsumedModules.substring("<br>".length());\r
+ }\r
+ int line2 = Tools.getSpecificStringCount(strConsumedModules, "<br>");\r
+ v.addElement("<html>" + strConsumedModules + "</html>");\r
+\r
+ v.addElement(vPpi.elementAt(index).getDeclaredBy());\r
+\r
+ model.addRow(v);\r
+ jTable.setRowHeight(index, (Math.max(line1, line2) > 1 ? Math.max(line1, line2) : 1) * 18);\r
+ }\r
+ } else {\r
+ Log.wrn("Find PPIs", "No PPI found!!!");\r
+ }\r
+ }\r
+\r
+ if (this.method.equals("PROTOCOL")) {\r
+ Vector<ProtocolId> vProtocol = Find.getAllProtocolsForFind();\r
+\r
+ if (vProtocol.size() > 0) {\r
+\r
+ for (int index = 0; index < vProtocol.size(); index++) {\r
+ Vector<String> v = new Vector<String>();\r
+ v.addElement(vProtocol.elementAt(index).getName());\r
+ v.addElement(vProtocol.elementAt(index).getType());\r
+ String strProducedModules = vProtocol.elementAt(index).getProducedModules();\r
+ if (strProducedModules.indexOf("<br>") == 0) {\r
+ strProducedModules = strProducedModules.substring("<br>".length());\r
+ }\r
+ int line1 = Tools.getSpecificStringCount(strProducedModules, "<br>");\r
+ v.addElement("<html>" + strProducedModules + "</html>");\r
+\r
+ String strConsumedModules = vProtocol.elementAt(index).getConsumedModules();\r
+ if (strConsumedModules.indexOf("<br>") == 0) {\r
+ strConsumedModules = strConsumedModules.substring("<br>".length());\r
+ }\r
+ int line2 = Tools.getSpecificStringCount(strConsumedModules, "<br>");\r
+ v.addElement("<html>" + strConsumedModules + "</html>");\r
+\r
+ v.addElement(vProtocol.elementAt(index).getDeclaredBy());\r
+\r
+ model.addRow(v);\r
+ jTable.setRowHeight(index, (Math.max(line1, line2) > 1 ? Math.max(line1, line2) : 1) * 18);\r
+ }\r
+ } else {\r
+ Log.wrn("Find PROTOCOLs", "No PROTOCOL found!!!");\r
+ }\r
+ }\r
+\r
+ if (this.method.equals("GUID")) {\r
+ Vector<GuidId> vGuid = Find.getAllGuidsForFind();\r
+\r
+ if (vGuid.size() > 0) {\r
+\r
+ for (int index = 0; index < vGuid.size(); index++) {\r
+ Vector<String> v = new Vector<String>();\r
+ v.addElement(vGuid.elementAt(index).getName());\r
+ v.addElement("GUID");\r
+ String strProducedModules = vGuid.elementAt(index).getProducedModules();\r
+ if (strProducedModules.indexOf("<br>") == 0) {\r
+ strProducedModules = strProducedModules.substring("<br>".length());\r
+ }\r
+ int line1 = Tools.getSpecificStringCount(strProducedModules, "<br>");\r
+ v.addElement("<html>" + strProducedModules + "</html>");\r
+\r
+ String strConsumedModules = vGuid.elementAt(index).getConsumedModules();\r
+ if (strConsumedModules.indexOf("<br>") == 0) {\r
+ strConsumedModules = strConsumedModules.substring("<br>".length());\r
+ }\r
+ int line2 = Tools.getSpecificStringCount(strConsumedModules, "<br>");\r
+ v.addElement("<html>" + strConsumedModules + "</html>");\r
+\r
+ v.addElement(vGuid.elementAt(index).getDeclaredBy());\r
+\r
+ model.addRow(v);\r
+ jTable.setRowHeight(index, (Math.max(line1, line2) > 1 ? Math.max(line1, line2) : 1) * 18);\r
+ }\r
+ } else {\r
+ Log.wrn("Find GUIDs", "No GUID found!!!");\r
+ }\r
+ }\r
+\r
+ if (this.method.equals("PCD")) {\r
+ Vector<PcdId> vPcd = Find.getAllPcdCodedForFind();\r
+\r
+ if (vPcd.size() > 0) {\r
+\r
+ for (int index = 0; index < vPcd.size(); index++) {\r
+ Vector<String> v = new Vector<String>();\r
+ v.addElement(vPcd.elementAt(index).getName());\r
+ v.addElement(vPcd.elementAt(index).getType());\r
+ String strProducedModules = vPcd.elementAt(index).getProducedModules();\r
+ if (strProducedModules.indexOf("<br>") == 0) {\r
+ strProducedModules = strProducedModules.substring("<br>".length());\r
+ }\r
+ int line1 = Tools.getSpecificStringCount(strProducedModules, "<br>");\r
+ v.addElement("<html>" + strProducedModules + "</html>");\r
+\r
+ String strConsumedModules = vPcd.elementAt(index).getConsumedModules();\r
+ if (strConsumedModules.indexOf("<br>") == 0) {\r
+ strConsumedModules = strConsumedModules.substring("<br>".length());\r
+ }\r
+ int line2 = Tools.getSpecificStringCount(strConsumedModules, "<br>");\r
+ v.addElement("<html>" + strConsumedModules + "</html>");\r
+\r
+ v.addElement(vPcd.elementAt(index).getDeclaredBy());\r
+\r
+ model.addRow(v);\r
+ jTable.setRowHeight(index, (Math.max(line1, line2) > 1 ? Math.max(line1, line2) : 1) * 18);\r
+ }\r
+ } else {\r
+ Log.wrn("Find PCDs", "No PCD found!!!");\r
+ }\r
+ }\r
+\r
+ if (this.method.equals("LIBRARY_CLASS")) {\r
+ Vector<LibraryClassId> vLibraryClass = Find.getAllLibraryClassForFind();\r
+\r
+ if (vLibraryClass.size() > 0) {\r
+\r
+ for (int index = 0; index < vLibraryClass.size(); index++) {\r
+ Vector<String> v = new Vector<String>();\r
+ v.addElement(vLibraryClass.elementAt(index).getName());\r
+ v.addElement(vLibraryClass.elementAt(index).getType());\r
+ String strProducedModules = vLibraryClass.elementAt(index).getProducedModules();\r
+ if (strProducedModules.indexOf("<br>") == 0) {\r
+ strProducedModules = strProducedModules.substring("<br>".length());\r
+ }\r
+ int line1 = Tools.getSpecificStringCount(strProducedModules, "<br>");\r
+ v.addElement("<html>" + strProducedModules + "</html>");\r
+\r
+ String strConsumedModules = vLibraryClass.elementAt(index).getConsumedModules();\r
+ if (strConsumedModules.indexOf("<br>") == 0) {\r
+ strConsumedModules = strConsumedModules.substring("<br>".length());\r
+ }\r
+ int line2 = Tools.getSpecificStringCount(strConsumedModules, "<br>");\r
+ v.addElement("<html>" + strConsumedModules + "</html>");\r
+\r
+ v.addElement(vLibraryClass.elementAt(index).getDeclaredBy());\r
+\r
+ model.addRow(v);\r
+ jTable.setRowHeight(index, (Math.max(line1, line2) > 1 ? Math.max(line1, line2) : 1) * 18);\r
+ }\r
+ } else {\r
+ Log.wrn("Find Library Classes", "No Library Class found!!!");\r
+ }\r
+ }\r
+\r
+ this.jTable.repaint();\r
+ this.jTable.updateUI();\r
+ }\r
+\r
+ public void tableChanged(TableModelEvent arg0) {\r
+ // TODO Auto-generated method stub\r
+\r
+ }\r
+\r
+ public void actionPerformed(ActionEvent arg0) {\r
+ if (arg0.getSource() == this.jButtonClose) {\r
+\r
+ this.dispose();\r
+ }\r
+ }\r
+\r
+ /* (non-Javadoc)\r
+ * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)\r
+ * \r
+ * Override componentResized to resize all components when frame's size is changed\r
+ */\r
+ public void componentResized(ComponentEvent arg0) {\r
+ int intCurrentWidth = this.getJContentPane().getWidth();\r
+ int intCurrentHeight = this.getJContentPane().getHeight();\r
+ int intPreferredWidth = this.getJContentPane().getPreferredSize().width;\r
+ int intPreferredHeight = this.getJContentPane().getPreferredSize().height;\r
+\r
+ Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,\r
+ intPreferredHeight);\r
+ Tools.centerComponent(this.jButtonClose, intCurrentWidth, intCurrentHeight, intPreferredHeight,\r
+ DataType.SPACE_TO_BOTTOM_FOR_CLOSE_BUTTON);\r
+ }\r
+\r
+ /* (non-Javadoc)\r
+ * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)\r
+ *\r
+ * Override windowClosing to popup warning message to confirm quit\r
+ * \r
+ */\r
+ public void windowClosing(WindowEvent arg0) {\r
+ this.dispose();\r
+ }\r
+\r
+ class MyTableCellRenderer extends DefaultTableCellRenderer {\r
+ ///\r
+ ///\r
+ ///\r
+ private static final long serialVersionUID = -2082787479305255946L;\r
+\r
+ public void setValue(Object value) {\r
+ this.setVerticalAlignment(SwingConstants.TOP);\r
+ super.setValue(value);\r
+ }\r
+ }\r
+\r
+}\r
--- /dev/null
+/** @file\r
+\r
+ The file is used to define GUID Identification used by find function\r
+\r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ **/\r
+package org.tianocore.frameworkwizard.common.find;\r
+\r
+public class GuidId {\r
+\r
+ private String name = null;\r
+\r
+ private String type = null;\r
+\r
+ private String producedModules = null;\r
+\r
+ private String consumedModules = null;\r
+ \r
+ private String declaredBy = null;\r
+\r
+ public GuidId(String arg0, String arg1, String arg2, String arg3, String arg4) {\r
+ this.name = (arg0 == null ? "" : arg0);\r
+ this.type = (arg1 == null ? "" : arg1);\r
+ this.producedModules = (arg2 == null ? "" : arg2);\r
+ this.consumedModules = (arg3 == null ? "" : arg3);\r
+ this.declaredBy = (arg4 == null ? "" : arg4);\r
+ }\r
+\r
+ public String getConsumedModules() {\r
+ return consumedModules;\r
+ }\r
+\r
+ public void setConsumedModules(String consumedModules) {\r
+ this.consumedModules = consumedModules;\r
+ }\r
+\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ public void setName(String name) {\r
+ this.name = name;\r
+ }\r
+\r
+ public String getProducedModules() {\r
+ return producedModules;\r
+ }\r
+\r
+ public void setProducedModules(String producedModules) {\r
+ this.producedModules = producedModules;\r
+ }\r
+\r
+ public String getType() {\r
+ return type;\r
+ }\r
+\r
+ public void setType(String type) {\r
+ this.type = type;\r
+ }\r
+\r
+ public String getDeclaredBy() {\r
+ return declaredBy;\r
+ }\r
+\r
+ public void setDeclaredBy(String declaredBy) {\r
+ this.declaredBy = declaredBy;\r
+ }\r
+}\r
--- /dev/null
+/** @file\r
+\r
+ The file is used to define Library Class Identification used by find function\r
+\r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ **/\r
+package org.tianocore.frameworkwizard.common.find;\r
+\r
+public class LibraryClassId {\r
+\r
+ private String name = null;\r
+\r
+ private String type = null;\r
+\r
+ private String producedModules = null;\r
+\r
+ private String consumedModules = null;\r
+ \r
+ private String declaredBy = null;\r
+\r
+ public LibraryClassId(String arg0, String arg1, String arg2, String arg3, String arg4) {\r
+ this.name = (arg0 == null ? "" : arg0);\r
+ this.type = (arg1 == null ? "" : arg1);\r
+ this.producedModules = (arg2 == null ? "" : arg2);\r
+ this.consumedModules = (arg3 == null ? "" : arg3);\r
+ this.declaredBy = (arg4 == null ? "" : arg4);\r
+ }\r
+\r
+ public String getConsumedModules() {\r
+ return consumedModules;\r
+ }\r
+\r
+ public void setConsumedModules(String consumedModules) {\r
+ this.consumedModules = consumedModules;\r
+ }\r
+\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ public void setName(String name) {\r
+ this.name = name;\r
+ }\r
+\r
+ public String getProducedModules() {\r
+ return producedModules;\r
+ }\r
+\r
+ public void setProducedModules(String producedModules) {\r
+ this.producedModules = producedModules;\r
+ }\r
+\r
+ public String getType() {\r
+ return type;\r
+ }\r
+\r
+ public void setType(String type) {\r
+ this.type = type;\r
+ }\r
+\r
+ public String getDeclaredBy() {\r
+ return declaredBy;\r
+ }\r
+\r
+ public void setDeclaredBy(String declaredBy) {\r
+ this.declaredBy = declaredBy;\r
+ }\r
+}\r
--- /dev/null
+/** @file\r
+\r
+ The file is used to define GUID Identification used by find function\r
+\r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ **/\r
+package org.tianocore.frameworkwizard.common.find;\r
+\r
+public class PcdId {\r
+\r
+ private String name = null;\r
+\r
+ private String type = null;\r
+\r
+ private String producedModules = null;\r
+\r
+ private String consumedModules = null;\r
+ \r
+ private String declaredBy = null;\r
+\r
+ public PcdId(String arg0, String arg1, String arg2, String arg3, String arg4) {\r
+ this.name = (arg0 == null ? "" : arg0);\r
+ this.type = (arg1 == null ? "" : arg1);\r
+ this.producedModules = (arg2 == null ? "" : arg2);\r
+ this.consumedModules = (arg3 == null ? "" : arg3);\r
+ this.declaredBy = (arg4 == null ? "" : arg4);\r
+ }\r
+\r
+ public String getConsumedModules() {\r
+ return consumedModules;\r
+ }\r
+\r
+ public void setConsumedModules(String consumedModules) {\r
+ this.consumedModules = consumedModules;\r
+ }\r
+\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ public void setName(String name) {\r
+ this.name = name;\r
+ }\r
+\r
+ public String getProducedModules() {\r
+ return producedModules;\r
+ }\r
+\r
+ public void setProducedModules(String producedModules) {\r
+ this.producedModules = producedModules;\r
+ }\r
+\r
+ public String getType() {\r
+ return type;\r
+ }\r
+\r
+ public void setType(String type) {\r
+ this.type = type;\r
+ }\r
+\r
+ public String getDeclaredBy() {\r
+ return declaredBy;\r
+ }\r
+\r
+ public void setDeclaredBy(String declaredBy) {\r
+ this.declaredBy = declaredBy;\r
+ }\r
+}\r
--- /dev/null
+/** @file\r
+\r
+ The file is used to define PPI Identification used by find function\r
+\r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ **/\r
+package org.tianocore.frameworkwizard.common.find;\r
+\r
+public class PpiId {\r
+\r
+ private String name = null;\r
+\r
+ private String type = null;\r
+\r
+ private String producedModules = null;\r
+\r
+ private String consumedModules = null;\r
+ \r
+ private String declaredBy = null;\r
+\r
+ public PpiId(String arg0, String arg1, String arg2, String arg3, String arg4) {\r
+ this.name = (arg0 == null ? "" : arg0);\r
+ this.type = (arg1 == null ? "" : arg1);\r
+ this.producedModules = (arg2 == null ? "" : arg2);\r
+ this.consumedModules = (arg3 == null ? "" : arg3);\r
+ this.declaredBy = (arg4 == null ? "" : arg4);\r
+ }\r
+\r
+ public String getConsumedModules() {\r
+ return consumedModules;\r
+ }\r
+\r
+ public void setConsumedModules(String consumedModules) {\r
+ this.consumedModules = consumedModules;\r
+ }\r
+\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ public void setName(String name) {\r
+ this.name = name;\r
+ }\r
+\r
+ public String getProducedModules() {\r
+ return producedModules;\r
+ }\r
+\r
+ public void setProducedModules(String producedModules) {\r
+ this.producedModules = producedModules;\r
+ }\r
+\r
+ public String getType() {\r
+ return type;\r
+ }\r
+\r
+ public void setType(String type) {\r
+ this.type = type;\r
+ }\r
+\r
+ public String getDeclaredBy() {\r
+ return declaredBy;\r
+ }\r
+\r
+ public void setDeclaredBy(String declaredBy) {\r
+ this.declaredBy = declaredBy;\r
+ }\r
+}\r
--- /dev/null
+/** @file\r
+\r
+ The file is used to define PROTOCOL Identification used by find function\r
+\r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+ **/\r
+package org.tianocore.frameworkwizard.common.find;\r
+\r
+public class ProtocolId {\r
+\r
+ private String name = null;\r
+\r
+ private String type = null;\r
+\r
+ private String producedModules = null;\r
+\r
+ private String consumedModules = null;\r
+ \r
+ private String declaredBy = null;\r
+\r
+ public ProtocolId(String arg0, String arg1, String arg2, String arg3, String arg4) {\r
+ this.name = (arg0 == null ? "" : arg0);\r
+ this.type = (arg1 == null ? "" : arg1);\r
+ this.producedModules = (arg2 == null ? "" : arg2);\r
+ this.consumedModules = (arg3 == null ? "" : arg3);\r
+ this.declaredBy = (arg4 == null ? "" : arg4);\r
+ }\r
+\r
+ public String getConsumedModules() {\r
+ return consumedModules;\r
+ }\r
+\r
+ public void setConsumedModules(String consumedModules) {\r
+ this.consumedModules = consumedModules;\r
+ }\r
+\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ public void setName(String name) {\r
+ this.name = name;\r
+ }\r
+\r
+ public String getProducedModules() {\r
+ return producedModules;\r
+ }\r
+\r
+ public void setProducedModules(String producedModules) {\r
+ this.producedModules = producedModules;\r
+ }\r
+\r
+ public String getType() {\r
+ return type;\r
+ }\r
+\r
+ public void setType(String type) {\r
+ this.type = type;\r
+ }\r
+\r
+ public String getDeclaredBy() {\r
+ return declaredBy;\r
+ }\r
+\r
+ public void setDeclaredBy(String declaredBy) {\r
+ this.declaredBy = declaredBy;\r
+ }\r
+}\r
\r
import java.util.Vector;\r
\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
+\r
public class GuidsIdentification {\r
\r
//\r
private String featureFlag = null;\r
\r
private String help = null;\r
+ \r
+ private ModuleIdentification belongModule = null;\r
+ \r
+ private PackageIdentification declaredBy = null;\r
\r
public GuidsIdentification(String arg0, String arg1, String arg2, Vector<String> arg3, String arg4) {\r
this.name = (arg0 == null ? "" : arg0);\r
public void setHelp(String help) {\r
this.help = help;\r
}\r
+ \r
+ public ModuleIdentification getBelongModule() {\r
+ return belongModule;\r
+ }\r
+\r
+ public void setBelongModule(ModuleIdentification belongModule) {\r
+ this.belongModule = belongModule;\r
+ }\r
+\r
+ public PackageIdentification getDeclaredBy() {\r
+ return declaredBy;\r
+ }\r
+\r
+ public void setDeclaredBy(PackageIdentification declaredBy) {\r
+ this.declaredBy = declaredBy;\r
+ }\r
}\r
\r
import java.util.Vector;\r
\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
+\r
public class LibraryClassIdentification {\r
private String libraryClassName = null;\r
\r
private Vector<String> supModuleList = null;\r
\r
private String help = null;\r
+ \r
+ private ModuleIdentification belongModule = null;\r
+ \r
+ private PackageIdentification declaredBy = null;\r
\r
public LibraryClassIdentification() {\r
\r
public void setHelp(String help) {\r
this.help = help;\r
}\r
+\r
+ public ModuleIdentification getBelongModule() {\r
+ return belongModule;\r
+ }\r
+\r
+ public void setBelongModule(ModuleIdentification belongModule) {\r
+ this.belongModule = belongModule;\r
+ }\r
+\r
+ public PackageIdentification getDeclaredBy() {\r
+ return declaredBy;\r
+ }\r
+\r
+ public void setDeclaredBy(PackageIdentification declaredBy) {\r
+ this.declaredBy = declaredBy;\r
+ }\r
}\r
\r
import java.util.Vector;\r
\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
+\r
public class PcdCodedIdentification {\r
\r
//\r
private String type = null;\r
\r
private String usage = null;\r
+ \r
+ private ModuleIdentification belongModule = null;\r
+ \r
+ private PackageIdentification declaredBy = null;\r
\r
public PcdCodedIdentification(String arg0, String arg1, String arg2, Vector<String> arg3, String arg4, String arg5, String arg6, String arg7) {\r
this.name = (arg0 == null ? "" : arg0);\r
public void setUsage(String usage) {\r
this.usage = usage;\r
}\r
+ \r
+ public ModuleIdentification getBelongModule() {\r
+ return belongModule;\r
+ }\r
+\r
+ public void setBelongModule(ModuleIdentification belongModule) {\r
+ this.belongModule = belongModule;\r
+ }\r
+\r
+ public PackageIdentification getDeclaredBy() {\r
+ return declaredBy;\r
+ }\r
+\r
+ public void setDeclaredBy(PackageIdentification declaredBy) {\r
+ this.declaredBy = declaredBy;\r
+ }\r
}\r
\r
import java.util.Vector;\r
\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
+\r
public class PpisIdentification {\r
\r
//\r
private String featureFlag = null;\r
\r
private String help = null;\r
+ \r
+ private ModuleIdentification belongModule = null;\r
+ \r
+ private PackageIdentification declaredBy = null;\r
\r
public PpisIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5) {\r
this.name = (arg0 == null ? "" : arg0);\r
public void setHelp(String help) {\r
this.help = help;\r
}\r
+\r
+ public ModuleIdentification getBelongModule() {\r
+ return belongModule;\r
+ }\r
+\r
+ public void setBelongModule(ModuleIdentification belongModule) {\r
+ this.belongModule = belongModule;\r
+ }\r
+\r
+ public PackageIdentification getDeclaredBy() {\r
+ return declaredBy;\r
+ }\r
+\r
+ public void setDeclaredBy(PackageIdentification declaredBy) {\r
+ this.declaredBy = declaredBy;\r
+ }\r
}\r
v.addElement(getPpis(index).getUsage());\r
return v;\r
}\r
-\r
}\r
\r
import java.util.Vector;\r
\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
+\r
public class ProtocolsIdentification {\r
\r
//\r
private String featureFlag = null;\r
\r
private String help = null;\r
+ \r
+ private ModuleIdentification belongModule = null;\r
+ \r
+ private PackageIdentification declaredBy = null;\r
\r
public ProtocolsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5) {\r
this.name = (arg0 == null ? "" : arg0);\r
public void setHelp(String help) {\r
this.help = help;\r
}\r
+ \r
+ public ModuleIdentification getBelongModule() {\r
+ return belongModule;\r
+ }\r
+\r
+ public void setBelongModule(ModuleIdentification belongModule) {\r
+ this.belongModule = belongModule;\r
+ }\r
+ \r
+ public PackageIdentification getDeclaredBy() {\r
+ return declaredBy;\r
+ }\r
+\r
+ public void setDeclaredBy(PackageIdentification declaredBy) {\r
+ this.declaredBy = declaredBy;\r
+ }\r
}\r