Generate Module Orders in FV at BuildOptions, UserExtensions with UserId "IMAGES...
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 27 Aug 2006 02:56:35 +0000 (02:56 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 27 Aug 2006 02:56:35 +0000 (02:56 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1392 6f19259b-4bc3-4df7-8a09-765794883524

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/global/WorkspaceProfile.java

index e60426446fbe826b66cf251432da64e9b5db78e4..07980d7ddba91714dce2c0b38be7760f519c3f4f 100644 (file)
@@ -760,31 +760,110 @@ public class FpdFileContents {
         return msa.getModuleSaBuildOptions().getFvBinding();\r
     }\r
     \r
-    public void setFvBinding(String moduleKey, String fvBinding){\r
-        ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);\r
-        if (msa == null ) {\r
+    public void setFvBinding(ModuleSADocument.ModuleSA moduleSa, String fvBinding) {\r
+        if (moduleSa == null ) {\r
             return;\r
         }\r
         if (fvBinding == null || fvBinding.length() == 0) {\r
-            if(msa.getModuleSaBuildOptions() != null){\r
-                msa.getModuleSaBuildOptions().unsetFvBinding();\r
+            if(moduleSa.getModuleSaBuildOptions() != null){\r
+                moduleSa.getModuleSaBuildOptions().unsetFvBinding();\r
             }\r
         }\r
         else {\r
-            if(msa.getModuleSaBuildOptions() == null){\r
-                msa.addNewModuleSaBuildOptions().setFvBinding(fvBinding);\r
+            if(moduleSa.getModuleSaBuildOptions() == null){\r
+                moduleSa.addNewModuleSaBuildOptions().setFvBinding(fvBinding);\r
                 return;\r
             }\r
-            msa.getModuleSaBuildOptions().setFvBinding(fvBinding);\r
+            moduleSa.getModuleSaBuildOptions().setFvBinding(fvBinding);\r
+        }\r
+    }\r
+    \r
+    public void setFvBinding(String moduleKey, String fvBinding){\r
+        ModuleSADocument.ModuleSA moduleSa = getModuleSA(moduleKey);\r
+        setFvBinding (moduleSa, fvBinding);\r
+    }\r
+    \r
+    public void removeFvBinding (ModuleSADocument.ModuleSA moduleSa, String fvName) {\r
+        if (moduleSa == null || moduleSa.getModuleSaBuildOptions() == null || moduleSa.getModuleSaBuildOptions().getFvBinding() == null) {\r
+            return;\r
+        }\r
+        \r
+        String fvNameList = moduleSa.getModuleSaBuildOptions().getFvBinding();\r
+        String[] fvNamesArray = fvNameList.split(" ");\r
+        int occursAt = -1;\r
+        for (int i = 0; i < fvNamesArray.length; ++i) {\r
+            if (fvNamesArray[i].equals(fvName)) {\r
+                occursAt = i;\r
+                break;\r
+            }\r
+        }\r
+        // jump over where the input fvName occurs in the original Fv list.\r
+        if (occursAt != -1) {\r
+            String newFvNameList = " ";\r
+            for (int i = 0; i < fvNamesArray.length; ++i) {\r
+                if (i == occursAt) {\r
+                    continue;\r
+                }\r
+                newFvNameList += fvNamesArray[i];\r
+            }\r
+            setFvBinding (moduleSa, newFvNameList.trim());\r
+        }\r
+\r
+    }\r
+    \r
+    /**\r
+     * @param fvName The FV name that to be removed from FvBinding List.\r
+     */\r
+    public void removeFvBindingAll (String fvName) {\r
+        if (getfpdFrameworkModules().getModuleSAList() == null || getfpdFrameworkModules().getModuleSAList().size() == 0){\r
+            removeElement(getfpdFrameworkModules());\r
+            fpdFrameworkModules = null;\r
+            return;\r
+        }\r
+        \r
+        Iterator<ModuleSADocument.ModuleSA> li = getfpdFrameworkModules().getModuleSAList().iterator();\r
+        while (li.hasNext()) {\r
+            ModuleSADocument.ModuleSA moduleSa = li.next();\r
+            removeFvBinding (moduleSa, fvName); \r
+        }\r
+    }\r
+    \r
+    public void appendFvBinding (String moduleKey, String fvName) {\r
+        ModuleSADocument.ModuleSA moduleSa = getModuleSA(moduleKey);\r
+        appendFvBinding (moduleSa, fvName);\r
+    }\r
+    \r
+    public void appendFvBinding (ModuleSADocument.ModuleSA moduleSa, String fvName) {\r
+        if (moduleSa == null) {\r
+            return;\r
+        }\r
+        \r
+        if (moduleSa.getModuleSaBuildOptions() == null || moduleSa.getModuleSaBuildOptions().getFvBinding() == null) {\r
+            setFvBinding(moduleSa, fvName);\r
+            return;\r
+        }\r
+        \r
+        String fvNameList = moduleSa.getModuleSaBuildOptions().getFvBinding();\r
+        String newFvNameList = fvNameList + " " + fvName;\r
+        setFvBinding (moduleSa, newFvNameList.trim());\r
+    }\r
+    \r
+    public void updateFvBindingInModuleSA (ModuleIdentification mi, String fvName) {\r
+        Vector<Object> vSupArchs = new Vector<Object>();\r
+        getPlatformDefsSupportedArchs(vSupArchs);\r
+        String moduleInfo = mi.getGuid() + " " + mi.getVersion() + " " + mi.getPackageId().getGuid() + " " + mi.getPackageId().getVersion();\r
+        for (int i = 0; i < vSupArchs.size(); ++i) {\r
+            String moduleKey = moduleInfo + " " + vSupArchs.get(i);\r
+            appendFvBinding (moduleKey, fvName);\r
         }\r
     }\r
     \r
     public String getFfsFileNameGuid(String moduleKey){\r
-        ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);\r
-        if (msa == null || msa.getModuleSaBuildOptions() == null) {\r
+        ModuleSADocument.ModuleSA moduleSa = getModuleSA(moduleKey);\r
+        if (moduleSa == null || moduleSa.getModuleSaBuildOptions() == null) {\r
             return null;\r
         }\r
-        return msa.getModuleSaBuildOptions().getFfsFileNameGuid();\r
+        return moduleSa.getModuleSaBuildOptions().getFfsFileNameGuid();\r
     }\r
     \r
     public void setFfsFileNameGuid(String moduleKey, String fileGuid){\r
@@ -1529,7 +1608,7 @@ public class FpdFileContents {
         return fpdBuildOpts;\r
     }\r
     \r
-    public void genBuildOptionsUserExtensions(String fvName, String outputFileName, String[][] includeModules) {\r
+    public void genBuildOptionsUserExtensions(String fvName, String outputFileName, Vector<String[]> includeModules) {\r
         UserExtensionsDocument.UserExtensions userExts = getfpdBuildOpts().addNewUserExtensions();\r
         userExts.setUserID("IMAGES");\r
         userExts.setIdentifier(new BigInteger("1"));\r
@@ -1545,10 +1624,10 @@ public class FpdFileContents {
         cursor.toNextToken();\r
         \r
         cursor.beginElement("IncludeModules");\r
-        for (int i = 0; i < includeModules.length; ++i) {\r
+        for (int i = 0; i < includeModules.size(); ++i) {\r
             cursor.beginElement("Module");\r
-            cursor.insertAttributeWithValue("ModuleGuid", includeModules[i][0]);\r
-            cursor.insertAttributeWithValue("BaseName", includeModules[i][1]);\r
+            cursor.insertAttributeWithValue("ModuleGuid", includeModules.get(i)[0]);\r
+            cursor.insertAttributeWithValue("BaseName", includeModules.get(i)[1]);\r
             cursor.toEndToken();\r
             cursor.toNextToken();\r
         }\r
index 3b07c696b265588866a7a38cb3f11ca029a550bd..8c61e9ff6bbd6eceb1c80e9876350fd1ec6f4387 100644 (file)
@@ -35,11 +35,15 @@ import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;
 \r
 import java.awt.FlowLayout;\r
 import java.awt.event.ActionEvent;\r
+import java.awt.event.ComponentAdapter;\r
+import java.awt.event.ComponentEvent;\r
 import java.awt.event.ItemEvent;\r
 import java.awt.event.ItemListener;\r
 import java.io.BufferedReader;\r
 import java.io.File;\r
 import java.io.FileReader;\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
 import java.util.Iterator;\r
 import java.util.LinkedHashMap;\r
 import java.util.Map;\r
@@ -988,18 +992,20 @@ public class FpdFlash extends IInternalFrame {
             jPanelFdf.add(getJPanelFdfN(), java.awt.BorderLayout.NORTH);\r
             jPanelFdf.add(getJPanelFdfS(), java.awt.BorderLayout.SOUTH);\r
             jPanelFdf.add(getJSplitPaneFdfC(), java.awt.BorderLayout.CENTER);\r
-//            jPanelFdf.addComponentListener(new ComponentAdapter(){\r
-//                public void componentShown(ComponentEvent e) {\r
+            jPanelFdf.addComponentListener(new ComponentAdapter(){\r
+                public void componentShown(ComponentEvent e) {\r
 //                    if (ffc.getFlashDefinitionFile() != null) {\r
 //                        jTextFieldFdf.setText(ffc.getFlashDefinitionFile());\r
+//                        initFvInFdfTable(System.getenv("WORKSPACE") + File.separator + jTextFieldFdf.getText());\r
+//    \r
 //                    }\r
-//                }\r
-//                public void componentHidden(ComponentEvent e) {\r
-//                    if (jCheckBoxFdf.isSelected()) {\r
-//                        ffc.genFlashDefinitionFile(jTextFieldFdf.getText());\r
-//                    }\r
-//                }\r
-//            });\r
+                }\r
+                public void componentHidden(ComponentEvent e) {\r
+                    if (jCheckBoxFdf.isSelected()) {\r
+                        ffc.genFlashDefinitionFile(jTextFieldFdf.getText());\r
+                    }\r
+                }\r
+            });\r
         }\r
         return jPanelFdf;\r
     }\r
@@ -1041,6 +1047,7 @@ public class FpdFlash extends IInternalFrame {
         if (jTextFieldFdf == null) {\r
             jTextFieldFdf = new JTextField();\r
             jTextFieldFdf.setEnabled(false);\r
+            jTextFieldFdf.setEditable(false);\r
             jTextFieldFdf.setPreferredSize(new Dimension(300, 20));\r
             jTextFieldFdf.addFocusListener(new java.awt.event.FocusAdapter() {\r
                 public void focusLost(java.awt.event.FocusEvent e) {\r
@@ -1086,14 +1093,7 @@ public class FpdFlash extends IInternalFrame {
                         jTextFieldFdf.setText(filePath.substring(wsDir.length() + 1).replace('\\', '/'));\r
                         ffc.genFlashDefinitionFile(jTextFieldFdf.getText());\r
                         docConsole.setSaved(false);\r
-                        Vector<FvInfoFromFdf> vFvInfo = new Vector<FvInfoFromFdf>();\r
-                        getFvInfoFromFdf(filePath, vFvInfo);\r
-                        getFvInFdfTableModel().setRowCount(0);\r
-                        for (int j = 0; j < vFvInfo.size(); ++j) {\r
-                            FvInfoFromFdf fvInfo = vFvInfo.get(j);\r
-                            String[] row = {fvInfo.getFvName(), fvInfo.getSize(), fvInfo.getEfiFileName()};\r
-                            getFvInFdfTableModel().addRow(row);\r
-                        }\r
+                        initFvInFdfTable(filePath);\r
                     }\r
                 }\r
                 \r
@@ -1102,6 +1102,32 @@ public class FpdFlash extends IInternalFrame {
         return jButtonFdfBrowse;\r
     }\r
 \r
+    private void initFvInFdfTable(String fdfPath){\r
+        Vector<FvInfoFromFdf> vFvInfo = new Vector<FvInfoFromFdf>();\r
+        getFvInfoFromFdf(fdfPath, vFvInfo);\r
+        getFvInFdfTableModel().setRowCount(0);\r
+        for (int j = 0; j < vFvInfo.size(); ++j) {\r
+            FvInfoFromFdf fvInfo = vFvInfo.get(j);\r
+            String[] row = {fvInfo.getFvName(), fvInfo.getSize(), fvInfo.getEfiFileName()};\r
+            getFvInFdfTableModel().addRow(row);\r
+        }\r
+\r
+        for (int k = 0; k < vFvInfo.size(); ++k) {\r
+            FvInfoFromFdf fvInfo = vFvInfo.get(k);\r
+            addTabForFv(fvInfo);\r
+        }\r
+    }\r
+    \r
+    private void addTabForFv (FvInfoFromFdf fvInfo) {\r
+        String fvName = fvInfo.getFvName();\r
+        String outputFile = fvInfo.getEfiFileName();\r
+        for (int i = 2; i < jTabbedPane.getTabCount(); ++i) {\r
+            if (jTabbedPane.getTitleAt(i).equals(fvName)) {\r
+                return;\r
+            }\r
+        }\r
+        jTabbedPane.addTab(fvName, null, new ModuleOrderPane(fvName, outputFile), null);\r
+    }\r
     /**\r
      * This method initializes jTextField4     \r
      *         \r
@@ -1495,6 +1521,7 @@ public class FpdFlash extends IInternalFrame {
         if (jButtonFvInFdfOptions == null) {\r
             jButtonFvInFdfOptions = new JButton();\r
             jButtonFvInFdfOptions.setPreferredSize(new java.awt.Dimension(80,20));\r
+            jButtonFvInFdfOptions.setEnabled(false);\r
             jButtonFvInFdfOptions.setText("Options");\r
             jButtonFvInFdfOptions.addActionListener(new java.awt.event.ActionListener() {\r
                 public void actionPerformed(java.awt.event.ActionEvent e) {\r
@@ -1561,7 +1588,13 @@ public class FpdFlash extends IInternalFrame {
         if (jButtonAddFv == null) {\r
             jButtonAddFv = new JButton();\r
             jButtonAddFv.setPreferredSize(new java.awt.Dimension(80,20));\r
+            jButtonAddFv.setEnabled(false);\r
             jButtonAddFv.setText("New");\r
+            jButtonAddFv.addActionListener(new java.awt.event.ActionListener() {\r
+                public void actionPerformed(java.awt.event.ActionEvent e) {\r
+                    System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()\r
+                }\r
+            });\r
         }\r
         return jButtonAddFv;\r
     }\r
@@ -1575,7 +1608,13 @@ public class FpdFlash extends IInternalFrame {
         if (jButtonDelFv == null) {\r
             jButtonDelFv = new JButton();\r
             jButtonDelFv.setPreferredSize(new java.awt.Dimension(80,20));\r
+            jButtonDelFv.setEnabled(false);\r
             jButtonDelFv.setText("Delete");\r
+            jButtonDelFv.addActionListener(new java.awt.event.ActionListener() {\r
+                public void actionPerformed(java.awt.event.ActionEvent e) {\r
+                    System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()\r
+                }\r
+            });\r
         }\r
         return jButtonDelFv;\r
     }\r
@@ -1589,7 +1628,13 @@ public class FpdFlash extends IInternalFrame {
         if (jButtonAddFvOptions == null) {\r
             jButtonAddFvOptions = new JButton();\r
             jButtonAddFvOptions.setPreferredSize(new java.awt.Dimension(80,20));\r
+            jButtonAddFvOptions.setEnabled(false);\r
             jButtonAddFvOptions.setText("Options");\r
+            jButtonAddFvOptions.addActionListener(new java.awt.event.ActionListener() {\r
+                public void actionPerformed(java.awt.event.ActionEvent e) {\r
+                    System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()\r
+                }\r
+            });\r
         }\r
         return jButtonAddFvOptions;\r
     }\r
@@ -1654,21 +1699,7 @@ public class FpdFlash extends IInternalFrame {
         }\r
         \r
         String fdfPath = System.getenv("WORKSPACE") + File.separator + fdfFile;\r
-        Vector<FvInfoFromFdf> vFvInfo = new Vector<FvInfoFromFdf>();\r
-        getFvInfoFromFdf(fdfPath, vFvInfo);\r
-        getFvInFdfTableModel().setRowCount(0);\r
-        for (int j = 0; j < vFvInfo.size(); ++j) {\r
-            FvInfoFromFdf fvInfo = vFvInfo.get(j);\r
-            String[] row = {fvInfo.getFvName(), fvInfo.getSize(), fvInfo.getEfiFileName()};\r
-            getFvInFdfTableModel().addRow(row);\r
-        }\r
-        \r
-\r
-        for (int k = 0; k < vFvInfo.size(); ++k) {\r
-            FvInfoFromFdf fvInfo = vFvInfo.get(k);\r
-            getJTabbedPane().addTab(fvInfo.getFvName(), null, new ModuleOrderPane(), null);\r
-\r
-        }\r
+        initFvInFdfTable(fdfPath);\r
     }\r
     \r
     private void getOptionNameValue(Map<String, String> m){\r
@@ -1798,7 +1829,11 @@ public class FpdFlash extends IInternalFrame {
                 }\r
    \r
             }\r
-        } catch (Exception e) {\r
+            \r
+            reader.close();\r
+            in.close();\r
+        }\r
+        catch (Exception e) {\r
            \r
         }\r
 \r
@@ -1826,19 +1861,22 @@ public class FpdFlash extends IInternalFrame {
         private JButton jButtonCancel = null;\r
         private NonEditableTableModel modInFvTableModel = null;\r
         private NonEditableTableModel fpdModTableModel = null;\r
+        private HashMap<String, ModuleIdentification> mGuidToModuleId = null;\r
+        private ArrayList<String> listModGuidInFv = null;\r
+        private String title = null;\r
+        private String outputFileName = null;\r
         \r
-        public ModuleOrderPane() {\r
+        public ModuleOrderPane(String tabTitle, String file) {\r
             super(new BorderLayout());\r
+            title = tabTitle;\r
+            outputFileName = file;\r
+            mGuidToModuleId = new HashMap<String, ModuleIdentification>();\r
+            listModGuidInFv = new ArrayList<String>();\r
             add(getJPanelModOrderN(), java.awt.BorderLayout.NORTH);\r
             add(getJPanelModOrderS(), java.awt.BorderLayout.SOUTH);\r
             add(getJPanelModOrderC(), java.awt.BorderLayout.CENTER);\r
-            addComponentListener(new java.awt.event.ComponentAdapter() {\r
-                public void componentShown(java.awt.event.ComponentEvent e) {\r
-                    String title = jTabbedPane.getTitleAt(jTabbedPane.getSelectedIndex()); // TODO Auto-generated Event stub componentShown()\r
-                    showModulesInFv(title);\r
-                    showAllModulesInPlatform();\r
-                }\r
-            });\r
+            showModulesInFv(title);\r
+            showAllModulesInPlatform();\r
         }\r
         \r
         private void showModulesInFv(String fvName) {\r
@@ -1849,6 +1887,7 @@ public class FpdFlash extends IInternalFrame {
                 ffc.getUserExtsIncMods(fvName, saa);\r
 \r
                 for (int i = 0; i < size; ++i) {\r
+                    listModGuidInFv.add(saa[i][0].toLowerCase());\r
                     String name = getModuleName(saa[i][0]);\r
                     String[] row = { name };\r
                     modInFvTableModel.addRow(row);\r
@@ -1866,16 +1905,16 @@ public class FpdFlash extends IInternalFrame {
             Iterator<String> iter = vGuid.iterator();\r
             while (iter.hasNext()){\r
                 String guid = iter.next();\r
-                String moduleName = getModuleName(guid);\r
-                if (existedInTable(moduleName, modInFvTableModel)) {\r
-                    vGuid.remove(guid);\r
+//                String moduleName = getModuleName(guid);\r
+//                if (existedInTable(moduleName, modInFvTableModel)) {\r
+//                    vGuid.remove(guid);\r
+//                }\r
+                if (!listModGuidInFv.contains(guid.toLowerCase())) {\r
+                    String[] row = {getModuleName(guid)};\r
+                    modInFvTableModel.addRow(row);\r
                 }\r
             }\r
-            \r
-            for (int j = 0; j < vGuid.size(); ++j) {\r
-                String[] row = {getModuleName(vGuid.get(j))};\r
-                modInFvTableModel.addRow(row);\r
-            }\r
+\r
         }\r
         \r
         private void showAllModulesInPlatform() {\r
@@ -1899,12 +1938,14 @@ public class FpdFlash extends IInternalFrame {
         private String getModuleName (String guid) {\r
             \r
             for (int i = 0; i < GlobalData.vModuleList.size(); ++i) {\r
-                String mg = GlobalData.vModuleList.get(i).getGuid();\r
+                ModuleIdentification mi = GlobalData.vModuleList.get(i);\r
+                String mg = mi.getGuid();\r
                 if (mg == null) {\r
                     continue;\r
                 }\r
                 if (mg.equalsIgnoreCase(guid)) {\r
-                    return GlobalData.vModuleList.get(i).getName();\r
+                    mGuidToModuleId.put(guid.toLowerCase(), mi);\r
+                    return mi.getName();\r
                 }\r
             }\r
             \r
@@ -1921,6 +1962,8 @@ public class FpdFlash extends IInternalFrame {
             return false;\r
         }\r
         \r
+        \r
+        \r
         /**\r
          * This method initializes jPanelModOrderN  \r
          *  \r
@@ -1991,6 +2034,7 @@ public class FpdFlash extends IInternalFrame {
                 jTableModInFv = new JTable(modInFvTableModel);\r
                 jTableModInFv.setRowHeight(20);\r
                 jTableModInFv.setShowGrid(false);\r
+                \r
             }\r
             return jTableModInFv;\r
         }\r
@@ -2043,6 +2087,7 @@ public class FpdFlash extends IInternalFrame {
                 jTableFpdModules.setRowHeight(20);\r
                 jTableFpdModules.setShowGrid(false);\r
                 fpdModTableModel.addColumn("Modules in Platform");\r
+\r
             }\r
             return jTableFpdModules;\r
         }\r
@@ -2096,12 +2141,12 @@ public class FpdFlash extends IInternalFrame {
                         if (selectedRowLeft < 0) {\r
                             modInFvTableModel.addRow(row);\r
                             jTableModInFv.changeSelection(jTableModInFv.getRowCount() - 1, 0, false, false);\r
-                            fpdModTableModel.removeRow(rowInModel);\r
                         }\r
                         else {\r
                             modInFvTableModel.insertRow(selectedRowLeft, row);\r
                             jTableModInFv.changeSelection(selectedRowLeft, 0, false, false);\r
                         }\r
+                        fpdModTableModel.removeRow(rowInModel);\r
                     }\r
                 });\r
             }\r
@@ -2171,7 +2216,43 @@ public class FpdFlash extends IInternalFrame {
             if (jButtonOk == null) {\r
                 jButtonOk = new JButton();\r
                 jButtonOk.setPreferredSize(new java.awt.Dimension(80,20));\r
-                jButtonOk.setText("Ok");\r
+                jButtonOk.setText("Save");\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 = jTableModInFv.getValueAt(i, 0)+"";\r
+                            if (moduleName.length() == 0) {\r
+                                continue;\r
+                            }\r
+                            ModuleIdentification mi = null;\r
+                            Set<String> key = mGuidToModuleId.keySet();\r
+                            Iterator<String> iter = key.iterator();\r
+                            while (iter.hasNext()) {\r
+                                String guid = iter.next();\r
+                                mi = mGuidToModuleId.get(guid);\r
+                                if (mi.getName().equals(moduleName)) {\r
+                                    String[] sa = {guid, WorkspaceProfile.getModuleBaseName(mi)};\r
+                                    vModInFv.add(sa);\r
+                                    ffc.updateFvBindingInModuleSA (mi, title);\r
+                                    break;\r
+                                }\r
+                            }\r
+                            \r
+                        }\r
+                        ffc.removeBuildOptionsUserExtensions(title);\r
+                        ffc.genBuildOptionsUserExtensions(title, outputFileName, vModInFv);\r
+                        \r
+                        docConsole.setSaved(false);\r
+                        jTabbedPane.setSelectedIndex(0);\r
+                    }\r
+                });\r
             }\r
             return jButtonOk;\r
         }\r
index 9a599aecad6a9617cd1354fe52859cbb66f846cb..162bfd23eb7674bd2d92ac4e5011788fc35424fe 100644 (file)
@@ -122,6 +122,14 @@ public class WorkspaceProfile {
         return vArchs;\r
     }\r
     \r
+    public static String getModuleBaseName (ModuleIdentification mi) {\r
+        ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = getModuleXmlObject(mi);\r
+        if (msa.getModuleDefinitions() == null || msa.getModuleDefinitions().getOutputFileBasename() == null) {\r
+            return null;\r
+        }\r
+        return msa.getModuleDefinitions().getOutputFileBasename();\r
+    }\r
+    \r
     public static boolean pcdInMsa (String cName, String tsGuid, ModuleIdentification mi) throws Exception {\r
         ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea)getModuleXmlObject(mi);\r
         if (msa.getPcdCoded() == null || msa.getPcdCoded().getPcdEntryList() == null) {\r