]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Provide "Find" function for Ppi/Protocol/Guid/Pcd/LibraryClass.
authorhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 24 Aug 2006 20:58:25 +0000 (20:58 +0000)
committerhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 24 Aug 2006 20:58:25 +0000 (20:58 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1382 6f19259b-4bc3-4df7-8a09-765794883524

18 files changed:
Tools/Source/FrameworkWizard/FrameworkWizard.msa
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Sort.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/Find.java [new file with mode: 0644]
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResult.java [new file with mode: 0644]
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/GuidId.java [new file with mode: 0644]
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/LibraryClassId.java [new file with mode: 0644]
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdId.java [new file with mode: 0644]
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PpiId.java [new file with mode: 0644]
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/ProtocolId.java [new file with mode: 0644]
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsIdentification.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassIdentification.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedIdentification.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisIdentification.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisVector.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsIdentification.java

index 1d764e8b3620c4fb99ca39f0dfe4cf085afa440e..35b54851fc8c9d9ff571de7d5265811c39ee951d 100644 (file)
@@ -59,6 +59,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <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
index d72a00591ac6d065d6f14f41f4c3fcc65f1ae96d..decd2e5a37f134ccec8cd35d659e62ec5e0d738b 100644 (file)
@@ -54,7 +54,7 @@ import org.tianocore.frameworkwizard.common.Identifications.Identification;
 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
@@ -241,9 +241,9 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
 \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
@@ -482,7 +482,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
             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
@@ -751,7 +751,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
             jMenuTools.add(getJMenuItemToolsClone());\r
             jMenuTools.add(getJMenuItemToolsCodeScan());\r
             jMenuTools.addSeparator();\r
-            \r
+\r
             jMenuTools.add(getJMenuItemToolsToolChainConfiguration());\r
             jMenuTools.add(getJMenuItemToolsBuildPreferences());\r
         }\r
@@ -1630,8 +1630,6 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
             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
@@ -1724,6 +1722,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
             jMenuItemEditFindLibraryInstance.setText("All Library Instances");\r
             jMenuItemEditFindLibraryInstance.setMnemonic('n');\r
             jMenuItemEditFindLibraryInstance.addActionListener(this);\r
+            jMenuItemEditFindLibraryInstance.setVisible(false);\r
         }\r
         return jMenuItemEditFindLibraryInstance;\r
     }\r
@@ -1848,9 +1847,29 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
         }\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
@@ -1967,8 +1986,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
         //\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
@@ -2416,7 +2434,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
         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
@@ -3073,10 +3092,55 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
      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
@@ -3175,9 +3239,10 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
     }\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
index 80af3239b387bafdf290c57e8be754528c381c16..dcf35617e6f2e1f209d9967f7f605e0d2b0ff778 100644 (file)
@@ -248,4 +248,31 @@ public class DataType {
     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
index 88fe64e4d93cf2853a5cd75a14e9203a0136ddd3..65a345ab5b515d7ecc3b72d55b0f6dc771e3591d 100644 (file)
@@ -18,8 +18,18 @@ package org.tianocore.frameworkwizard.common;
 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
@@ -212,6 +222,135 @@ public class Sort {
         }\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
index 7a98afdb7bddb45a98bdf216a995f3b2876368d4..4b32baa7ef8247917c23d05490ef3fbedb86befb 100644 (file)
@@ -389,7 +389,7 @@ public class Tools {
 \r
         return strReturn;\r
     }\r
-    \r
+\r
     public static String convertUnicodeHexStringToString(String str) {\r
         //\r
         // Handle if str is null or empty\r
@@ -415,8 +415,8 @@ public class Tools {
             // 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
@@ -468,7 +468,7 @@ public class Tools {
         //\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
@@ -495,7 +495,7 @@ public class Tools {
         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
@@ -537,7 +537,7 @@ public class Tools {
      * \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
@@ -589,32 +589,47 @@ public class Tools {
      * \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
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 (file)
index 0000000..b833ba6
--- /dev/null
@@ -0,0 +1,877 @@
+/** @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
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 (file)
index 0000000..0033797
--- /dev/null
@@ -0,0 +1,478 @@
+/** @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
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 (file)
index 0000000..2533108
--- /dev/null
@@ -0,0 +1,76 @@
+/** @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
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 (file)
index 0000000..a31cb38
--- /dev/null
@@ -0,0 +1,76 @@
+/** @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
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 (file)
index 0000000..4982109
--- /dev/null
@@ -0,0 +1,76 @@
+/** @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
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 (file)
index 0000000..d4782c4
--- /dev/null
@@ -0,0 +1,76 @@
+/** @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
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 (file)
index 0000000..69bcbec
--- /dev/null
@@ -0,0 +1,76 @@
+/** @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
index d167e06fe5fddff9b9bea05131fcf85879d8f543..4affae979754e77728e8eb646acb3853d30953ca 100644 (file)
@@ -17,6 +17,9 @@ package org.tianocore.frameworkwizard.module.Identifications.Guids;
 \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
@@ -31,6 +34,10 @@ public class GuidsIdentification {
     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
@@ -86,4 +93,20 @@ public class GuidsIdentification {
     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
index b5d7ead044919415cce217aa7947390fafe7e135..d47fa74208992d8582f9a2dcef2960701691a6e2 100644 (file)
@@ -17,6 +17,9 @@ package org.tianocore.frameworkwizard.module.Identifications.LibraryClass;
 \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
@@ -33,6 +36,10 @@ public class LibraryClassIdentification {
     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
@@ -121,4 +128,20 @@ public class LibraryClassIdentification {
     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
index 02ae08d4d7ae5ccee3b06d40c2989f2e793a7e6f..cf4b5bb16fd9e1ebd65c191827b8a9519e8a7de9 100644 (file)
@@ -17,6 +17,9 @@ package org.tianocore.frameworkwizard.module.Identifications.PcdCoded;
 \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
@@ -37,6 +40,10 @@ public class PcdCodedIdentification {
     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
@@ -119,4 +126,20 @@ public class PcdCodedIdentification {
     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
index 8d0198ea49acd425afdc23977861e20d407dbd99..a871f628db245583a640cbb79b836cc62afd9dd4 100644 (file)
@@ -17,6 +17,9 @@ package org.tianocore.frameworkwizard.module.Identifications.Ppis;
 \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
@@ -33,6 +36,10 @@ public class PpisIdentification {
     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
@@ -97,4 +104,20 @@ public class PpisIdentification {
     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
index deaa71dd09566681cb6582e0638aa025148a3c31..685c6d1b6e15673bc942e91519ee72b73575ef78 100644 (file)
@@ -17,6 +17,9 @@ package org.tianocore.frameworkwizard.module.Identifications.Protocols;
 \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
@@ -33,6 +36,10 @@ public class ProtocolsIdentification {
     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
@@ -97,4 +104,20 @@ public class ProtocolsIdentification {
     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