Provide UI for generating Apriori file of PEI or DXE phase. The module order informat...
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 8 Nov 2006 02:59:31 +0000 (02:59 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 8 Nov 2006 02:59:31 +0000 (02:59 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1912 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFlash.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/GenAprioriFileDialog.java [new file with mode: 0644]

index 82a3ded696cd50b1471073e2fc5f6cca528b5b1d..fdf5fb55e77f2dff6f78ae3638588040ad104541 100644 (file)
@@ -1800,15 +1800,15 @@ public class FpdFileContents {
         return fpdBuildOpts;\r
     }\r
     \r
-    public void genBuildOptionsUserExtensions(String fvName, String outputFileName, Vector<String[]> includeModules) {\r
+    public void genBuildOptionsUserExtensions(String fvName, String userId, String id, String outputFileName, Vector<String[]> includeModules) {\r
         QName elementFvName = new QName (xmlNs, "FvName");\r
         QName elementIncludeModules = new QName(xmlNs, "IncludeModules");\r
         QName elementInfFileName = new QName(xmlNs, "InfFileName");\r
         QName elementModule = new QName(xmlNs, "Module");\r
         \r
         UserExtensionsDocument.UserExtensions userExts = getfpdBuildOpts().addNewUserExtensions();\r
-        userExts.setUserID("IMAGES");\r
-        userExts.setIdentifier(new BigInteger("1"));\r
+        userExts.setUserID(userId);\r
+        userExts.setIdentifier(new BigInteger(id));\r
         XmlCursor cursor = userExts.newCursor();\r
         cursor.toEndToken();\r
         \r
@@ -1817,7 +1817,7 @@ public class FpdFileContents {
         cursor.toNextToken();\r
         \r
         cursor.beginElement(elementInfFileName);\r
-        cursor.insertChars(fvName + ".inf");\r
+        cursor.insertChars(outputFileName);\r
         cursor.toNextToken();\r
         \r
         cursor.beginElement(elementIncludeModules);\r
@@ -1839,15 +1839,19 @@ public class FpdFileContents {
         cursor.dispose();\r
     }\r
     \r
-    public int getUserExtsIncModCount (String fvName) {\r
+    public int getUserExtsIncModCount (String fvName, String userId, int id) {\r
         if (getfpdBuildOpts().getUserExtensionsList() == null) {\r
             return -1;\r
         }\r
+\r
         ListIterator<UserExtensionsDocument.UserExtensions> li = getfpdBuildOpts().getUserExtensionsList().listIterator();\r
         QName elementIncludeModules = new QName(xmlNs, "IncludeModules");\r
         while (li.hasNext()) {\r
             UserExtensionsDocument.UserExtensions ues = li.next();\r
-            if (!ues.getUserID().equals("IMAGES")) {\r
+            if (!ues.getUserID().equals(userId)) {\r
+                continue;\r
+            }\r
+            if (ues.getIdentifier() == null || ues.getIdentifier().intValue() != id) {\r
                 continue;\r
             }\r
             XmlCursor cursor = ues.newCursor();\r
@@ -1869,14 +1873,15 @@ public class FpdFileContents {
         return -1;\r
     }\r
     \r
-    public void getUserExtsIncMods(String fvName, String[][] saa) {\r
+    public void getUserExtsIncMods(String fvName, String userId, int id, String[][] saa) {\r
         if (getfpdBuildOpts().getUserExtensionsList() == null) {\r
             return;\r
         }\r
-        \r
+\r
         XmlCursor cursor = getfpdBuildOpts().newCursor();\r
         QName elementUserExts = new QName (xmlNs, "UserExtensions");\r
         QName attribUserId = new QName ("UserID");\r
+        QName attribId = new QName ("Identifier");\r
         QName elementFvName = new QName (xmlNs, "FvName");\r
         QName elementIncludeModules = new QName(xmlNs, "IncludeModules");\r
         QName attribModuleGuid = new QName("ModuleGuid");\r
@@ -1888,7 +1893,7 @@ public class FpdFileContents {
         if (cursor.toChild(elementUserExts)) {\r
             do {\r
                 cursor.push();\r
-                if (cursor.getAttributeText(attribUserId).equals("IMAGES")) {\r
+                if (cursor.getAttributeText(attribUserId).equals(userId) && cursor.getAttributeText(attribId).equals(id+"")) {\r
                     cursor.toChild(elementFvName);\r
                     String elementName = cursor.getTextValue();\r
                     if (elementName.equals(fvName)) {\r
@@ -1935,15 +1940,18 @@ public class FpdFileContents {
         \r
     }\r
     \r
-    public void removeBuildOptionsUserExtensions (String fvName) {\r
+    public void removeBuildOptionsUserExtensions (String fvName, String userId, int id) {\r
         if (getfpdBuildOpts().getUserExtensionsList() == null) {\r
             return;\r
         }\r
-        \r
+\r
         ListIterator<UserExtensionsDocument.UserExtensions> li = getfpdBuildOpts().getUserExtensionsList().listIterator();\r
         while (li.hasNext()) {\r
             UserExtensionsDocument.UserExtensions ues = li.next();\r
-            if (!ues.getUserID().equals("IMAGES")) {\r
+            if (!ues.getUserID().equals(userId)) {\r
+                continue;\r
+            }\r
+            if (ues.getIdentifier()== null || ues.getIdentifier().intValue() != id) {\r
                 continue;\r
             }\r
             XmlCursor cursor = ues.newCursor();\r
@@ -1974,13 +1982,13 @@ public class FpdFileContents {
         return false;\r
     }\r
     \r
-    public boolean moduleInBuildOptionsUserExtensions (String fvName, String moduleGuid, String moduleVersion, String packageGuid, String packageVersion, String arch) {\r
+    public boolean moduleInBuildOptionsUserExtensions (String fvName, String userId, int id, String moduleGuid, String moduleVersion, String packageGuid, String packageVersion, String arch) {\r
         boolean inList = false;\r
-        if (getUserExtsIncModCount(fvName) > 0) {\r
-            \r
+        if (getUserExtsIncModCount(fvName, userId, id) > 0) {\r
             XmlCursor cursor = getfpdBuildOpts().newCursor();\r
             QName elementUserExts = new QName (xmlNs, "UserExtensions");\r
             QName attribUserId = new QName ("UserID");\r
+            QName attribId = new QName ("Identifier");\r
             QName elementFvName = new QName (xmlNs, "FvName");\r
             QName elementIncludeModules = new QName(xmlNs, "IncludeModules");\r
             QName attribModuleGuid = new QName("ModuleGuid");\r
@@ -1992,7 +2000,7 @@ public class FpdFileContents {
             if (cursor.toChild(elementUserExts)) {\r
                 do {\r
                     cursor.push();\r
-                    if (cursor.getAttributeText(attribUserId).equals("IMAGES")) {\r
+                    if (cursor.getAttributeText(attribUserId).equals(userId) && cursor.getAttributeText(attribId).equals(id+"")) {\r
                         cursor.toChild(elementFvName);\r
                         String elementName = cursor.getTextValue();\r
                         if (elementName.equals(fvName)) {\r
@@ -2035,21 +2043,21 @@ public class FpdFileContents {
         return inList;\r
     }\r
     \r
-    public void removeModuleInBuildOptionsUserExtensions (String fvName, String moduleGuid, String moduleVersion, String packageGuid, String packageVersion, String arch) {\r
+    public void removeModuleInBuildOptionsUserExtensions (String fvName, String userId, int id, String moduleGuid, String moduleVersion, String packageGuid, String packageVersion, String arch) {\r
         //\r
         // if there is only one module before remove operation, the whole user extension should be removed.\r
         //\r
-        int moduleAmount = getUserExtsIncModCount(fvName);\r
+        int moduleAmount = getUserExtsIncModCount(fvName, userId, id);\r
         if (moduleAmount == 1) {\r
-            removeBuildOptionsUserExtensions(fvName);\r
+            removeBuildOptionsUserExtensions(fvName, userId, id);\r
             return;\r
         }\r
         \r
         if (moduleAmount > 1) {\r
-            \r
             XmlCursor cursor = getfpdBuildOpts().newCursor();\r
             QName elementUserExts = new QName (xmlNs, "UserExtensions");\r
             QName attribUserId = new QName ("UserID");\r
+            QName attribId = new QName ("Identifier");\r
             QName elementFvName = new QName (xmlNs, "FvName");\r
             QName elementIncludeModules = new QName(xmlNs, "IncludeModules");\r
             QName attribModuleGuid = new QName("ModuleGuid");\r
@@ -2061,7 +2069,7 @@ public class FpdFileContents {
             if (cursor.toChild(elementUserExts)) {\r
                 do {\r
                     cursor.push();\r
-                    if (cursor.getAttributeText(attribUserId).equals("IMAGES")) {\r
+                    if (cursor.getAttributeText(attribUserId).equals(userId) && cursor.getAttributeText(attribId).equals(id+"")) {\r
                         cursor.toChild(elementFvName);\r
                         String elementName = cursor.getTextValue();\r
                         if (elementName.equals(fvName)) {\r
@@ -2102,16 +2110,20 @@ public class FpdFileContents {
         }\r
     }\r
     \r
-    public void addModuleIntoBuildOptionsUserExtensions (String fvName, String moduleGuid, String moduleVersion, String packageGuid, String packageVersion, String arch) {\r
-        if (moduleInBuildOptionsUserExtensions (fvName, moduleGuid, moduleVersion, packageGuid, packageVersion, arch)) {\r
+    public void addModuleIntoBuildOptionsUserExtensions (String fvName, String userId, int id, String moduleGuid, String moduleVersion, String packageGuid, String packageVersion, String arch) {\r
+        if (moduleInBuildOptionsUserExtensions (fvName, userId, id, moduleGuid, moduleVersion, packageGuid, packageVersion, arch)) {\r
             return;\r
         }\r
+\r
         ListIterator<UserExtensionsDocument.UserExtensions> li = getfpdBuildOpts().getUserExtensionsList().listIterator();\r
         QName elementIncludeModules = new QName(xmlNs, "IncludeModules");\r
         QName elementModule = new QName(xmlNs, "Module");\r
         while (li.hasNext()) {\r
             UserExtensionsDocument.UserExtensions ues = li.next();\r
-            if (!ues.getUserID().equals("IMAGES")) {\r
+            if (!ues.getUserID().equals(userId)) {\r
+                continue;\r
+            }\r
+            if (ues.getIdentifier() == null || ues.getIdentifier().intValue() != id) {\r
                 continue;\r
             }\r
             XmlCursor cursor = ues.newCursor();\r
index a880ae41f24e4c061de311c12c65ee2c3eabd493..5717b3b781b89270fc2ce0c4c1219dd0201ec183 100644 (file)
@@ -34,6 +34,7 @@ import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;
 \r
 import java.awt.FlowLayout;\r
 import java.awt.event.ActionEvent;\r
+import java.awt.event.ActionListener;\r
 import java.awt.event.ComponentAdapter;\r
 import java.awt.event.ComponentEvent;\r
 import java.awt.event.ItemEvent;\r
@@ -1268,7 +1269,10 @@ public class FpdFlash extends IInternalFrame {
         if (index >= startIndexOfDynamicTab) {\r
             return;\r
         }\r
-        jTabbedPane.addTab(fvName, null, new ModuleOrderPane(fvName, outputFile), null);\r
+        ModuleOrderPane pane = new ModuleOrderPane(fvName, outputFile, ffc, this);\r
+        pane.showModulesInFv(fvName);\r
+        pane.showAllModulesInPlatform();\r
+        jTabbedPane.addTab(fvName, null, pane, null);\r
     }\r
     /**\r
      * This method initializes jTextField4     \r
@@ -1799,7 +1803,10 @@ public class FpdFlash extends IInternalFrame {
                                 ffc.updateFvImageNameAll(oldFvName, newFvName);\r
                                 \r
                             } else {\r
-                                jTabbedPane.addTab(newFvName, new ModuleOrderPane(newFvName, ""));\r
+                                ModuleOrderPane pane = new ModuleOrderPane(newFvName, "", ffc, FpdFlash.this);\r
+                                pane.showModulesInFv(newFvName);\r
+                                pane.showAllModulesInPlatform();\r
+                                jTabbedPane.addTab(newFvName, pane);\r
                                 // Add FvImageNames in Flash\r
                                 String[] fvNames = {newFvName};\r
                                 ffc.addFvImageFvImageNames(fvNames);\r
@@ -2475,718 +2482,655 @@ public class FpdFlash extends IInternalFrame {
         }\r
 \r
     }\r
+\r
+    /* (non-Javadoc)\r
+     * @see org.tianocore.frameworkwizard.common.ui.IInternalFrame#actionPerformed(java.awt.event.ActionEvent)\r
+     */\r
+    @Override\r
+    public void actionPerformed(ActionEvent arg0) {\r
+        if (arg0.getActionCommand().equals("ModuleOrderPaneOk")) {\r
+            docConsole.setSaved(false);\r
+            jTabbedPane.setSelectedIndex(0);\r
+        }\r
+        else if (arg0.getActionCommand().equals("ModuleOrderPaneCancel")) {\r
+            jTabbedPane.setSelectedIndex(0);\r
+        }\r
+        else {\r
+            return;\r
+        }\r
+    }\r
     \r
-//    class ModuleSAInfo {\r
-//        private int rowNumber = -1;\r
-//        private String moduleGuid = null;\r
-//        private String moduleVersion = null;\r
-//        private String packageGuid = null;\r
-//        private String packageVersion = null;\r
-//        private String arch = null;\r
-//        \r
-//        public ModuleSAInfo (String mg, String mv, String pg, String pv, String a) {\r
-//            moduleGuid = mg;\r
-//            moduleVersion = mv;\r
-//            packageGuid = pg;\r
-//            packageVersion = pv;\r
-//            arch = a;\r
-//        }\r
-//\r
-//        /**\r
-//         * @return Returns the arch.\r
-//         */\r
-//        public String getArch() {\r
-//            return arch;\r
-//        }\r
-//\r
-//        /**\r
-//         * @param arch The arch to set.\r
-//         */\r
-//        public void setArch(String arch) {\r
-//            this.arch = arch;\r
-//        }\r
-//\r
-//        /**\r
-//         * @return Returns the moduleGuid.\r
-//         */\r
-//        public String getModuleGuid() {\r
-//            return moduleGuid;\r
-//        }\r
-//\r
-//        /**\r
-//         * @param moduleGuid The moduleGuid to set.\r
-//         */\r
-//        public void setModuleGuid(String moduleGuid) {\r
-//            this.moduleGuid = moduleGuid;\r
-//        }\r
-//\r
-//        /**\r
-//         * @return Returns the moduleVersion.\r
-//         */\r
-//        public String getModuleVersion() {\r
-//            return moduleVersion;\r
-//        }\r
-//\r
-//        /**\r
-//         * @param moduleVersion The moduleVersion to set.\r
-//         */\r
-//        public void setModuleVersion(String moduleVersion) {\r
-//            this.moduleVersion = moduleVersion;\r
-//        }\r
-//\r
-//        /**\r
-//         * @return Returns the packageGuid.\r
-//         */\r
-//        public String getPackageGuid() {\r
-//            return packageGuid;\r
-//        }\r
-//\r
-//        /**\r
-//         * @param packageGuid The packageGuid to set.\r
-//         */\r
-//        public void setPackageGuid(String packageGuid) {\r
-//            this.packageGuid = packageGuid;\r
-//        }\r
-//\r
-//        /**\r
-//         * @return Returns the packageVersion.\r
-//         */\r
-//        public String getPackageVersion() {\r
-//            return packageVersion;\r
-//        }\r
-//\r
-//        /**\r
-//         * @param packageVersion The packageVersion to set.\r
-//         */\r
-//        public void setPackageVersion(String packageVersion) {\r
-//            this.packageVersion = packageVersion;\r
-//        }\r
-//\r
-//        /**\r
-//         * @return Returns the rowNumber.\r
-//         */\r
-//        public int getRowNumber() {\r
-//            return rowNumber;\r
-//        }\r
-//\r
-//        /**\r
-//         * @param rowNumber The rowNumber to set.\r
-//         */\r
-//        public void setRowNumber(int rowNumber) {\r
-//            this.rowNumber = rowNumber;\r
-//        }\r
-//    }\r
+}  //  @jve:decl-index=0:visual-constraint="10,10"\r
+\r
+class ModuleOrderPane extends JPanel implements ActionListener{\r
+\r
+    /**\r
+     * \r
+     */\r
+    private static final long serialVersionUID = 1L;\r
+    private JPanel jPanelModOrderN = null;\r
+    private JPanel jPanelModOrderS = null;\r
+    private JPanel jPanelModOrderC = null;\r
+    private JScrollPane jScrollPaneModInFv = null;\r
+    private JTable jTableModInFv = null;\r
+    private JPanel jPanelController = null;\r
+    private JScrollPane jScrollPaneFpdModules = null;\r
+    private JTable jTableFpdModules = null;\r
+    private JButton jButtonUp = null;\r
+    private JButton jButtonInsert = null;\r
+    private JButton jButtonRemove = null;\r
+    private JButton jButtonDown = null;\r
+    private JButton jButtonOk = null;\r
+    private JButton jButtonCancel = null;\r
+    private IDefaultTableModel modInFvTableModel = null;\r
+    private IDefaultTableModel fpdModTableModel = null;\r
+    private FpdFileContents ffc = null;\r
+    private String title = null;\r
+    private String outputFileName = null;\r
     \r
-    private class ModuleOrderPane extends JPanel {\r
-\r
-        /**\r
-         * \r
-         */\r
-        private static final long serialVersionUID = 1L;\r
-        private JPanel jPanelModOrderN = null;\r
-        private JPanel jPanelModOrderS = null;\r
-        private JPanel jPanelModOrderC = null;\r
-        private JScrollPane jScrollPaneModInFv = null;\r
-        private JTable jTableModInFv = null;\r
-        private JPanel jPanelController = null;\r
-        private JScrollPane jScrollPaneFpdModules = null;\r
-        private JTable jTableFpdModules = null;\r
-        private JButton jButtonUp = null;\r
-        private JButton jButtonInsert = null;\r
-        private JButton jButtonRemove = null;\r
-        private JButton jButtonDown = null;\r
-        private JButton jButtonOk = null;\r
-        private JButton jButtonCancel = null;\r
-        private IDefaultTableModel modInFvTableModel = null;\r
-        private IDefaultTableModel fpdModTableModel = null;\r
-//        private ArrayList<ModuleSAInfo> listTableModInFvModuleSAInfo = null;\r
-//        private ArrayList<ModuleSAInfo> listTableFpdModulesModuleSAInfo = null;\r
-        private String title = null;\r
-        private String outputFileName = null;\r
+    public ModuleOrderPane(String tabTitle, String file, FpdFileContents inputFfc, ActionListener action) {\r
+        super(new BorderLayout());\r
+        title = tabTitle;\r
+        outputFileName = file;\r
+        ffc = inputFfc;\r
+        add(getJPanelModOrderN(), java.awt.BorderLayout.NORTH);\r
+        add(getJPanelModOrderS(), java.awt.BorderLayout.SOUTH);\r
+        add(getJPanelModOrderC(), java.awt.BorderLayout.CENTER);\r
+        jButtonOk.addActionListener(action);\r
+        jButtonCancel.addActionListener(action);\r
         \r
-        public ModuleOrderPane(String tabTitle, String file) {\r
-            super(new BorderLayout());\r
-            title = tabTitle;\r
-            outputFileName = file;\r
-//            listTableModInFvModuleSAInfo = new ArrayList<ModuleSAInfo>();\r
-//            listTableFpdModulesModuleSAInfo = new ArrayList<ModuleSAInfo>();\r
-            add(getJPanelModOrderN(), java.awt.BorderLayout.NORTH);\r
-            add(getJPanelModOrderS(), java.awt.BorderLayout.SOUTH);\r
-            add(getJPanelModOrderC(), java.awt.BorderLayout.CENTER);\r
-            showModulesInFv(title);\r
-            showAllModulesInPlatform();\r
-        }\r
+    }\r
+    \r
+    public void showModulesInFv(String fvName) {\r
         \r
-        private void showModulesInFv(String fvName) {\r
-            int size = ffc.getUserExtsIncModCount(fvName);\r
-            \r
-            if (size != -1) {\r
-                String[][] saa = new String[size][5];\r
-                ffc.getUserExtsIncMods(fvName, saa);\r
-\r
-                for (int i = 0; i < size; ++i) {\r
-                    String moduleKey = saa[i][0] + " " + saa[i][1] + " " + saa[i][2] + " " + saa[i][3];\r
-                    ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);\r
-                    String name = "N/A";\r
-                    if (mi != null) {\r
-                        name = mi.getName();\r
-                    }\r
-                    \r
-                    String[] row = { name, saa[i][0] , saa[i][1], saa[i][2] , saa[i][3], saa[i][4] };\r
-                    modInFvTableModel.addRow(row);\r
-                }\r
-            }\r
-            //\r
-            // From ModuleSAs, get module guids with FvBinding = fvName.\r
-            //\r
-            Vector<String[]> vModuleSA = new Vector<String[]>();\r
-            ffc.getFrameworkModuleSAByFvBinding(fvName, vModuleSA);\r
-            //\r
-            // If BuildOptions->UserExtensions already contain these module info,\r
-            // no need to add them into table again.\r
-            //\r
-            Iterator<String[]> iter = vModuleSA.iterator();\r
-            while (iter.hasNext()){\r
-                String[] sa = iter.next();\r
-                if (!moduleInfoInTable (sa, modInFvTableModel)) {\r
-                    String moduleKey = sa[0] + " " + sa[1] + " " + sa[2] + " " + sa[3];\r
-                    ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);\r
-                    String name = "N/A";\r
-                    if (mi != null) {\r
-                        name = mi.getName();\r
-                    }\r
-                    String[] row = { name, sa[0] , sa[1], sa[2] , sa[3], sa[4] };\r
-                    modInFvTableModel.addRow(row);\r
-                }\r
-            }\r
-\r
+        if (modInFvTableModel == null) {\r
+            return;\r
         }\r
+        int size = ffc.getUserExtsIncModCount(fvName, "IMAGES", 1);\r
         \r
-        private void showAllModulesInPlatform() {\r
-            int size = ffc.getFrameworkModulesCount();\r
+        if (size != -1) {\r
             String[][] saa = new String[size][5];\r
-            ffc.getFrameworkModulesInfo(saa);\r
-            \r
+            ffc.getUserExtsIncMods(fvName, "IMAGES", 1, saa);\r
+\r
             for (int i = 0; i < size; ++i) {\r
-                if (moduleInfoInTable(saa[i], modInFvTableModel) || moduleInfoInTable(saa[i], fpdModTableModel)) {\r
-                    continue;\r
-                }\r
                 String moduleKey = saa[i][0] + " " + saa[i][1] + " " + saa[i][2] + " " + saa[i][3];\r
                 ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);\r
                 String name = "N/A";\r
                 if (mi != null) {\r
                     name = mi.getName();\r
                 }\r
+                \r
                 String[] row = { name, saa[i][0] , saa[i][1], saa[i][2] , saa[i][3], saa[i][4] };\r
-                fpdModTableModel.addRow(row);\r
+                modInFvTableModel.addRow(row);\r
             }\r
-            \r
-            TableSorter sorter = (TableSorter)jTableFpdModules.getModel();\r
-            sorter.setSortState(0, TableSorter.ASCENDING);\r
         }\r
-        \r
-        \r
-        private boolean moduleInfoInTable (String[] moduleInfo, DefaultTableModel model) {\r
-            boolean matched = false;\r
-            int size = model.getDataVector().size();\r
-            for (int i = 0; i < size; ++i) {\r
-                Vector rowData = (Vector)model.getDataVector().elementAt(i);\r
-                for (int j = 1; j < rowData.size(); ++j) {\r
-                    if (rowData.elementAt(j) == null && moduleInfo[j-1] == null) {\r
-                        matched = true;\r
-                    }\r
-                    else if (rowData.elementAt(j).equals("null") && moduleInfo[j-1] == null) {\r
-                        matched = true;\r
-                    }\r
-                    else if (rowData.elementAt(j) == null && moduleInfo[j-1].equals("null")) {\r
-                        matched = true;\r
-                    }\r
-                    else if (rowData.elementAt(j) != null && rowData.elementAt(j).toString().equalsIgnoreCase(moduleInfo[j-1])) {\r
-                        matched = true;\r
-                    }\r
-                    else {\r
-                        matched = false;\r
-                        break;\r
-                    }\r
-                }\r
-                \r
-                if (matched) {\r
-                    return true;\r
+        //\r
+        // From ModuleSAs, get module guids with FvBinding = fvName.\r
+        //\r
+        Vector<String[]> vModuleSA = new Vector<String[]>();\r
+        ffc.getFrameworkModuleSAByFvBinding(fvName, vModuleSA);\r
+        //\r
+        // If BuildOptions->UserExtensions already contain these module info,\r
+        // no need to add them into table again.\r
+        //\r
+        Iterator<String[]> iter = vModuleSA.iterator();\r
+        while (iter.hasNext()){\r
+            String[] sa = iter.next();\r
+            if (!moduleInfoInTable (sa, modInFvTableModel)) {\r
+                String moduleKey = sa[0] + " " + sa[1] + " " + sa[2] + " " + sa[3];\r
+                ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);\r
+                String name = "N/A";\r
+                if (mi != null) {\r
+                    name = mi.getName();\r
                 }\r
-                \r
+                String[] row = { name, sa[0] , sa[1], sa[2] , sa[3], sa[4] };\r
+                modInFvTableModel.addRow(row);\r
             }\r
-            return false;\r
         }\r
+\r
+    }\r
+    \r
+    public void showAllModulesInPlatform() {\r
         \r
+        if (modInFvTableModel == null || fpdModTableModel == null) {\r
+            return;\r
+        }\r
+        int size = ffc.getFrameworkModulesCount();\r
+        String[][] saa = new String[size][5];\r
+        ffc.getFrameworkModulesInfo(saa);\r
         \r
-        \r
-        /**\r
-         * This method initializes jPanelModOrderN  \r
-         *  \r
-         * @return javax.swing.JPanel   \r
-         */\r
-        private JPanel getJPanelModOrderN() {\r
-            if (jPanelModOrderN == null) {\r
-                jPanelModOrderN = new JPanel();\r
+        for (int i = 0; i < size; ++i) {\r
+            if (moduleInfoInTable(saa[i], modInFvTableModel) || moduleInfoInTable(saa[i], fpdModTableModel)) {\r
+                continue;\r
             }\r
-            return jPanelModOrderN;\r
-        }\r
-\r
-        /**\r
-         * This method initializes jPanelModOrderS  \r
-         *  \r
-         * @return javax.swing.JPanel   \r
-         */\r
-        private JPanel getJPanelModOrderS() {\r
-            if (jPanelModOrderS == null) {\r
-                FlowLayout flowLayout6 = new FlowLayout();\r
-                flowLayout6.setAlignment(java.awt.FlowLayout.RIGHT);\r
-                jPanelModOrderS = new JPanel();\r
-                jPanelModOrderS.setLayout(flowLayout6);\r
-                jPanelModOrderS.add(getJButtonOk(), null);\r
-                jPanelModOrderS.add(getJButtonCancel(), null);\r
+            String moduleKey = saa[i][0] + " " + saa[i][1] + " " + saa[i][2] + " " + saa[i][3];\r
+            ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);\r
+            String name = "N/A";\r
+            if (mi != null) {\r
+                name = mi.getName();\r
             }\r
-            return jPanelModOrderS;\r
-        }\r
-\r
-        /**\r
-         * This method initializes jPanelModOrderC  \r
-         *  \r
-         * @return javax.swing.JPanel   \r
-         */\r
-        private JPanel getJPanelModOrderC() {\r
-            if (jPanelModOrderC == null) {\r
-                jPanelModOrderC = new JPanel();\r
-                jPanelModOrderC.add(getJScrollPaneModInFv(), null);\r
-                jPanelModOrderC.add(getJPanelController(), null);\r
-                jPanelModOrderC.add(getJScrollPaneFpdModules(), null);\r
+            String[] row = { name, saa[i][0] , saa[i][1], saa[i][2] , saa[i][3], saa[i][4] };\r
+            fpdModTableModel.addRow(row);\r
+        }\r
+        \r
+        TableSorter sorter = (TableSorter)jTableFpdModules.getModel();\r
+        sorter.setSortState(0, TableSorter.ASCENDING);\r
+    }\r
+    \r
+    \r
+    protected boolean moduleInfoInTable (String[] moduleInfo, DefaultTableModel model) {\r
+        boolean matched = false;\r
+        int size = model.getDataVector().size();\r
+        for (int i = 0; i < size; ++i) {\r
+            Vector rowData = (Vector)model.getDataVector().elementAt(i);\r
+            for (int j = 1; j < rowData.size(); ++j) {\r
+                if (rowData.elementAt(j) == null && moduleInfo[j-1] == null) {\r
+                    matched = true;\r
+                }\r
+                else if (rowData.elementAt(j).equals("null") && moduleInfo[j-1] == null) {\r
+                    matched = true;\r
+                }\r
+                else if (rowData.elementAt(j) == null && moduleInfo[j-1].equals("null")) {\r
+                    matched = true;\r
+                }\r
+                else if (rowData.elementAt(j) != null && rowData.elementAt(j).toString().equalsIgnoreCase(moduleInfo[j-1])) {\r
+                    matched = true;\r
+                }\r
+                else {\r
+                    matched = false;\r
+                    break;\r
+                }\r
             }\r
-            return jPanelModOrderC;\r
-        }\r
-\r
-        /**\r
-         * This method initializes jScrollPaneModInFv   \r
-         *  \r
-         * @return javax.swing.JScrollPane  \r
-         */\r
-        private JScrollPane getJScrollPaneModInFv() {\r
-            if (jScrollPaneModInFv == null) {\r
-                jScrollPaneModInFv = new JScrollPane();\r
-                jScrollPaneModInFv.setPreferredSize(new java.awt.Dimension(200,500));\r
-                jScrollPaneModInFv.setViewportView(getJTableModInFv());\r
+            \r
+            if (matched) {\r
+                return true;\r
             }\r
-            return jScrollPaneModInFv;\r
+            \r
+        }\r
+        return false;\r
+    }\r
+    \r
+    \r
+    \r
+    /**\r
+     * This method initializes jPanelModOrderN  \r
+     *  \r
+     * @return javax.swing.JPanel   \r
+     */\r
+    private JPanel getJPanelModOrderN() {\r
+        if (jPanelModOrderN == null) {\r
+            jPanelModOrderN = new JPanel();\r
         }\r
+        return jPanelModOrderN;\r
+    }\r
 \r
-        /**\r
-         * This method initializes jTableModInFv    \r
-         *  \r
-         * @return javax.swing.JTable   \r
-         */\r
-        private JTable getJTableModInFv() {\r
-            if (jTableModInFv == null) {\r
-                modInFvTableModel = new IDefaultTableModel();\r
-                \r
-                jTableModInFv = new JTable(modInFvTableModel){\r
-                    /**\r
-                     * \r
-                     */\r
-                    private static final long serialVersionUID = 4903583933542581721L;\r
-\r
-                    public String getToolTipText(MouseEvent e) {\r
-                        String tip = null;\r
-                        java.awt.Point p = e.getPoint();\r
-                        int rowIndex = rowAtPoint(p);\r
-//                        int colIndex = columnAtPoint(p);\r
-//                        int realColumnIndex = convertColumnIndexToModel(colIndex);\r
-\r
-                        TableModel model = getModel();\r
+    /**\r
+     * This method initializes jPanelModOrderS  \r
+     *  \r
+     * @return javax.swing.JPanel   \r
+     */\r
+    private JPanel getJPanelModOrderS() {\r
+        if (jPanelModOrderS == null) {\r
+            FlowLayout flowLayout6 = new FlowLayout();\r
+            flowLayout6.setAlignment(java.awt.FlowLayout.RIGHT);\r
+            jPanelModOrderS = new JPanel();\r
+            jPanelModOrderS.setLayout(flowLayout6);\r
+            jPanelModOrderS.add(getJButtonOk(), null);\r
+            jPanelModOrderS.add(getJButtonCancel(), null);\r
+        }\r
+        return jPanelModOrderS;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jPanelModOrderC  \r
+     *  \r
+     * @return javax.swing.JPanel   \r
+     */\r
+    private JPanel getJPanelModOrderC() {\r
+        if (jPanelModOrderC == null) {\r
+            jPanelModOrderC = new JPanel();\r
+            jPanelModOrderC.add(getJScrollPaneModInFv(), null);\r
+            jPanelModOrderC.add(getJPanelController(), null);\r
+            jPanelModOrderC.add(getJScrollPaneFpdModules(), null);\r
+        }\r
+        return jPanelModOrderC;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jScrollPaneModInFv   \r
+     *  \r
+     * @return javax.swing.JScrollPane  \r
+     */\r
+    private JScrollPane getJScrollPaneModInFv() {\r
+        if (jScrollPaneModInFv == null) {\r
+            jScrollPaneModInFv = new JScrollPane();\r
+            jScrollPaneModInFv.setPreferredSize(new java.awt.Dimension(200,500));\r
+            jScrollPaneModInFv.setViewportView(getJTableModInFv());\r
+        }\r
+        return jScrollPaneModInFv;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jTableModInFv    \r
+     *  \r
+     * @return javax.swing.JTable   \r
+     */\r
+    protected JTable getJTableModInFv() {\r
+        if (jTableModInFv == null) {\r
+            modInFvTableModel = new IDefaultTableModel();\r
+            \r
+            jTableModInFv = new JTable(modInFvTableModel){\r
+                /**\r
+                 * \r
+                 */\r
+                private static final long serialVersionUID = 4903583933542581721L;\r
+\r
+                public String getToolTipText(MouseEvent e) {\r
+                    String tip = null;\r
+                    java.awt.Point p = e.getPoint();\r
+                    int rowIndex = rowAtPoint(p);\r
+//                    int colIndex = columnAtPoint(p);\r
+//                    int realColumnIndex = convertColumnIndexToModel(colIndex);\r
+\r
+                    TableModel model = getModel();\r
+                    String mg = (String) model.getValueAt(rowIndex, 1);\r
+                    String mv = (String) model.getValueAt(rowIndex, 2);\r
+                    String pg = (String) model.getValueAt(rowIndex, 3);\r
+                    String pv = (String) model.getValueAt(rowIndex, 4);\r
+                    String arch = (String) model.getValueAt(rowIndex, 5);\r
+                    ModuleIdentification mi = WorkspaceProfile.getModuleId(mg + " " + mv + " " + pg + " " + pv);\r
+                    if (mi != null) {\r
+                        tip = "Path: " + mi.getPath() + "; Arch: " + arch + ";";\r
+                    }\r
+                    else {\r
+                        tip = "No Module Path Information."; \r
+                    }\r
+                         \r
+                    return tip;\r
+                }\r
+\r
+            };\r
+            modInFvTableModel.addColumn("Module Orders in FV");\r
+            modInFvTableModel.addColumn("mg");\r
+            modInFvTableModel.addColumn("mv");\r
+            modInFvTableModel.addColumn("pg");\r
+            modInFvTableModel.addColumn("pv");\r
+            modInFvTableModel.addColumn("arch");\r
+            \r
+            for (int i = 1; i < 6; ++i) {\r
+                jTableModInFv.removeColumn(jTableModInFv.getColumnModel().getColumn(jTableModInFv.getColumnCount()-1));\r
+            }\r
+            \r
+            jTableModInFv.setRowHeight(20);\r
+            jTableModInFv.setShowGrid(false);\r
+            jTableModInFv.setAutoCreateColumnsFromModel(false);\r
+            jTableModInFv.addMouseListener(new MouseAdapter() {\r
+\r
+                /* (non-Javadoc)\r
+                 * @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)\r
+                 */\r
+                @Override\r
+                public void mouseClicked(MouseEvent arg0) {\r
+                    if (arg0.getButton() == MouseEvent.BUTTON3) {\r
+                        java.awt.Point p = arg0.getPoint();\r
+                        int rowIndex = jTableModInFv.rowAtPoint(p);\r
+                        TableModel model = jTableModInFv.getModel();\r
                         String mg = (String) model.getValueAt(rowIndex, 1);\r
                         String mv = (String) model.getValueAt(rowIndex, 2);\r
                         String pg = (String) model.getValueAt(rowIndex, 3);\r
                         String pv = (String) model.getValueAt(rowIndex, 4);\r
-                        String arch = (String) model.getValueAt(rowIndex, 5);\r
                         ModuleIdentification mi = WorkspaceProfile.getModuleId(mg + " " + mv + " " + pg + " " + pv);\r
+                        String details = "PackageGuid: " + pg + "; ModuleVer:" + mv + "; PkgVer:" + pv;\r
                         if (mi != null) {\r
-                            tip = "Path: " + mi.getPath() + "; Arch: " + arch + ";";\r
-                        }\r
-                        else {\r
-                            tip = "No Module Path Information."; \r
+                            details = "In Package " + mi.getPackageId().getName() + "; ModuleVer:" + mv + "; PkgVer:" + pv;\r
                         }\r
-                             \r
-                        return tip;\r
+                        JOptionPane.showMessageDialog(ModuleOrderPane.this, details);\r
                     }\r
-\r
-                };\r
-                modInFvTableModel.addColumn("Module Orders in FV");\r
-                modInFvTableModel.addColumn("mg");\r
-                modInFvTableModel.addColumn("mv");\r
-                modInFvTableModel.addColumn("pg");\r
-                modInFvTableModel.addColumn("pv");\r
-                modInFvTableModel.addColumn("arch");\r
-                \r
-                for (int i = 1; i < 6; ++i) {\r
-                    jTableModInFv.removeColumn(jTableModInFv.getColumnModel().getColumn(jTableModInFv.getColumnCount()-1));\r
                 }\r
                 \r
-                jTableModInFv.setRowHeight(20);\r
-                jTableModInFv.setShowGrid(false);\r
-                jTableModInFv.setAutoCreateColumnsFromModel(false);\r
-                jTableModInFv.addMouseListener(new MouseAdapter() {\r
-\r
-                    /* (non-Javadoc)\r
-                     * @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)\r
-                     */\r
-                    @Override\r
-                    public void mouseClicked(MouseEvent arg0) {\r
-                        if (arg0.getButton() == MouseEvent.BUTTON3) {\r
-                            java.awt.Point p = arg0.getPoint();\r
-                            int rowIndex = jTableModInFv.rowAtPoint(p);\r
-                            TableModel model = jTableModInFv.getModel();\r
-                            String mg = (String) model.getValueAt(rowIndex, 1);\r
-                            String mv = (String) model.getValueAt(rowIndex, 2);\r
-                            String pg = (String) model.getValueAt(rowIndex, 3);\r
-                            String pv = (String) model.getValueAt(rowIndex, 4);\r
-                            ModuleIdentification mi = WorkspaceProfile.getModuleId(mg + " " + mv + " " + pg + " " + pv);\r
-                            String details = "PackageGuid: " + pg + "; ModuleVer:" + mv + "; PkgVer:" + pv;\r
-                            if (mi != null) {\r
-                                details = "In Package " + mi.getPackageId().getName() + "; ModuleVer:" + mv + "; PkgVer:" + pv;\r
-                            }\r
-                            JOptionPane.showMessageDialog(frame, details);\r
-                        }\r
+            });\r
+        }\r
+        return jTableModInFv;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jPanelController \r
+     *  \r
+     * @return javax.swing.JPanel   \r
+     */\r
+    private JPanel getJPanelController() {\r
+        if (jPanelController == null) {\r
+            FlowLayout flowLayout5 = new FlowLayout();\r
+            flowLayout5.setVgap(50);\r
+            flowLayout5.setHgap(50);\r
+            jPanelController = new JPanel();\r
+            jPanelController.setLayout(flowLayout5);\r
+            jPanelController.setPreferredSize(new java.awt.Dimension(150,500));\r
+            jPanelController.add(getJButtonUp(), null);\r
+            jPanelController.add(getJButtonInsert(), null);\r
+            jPanelController.add(getJButtonRemove(), null);\r
+            jPanelController.add(getJButtonDown(), null);\r
+        }\r
+        return jPanelController;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jScrollPaneFpdModules    \r
+     *  \r
+     * @return javax.swing.JScrollPane  \r
+     */\r
+    private JScrollPane getJScrollPaneFpdModules() {\r
+        if (jScrollPaneFpdModules == null) {\r
+            jScrollPaneFpdModules = new JScrollPane();\r
+            jScrollPaneFpdModules.setPreferredSize(new java.awt.Dimension(200,500));\r
+            jScrollPaneFpdModules.setViewportView(getJTableFpdModules());\r
+        }\r
+        return jScrollPaneFpdModules;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jTableFpdModules \r
+     *  \r
+     * @return javax.swing.JTable   \r
+     */\r
+    private JTable getJTableFpdModules() {\r
+        if (jTableFpdModules == null) {\r
+            fpdModTableModel = new IDefaultTableModel();\r
+            TableSorter sorter = new TableSorter(fpdModTableModel);\r
+            jTableFpdModules = new JTable(sorter){\r
+                /**\r
+                 * \r
+                 */\r
+                private static final long serialVersionUID = -4666296888377637808L;\r
+\r
+                public String getToolTipText(MouseEvent e) {\r
+                    String tip = null;\r
+                    java.awt.Point p = e.getPoint();\r
+                    int rowIndex = rowAtPoint(p);\r
+//                    int colIndex = columnAtPoint(p);\r
+//                    int realColumnIndex = convertColumnIndexToModel(colIndex);\r
+\r
+                    TableModel model = getModel();\r
+                    String mg = (String) model.getValueAt(rowIndex, 1);\r
+                    String mv = (String) model.getValueAt(rowIndex, 2);\r
+                    String pg = (String) model.getValueAt(rowIndex, 3);\r
+                    String pv = (String) model.getValueAt(rowIndex, 4);\r
+                    String arch = (String) model.getValueAt(rowIndex, 5);\r
+                    ModuleIdentification mi = WorkspaceProfile.getModuleId(mg + " " + mv + " " + pg + " " + pv);\r
+                    if (mi != null) {\r
+                        tip = "Path: " + mi.getPath() + "; Arch: " + arch + ";";\r
                     }\r
-                    \r
-                });\r
-            }\r
-            return jTableModInFv;\r
-        }\r
-\r
-        /**\r
-         * This method initializes jPanelController \r
-         *  \r
-         * @return javax.swing.JPanel   \r
-         */\r
-        private JPanel getJPanelController() {\r
-            if (jPanelController == null) {\r
-                FlowLayout flowLayout5 = new FlowLayout();\r
-                flowLayout5.setVgap(50);\r
-                flowLayout5.setHgap(50);\r
-                jPanelController = new JPanel();\r
-                jPanelController.setLayout(flowLayout5);\r
-                jPanelController.setPreferredSize(new java.awt.Dimension(150,500));\r
-                jPanelController.add(getJButtonUp(), null);\r
-                jPanelController.add(getJButtonInsert(), null);\r
-                jPanelController.add(getJButtonRemove(), null);\r
-                jPanelController.add(getJButtonDown(), null);\r
-            }\r
-            return jPanelController;\r
-        }\r
-\r
-        /**\r
-         * This method initializes jScrollPaneFpdModules    \r
-         *  \r
-         * @return javax.swing.JScrollPane  \r
-         */\r
-        private JScrollPane getJScrollPaneFpdModules() {\r
-            if (jScrollPaneFpdModules == null) {\r
-                jScrollPaneFpdModules = new JScrollPane();\r
-                jScrollPaneFpdModules.setPreferredSize(new java.awt.Dimension(200,500));\r
-                jScrollPaneFpdModules.setViewportView(getJTableFpdModules());\r
+                    else {\r
+                        tip = "No Module Path Information."; \r
+                    }\r
+                         \r
+                    return tip;\r
+                }\r
+\r
+            };\r
+            \r
+            fpdModTableModel.addColumn("Modules in Platform");\r
+            fpdModTableModel.addColumn("mg");\r
+            fpdModTableModel.addColumn("mv");\r
+            fpdModTableModel.addColumn("pg");\r
+            fpdModTableModel.addColumn("pv");\r
+            fpdModTableModel.addColumn("arch");\r
+            \r
+            for (int i = 1; i < 6; ++i) {\r
+                jTableFpdModules.removeColumn(jTableFpdModules.getColumnModel().getColumn(jTableFpdModules.getColumnCount()-1));\r
             }\r
-            return jScrollPaneFpdModules;\r
-        }\r
-\r
-        /**\r
-         * This method initializes jTableFpdModules \r
-         *  \r
-         * @return javax.swing.JTable   \r
-         */\r
-        private JTable getJTableFpdModules() {\r
-            if (jTableFpdModules == null) {\r
-                fpdModTableModel = new IDefaultTableModel();\r
-                TableSorter sorter = new TableSorter(fpdModTableModel);\r
-                jTableFpdModules = new JTable(sorter){\r
-                    /**\r
-                     * \r
-                     */\r
-                    private static final long serialVersionUID = -4666296888377637808L;\r
-\r
-                    public String getToolTipText(MouseEvent e) {\r
-                        String tip = null;\r
-                        java.awt.Point p = e.getPoint();\r
-                        int rowIndex = rowAtPoint(p);\r
-//                        int colIndex = columnAtPoint(p);\r
-//                        int realColumnIndex = convertColumnIndexToModel(colIndex);\r
-\r
-                        TableModel model = getModel();\r
+            jTableFpdModules.setRowHeight(20);\r
+            jTableFpdModules.setShowGrid(false);\r
+            jTableFpdModules.setAutoCreateColumnsFromModel(false);\r
+            jTableFpdModules.addMouseListener(new MouseAdapter() {\r
+\r
+                /* (non-Javadoc)\r
+                 * @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)\r
+                 */\r
+                @Override\r
+                public void mouseClicked(MouseEvent arg0) {\r
+                    if (arg0.getButton() == MouseEvent.BUTTON3) {\r
+                        java.awt.Point p = arg0.getPoint();\r
+                        int rowIndex = jTableFpdModules.rowAtPoint(p);\r
+                        TableModel model = jTableFpdModules.getModel();\r
                         String mg = (String) model.getValueAt(rowIndex, 1);\r
                         String mv = (String) model.getValueAt(rowIndex, 2);\r
                         String pg = (String) model.getValueAt(rowIndex, 3);\r
                         String pv = (String) model.getValueAt(rowIndex, 4);\r
-                        String arch = (String) model.getValueAt(rowIndex, 5);\r
                         ModuleIdentification mi = WorkspaceProfile.getModuleId(mg + " " + mv + " " + pg + " " + pv);\r
+                        String details = "PackageGuid: " + pg + "; ModuleVer:" + mv + "; PkgVer:" + pv;\r
                         if (mi != null) {\r
-                            tip = "Path: " + mi.getPath() + "; Arch: " + arch + ";";\r
-                        }\r
-                        else {\r
-                            tip = "No Module Path Information."; \r
+                            details = "In Package " + mi.getPackageId().getName() + "; ModuleVer:" + mv + "; PkgVer:" + pv;\r
                         }\r
-                             \r
-                        return tip;\r
+                        JOptionPane.showMessageDialog(ModuleOrderPane.this, details);\r
                     }\r
-\r
-                };\r
-                \r
-                fpdModTableModel.addColumn("Modules in Platform");\r
-                fpdModTableModel.addColumn("mg");\r
-                fpdModTableModel.addColumn("mv");\r
-                fpdModTableModel.addColumn("pg");\r
-                fpdModTableModel.addColumn("pv");\r
-                fpdModTableModel.addColumn("arch");\r
-                \r
-                for (int i = 1; i < 6; ++i) {\r
-                    jTableFpdModules.removeColumn(jTableFpdModules.getColumnModel().getColumn(jTableFpdModules.getColumnCount()-1));\r
                 }\r
-                jTableFpdModules.setRowHeight(20);\r
-                jTableFpdModules.setShowGrid(false);\r
-                jTableFpdModules.setAutoCreateColumnsFromModel(false);\r
-                jTableFpdModules.addMouseListener(new MouseAdapter() {\r
-\r
-                    /* (non-Javadoc)\r
-                     * @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)\r
-                     */\r
-                    @Override\r
-                    public void mouseClicked(MouseEvent arg0) {\r
-                        if (arg0.getButton() == MouseEvent.BUTTON3) {\r
-                            java.awt.Point p = arg0.getPoint();\r
-                            int rowIndex = jTableFpdModules.rowAtPoint(p);\r
-                            TableModel model = jTableFpdModules.getModel();\r
-                            String mg = (String) model.getValueAt(rowIndex, 1);\r
-                            String mv = (String) model.getValueAt(rowIndex, 2);\r
-                            String pg = (String) model.getValueAt(rowIndex, 3);\r
-                            String pv = (String) model.getValueAt(rowIndex, 4);\r
-                            ModuleIdentification mi = WorkspaceProfile.getModuleId(mg + " " + mv + " " + pg + " " + pv);\r
-                            String details = "PackageGuid: " + pg + "; ModuleVer:" + mv + "; PkgVer:" + pv;\r
-                            if (mi != null) {\r
-                                details = "In Package " + mi.getPackageId().getName() + "; ModuleVer:" + mv + "; PkgVer:" + pv;\r
-                            }\r
-                            JOptionPane.showMessageDialog(frame, details);\r
-                        }\r
+                \r
+            });\r
+\r
+        }\r
+        return jTableFpdModules;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jButtonUp    \r
+     *  \r
+     * @return javax.swing.JButton  \r
+     */\r
+    private JButton getJButtonUp() {\r
+        if (jButtonUp == null) {\r
+            jButtonUp = new JButton();\r
+            jButtonUp.setPreferredSize(new java.awt.Dimension(60,20));\r
+            jButtonUp.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 14));\r
+            jButtonUp.setText("^");\r
+            jButtonUp.addActionListener(new java.awt.event.ActionListener() {\r
+                public void actionPerformed(java.awt.event.ActionEvent e) {\r
+                    int selectedRow = jTableModInFv.getSelectedRow();\r
+                    if (selectedRow <= 0) {\r
+                        return;\r
                     }\r
-                    \r
-                });\r
+                    modInFvTableModel.moveRow(selectedRow, selectedRow, selectedRow - 1);\r
+                    jTableModInFv.changeSelection(selectedRow - 1, 0, false, false);\r
+                }\r
+            });\r
+        }\r
+        return jButtonUp;\r
+    }\r
 \r
-            }\r
-            return jTableFpdModules;\r
-        }\r
-\r
-        /**\r
-         * This method initializes jButtonUp    \r
-         *  \r
-         * @return javax.swing.JButton  \r
-         */\r
-        private JButton getJButtonUp() {\r
-            if (jButtonUp == null) {\r
-                jButtonUp = new JButton();\r
-                jButtonUp.setPreferredSize(new java.awt.Dimension(60,20));\r
-                jButtonUp.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 14));\r
-                jButtonUp.setText("^");\r
-                jButtonUp.addActionListener(new java.awt.event.ActionListener() {\r
-                    public void actionPerformed(java.awt.event.ActionEvent e) {\r
-                        int selectedRow = jTableModInFv.getSelectedRow();\r
-                        if (selectedRow <= 0) {\r
-                            return;\r
-                        }\r
-                        modInFvTableModel.moveRow(selectedRow, selectedRow, selectedRow - 1);\r
-                        jTableModInFv.changeSelection(selectedRow - 1, 0, false, false);\r
+    /**\r
+     * This method initializes jButtonInsert    \r
+     *  \r
+     * @return javax.swing.JButton  \r
+     */\r
+    private JButton getJButtonInsert() {\r
+        if (jButtonInsert == null) {\r
+            jButtonInsert = new JButton();\r
+            jButtonInsert.setText("<");\r
+            jButtonInsert.setPreferredSize(new java.awt.Dimension(60,20));\r
+            jButtonInsert.addActionListener(new java.awt.event.ActionListener() {\r
+                public void actionPerformed(java.awt.event.ActionEvent e) {\r
+                    int selectedRowRight = jTableFpdModules.getSelectedRow();\r
+                    if (selectedRowRight < 0) {\r
+                        return;\r
                     }\r
-                });\r
-            }\r
-            return jButtonUp;\r
-        }\r
-\r
-        /**\r
-         * This method initializes jButtonInsert    \r
-         *  \r
-         * @return javax.swing.JButton  \r
-         */\r
-        private JButton getJButtonInsert() {\r
-            if (jButtonInsert == null) {\r
-                jButtonInsert = new JButton();\r
-                jButtonInsert.setText("<");\r
-                jButtonInsert.setPreferredSize(new java.awt.Dimension(60,20));\r
-                jButtonInsert.addActionListener(new java.awt.event.ActionListener() {\r
-                    public void actionPerformed(java.awt.event.ActionEvent e) {\r
-                        int selectedRowRight = jTableFpdModules.getSelectedRow();\r
-                        if (selectedRowRight < 0) {\r
-                            return;\r
-                        }\r
-                        \r
-                        int rowInModel = ((TableSorter)jTableFpdModules.getModel()).getModelRowIndex(selectedRowRight);\r
-                        String name = fpdModTableModel.getValueAt(rowInModel, 0)+"";\r
-                        String mg = fpdModTableModel.getValueAt(rowInModel, 1)+"";\r
-                        String mv = fpdModTableModel.getValueAt(rowInModel, 2)+"";\r
-                        String pg = fpdModTableModel.getValueAt(rowInModel, 3)+"";\r
-                        String pv = fpdModTableModel.getValueAt(rowInModel, 4)+"";\r
-                        String arch = fpdModTableModel.getValueAt(rowInModel, 5)+"";\r
-                        String[] row = {name, mg, mv, pg, pv, arch};\r
-                        if (name.length() == 0 || name.equals("N/A")) {\r
-                            return;\r
-                        }\r
-                        \r
-                        int selectedRowLeft = jTableModInFv.getSelectedRow();\r
-                        if (selectedRowLeft < 0) {\r
-                            modInFvTableModel.addRow(row);\r
-                            jTableModInFv.changeSelection(jTableModInFv.getRowCount() - 1, 0, false, false);\r
-                        }\r
-                        else {\r
-                            modInFvTableModel.insertRow(selectedRowLeft, row);\r
-                            jTableModInFv.changeSelection(selectedRowLeft, 0, false, false);\r
-                        }\r
-                        fpdModTableModel.removeRow(rowInModel);\r
+                    \r
+                    int rowInModel = ((TableSorter)jTableFpdModules.getModel()).getModelRowIndex(selectedRowRight);\r
+                    String name = fpdModTableModel.getValueAt(rowInModel, 0)+"";\r
+                    String mg = fpdModTableModel.getValueAt(rowInModel, 1)+"";\r
+                    String mv = fpdModTableModel.getValueAt(rowInModel, 2)+"";\r
+                    String pg = fpdModTableModel.getValueAt(rowInModel, 3)+"";\r
+                    String pv = fpdModTableModel.getValueAt(rowInModel, 4)+"";\r
+                    String arch = fpdModTableModel.getValueAt(rowInModel, 5)+"";\r
+                    String[] row = {name, mg, mv, pg, pv, arch};\r
+                    if (name.length() == 0 || name.equals("N/A")) {\r
+                        return;\r
                     }\r
-                });\r
-            }\r
-            return jButtonInsert;\r
-        }\r
-\r
-        /**\r
-         * This method initializes jButtonRemove    \r
-         *  \r
-         * @return javax.swing.JButton  \r
-         */\r
-        private JButton getJButtonRemove() {\r
-            if (jButtonRemove == null) {\r
-                jButtonRemove = new JButton();\r
-                jButtonRemove.setPreferredSize(new java.awt.Dimension(60,20));\r
-                jButtonRemove.setText(">");\r
-                jButtonRemove.addActionListener(new java.awt.event.ActionListener() {\r
-                    public void actionPerformed(java.awt.event.ActionEvent e) {\r
-                        int selectedRowLeft = jTableModInFv.getSelectedRow();\r
-                        if (selectedRowLeft < 0) {\r
-                            return;\r
-                        }\r
-                        \r
-                        String name = modInFvTableModel.getValueAt(selectedRowLeft, 0)+"";\r
-                        String mg = modInFvTableModel.getValueAt(selectedRowLeft, 1)+"";\r
-                        String mv = modInFvTableModel.getValueAt(selectedRowLeft, 2)+"";\r
-                        String pg = modInFvTableModel.getValueAt(selectedRowLeft, 3)+"";\r
-                        String pv = modInFvTableModel.getValueAt(selectedRowLeft, 4)+"";\r
-                        String arch = modInFvTableModel.getValueAt(selectedRowLeft, 5)+"";\r
-                        String[] row = {name, mg, mv, pg, pv, arch};\r
-                        String moduleKey = mg + " " + mv + " " + pg + " " + pv + " " + arch; \r
-                        if (name.length() == 0 || name.equals("N/A") || ffc.getModuleSA(moduleKey) == null) {\r
-                            JOptionPane.showMessageDialog(frame, "Module " + name + " not exists in platform. If you want to add back this module, please first add it into current platform. " + moduleKey );\r
-                            modInFvTableModel.removeRow(selectedRowLeft);\r
-                            return;\r
-                        }\r
-                       \r
-                        fpdModTableModel.addRow(row);\r
-                        int viewIndex = ((TableSorter) jTableFpdModules.getModel()).getViewIndexArray()[jTableFpdModules\r
-                                                                                                                        .getRowCount() - 1];\r
-                        jTableFpdModules.changeSelection(viewIndex, 0, false, false);\r
-                        modInFvTableModel.removeRow(selectedRowLeft);\r
+                    \r
+                    int selectedRowLeft = jTableModInFv.getSelectedRow();\r
+                    if (selectedRowLeft < 0) {\r
+                        modInFvTableModel.addRow(row);\r
+                        jTableModInFv.changeSelection(jTableModInFv.getRowCount() - 1, 0, false, false);\r
                     }\r
-                });\r
-            }\r
-            return jButtonRemove;\r
-        }\r
-\r
-        /**\r
-         * This method initializes jButtonDown  \r
-         *  \r
-         * @return javax.swing.JButton  \r
-         */\r
-        private JButton getJButtonDown() {\r
-            if (jButtonDown == null) {\r
-                jButtonDown = new JButton();\r
-                jButtonDown.setPreferredSize(new java.awt.Dimension(60,20));\r
-                jButtonDown.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));\r
-                jButtonDown.setText("v");\r
-                jButtonDown.addActionListener(new java.awt.event.ActionListener() {\r
-                    public void actionPerformed(java.awt.event.ActionEvent e) {\r
-                        int selectedRow = jTableModInFv.getSelectedRow();\r
-                        if (selectedRow >= jTableModInFv.getRowCount() - 1) {\r
-                            return;\r
-                        }\r
-                        modInFvTableModel.moveRow(selectedRow, selectedRow, selectedRow + 1);\r
-                        jTableModInFv.changeSelection(selectedRow + 1, 0, false, false);\r
+                    else {\r
+                        modInFvTableModel.insertRow(selectedRowLeft, row);\r
+                        jTableModInFv.changeSelection(selectedRowLeft, 0, false, false);\r
                     }\r
-                });\r
-            }\r
-            return jButtonDown;\r
+                    fpdModTableModel.removeRow(rowInModel);\r
+                }\r
+            });\r
         }\r
-        \r
-        /**\r
-         * This method initializes jButtonOk    \r
-         *  \r
-         * @return javax.swing.JButton  \r
-         */\r
-        private JButton getJButtonOk() {\r
-            if (jButtonOk == null) {\r
-                jButtonOk = new JButton();\r
-                jButtonOk.setPreferredSize(new java.awt.Dimension(80,20));\r
-                jButtonOk.setText("Ok");\r
-                jButtonOk.addActionListener(new java.awt.event.ActionListener() {\r
-                    public void actionPerformed(java.awt.event.ActionEvent e) {\r
-                        // need reset FvBindings in ModuleSA.\r
-                        ffc.removeFvBindingAll(title);\r
-                        //\r
-                        // collect module order information to store them into <BuildOptions> -> <UserExtensions>.\r
-                        // also update the FvBinding info in <ModuleSA>.\r
-                        //\r
-                        Vector<String[]> vModInFv = new Vector<String[]>();\r
-                        for (int i = 0; i < jTableModInFv.getRowCount(); ++i) {\r
-                            String moduleName = modInFvTableModel.getValueAt(i, 0)+"";\r
-                            if (moduleName.length() == 0 || moduleName.equals("N/A")) {\r
-                                continue;\r
-                            }\r
-                            \r
-                            String mg = modInFvTableModel.getValueAt(i, 1)+"";\r
-                            String mv = modInFvTableModel.getValueAt(i, 2)+"";\r
-                            String pg = modInFvTableModel.getValueAt(i, 3)+"";\r
-                            String pv = modInFvTableModel.getValueAt(i, 4)+"";\r
-                            String arch = modInFvTableModel.getValueAt(i, 5)+"";\r
-                           \r
-                            String moduleInfo = mg + " " + mv + " " + pg + " " + pv + " " + arch;\r
-                                \r
-                            String[] sa = { mg, mv, pg, pv, arch};\r
-                            vModInFv.add(sa);\r
-                            ffc.updateFvBindingInModuleSA(moduleInfo, title);\r
-                            \r
-                        }\r
-                        ffc.removeBuildOptionsUserExtensions(title);\r
-                        ffc.genBuildOptionsUserExtensions(title, outputFileName, vModInFv);\r
-                        \r
-                        docConsole.setSaved(false);\r
-                        jTabbedPane.setSelectedIndex(0);\r
+        return jButtonInsert;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jButtonRemove    \r
+     *  \r
+     * @return javax.swing.JButton  \r
+     */\r
+    private JButton getJButtonRemove() {\r
+        if (jButtonRemove == null) {\r
+            jButtonRemove = new JButton();\r
+            jButtonRemove.setPreferredSize(new java.awt.Dimension(60,20));\r
+            jButtonRemove.setText(">");\r
+            jButtonRemove.addActionListener(new java.awt.event.ActionListener() {\r
+                public void actionPerformed(java.awt.event.ActionEvent e) {\r
+                    int selectedRowLeft = jTableModInFv.getSelectedRow();\r
+                    if (selectedRowLeft < 0) {\r
+                        return;\r
                     }\r
-                });\r
-            }\r
-            return jButtonOk;\r
-        }\r
-\r
-        /**\r
-         * This method initializes jButtonCancel    \r
-         *  \r
-         * @return javax.swing.JButton  \r
-         */\r
-        private JButton getJButtonCancel() {\r
-            if (jButtonCancel == null) {\r
-                jButtonCancel = new JButton();\r
-                jButtonCancel.setPreferredSize(new java.awt.Dimension(80,20));\r
-                jButtonCancel.setText("Cancel");\r
-                jButtonCancel.addActionListener(new java.awt.event.ActionListener() {\r
-                    public void actionPerformed(java.awt.event.ActionEvent e) {\r
-                        jTabbedPane.setSelectedIndex(0);\r
+                    \r
+                    String name = modInFvTableModel.getValueAt(selectedRowLeft, 0)+"";\r
+                    String mg = modInFvTableModel.getValueAt(selectedRowLeft, 1)+"";\r
+                    String mv = modInFvTableModel.getValueAt(selectedRowLeft, 2)+"";\r
+                    String pg = modInFvTableModel.getValueAt(selectedRowLeft, 3)+"";\r
+                    String pv = modInFvTableModel.getValueAt(selectedRowLeft, 4)+"";\r
+                    String arch = modInFvTableModel.getValueAt(selectedRowLeft, 5)+"";\r
+                    String[] row = {name, mg, mv, pg, pv, arch};\r
+                    String moduleKey = mg + " " + mv + " " + pg + " " + pv + " " + arch; \r
+                    if (name.length() == 0 || name.equals("N/A") || ffc.getModuleSA(moduleKey) == null) {\r
+                        JOptionPane.showMessageDialog(ModuleOrderPane.this, "Module " + name + " not exists in platform. If you want to add back this module, please first add it into current platform. " + moduleKey );\r
+                        modInFvTableModel.removeRow(selectedRowLeft);\r
+                        return;\r
                     }\r
-                });\r
+                   \r
+                    fpdModTableModel.addRow(row);\r
+                    int viewIndex = ((TableSorter) jTableFpdModules.getModel()).getViewIndexArray()[jTableFpdModules\r
+                                                                                                                    .getRowCount() - 1];\r
+                    jTableFpdModules.changeSelection(viewIndex, 0, false, false);\r
+                    modInFvTableModel.removeRow(selectedRowLeft);\r
+                }\r
+            });\r
+        }\r
+        return jButtonRemove;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jButtonDown  \r
+     *  \r
+     * @return javax.swing.JButton  \r
+     */\r
+    private JButton getJButtonDown() {\r
+        if (jButtonDown == null) {\r
+            jButtonDown = new JButton();\r
+            jButtonDown.setPreferredSize(new java.awt.Dimension(60,20));\r
+            jButtonDown.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));\r
+            jButtonDown.setText("v");\r
+            jButtonDown.addActionListener(new java.awt.event.ActionListener() {\r
+                public void actionPerformed(java.awt.event.ActionEvent e) {\r
+                    int selectedRow = jTableModInFv.getSelectedRow();\r
+                    if (selectedRow >= jTableModInFv.getRowCount() - 1) {\r
+                        return;\r
+                    }\r
+                    modInFvTableModel.moveRow(selectedRow, selectedRow, selectedRow + 1);\r
+                    jTableModInFv.changeSelection(selectedRow + 1, 0, false, false);\r
+                }\r
+            });\r
+        }\r
+        return jButtonDown;\r
+    }\r
+    \r
+    /**\r
+     * This method initializes jButtonOk    \r
+     *  \r
+     * @return javax.swing.JButton  \r
+     */\r
+    protected JButton getJButtonOk() {\r
+        if (jButtonOk == null) {\r
+            jButtonOk = new JButton();\r
+            jButtonOk.setPreferredSize(new java.awt.Dimension(80,20));\r
+            jButtonOk.setText("Ok");\r
+            jButtonOk.setActionCommand("ModuleOrderPaneOk");\r
+            jButtonOk.addActionListener(this);\r
+            \r
+        }\r
+        return jButtonOk;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jButtonCancel    \r
+     *  \r
+     * @return javax.swing.JButton  \r
+     */\r
+    protected JButton getJButtonCancel() {\r
+        if (jButtonCancel == null) {\r
+            jButtonCancel = new JButton();\r
+            jButtonCancel.setPreferredSize(new java.awt.Dimension(80,20));\r
+            jButtonCancel.setText("Cancel");\r
+            jButtonCancel.setActionCommand("ModuleOrderPaneCancel");\r
+            \r
+        }\r
+        return jButtonCancel;\r
+    }\r
+\r
+    public void actionPerformed(ActionEvent arg0) {\r
+        if (arg0.getSource() == jButtonOk) {\r
+            //          need reset FvBindings in ModuleSA.\r
+            ffc.removeFvBindingAll(title);\r
+            //\r
+            // collect module order information to store them into <BuildOptions> -> <UserExtensions>.\r
+            // also update the FvBinding info in <ModuleSA>.\r
+            //\r
+            Vector<String[]> vModInFv = new Vector<String[]>();\r
+            for (int i = 0; i < jTableModInFv.getRowCount(); ++i) {\r
+                String moduleName = modInFvTableModel.getValueAt(i, 0)+"";\r
+                if (moduleName.length() == 0 || moduleName.equals("N/A")) {\r
+                    continue;\r
+                }\r
+                \r
+                String mg = modInFvTableModel.getValueAt(i, 1)+"";\r
+                String mv = modInFvTableModel.getValueAt(i, 2)+"";\r
+                String pg = modInFvTableModel.getValueAt(i, 3)+"";\r
+                String pv = modInFvTableModel.getValueAt(i, 4)+"";\r
+                String arch = modInFvTableModel.getValueAt(i, 5)+"";\r
+               \r
+                String moduleInfo = mg + " " + mv + " " + pg + " " + pv + " " + arch;\r
+                    \r
+                String[] sa = { mg, mv, pg, pv, arch};\r
+                vModInFv.add(sa);\r
+                ffc.updateFvBindingInModuleSA(moduleInfo, title);\r
+                \r
             }\r
-            return jButtonCancel;\r
+            ffc.removeBuildOptionsUserExtensions(title, "IMAGES", 1);\r
+            ffc.genBuildOptionsUserExtensions(title, "IMAGES", "1", outputFileName, vModInFv);\r
+            \r
         }\r
     }\r
 \r
-}  //  @jve:decl-index=0:visual-constraint="10,10"\r
+    /**\r
+     * @return Returns the fpdModTableModel.\r
+     */\r
+    protected IDefaultTableModel getFpdModTableModel() {\r
+        return fpdModTableModel;\r
+    }\r
+\r
+    /**\r
+     * @return Returns the modInFvTableModel.\r
+     */\r
+    protected IDefaultTableModel getModInFvTableModel() {\r
+        return modInFvTableModel;\r
+    }\r
+}\r
+\r
 \r
 class FvOptsTableModel extends DefaultTableModel {\r
 \r
index 7c41dd96234c1d368041443b0344c37152f45efc..d8b193413bb60276c5508bed42de3e4acdfc6a01 100644 (file)
@@ -40,6 +40,7 @@ import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;
 import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
 \r
 import java.awt.FlowLayout;\r
+import java.awt.event.ActionEvent;\r
 import java.awt.event.KeyEvent;\r
 import java.awt.event.MouseEvent;\r
 import java.util.ArrayList;\r
@@ -188,6 +189,8 @@ public class FpdFrameworkModules extends IInternalFrame {
     private final int typeMinWidth = 100;\r
     \r
     private final int typeMaxWidth = 155;\r
+\r
+    private JButton jButtonApriori = null;\r
     \r
     /**\r
      * This method initializes jSplitPane\r
@@ -526,6 +529,7 @@ public class FpdFrameworkModules extends IInternalFrame {
             jPanelBottomSouth.setLayout(flowLayout1);\r
             jPanelBottomSouth.add(getJButtonSettings(), null);\r
             jPanelBottomSouth.add(getJButtonRemoveModule(), null);\r
+            jPanelBottomSouth.add(getJButtonApriori(), null);\r
         }\r
         return jPanelBottomSouth;\r
     }\r
@@ -751,7 +755,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                     if (fvBindings != null) {\r
                         String[] fvArray = fvBindings.split(" ");\r
                         for (int i = 0; i < fvArray.length; ++i) {\r
-                            ffc.removeModuleInBuildOptionsUserExtensions(fvArray[i].trim(), mg, mv, pg, pv, arch);\r
+                            ffc.removeModuleInBuildOptionsUserExtensions(fvArray[i].trim(), "IMAGES", 1, mg, mv, pg, pv, arch);\r
                         }\r
                     }\r
                     \r
@@ -795,6 +799,29 @@ public class FpdFrameworkModules extends IInternalFrame {
         return jButtonRemoveModule;\r
     }\r
 \r
+    /**\r
+     * This method initializes jButtonApriori  \r
+     *         \r
+     * @return javax.swing.JButton     \r
+     */\r
+    private JButton getJButtonApriori() {\r
+        if (jButtonApriori == null) {\r
+            jButtonApriori = new JButton();\r
+            jButtonApriori.setText("Apriori Files");\r
+            FontMetrics fm = jButtonApriori.getFontMetrics(jButtonApriori.getFont());\r
+            int buttonWidth = fm.stringWidth(jButtonApriori.getText()) + 40;\r
+            if (jButtonRemoveModule.getWidth() > buttonWidth) {\r
+                buttonWidth = jButtonRemoveModule.getWidth();\r
+            }\r
+            jButtonApriori.setPreferredSize(new Dimension (buttonWidth, 20));\r
+            jButtonApriori.addActionListener(new java.awt.event.ActionListener() {\r
+                public void actionPerformed(ActionEvent arg0) {\r
+                    new GenAprioriFileDialog(ffc, docConsole).setVisible(true);\r
+                }});\r
+        }\r
+        return jButtonApriori;\r
+    }\r
+\r
     /**\r
      * \r
      * @param args\r
index 8f6d31057f6956589ed9692086201246b8c2f15f..db54307c4343afeb04c2d3d119a0bbca8085b93b 100644 (file)
@@ -1331,7 +1331,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                     //\r
                     oldFvList.removeAll(newFvList);\r
                     for (int j = 0; j < oldFvList.size(); ++j) {\r
-                        ffc.removeModuleInBuildOptionsUserExtensions(oldFvList.get(j), moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]);    \r
+                        ffc.removeModuleInBuildOptionsUserExtensions(oldFvList.get(j), "IMAGES", 1, moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]);    \r
                     }\r
                     //\r
                     // add module to Fvs that were not in oldFvList.\r
@@ -1339,7 +1339,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                     oldFvList = getVectorFromString (originalFvBinding);\r
                     newFvList.removeAll(oldFvList);\r
                     for (int i = 0; i < newFvList.size(); ++i) {\r
-                        ffc.addModuleIntoBuildOptionsUserExtensions(newFvList.get(i), moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]);\r
+                        ffc.addModuleIntoBuildOptionsUserExtensions(newFvList.get(i), "IMAGES", 1, moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]);\r
                     }\r
                     docConsole.setSaved(false);\r
                 }\r
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/GenAprioriFileDialog.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/GenAprioriFileDialog.java
new file mode 100644 (file)
index 0000000..3ec3572
--- /dev/null
@@ -0,0 +1,265 @@
+/**\r
+ * \r
+ */\r
+package org.tianocore.frameworkwizard.platform.ui;\r
+\r
+import java.awt.BorderLayout;\r
+import java.awt.Dimension;\r
+import java.awt.Toolkit;\r
+\r
+import javax.swing.JPanel;\r
+\r
+import java.awt.event.ActionEvent;\r
+import java.awt.event.ActionListener;\r
+import java.util.Vector;\r
+\r
+import javax.swing.JDialog;\r
+import javax.swing.JLabel;\r
+import javax.swing.JComboBox;\r
+import javax.swing.JTabbedPane;\r
+\r
+import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
+import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;\r
+\r
+/**\r
+ * @author jlin16\r
+ *\r
+ */\r
+public class GenAprioriFileDialog extends JDialog implements ActionListener {\r
+\r
+    /**\r
+     * \r
+     */\r
+    private static final long serialVersionUID = 3627991301208644354L;\r
+    private JPanel jContentPane = null;\r
+    private JPanel jPanelN = null;\r
+    private JLabel jLabelFvName = null;\r
+    private JComboBox jComboBoxFvNames = null;\r
+    private JTabbedPane jTabbedPane = null;\r
+    private FpdFileContents ffc = null;\r
+    private OpeningPlatformType docConsole = null;\r
+\r
+    /**\r
+     * This is the default constructor\r
+     */\r
+    public GenAprioriFileDialog(FpdFileContents inputFfc, OpeningPlatformType dc) {\r
+        super();\r
+        ffc = inputFfc;\r
+        docConsole = dc;\r
+        initialize();\r
+    }\r
+\r
+    /**\r
+     * This method initializes this\r
+     * \r
+     * @return void\r
+     */\r
+    private void initialize() {\r
+        this.setSize(670, 670);\r
+        this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r
+        this.setTitle("Apriori Files");\r
+        this.setContentPane(getJContentPane());\r
+        this.setResizable(false);\r
+        this.setModal(true);\r
+        \r
+        String fvName = jComboBoxFvNames.getSelectedItem()+"";\r
+        if (fvName.length() > 0) {\r
+            jTabbedPane.removeAll();\r
+            AprioriModuleOrderPane peiPane = new AprioriModuleOrderPane(fvName, "", GenAprioriFileDialog.this, true);\r
+            peiPane.showModulesInFv(fvName);\r
+            peiPane.showAllModulesInPlatform();\r
+            jTabbedPane.addTab("PEIMs", peiPane);\r
+            AprioriModuleOrderPane dxePane = new AprioriModuleOrderPane(fvName, "", GenAprioriFileDialog.this, false);\r
+            dxePane.showModulesInFv(fvName);\r
+            dxePane.showAllModulesInPlatform();\r
+            jTabbedPane.addTab("DXE Drivers", dxePane);\r
+        }\r
+        this.centerWindow();\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(new BorderLayout());\r
+            jContentPane.add(getJPanelN(), java.awt.BorderLayout.NORTH);\r
+            jContentPane.add(getJTabbedPane(), java.awt.BorderLayout.CENTER);\r
+        }\r
+        return jContentPane;\r
+    }\r
+\r
+    public void actionPerformed(ActionEvent arg0) {\r
+        // TODO Auto-generated method stub\r
+        if (arg0.getActionCommand().equals("ModuleOrderPaneOk")) {\r
+            docConsole.setSaved(false);\r
+            return;\r
+        }\r
+        if (arg0.getActionCommand().equals("ModuleOrderPaneCancel")) {\r
+            this.dispose();\r
+        }\r
+    }\r
+    \r
+    /**\r
+    Start the window at the center of screen\r
+    \r
+    **/\r
+   protected void centerWindow(int intWidth, int intHeight) {\r
+       Dimension d = Toolkit.getDefaultToolkit().getScreenSize();\r
+       this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2);\r
+   }\r
+\r
+   /**\r
+    Start the window at the center of screen\r
+    \r
+    **/\r
+   protected void centerWindow() {\r
+       centerWindow(this.getSize().width, this.getSize().height);\r
+   }\r
+\r
+/**\r
+ * This method initializes jPanelN     \r
+ *     \r
+ * @return javax.swing.JPanel  \r
+ */\r
+private JPanel getJPanelN() {\r
+    if (jPanelN == null) {\r
+        jLabelFvName = new JLabel();\r
+        jLabelFvName.setText("FV Name");\r
+        jPanelN = new JPanel();\r
+        jPanelN.add(jLabelFvName, null);\r
+        jPanelN.add(getJComboBoxFvNames(), null);\r
+    }\r
+    return jPanelN;\r
+}\r
+\r
+/**\r
+ * This method initializes jComboBoxFvNames    \r
+ *     \r
+ * @return javax.swing.JComboBox       \r
+ */\r
+private JComboBox getJComboBoxFvNames() {\r
+    if (jComboBoxFvNames == null) {\r
+        jComboBoxFvNames = new JComboBox();\r
+        jComboBoxFvNames.setPreferredSize(new java.awt.Dimension(200,20));\r
+        Vector<String> vFvNames = new Vector<String>();\r
+        ffc.getFvImagesFvImageFvImageNames(vFvNames);\r
+        for (int i = 0; i < vFvNames.size(); ++i) {\r
+            jComboBoxFvNames.addItem(vFvNames.get(i));\r
+        }\r
+//        if (jComboBoxFvNames.getItemCount() > 0) {\r
+//            jComboBoxFvNames.setSelectedIndex(0);\r
+//            \r
+//        }\r
+        jComboBoxFvNames.addItemListener(new java.awt.event.ItemListener() {\r
+            public void itemStateChanged(java.awt.event.ItemEvent e) {\r
+                String fvName = jComboBoxFvNames.getSelectedItem()+"";\r
+                if (fvName.length() > 0) {\r
+                    jTabbedPane.removeAll();\r
+                    AprioriModuleOrderPane peiPane = new AprioriModuleOrderPane(fvName, "", GenAprioriFileDialog.this, true);\r
+                    peiPane.showModulesInFv(fvName);\r
+                    peiPane.showAllModulesInPlatform();\r
+                    jTabbedPane.addTab("PEIMs", peiPane);\r
+                    AprioriModuleOrderPane dxePane = new AprioriModuleOrderPane(fvName, "", GenAprioriFileDialog.this, false);\r
+                    dxePane.showModulesInFv(fvName);\r
+                    dxePane.showAllModulesInPlatform();\r
+                    jTabbedPane.addTab("DXE Drivers", dxePane);\r
+                }\r
+                \r
+            }\r
+        });\r
+    }\r
+    return jComboBoxFvNames;\r
+}\r
+\r
+/**\r
+ * This method initializes jTabbedPane \r
+ *     \r
+ * @return javax.swing.JTabbedPane     \r
+ */\r
+private JTabbedPane getJTabbedPane() {\r
+    if (jTabbedPane == null) {\r
+        jTabbedPane = new JTabbedPane();\r
+    }\r
+    return jTabbedPane;\r
+}\r
+\r
+private class AprioriModuleOrderPane extends ModuleOrderPane {\r
+    /**\r
+     * \r
+     */\r
+    private static final long serialVersionUID = -7952853414833230546L;\r
+    private boolean forPEI = false;\r
+    private String fvName = null;\r
+\r
+    AprioriModuleOrderPane (String fvName, String file, ActionListener action, boolean b) {\r
+        \r
+        super(fvName, file, ffc, action);\r
+        this.fvName = fvName;\r
+        forPEI = b;\r
+        getJTableModInFv().getColumnModel().getColumn(0).setHeaderValue("Modules in Apriori File");\r
+        getJButtonOk().setText("Save");\r
+        getJButtonCancel().setText("Close");\r
+    }\r
+    \r
+    public void showModulesInFv (String fvName) {\r
+        int id = 1;\r
+        if (forPEI) {\r
+            id = 0;\r
+        }\r
+        int size = ffc.getUserExtsIncModCount(fvName, "APRIORI", id);\r
+        \r
+        if (size != -1) {\r
+            String[][] saa = new String[size][5];\r
+            ffc.getUserExtsIncMods(fvName, "APRIORI", id, saa);\r
+\r
+            for (int i = 0; i < size; ++i) {\r
+                String moduleKey = saa[i][0] + " " + saa[i][1] + " " + saa[i][2] + " " + saa[i][3];\r
+                ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);\r
+                String name = "N/A";\r
+                if (mi != null) {\r
+                    name = mi.getName();\r
+                }\r
+                \r
+                String[] row = { name, saa[i][0] , saa[i][1], saa[i][2] , saa[i][3], saa[i][4] };\r
+                getModInFvTableModel().addRow(row);\r
+            }\r
+        }\r
+    }\r
+    \r
+    public void actionPerformed(ActionEvent arg0) {\r
+        if (arg0.getActionCommand().equals("ModuleOrderPaneOk")) {\r
+            int id = 1;\r
+            if (forPEI) {\r
+                id = 0;\r
+            }\r
+            \r
+            Vector<String[]> vModInFv = new Vector<String[]>();\r
+            for (int i = 0; i < getJTableModInFv().getRowCount(); ++i) {\r
+                String moduleName = getModInFvTableModel().getValueAt(i, 0)+"";\r
+                if (moduleName.length() == 0 || moduleName.equals("N/A")) {\r
+                    continue;\r
+                }\r
+                \r
+                String mg = getModInFvTableModel().getValueAt(i, 1)+"";\r
+                String mv = getModInFvTableModel().getValueAt(i, 2)+"";\r
+                String pg = getModInFvTableModel().getValueAt(i, 3)+"";\r
+                String pv = getModInFvTableModel().getValueAt(i, 4)+"";\r
+                String arch = getModInFvTableModel().getValueAt(i, 5)+"";\r
+                    \r
+                String[] sa = { mg, mv, pg, pv, arch};\r
+                vModInFv.add(sa);\r
+                \r
+            }\r
+            \r
+            ffc.removeBuildOptionsUserExtensions(fvName, "APRIORI", id);\r
+            ffc.genBuildOptionsUserExtensions(fvName, "APRIORI", id+"", "", vModInFv);\r
+            \r
+        }\r
+    }\r
+}\r
+}  //  @jve:decl-index=0:visual-constraint="10,10"\r