Fix EDKT337,Double click on modules in "Framework Modules" of Platforms should be...
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 27 Sep 2006 04:23:50 +0000 (04:23 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 27 Sep 2006 04:23:50 +0000 (04:23 +0000)
Fix EDKT334, Wizard should sync modules list in fpd with modules in fv_order.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1630 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFlash.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java

index 57b7f2c..7f06730 100644 (file)
@@ -294,22 +294,14 @@ public class FpdBuildOptions extends IInternalFrame {
 \r
     private JPanel jPanelSectionN = null;\r
 \r
-    private JPanel jPanelSectionC = null;\r
-\r
     private JPanel jPanelSectionsN = null;\r
 \r
-    private JPanel jPanelSectionsC = null;\r
-\r
     private JPanel jPanelSubSectionN = null;\r
 \r
-    private JPanel jPanelSubSectionC = null;\r
-\r
     private JPanel jPanelOptionsContainer = null;\r
 \r
     private JPanel jPanelUserDefCenterN = null;\r
 \r
-    private JPanel jPanelUserDefCenterC = null;\r
-\r
     /**\r
      * This method initializes jPanel  \r
      *         \r
@@ -1245,7 +1237,7 @@ public class FpdBuildOptions extends IInternalFrame {
             jPanelFfsCTop = new JPanel();\r
             jPanelFfsCTop.setLayout(new BorderLayout());\r
             jPanelFfsCTop.add(getJPanelSectionN(), java.awt.BorderLayout.NORTH);\r
-            jPanelFfsCTop.add(getJPanelSectionC(), java.awt.BorderLayout.CENTER);\r
+            jPanelFfsCTop.add(getJScrollPaneFfsSection(), java.awt.BorderLayout.CENTER);\r
         }\r
         return jPanelFfsCTop;\r
     }\r
@@ -1277,7 +1269,7 @@ public class FpdBuildOptions extends IInternalFrame {
             jPanelFfsCBottomTop = new JPanel();\r
             jPanelFfsCBottomTop.setLayout(new BorderLayout());\r
             jPanelFfsCBottomTop.add(getJPanelSectionsN(), java.awt.BorderLayout.NORTH);\r
-            jPanelFfsCBottomTop.add(getJPanelSectionsC(), java.awt.BorderLayout.CENTER);\r
+            jPanelFfsCBottomTop.add(getJScrollPaneFfsSections(), java.awt.BorderLayout.CENTER);\r
         }\r
         return jPanelFfsCBottomTop;\r
     }\r
@@ -1292,7 +1284,7 @@ public class FpdBuildOptions extends IInternalFrame {
             jPanelFfsCBottomBottom = new JPanel();\r
             jPanelFfsCBottomBottom.setLayout(new BorderLayout());\r
             jPanelFfsCBottomBottom.add(getJPanelSubSectionN(), java.awt.BorderLayout.NORTH);\r
-            jPanelFfsCBottomBottom.add(getJPanelSubSectionC(), java.awt.BorderLayout.CENTER);\r
+            jPanelFfsCBottomBottom.add(getJScrollPaneFfsSubSection(), java.awt.BorderLayout.CENTER);\r
         }\r
         return jPanelFfsCBottomBottom;\r
     }\r
@@ -1314,19 +1306,6 @@ public class FpdBuildOptions extends IInternalFrame {
         return jPanelSectionN;\r
     }\r
 \r
-    /**\r
-     * This method initializes jPanelSectionC   \r
-     *  \r
-     * @return javax.swing.JPanel   \r
-     */\r
-    private JPanel getJPanelSectionC() {\r
-        if (jPanelSectionC == null) {\r
-            jPanelSectionC = new JPanel();\r
-            jPanelSectionC.add(getJScrollPaneFfsSection(), null);\r
-        }\r
-        return jPanelSectionC;\r
-    }\r
-\r
     /**\r
      * This method initializes jPanelSectionsN  \r
      *  \r
@@ -1344,19 +1323,6 @@ public class FpdBuildOptions extends IInternalFrame {
         return jPanelSectionsN;\r
     }\r
 \r
-    /**\r
-     * This method initializes jPanelSectionsC  \r
-     *  \r
-     * @return javax.swing.JPanel   \r
-     */\r
-    private JPanel getJPanelSectionsC() {\r
-        if (jPanelSectionsC == null) {\r
-            jPanelSectionsC = new JPanel();\r
-            jPanelSectionsC.add(getJScrollPaneFfsSections(), null);\r
-        }\r
-        return jPanelSectionsC;\r
-    }\r
-\r
     /**\r
      * This method initializes jPanelSubSectionN    \r
      *  \r
@@ -1374,19 +1340,6 @@ public class FpdBuildOptions extends IInternalFrame {
         return jPanelSubSectionN;\r
     }\r
 \r
-    /**\r
-     * This method initializes jPanelSubSectionC    \r
-     *  \r
-     * @return javax.swing.JPanel   \r
-     */\r
-    private JPanel getJPanelSubSectionC() {\r
-        if (jPanelSubSectionC == null) {\r
-            jPanelSubSectionC = new JPanel();\r
-            jPanelSubSectionC.add(getJScrollPaneFfsSubSection(), null);\r
-        }\r
-        return jPanelSubSectionC;\r
-    }\r
-\r
     /**\r
      * The following section contains all Build Options content\r
      */\r
@@ -1976,19 +1929,6 @@ public class FpdBuildOptions extends IInternalFrame {
         return jPanelUserDefCenterN;\r
     }\r
 \r
-    /**\r
-     * This method initializes jPanelUserDefCenterC    \r
-     *         \r
-     * @return javax.swing.JPanel      \r
-     */\r
-    private JPanel getJPanelUserDefCenterC() {\r
-        if (jPanelUserDefCenterC == null) {\r
-            jPanelUserDefCenterC = new JPanel();\r
-            jPanelUserDefCenterC.add(getJScrollPaneAntTasks(), null);\r
-        }\r
-        return jPanelUserDefCenterC;\r
-    }\r
-\r
     /**\r
      * This method initializes jPanel8  \r
      *  \r
@@ -2044,7 +1984,7 @@ public class FpdBuildOptions extends IInternalFrame {
             jPanelUserDefCenter.setLayout(new BorderLayout());\r
 \r
             jPanelUserDefCenter.add(getJPanelUserDefCenterN(), java.awt.BorderLayout.NORTH);\r
-            jPanelUserDefCenter.add(getJPanelUserDefCenterC(), java.awt.BorderLayout.CENTER);\r
+            jPanelUserDefCenter.add(getJScrollPaneAntTasks(), java.awt.BorderLayout.CENTER);\r
         }\r
         return jPanelUserDefCenter;\r
     }\r
index 8584657..0545906 100644 (file)
@@ -23,6 +23,7 @@ import javax.swing.JRadioButton;
 import javax.swing.JButton;\r
 import javax.swing.JLabel;\r
 import javax.swing.JTextField;\r
+import java.awt.GridLayout;\r
 \r
 public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {\r
 \r
@@ -31,9 +32,6 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
      */\r
     private static final long serialVersionUID = 1L;\r
     private JPanel jContentPane = null;\r
-    private JPanel jPanelContentNorth = null;\r
-    private JPanel jPanelContentCenter = null;\r
-    private JPanel jPanelContentSouth = null;\r
     private JScrollPane jScrollPaneDynPcd = null;\r
     private JTable jTableDynPcd = null;\r
     private DynPcdTableModel modelPcd = null; \r
@@ -63,6 +61,7 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
     private JRadioButton jRadioButtonDefaultValue = null;\r
     private ButtonGroup bg = new ButtonGroup();\r
     private JLabel jLabelPadd = null;\r
+    private JLabel jLabelPad1 = null;\r
     /**\r
      * This is the default constructor\r
      */\r
@@ -119,52 +118,13 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
         if (jContentPane == null) {\r
             jContentPane = new JPanel();\r
             jContentPane.setLayout(new BorderLayout());\r
-            jContentPane.add(getJPanelContentNorth(), java.awt.BorderLayout.NORTH);\r
-            jContentPane.add(getJPanelContentCenter(), java.awt.BorderLayout.CENTER);\r
-            jContentPane.add(getJPanelContentSouth(), java.awt.BorderLayout.SOUTH);\r
+            jContentPane.add(getJScrollPaneDynPcd(), java.awt.BorderLayout.NORTH);\r
+            jContentPane.add(getJPanelSkuInfo(), java.awt.BorderLayout.CENTER);\r
+            jContentPane.add(getJPanelDynPcdValue(), java.awt.BorderLayout.SOUTH);\r
         }\r
         return jContentPane;\r
     }\r
 \r
-    /**\r
-     * This method initializes jPanel  \r
-     *         \r
-     * @return javax.swing.JPanel      \r
-     */\r
-    private JPanel getJPanelContentNorth() {\r
-        if (jPanelContentNorth == null) {\r
-            jPanelContentNorth = new JPanel();\r
-        }\r
-        return jPanelContentNorth;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jPanel1 \r
-     *         \r
-     * @return javax.swing.JPanel      \r
-     */\r
-    private JPanel getJPanelContentCenter() {\r
-        if (jPanelContentCenter == null) {\r
-            jPanelContentCenter = new JPanel();\r
-            jPanelContentCenter.add(getJScrollPaneDynPcd(), null);\r
-            jPanelContentCenter.add(getJPanelSkuInfo(), null);\r
-            jPanelContentCenter.add(getJPanelDynPcdValue(), null);\r
-        }\r
-        return jPanelContentCenter;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jPanel2 \r
-     *         \r
-     * @return javax.swing.JPanel      \r
-     */\r
-    private JPanel getJPanelContentSouth() {\r
-        if (jPanelContentSouth == null) {\r
-            jPanelContentSouth = new JPanel();\r
-        }\r
-        return jPanelContentSouth;\r
-    }\r
-\r
     /**\r
      * This method initializes jScrollPane     \r
      *         \r
@@ -173,7 +133,7 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
     private JScrollPane getJScrollPaneDynPcd() {\r
         if (jScrollPaneDynPcd == null) {\r
             jScrollPaneDynPcd = new JScrollPane();\r
-            jScrollPaneDynPcd.setPreferredSize(new java.awt.Dimension(600,200));\r
+            jScrollPaneDynPcd.setPreferredSize(new java.awt.Dimension(100,300));\r
             jScrollPaneDynPcd.setViewportView(getJTableDynPcd());\r
         }\r
         return jScrollPaneDynPcd;\r
@@ -345,6 +305,14 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
      */\r
     private JPanel getJPanelDynPcdValue() {\r
         if (jPanelDynPcdValue == null) {\r
+            jLabelPad1 = new JLabel();\r
+            jLabelPad1.setText(" ");\r
+            GridLayout gridLayout = new GridLayout();\r
+            gridLayout.setColumns(5);\r
+            gridLayout.setRows(4);\r
+            gridLayout.setHgap(5);\r
+            gridLayout.setVgap(5);\r
+            \r
             jLabelVpdOffset = new JLabel();\r
             jLabelVpdOffset.setPreferredSize(new java.awt.Dimension(80,20));\r
             jLabelVpdOffset.setText("VPD Offset");\r
@@ -363,11 +331,9 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
             jLabelVarName.setText("Variable Name");\r
             jLabelVarName.setToolTipText("");\r
             jLabelVarName.setPreferredSize(new java.awt.Dimension(90,20));\r
-            FlowLayout flowLayout1 = new FlowLayout();\r
-            flowLayout1.setAlignment(java.awt.FlowLayout.LEFT);\r
             jPanelDynPcdValue = new JPanel();\r
             jPanelDynPcdValue.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.LOWERED));\r
-            jPanelDynPcdValue.setLayout(flowLayout1);\r
+            jPanelDynPcdValue.setLayout(gridLayout);\r
             jPanelDynPcdValue.setPreferredSize(new java.awt.Dimension(600,120));\r
             jPanelDynPcdValue.add(getJRadioButtonHii(), null);\r
             jPanelDynPcdValue.add(jLabelVarName, null);\r
@@ -381,15 +347,16 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
             jPanelDynPcdValue.add(getJTextFieldHiiDefaultValue(), null);\r
             jPanelDynPcdValue.add(getJRadioButtonVpd(), null);\r
             jPanelDynPcdValue.add(jLabelVpdOffset, null);\r
-            jPanelDynPcdValue.add(getJTextFieldVpdOffset(), null);\r
             jLabelPadd = new JLabel();\r
             jLabelPadd.setText("                           ");\r
-            jPanelDynPcdValue.add(jLabelPadd, null);\r
+            jPanelDynPcdValue.add(getJTextFieldVpdOffset(), null);\r
                        jLabelVarName.setEnabled(false);\r
                        jLabelVarGuid.setEnabled(false);\r
                        jLabelHiiDefaultValue.setEnabled(false);\r
                        jLabelVarOffset.setEnabled(false);\r
                        jLabelVpdOffset.setEnabled(false);\r
+                       jPanelDynPcdValue.add(jLabelPadd, null);\r
+                       jPanelDynPcdValue.add(jLabelPad1, null);\r
                        jPanelDynPcdValue.add(getJRadioButtonDefaultValue(), null);\r
                        jPanelDynPcdValue.add(getJTextFieldDefaultValue(), null);\r
             bg.add(jRadioButtonHii);\r
index 6ca1571..26d3d69 100644 (file)
@@ -1897,6 +1897,138 @@ public class FpdFileContents {
         \r
     }\r
     \r
+    private boolean versionEqual (String v1, String v2) {\r
+        \r
+        if ((v1 == null || v1.length() == 0 || v1.equalsIgnoreCase("null")) \r
+                        && (v2 == null || v2.length() == 0 || v2.equalsIgnoreCase("null"))) {\r
+            return true;\r
+        }\r
+        \r
+        if (v1 != null && v1.equals(v2)) {\r
+            return true;\r
+        }\r
+        \r
+        return false;\r
+    }\r
+    \r
+    public boolean moduleInBuildOptionsUserExtensions (String fvName, String moduleGuid, String moduleVersion, String packageGuid, String packageVersion, String arch) {\r
+        boolean inList = false;\r
+        if (getUserExtsIncModCount(fvName) > 0) {\r
+            \r
+            XmlCursor cursor = getfpdBuildOpts().newCursor();\r
+            QName elementUserExts = new QName (xmlNs, "UserExtensions");\r
+            QName attribUserId = new QName ("UserID");\r
+            QName elementFvName = new QName (xmlNs, "FvName");\r
+            QName elementIncludeModules = new QName(xmlNs, "IncludeModules");\r
+            QName attribModuleGuid = new QName("ModuleGuid");\r
+            QName attribModuleVersion = new QName("ModuleVersion");\r
+            QName attribPackageGuid = new QName("PackageGuid");\r
+            QName attribPackageVersion = new QName("PackageVersion");\r
+            QName attribArch = new QName("Arch");\r
+            \r
+            if (cursor.toChild(elementUserExts)) {\r
+                do {\r
+                    cursor.push();\r
+                    if (cursor.getAttributeText(attribUserId).equals("IMAGES")) {\r
+                        cursor.toChild(elementFvName);\r
+                        String elementName = cursor.getTextValue();\r
+                        if (elementName.equals(fvName)) {\r
+                            cursor.toNextSibling(elementIncludeModules);\r
+                            if (cursor.toFirstChild()) {\r
+                                \r
+                                do {\r
+                                    String mg = cursor.getAttributeText(attribModuleGuid);\r
+                                    String mv = cursor.getAttributeText(attribModuleVersion);\r
+                                    String pg = cursor.getAttributeText(attribPackageGuid);\r
+                                    String pv = cursor.getAttributeText(attribPackageVersion);\r
+                                    String ar = cursor.getAttributeText(attribArch);\r
+                                    if (!moduleGuid.equalsIgnoreCase(mg)) {\r
+                                        continue;\r
+                                    }\r
+                                    if (!packageGuid.equalsIgnoreCase(pg)) {\r
+                                        continue;\r
+                                    }\r
+                                    if (!arch.equalsIgnoreCase(ar)) {\r
+                                        continue;\r
+                                    }\r
+                                    if (!versionEqual(moduleVersion, mv)) {\r
+                                        continue;\r
+                                    }\r
+                                    if (!versionEqual(packageVersion, pv)) {\r
+                                        continue;\r
+                                    }\r
+                                    inList = true;\r
+                                    break;\r
+                                }while (cursor.toNextSibling());\r
+                            }\r
+                            break;\r
+                        }\r
+                    }\r
+                    cursor.pop();\r
+                }while (cursor.toNextSibling(elementUserExts));\r
+            }\r
+            cursor.dispose();\r
+        }\r
+        return inList;\r
+    }\r
+    \r
+    public void removeModuleInBuildOptionsUserExtensions (String fvName, String moduleGuid, String moduleVersion, String packageGuid, String packageVersion, String arch) {\r
+        if (getUserExtsIncModCount(fvName) > 0) {\r
+            \r
+            XmlCursor cursor = getfpdBuildOpts().newCursor();\r
+            QName elementUserExts = new QName (xmlNs, "UserExtensions");\r
+            QName attribUserId = new QName ("UserID");\r
+            QName elementFvName = new QName (xmlNs, "FvName");\r
+            QName elementIncludeModules = new QName(xmlNs, "IncludeModules");\r
+            QName attribModuleGuid = new QName("ModuleGuid");\r
+            QName attribModuleVersion = new QName("ModuleVersion");\r
+            QName attribPackageGuid = new QName("PackageGuid");\r
+            QName attribPackageVersion = new QName("PackageVersion");\r
+            QName attribArch = new QName("Arch");\r
+            \r
+            if (cursor.toChild(elementUserExts)) {\r
+                do {\r
+                    cursor.push();\r
+                    if (cursor.getAttributeText(attribUserId).equals("IMAGES")) {\r
+                        cursor.toChild(elementFvName);\r
+                        String elementName = cursor.getTextValue();\r
+                        if (elementName.equals(fvName)) {\r
+                            cursor.toNextSibling(elementIncludeModules);\r
+                            if (cursor.toFirstChild()) {\r
+                                \r
+                                do {\r
+                                    String mg = cursor.getAttributeText(attribModuleGuid);\r
+                                    String mv = cursor.getAttributeText(attribModuleVersion);\r
+                                    String pg = cursor.getAttributeText(attribPackageGuid);\r
+                                    String pv = cursor.getAttributeText(attribPackageVersion);\r
+                                    String ar = cursor.getAttributeText(attribArch);\r
+                                    if (!moduleGuid.equalsIgnoreCase(mg)) {\r
+                                        continue;\r
+                                    }\r
+                                    if (!packageGuid.equalsIgnoreCase(pg)) {\r
+                                        continue;\r
+                                    }\r
+                                    if (!arch.equalsIgnoreCase(ar)) {\r
+                                        continue;\r
+                                    }\r
+                                    if (!versionEqual(moduleVersion, mv)) {\r
+                                        continue;\r
+                                    }\r
+                                    if (!versionEqual(packageVersion, pv)) {\r
+                                        continue;\r
+                                    }\r
+                                    cursor.removeXml();\r
+                                }while (cursor.toNextSibling());\r
+                            }\r
+                            break;\r
+                        }\r
+                    }\r
+                    cursor.pop();\r
+                }while (cursor.toNextSibling(elementUserExts));\r
+            }\r
+            cursor.dispose();\r
+        }\r
+    }\r
     \r
     public void genBuildOptionsUserDefAntTask (String id, String fileName, String execOrder) {\r
         UserDefinedAntTasksDocument.UserDefinedAntTasks udats = getfpdBuildOpts().getUserDefinedAntTasks();\r
index e97004c..5eefacb 100644 (file)
@@ -2461,6 +2461,7 @@ public class FpdFlash extends IInternalFrame {
                     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
@@ -2903,10 +2904,13 @@ public class FpdFlash extends IInternalFrame {
                         String pv = modInFvTableModel.getValueAt(selectedRowLeft, 4)+"";\r
                         String arch = modInFvTableModel.getValueAt(selectedRowLeft, 5)+"";\r
                         String[] row = {name, mg, mv, pg, pv, arch};\r
-                        if (name.length() == 0 || name.equals("N/A")) {\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
+                       \r
                         fpdModTableModel.addRow(row);\r
                         int viewIndex = ((TableSorter) jTableFpdModules.getModel()).getViewIndexArray()[jTableFpdModules\r
                                                                                                                         .getRowCount() - 1];\r
index 7a5a9d1..ae74471 100644 (file)
@@ -38,6 +38,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.MouseEvent;\r
 import java.util.ArrayList;\r
 import java.util.HashMap;\r
 import java.util.Iterator;\r
@@ -297,7 +298,19 @@ public class FpdFrameworkModules extends IInternalFrame {
 \r
             jTableAllModules.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
             jTableAllModules.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\r
-\r
+            jTableAllModules.addMouseListener(new java.awt.event.MouseAdapter() {\r
+                public void mouseClicked(java.awt.event.MouseEvent e) {\r
+                    if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) {\r
+                        java.awt.Point p = e.getPoint();\r
+                        int rowIndex = jTableAllModules.rowAtPoint(p);\r
+                        TableSorter sorter = (TableSorter) jTableAllModules.getModel();\r
+                        rowIndex = sorter.getModelRowIndex(rowIndex);\r
+                        addModuleIntoPlatform (rowIndex);\r
+                    }\r
+                }\r
+            });\r
+            \r
+            \r
         }\r
         return jTableAllModules;\r
     }\r
@@ -319,6 +332,109 @@ public class FpdFrameworkModules extends IInternalFrame {
         }\r
         return jPanelTopSouth;\r
     }\r
+    \r
+    private void addModuleIntoPlatform (int selectedRow) {\r
+        String path = modelAllModules.getValueAt(selectedRow, pathColForAllModTable) + "";\r
+        ModuleIdentification mi = miList.get(selectedRow);\r
+        Vector<String> vArchs = null;\r
+        try {\r
+            vArchs = WorkspaceProfile.getModuleSupArchs(mi);\r
+        }\r
+        catch (Exception exp) {\r
+            JOptionPane.showMessageDialog(frame, exp.getMessage());\r
+        }\r
+\r
+        if (vArchs == null) {\r
+            JOptionPane.showMessageDialog(frame, "No Supported Architectures specified in MSA file.");\r
+            return;\r
+        }\r
+\r
+        String archsAdded = "";\r
+        String mg = mi.getGuid();\r
+        String mv = mi.getVersion();\r
+        String pg = mi.getPackageId().getGuid();\r
+        String pv = mi.getPackageId().getVersion();\r
+        String mType = SurfaceAreaQuery.getModuleType(mi);\r
+\r
+        ArrayList<String> al = fpdMsa.get(mg + mv + pg + pv);\r
+        if (al == null) {\r
+            //\r
+            // if existing ModuleSA does not specify version info.\r
+            //\r
+            al = fpdMsa.get(mg + "null" + pg + "null");\r
+            if (al == null) {\r
+                al = fpdMsa.get(mg + "null" + pg + pv);\r
+                if (al == null){\r
+                    al = fpdMsa.get(mg + mv + pg + "null");\r
+                    if (al == null) {\r
+                        al = new ArrayList<String>();\r
+                        fpdMsa.put(mg + mv + pg + pv, al);    \r
+                    }\r
+                }\r
+            }\r
+        }\r
+        //\r
+        // filter from module SupArchs what archs has been added.\r
+        //\r
+        for (int i = 0; i < al.size(); ++i) {\r
+            vArchs.remove(al.get(i));\r
+        }\r
+        //\r
+        // check whether archs conform to SupArch of platform.\r
+        //\r
+        Vector<Object> platformSupArch = new Vector<Object>();\r
+        ffc.getPlatformDefsSupportedArchs(platformSupArch);\r
+        vArchs.retainAll(platformSupArch);\r
+        //\r
+        // Archs this Module supported have already been added.\r
+        //\r
+        if (vArchs.size() == 0) {\r
+            JOptionPane.showMessageDialog(frame, "This Module has already been added.");\r
+            return;\r
+        }\r
+        //ToDo put Arch instead of null\r
+        boolean errorOccurred = false;\r
+        for (int i = 0; i < vArchs.size(); ++i) {\r
+            String arch = vArchs.get(i);\r
+            al.add(arch);\r
+            archsAdded += arch + " ";\r
+            String[] row = { "", "", "", "", "", "", "" };\r
+\r
+            if (mi != null) {\r
+                row[modNameColForFpdModTable] = mi.getName();\r
+                row[pkgNameColForFpdModTable] = mi.getPackageId().getName();\r
+                row[pathColForFpdModTable] = path;\r
+                row[archColForFpdModTable] = arch;\r
+                row[pkgVerColForFpdModTable] = pv;\r
+                row[modVerColForFpdModTable] = mv;\r
+                row[typeColForFpdModTable] = mType;\r
+\r
+            }\r
+            modelFpdModules.addRow(row);\r
+\r
+            docConsole.setSaved(false);\r
+            try {\r
+                //ToDo : specify archs need to add.\r
+                ffc.addFrameworkModulesPcdBuildDefs(mi, arch, null);\r
+            } catch (Exception exception) {\r
+                JOptionPane.showMessageDialog(frame, "Adding " + row[modNameColForFpdModTable] + " with Supporting Architectures: " + arch\r
+                                                     + ": " + exception.getMessage());\r
+                errorOccurred = true;\r
+            }\r
+        }\r
+\r
+        String s = "This Module with Architecture " + archsAdded;\r
+        if (errorOccurred) {\r
+            s += " was added with Error. Platform may NOT Build.";\r
+        } else {\r
+            s += " was added Successfully.";\r
+        }\r
+        JOptionPane.showMessageDialog(frame, s);\r
+        TableSorter sorterFpdModules = (TableSorter)jTableFpdModules.getModel();\r
+        int viewIndex = sorterFpdModules.getViewIndexArray()[modelFpdModules.getRowCount() - 1];\r
+        jTableFpdModules.changeSelection(viewIndex, 0, false, false);\r
+\r
+    }\r
 \r
     /**\r
      * This method initializes jButtonAddModule        \r
@@ -339,105 +455,7 @@ public class FpdFrameworkModules extends IInternalFrame {
 \r
                     TableSorter sorter = (TableSorter) jTableAllModules.getModel();\r
                     selectedRow = sorter.getModelRowIndex(selectedRow);\r
-                    String path = modelAllModules.getValueAt(selectedRow, pathColForAllModTable) + "";\r
-                    ModuleIdentification mi = miList.get(selectedRow);\r
-                    Vector<String> vArchs = null;\r
-                    try {\r
-                        vArchs = WorkspaceProfile.getModuleSupArchs(mi);\r
-                    }\r
-                    catch (Exception exp) {\r
-                        JOptionPane.showMessageDialog(frame, exp.getMessage());\r
-                    }\r
-\r
-                    if (vArchs == null) {\r
-                        JOptionPane.showMessageDialog(frame, "No Supported Architectures specified in MSA file.");\r
-                        return;\r
-                    }\r
-\r
-                    String archsAdded = "";\r
-                    String mg = mi.getGuid();\r
-                    String mv = mi.getVersion();\r
-                    String pg = mi.getPackageId().getGuid();\r
-                    String pv = mi.getPackageId().getVersion();\r
-                    String mType = SurfaceAreaQuery.getModuleType(mi);\r
-\r
-                    ArrayList<String> al = fpdMsa.get(mg + mv + pg + pv);\r
-                    if (al == null) {\r
-                        //\r
-                        // if existing ModuleSA does not specify version info.\r
-                        //\r
-                        al = fpdMsa.get(mg + "null" + pg + "null");\r
-                        if (al == null) {\r
-                            al = fpdMsa.get(mg + "null" + pg + pv);\r
-                            if (al == null){\r
-                                al = fpdMsa.get(mg + mv + pg + "null");\r
-                                if (al == null) {\r
-                                    al = new ArrayList<String>();\r
-                                    fpdMsa.put(mg + mv + pg + pv, al);    \r
-                                }\r
-                            }\r
-                        }\r
-                    }\r
-                    //\r
-                    // filter from module SupArchs what archs has been added.\r
-                    //\r
-                    for (int i = 0; i < al.size(); ++i) {\r
-                        vArchs.remove(al.get(i));\r
-                    }\r
-                    //\r
-                    // check whether archs conform to SupArch of platform.\r
-                    //\r
-                    Vector<Object> platformSupArch = new Vector<Object>();\r
-                    ffc.getPlatformDefsSupportedArchs(platformSupArch);\r
-                    vArchs.retainAll(platformSupArch);\r
-                    //\r
-                    // Archs this Module supported have already been added.\r
-                    //\r
-                    if (vArchs.size() == 0) {\r
-                        JOptionPane.showMessageDialog(frame, "This Module has already been added.");\r
-                        return;\r
-                    }\r
-                    //ToDo put Arch instead of null\r
-                    boolean errorOccurred = false;\r
-                    for (int i = 0; i < vArchs.size(); ++i) {\r
-                        String arch = vArchs.get(i);\r
-                        al.add(arch);\r
-                        archsAdded += arch + " ";\r
-                        String[] row = { "", "", "", "", "", "", "" };\r
-\r
-                        if (mi != null) {\r
-                            row[modNameColForFpdModTable] = mi.getName();\r
-                            row[pkgNameColForFpdModTable] = mi.getPackageId().getName();\r
-                            row[pathColForFpdModTable] = path;\r
-                            row[archColForFpdModTable] = arch;\r
-                            row[pkgVerColForFpdModTable] = pv;\r
-                            row[modVerColForFpdModTable] = mv;\r
-                            row[typeColForFpdModTable] = mType;\r
-\r
-                        }\r
-                        modelFpdModules.addRow(row);\r
-\r
-                        docConsole.setSaved(false);\r
-                        try {\r
-                            //ToDo : specify archs need to add.\r
-                            ffc.addFrameworkModulesPcdBuildDefs(mi, arch, null);\r
-                        } catch (Exception exception) {\r
-                            JOptionPane.showMessageDialog(frame, "Adding " + row[modNameColForFpdModTable] + " with Supporting Architectures: " + arch\r
-                                                                 + ": " + exception.getMessage());\r
-                            errorOccurred = true;\r
-                        }\r
-                    }\r
-\r
-                    String s = "This Module with Architecture " + archsAdded;\r
-                    if (errorOccurred) {\r
-                        s += " was added with Error. Platform may NOT Build.";\r
-                    } else {\r
-                        s += " was added Successfully.";\r
-                    }\r
-                    JOptionPane.showMessageDialog(frame, s);\r
-                    TableSorter sorterFpdModules = (TableSorter)jTableFpdModules.getModel();\r
-                    int viewIndex = sorterFpdModules.getViewIndexArray()[modelFpdModules.getRowCount() - 1];\r
-                    jTableFpdModules.changeSelection(viewIndex, 0, false, false);\r
+                    addModuleIntoPlatform (selectedRow);    \r
                 }\r
             });\r
         }\r
@@ -530,6 +548,18 @@ public class FpdFrameworkModules extends IInternalFrame {
             jTableFpdModules.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
             jTableFpdModules.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);\r
             \r
+            jTableFpdModules.addMouseListener(new java.awt.event.MouseAdapter() {\r
+                public void mouseClicked(java.awt.event.MouseEvent e) {\r
+                    if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) {\r
+                        java.awt.Point p = e.getPoint();\r
+                        int rowIndex = jTableFpdModules.rowAtPoint(p);\r
+                        TableSorter sorter = (TableSorter) jTableFpdModules.getModel();\r
+                        rowIndex = sorter.getModelRowIndex(rowIndex);\r
+                        showSettingsDlg (rowIndex);\r
+                    }\r
+                }\r
+            });\r
+            \r
             jTableFpdModules.getModel().addTableModelListener(this);\r
         }\r
         return jTableFpdModules;\r
@@ -550,6 +580,32 @@ public class FpdFrameworkModules extends IInternalFrame {
             docConsole.setSaved(false);\r
         }\r
     }\r
+    \r
+    private void showSettingsDlg (int row) {\r
+        try {\r
+            if (ffc.adjustPcd(row)) {\r
+                docConsole.setSaved(false);\r
+            }\r
+        }\r
+        catch (Exception exp) {\r
+            JOptionPane.showMessageDialog(frame, exp.getMessage());\r
+            return;\r
+        }\r
+        \r
+        if (settingDlg == null) {\r
+            settingDlg = new FpdModuleSA(ffc);\r
+        }\r
+\r
+        String[] sa = new String[5];\r
+        ffc.getFrameworkModuleInfo(row, sa);\r
+        String mg = sa[ffcModGuid];\r
+        String mv = sa[ffcModVer];\r
+        String pg = sa[ffcPkgGuid];\r
+        String pv = sa[ffcPkgVer];\r
+        String arch = sa[ffcModArch];\r
+        settingDlg.setKey(mg + " " + mv + " " + pg + " " + pv + " " + arch, row, docConsole);\r
+        settingDlg.setVisible(true);\r
+    }\r
     /**\r
      * This method initializes jButtonSettings\r
      *         \r
@@ -569,29 +625,7 @@ public class FpdFrameworkModules extends IInternalFrame {
 \r
                     TableSorter sorter = (TableSorter) jTableFpdModules.getModel();\r
                     selectedRow = sorter.getModelRowIndex(selectedRow);\r
-                    try {\r
-                        if (ffc.adjustPcd(selectedRow)) {\r
-                            docConsole.setSaved(false);\r
-                        }\r
-                    }\r
-                    catch (Exception exp) {\r
-                        JOptionPane.showMessageDialog(frame, exp.getMessage());\r
-                        return;\r
-                    }\r
-                    \r
-                    if (settingDlg == null) {\r
-                        settingDlg = new FpdModuleSA(ffc);\r
-                    }\r
-\r
-                    String[] sa = new String[5];\r
-                    ffc.getFrameworkModuleInfo(selectedRow, sa);\r
-                    String mg = sa[ffcModGuid];\r
-                    String mv = sa[ffcModVer];\r
-                    String pg = sa[ffcPkgGuid];\r
-                    String pv = sa[ffcPkgVer];\r
-                    String arch = sa[ffcModArch];\r
-                    settingDlg.setKey(mg + " " + mv + " " + pg + " " + pv + " " + arch, selectedRow, docConsole);\r
-                    settingDlg.setVisible(true);\r
+                    showSettingsDlg (selectedRow);\r
                 }\r
             });\r
         }\r
@@ -626,6 +660,18 @@ public class FpdFrameworkModules extends IInternalFrame {
                     String pg = sa[ffcPkgGuid];\r
                     String pv = sa[ffcPkgVer];\r
                     String arch = sa[ffcModArch];\r
+                    //\r
+                    // sync. module order list in BuildOptions-UserExtensions.\r
+                    //\r
+                    String moduleKey = mg + " " + mv + " " + pg + " " + pv + " " + arch;\r
+                    String fvBindings = ffc.getFvBinding(moduleKey);\r
+                    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
+                        }\r
+                    }\r
+                    \r
                     ModuleIdentification mi = WorkspaceProfile.getModuleId(mg + " " + mv + " " + pg + " " + pv + " " + arch);\r
                     if (mi != null) {\r
                         mv = mi.getVersion();\r
index 7c1eb54..dea3187 100644 (file)
@@ -123,7 +123,6 @@ public class FpdModuleSA extends JDialog implements ActionListener {
     private OpeningPlatformType docConsole = null;\r
     private JPanel jPanelCustomToolChain = null;\r
     private JPanel jPanelToolchainS = null;\r
-    private JPanel jPanelToolchainC = null;\r
     private JPanel jPanelLibraryCenterN = null;\r
     private JPanel jPanelLibraryCenterC = null;  //  @jve:decl-index=0:visual-constraint="20,224"\r
     /**\r
@@ -1126,7 +1125,8 @@ public class FpdModuleSA extends JDialog implements ActionListener {
     private JTextField getJTextFieldFvBinding() {\r
         if (jTextFieldFvBinding == null) {\r
             jTextFieldFvBinding = new JTextField();\r
-            jTextFieldFvBinding.setPreferredSize(new java.awt.Dimension(150,20));\r
+            jTextFieldFvBinding.setPreferredSize(new java.awt.Dimension(400,20));\r
+            jTextFieldFvBinding.setEditable(false);\r
             jTextFieldFvBinding.addFocusListener(new java.awt.event.FocusAdapter() {\r
                 public void focusLost(java.awt.event.FocusEvent e) {\r
                     String originalFvBinding = ffc.getFvBinding(moduleKey);\r
@@ -1603,7 +1603,7 @@ private JPanel getJPanelCustomToolChain() {
         jPanelCustomToolChain = new JPanel();\r
         jPanelCustomToolChain.setLayout(new BorderLayout());\r
         jPanelCustomToolChain.add(getJPanelToolchainS(), java.awt.BorderLayout.SOUTH);\r
-        jPanelCustomToolChain.add(getJPanelToolchainC(), java.awt.BorderLayout.CENTER);\r
+        jPanelCustomToolChain.add(getJScrollPaneModuleSaOptions(), java.awt.BorderLayout.CENTER);\r
         jPanelCustomToolChain.addComponentListener(new java.awt.event.ComponentAdapter() {\r
             public void componentShown(java.awt.event.ComponentEvent e) {\r
                 initToolChainOptions(moduleKey);\r
@@ -1625,18 +1625,7 @@ private JPanel getJPanelToolchainS() {
     }\r
     return jPanelToolchainS;\r
 }\r
-/**\r
- * This method initializes jPanelToolchainC    \r
- *     \r
- * @return javax.swing.JPanel  \r
- */\r
-private JPanel getJPanelToolchainC() {\r
-    if (jPanelToolchainC == null) {\r
-        jPanelToolchainC = new JPanel();\r
-        jPanelToolchainC.add(getJScrollPaneModuleSaOptions(), null);\r
-    }\r
-    return jPanelToolchainC;\r
-}\r
+\r
 /**\r
  * This method initializes jPanelLibraryCenterN        \r
  *     \r