Adjust module order list after specifying FvBinding for ModuleSA.
authorjlin16 <jlin16@de2fecce-e211-0410-80a6-f3fac2684e05>
Mon, 16 Oct 2006 08:11:27 +0000 (08:11 +0000)
committerjlin16 <jlin16@de2fecce-e211-0410-80a6-f3fac2684e05>
Mon, 16 Oct 2006 08:11:27 +0000 (08:11 +0000)
git-svn-id: https://edk2.tianocore.org/svn/edk2/trunk@1756 de2fecce-e211-0410-80a6-f3fac2684e05

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

index dae2aed..8af4bea 100644 (file)
@@ -306,6 +306,13 @@ public class FpdBuildOptions extends IInternalFrame {
     private JPanel jPanelTableOptionsContainer = null;\r
 \r
     private JLabel jLabelTableOptionsTitle = null;\r
+    \r
+    private final int buildTargetWidth = 150;\r
+    private final int toolChainFamilyWidth = 150;\r
+    private final int supportArchWidth = 150;\r
+    private final int toolCmdCodeWidth = 200;\r
+    private final int tagNameWidth = 150;\r
+    private final int argWidth = 400;\r
 \r
     /**\r
      * This method initializes jPanel  \r
@@ -1764,6 +1771,13 @@ public class FpdBuildOptions extends IInternalFrame {
             optionsTableModel.addColumn("Tool Command Code");\r
             optionsTableModel.addColumn("TagName");\r
             optionsTableModel.addColumn("Arguments");\r
+            \r
+            jTableOptions.getColumnModel().getColumn(0).setMinWidth(buildTargetWidth);\r
+            jTableOptions.getColumnModel().getColumn(1).setMinWidth(toolChainFamilyWidth);\r
+            jTableOptions.getColumnModel().getColumn(2).setMinWidth(supportArchWidth);\r
+            jTableOptions.getColumnModel().getColumn(3).setMinWidth(toolCmdCodeWidth);\r
+            jTableOptions.getColumnModel().getColumn(4).setMinWidth(tagNameWidth);\r
+            jTableOptions.getColumnModel().getColumn(5).setMinWidth(argWidth);\r
 \r
 //            javax.swing.table.TableColumn toolFamilyCol = jTableOptions.getColumnModel().getColumn(1);\r
 //            JComboBox cb = new JComboBox();\r
index 5f4e0b5..3903f97 100644 (file)
@@ -2039,6 +2039,45 @@ 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
+            return;\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
+                continue;\r
+            }\r
+            XmlCursor cursor = ues.newCursor();\r
+            cursor.toFirstChild();\r
+            String elementName = cursor.getTextValue();\r
+            if (elementName.equals(fvName)) {\r
+                cursor.toNextSibling(elementIncludeModules);\r
+                cursor.toLastChild();\r
+                cursor.toEndToken();\r
+                cursor.toNextToken();\r
+                cursor.beginElement(elementModule);\r
+                cursor.insertAttributeWithValue("ModuleGuid", moduleGuid);\r
+                if (!moduleVersion.equals("null") && moduleVersion.length() != 0) {\r
+                    cursor.insertAttributeWithValue("ModuleVersion", moduleVersion);\r
+                }\r
+                cursor.insertAttributeWithValue("PackageGuid", packageGuid);\r
+                if (!packageVersion.equals("null") && packageVersion.length() != 0) {\r
+                    cursor.insertAttributeWithValue("PackageVersion", packageVersion);\r
+                }\r
+                \r
+                cursor.insertAttributeWithValue("Arch", arch);\r
+                cursor.dispose();\r
+                return;\r
+            }\r
+            cursor.dispose();\r
+        }\r
+        \r
+    }\r
+    \r
     public void genBuildOptionsUserDefAntTask (String id, String fileName, String execOrder) {\r
         UserDefinedAntTasksDocument.UserDefinedAntTasks udats = getfpdBuildOpts().getUserDefinedAntTasks();\r
         if (udats == null) {\r
index 2e5bbd7..2d11423 100644 (file)
@@ -668,7 +668,7 @@ public class FpdFrameworkModules extends IInternalFrame {
         }\r
         catch (Exception exp) {\r
             JOptionPane.showMessageDialog(frame, exp.getMessage());\r
-            return;\r
+//            return;\r
         }\r
         \r
         if (settingDlg == null) {\r
index 4d23bec..b358652 100644 (file)
@@ -124,6 +124,14 @@ public class FpdModuleSA extends JDialog implements ActionListener {
     private JPanel jPanelToolchainS = null;\r
     private JPanel jPanelLibraryCenterN = null;\r
     private JPanel jPanelLibraryCenterC = null;  //  @jve:decl-index=0:visual-constraint="20,224"\r
+    \r
+    private final int buildTargetWidth = 150;\r
+    private final int toolChainFamilyWidth = 150;\r
+    private final int supportArchWidth = 150;\r
+    private final int toolCmdCodeWidth = 200;\r
+    private final int tagNameWidth = 150;\r
+    private final int argWidth = 400;\r
+    \r
     /**\r
      * This is the default constructor\r
      */\r
@@ -1147,8 +1155,14 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                     if (newFvBinding.length() == 0 && originalFvBinding == null) {\r
                         return;\r
                     }\r
-                    docConsole.setSaved(false);\r
+                    \r
                     ffc.setFvBinding(moduleKey, newFvBinding);\r
+                    String moduleInfo[] = moduleKey.split(" ");\r
+                    String fvNames[] = newFvBinding.split(" ");\r
+                    for (int i = 0; i < fvNames.length; ++i) {\r
+                        ffc.addModuleIntoBuildOptionsUserExtensions(fvNames[i], moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]);\r
+                    }\r
+                    docConsole.setSaved(false);\r
                 }\r
             });\r
             \r
@@ -1250,6 +1264,12 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             jTableModuleSaOptions = new JTable(optionsTableModel);\r
             jTableModuleSaOptions.setRowHeight(20);\r
             \r
+            jTableModuleSaOptions.getColumnModel().getColumn(0).setMinWidth(buildTargetWidth);\r
+            jTableModuleSaOptions.getColumnModel().getColumn(1).setMinWidth(toolChainFamilyWidth);\r
+            jTableModuleSaOptions.getColumnModel().getColumn(2).setMinWidth(tagNameWidth);\r
+            jTableModuleSaOptions.getColumnModel().getColumn(3).setMinWidth(toolCmdCodeWidth);\r
+            jTableModuleSaOptions.getColumnModel().getColumn(4).setMinWidth(supportArchWidth);\r
+            jTableModuleSaOptions.getColumnModel().getColumn(5).setMinWidth(argWidth);\r
 //            javax.swing.table.TableColumn toolFamilyCol = jTableModuleSaOptions.getColumnModel().getColumn(1);\r
 //            JComboBox cb = new JComboBox();\r
 //            cb.addItem("MSFT");\r