some bug fixing for FpdFrameworkModules
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 6 Jul 2006 01:09:38 +0000 (01:09 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 6 Jul 2006 01:09:38 +0000 (01:09 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@779 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/FpdFrameworkModules.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/GlobalData.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/SurfaceAreaQuery.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/id/FpdModuleIdentification.java

index b94e695ecc315165973596b07d4e25f7cf395b1a..af0c95cadd394ad61e7ccc864925a2f6d07fa130 100644 (file)
@@ -390,6 +390,7 @@ public class FpdBuildOptions extends IInternalFrame {
         if (jTable2 == null) {\r
             antTaskTableModel = new DefaultTableModel();\r
             jTable2 = new JTable(antTaskTableModel);\r
+            jTable2.setRowHeight(20);\r
             antTaskTableModel.addColumn("ID");\r
             antTaskTableModel.addColumn("Filename");\r
             antTaskTableModel.addColumn("ANT Command Options");\r
@@ -635,6 +636,7 @@ public class FpdBuildOptions extends IInternalFrame {
             ffsAttributesTableModel = new DefaultTableModel();\r
             jTable4 = new JTable(ffsAttributesTableModel);\r
             jTable4.setPreferredSize(new java.awt.Dimension(400,80));\r
+            jTable4.setRowHeight(20);\r
             ffsAttributesTableModel.addColumn("Name");\r
             ffsAttributesTableModel.addColumn("Value");\r
             \r
@@ -809,6 +811,7 @@ public class FpdBuildOptions extends IInternalFrame {
         if (jTable5 == null) {\r
             optionsTableModel = new DefaultTableModel();\r
             jTable5 = new JTable(optionsTableModel);\r
+            jTable5.setRowHeight(20);\r
             optionsTableModel.addColumn("BuildTargets");\r
             optionsTableModel.addColumn("ToolChainFamily");\r
             optionsTableModel.addColumn("SupportedArch");\r
@@ -1271,6 +1274,7 @@ public class FpdBuildOptions extends IInternalFrame {
             sectionTableModel.addColumn("SectionType");\r
             \r
             jTable1 = new JTable(sectionTableModel);\r
+            jTable1.setRowHeight(20);\r
             JComboBox cb = new JComboBox();\r
             cb.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");\r
             cb.addItem("EFI_SECTION_VERSION");\r
@@ -1333,6 +1337,7 @@ public class FpdBuildOptions extends IInternalFrame {
             subsectionsTableModel = new DefaultTableModel();\r
             subsectionsTableModel.addColumn("SectionType");\r
             jTable3 = new JTable(subsectionsTableModel);\r
+            jTable3.setRowHeight(20);\r
             JComboBox cb = new JComboBox();\r
             cb.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");\r
             cb.addItem("EFI_SECTION_VERSION");\r
@@ -1572,7 +1577,7 @@ public class FpdBuildOptions extends IInternalFrame {
             sectionsTableModel = new DefaultTableModel();\r
             sectionsTableModel.addColumn("EncapsulationType");\r
             jTable6 = new JTable(sectionsTableModel);\r
-            \r
+            jTable6.setRowHeight(20);\r
             jTable6.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
             jTable6.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\r
                 public void valueChanged(ListSelectionEvent e) {\r
index 5c1393de58968742c15d7c96c6340d19f8de6835..58bdeb606d5871c226a71b247a2b4f1d96929a95 100644 (file)
@@ -183,7 +183,7 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
             model.addColumn("MaxDatumSize");\r
             model.addColumn("DatumType");\r
             jTable = new JTable(model);\r
-            \r
+            jTable.setRowHeight(20);\r
             jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
             jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\r
                 public void valueChanged(ListSelectionEvent e) {\r
index 21e0a5b25b00cefbfd7d5753a8b1592635982ba8..a8191aba5fe91cdd14d43fe735cdf4ed3900d6f1 100644 (file)
@@ -208,9 +208,27 @@ public class FpdFileContents {
         ListIterator li = getfpdFrameworkModules().getModuleSAList().listIterator();\r
         while(li.hasNext()) {\r
             ModuleSADocument.ModuleSA msa = (ModuleSADocument.ModuleSA)li.next();\r
-            if (msa.getModuleGuid().equals(s[0]) && msa.getModuleVersion().equals(s[1])\r
-                            && msa.getPackageGuid().equals(s[2]) && msa.getPackageVersion().equals(s[3])) {\r
-                \r
+            if (msa.getModuleGuid().equals(s[0]) && msa.getPackageGuid().equals(s[2])) {\r
+                if (msa.getModuleVersion() != null) {\r
+                    if (!msa.getModuleVersion().equals(s[1])) {\r
+                        continue;\r
+                    }\r
+                }\r
+                else{\r
+                    if (s[1] != null) {\r
+                        continue;\r
+                    }\r
+                }\r
+                if (msa.getPackageVersion() != null) {\r
+                    if (!msa.getPackageVersion().equals(s[3])) {\r
+                        continue;\r
+                    }\r
+                }\r
+                else{\r
+                    if (s[3] != null) {\r
+                        continue;\r
+                    }\r
+                }\r
                 return msa;\r
             }\r
         }\r
index 929e1647e0bb9cbb803d6abf542a9b7494ff3d9f..2ab4d65d2b9521f86f871929289c1b4721e214c7 100644 (file)
@@ -134,6 +134,7 @@ public class FpdFrameworkModules extends IInternalFrame {
         if (jTable == null) {\r
             model = new NonEditableTableModel();\r
             jTable = new JTable(model);\r
+            jTable.setRowHeight(20);\r
             model.addColumn("ModuleName");\r
             model.addColumn("ModuleGUID");\r
             model.addColumn("ModuleVersion");\r
@@ -190,8 +191,11 @@ public class FpdFrameworkModules extends IInternalFrame {
                     fpdMsa.put(mg + mv + pg + pv, null);\r
                     \r
                     String[] row = {" ", mg, mv, pg, pv};\r
-                    if (getModuleId(mg + " " + mv + " " + pg + " " + pv) != null) {\r
-                        row[0] = getModuleId(mg + " " + mv + " " + pg + " " + pv).getName();\r
+                    ModuleIdentification mi = getModuleId(mg + " " + mv + " " + pg + " " + pv);\r
+                    if (mi != null) {\r
+                        row[0] = mi.getName();\r
+                        row[2] = mi.getVersion();\r
+                        row[4] = mi.getPackage().getVersion();\r
                     }\r
                     model1.addRow(row);\r
                     ffc.addFrameworkModulesPcdBuildDefs(miList.get(selectedRow), null);\r
@@ -241,6 +245,7 @@ public class FpdFrameworkModules extends IInternalFrame {
         if (jTable1 == null) {\r
             model1 = new NonEditableTableModel();\r
             jTable1 = new JTable(model1);\r
+            jTable1.setRowHeight(20);\r
             model1.addColumn("ModuleName");\r
             model1.addColumn("ModuleGUID");\r
             model1.addColumn("ModuleVersion");            \r
@@ -273,10 +278,10 @@ public class FpdFrameworkModules extends IInternalFrame {
                         settingDlg = new FpdModuleSA(ffc);\r
                     }\r
                     \r
-                    String mg = model1.getValueAt(selectedRow, 1).toString();\r
-                    String mv = model1.getValueAt(selectedRow, 2).toString();\r
-                    String pg = model1.getValueAt(selectedRow, 3).toString();\r
-                    String pv = model1.getValueAt(selectedRow, 4).toString();\r
+                    String mg = model1.getValueAt(selectedRow, 1)+"";\r
+                    String mv = model1.getValueAt(selectedRow, 2)+"";\r
+                    String pg = model1.getValueAt(selectedRow, 3)+"";\r
+                    String pv = model1.getValueAt(selectedRow, 4)+"";\r
                     settingDlg.setKey(mg + " " + mv + " " + pg + " " + pv);\r
                     settingDlg.setVisible(true);\r
                 }\r
@@ -357,8 +362,11 @@ public class FpdFrameworkModules extends IInternalFrame {
             String[][] saa = new String[ffc.getFrameworkModulesCount()][5];\r
             ffc.getFrameworkModulesInfo(saa);\r
             for (int i = 0; i < saa.length; ++i) {\r
-                if (getModuleId(saa[i][1]+ " "+saa[i][2]+" "+saa[i][3]+" "+saa[i][4]) != null) {\r
-                    saa[i][0] = getModuleId(saa[i][1]+ " "+saa[i][2]+" "+saa[i][3]+" "+saa[i][4]).getName();\r
+                ModuleIdentification mi = getModuleId(saa[i][1]+ " "+saa[i][2]+" "+saa[i][3]+" "+saa[i][4]);\r
+                if (mi != null) {\r
+                    saa[i][0] = mi.getName();\r
+                    saa[i][2] = mi.getVersion();\r
+                    saa[i][4] = mi.getPackage().getVersion();\r
                 }\r
                 model1.addRow(saa[i]);\r
                 fpdMsa.put(saa[i][1]+saa[i][2]+saa[i][3]+saa[i][4], saa[i][0]);\r
@@ -417,14 +425,17 @@ public class FpdFrameworkModules extends IInternalFrame {
         \r
         while(ispi.hasNext()) {\r
             PackageIdentification pi = (PackageIdentification)ispi.next();\r
-            if ( !pi.getGuid().equals(keyPart[2]) || !pi.getVersion().equals(keyPart[3])){\r
+            if ( !pi.getGuid().equals(keyPart[2])){ \r
+//                            || !pi.getVersion().equals(keyPart[3])){\r
                 continue;\r
             }\r
             Set<ModuleIdentification> smi = GlobalData.getModules(pi);\r
             Iterator ismi = smi.iterator();\r
             while(ismi.hasNext()) {\r
                 ModuleIdentification mi = (ModuleIdentification)ismi.next();\r
-                if (mi.getGuid().equals(keyPart[0]) && mi.getVersion().equals(keyPart[1])){\r
+                if (mi.getGuid().equals(keyPart[0])){\r
+//                                && mi.getVersion().equals(keyPart[1])){\r
+\r
                     return mi;\r
                 }\r
             }\r
index d897959aeaf9474daf9f691ef7baa8e814e52e76..3f50fb6862a56c33b37f10891b670e235c0d41e6 100644 (file)
@@ -674,6 +674,7 @@ public class FpdHeader extends IInternalFrame {
         resizeComponentWidth(this.jTextFieldBaseName, this.getWidth(), intPreferredWidth);\r
                resizeComponentWidth(this.jTextFieldGuid, this.getWidth(), intPreferredWidth);\r
                resizeComponentWidth(this.jTextFieldVersion, this.getWidth(), intPreferredWidth);\r
+        resizeComponentWidth(this.jTextField, this.getWidth(), intPreferredWidth);\r
                resizeComponentWidth(this.jScrollPaneLicense, this.getWidth(), intPreferredWidth);\r
                resizeComponentWidth(this.jTextFieldCopyright, this.getWidth(), intPreferredWidth);\r
                resizeComponentWidth(this.jScrollPaneDescription, this.getWidth(), intPreferredWidth);\r
index 58c181dcd38fe4a2d710d719e4d142382061146c..daca39c657a03ef1c1c2edecd865e43fb9fd8bfb 100644 (file)
@@ -1,6 +1,8 @@
 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.JFrame;\r
 import javax.swing.JOptionPane;\r
@@ -398,6 +400,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
      */\r
     private void initialize() {\r
         this.setSize(664, 515);\r
+        this.centerWindow();\r
         this.setModal(true);\r
         this.setTitle("Module Settings");\r
         this.setContentPane(getJContentPane());\r
@@ -499,6 +502,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         if (jTable == null) {\r
             model = new PartialEditableTableModel();\r
             jTable = new JTable(model);\r
+            jTable.setRowHeight(20);\r
             model.addColumn("CName");\r
             model.addColumn("TokenSpaceGUID");\r
             model.addColumn("ItemType");\r
@@ -682,7 +686,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             model1.addColumn("PackageGUID");\r
             model1.addColumn("PackageVersion");\r
             jTable1 = new JTable(model1);\r
-            \r
+            jTable1.setRowHeight(20);\r
             jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
             jTable1.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\r
                 public void valueChanged(ListSelectionEvent e) {\r
@@ -731,7 +735,8 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             model2 = new LibraryTableModel();\r
             model2.addColumn("LibraryClass");\r
             jTable2 = new JTable(model2);\r
-            \r
+            jTable2.setRowHeight(20);\r
+            jTable2.setShowGrid(false);\r
             jTable2.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
             jTable2.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\r
                 public void valueChanged(ListSelectionEvent e) {\r
@@ -803,7 +808,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             model3.addColumn("PackageGUID");\r
             model3.addColumn("PackageVersion");\r
             jTable3 = new JTable(model3);\r
-            \r
+            jTable3.setRowHeight(20);\r
             jTable3.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
             jTable3.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\r
                 public void valueChanged(ListSelectionEvent e) {\r
@@ -1099,6 +1104,15 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             optionsTableModel.addColumn("SupportedArchs");\r
             optionsTableModel.addColumn("Contents");\r
             jTable4 = new JTable(optionsTableModel);\r
+            jTable4.setRowHeight(20);\r
+            Vector<String> vArch = new Vector<String>();\r
+            vArch.add("IA32");\r
+            vArch.add("X64");\r
+            vArch.add("IPF");\r
+            vArch.add("EBC");\r
+            vArch.add("ARM");\r
+            vArch.add("PPC");\r
+            jTable4.getColumnModel().getColumn(4).setCellEditor(new ListEditor(vArch));\r
             jTable4.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
             jTable4.getModel().addTableModelListener(new TableModelListener() {\r
                 public void tableChanged(TableModelEvent arg0) {\r
@@ -1109,23 +1123,28 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                     if (arg0.getType() == TableModelEvent.UPDATE){\r
                         //ToDo Data Validition check.\r
                         String targets = m.getValueAt(row, 0) + "";\r
-                        Vector<Object> targetName = new Vector<Object>();\r
-                        String[] sArray = targets.split(" ");\r
-                        for (int i = 0; i < sArray.length; ++i) {\r
-                            targetName.add(sArray[i]);\r
+                        Vector<Object> targetName = null;\r
+                        if (targets.length() > 0) {\r
+                            targetName = new Vector<Object>();\r
+                            String[] sArray = targets.split(" ");\r
+                            for (int i = 0; i < sArray.length; ++i) {\r
+                                targetName.add(sArray[i]);\r
+                            }\r
                         }\r
+                        \r
                         String toolChain = m.getValueAt(row, 1) + "";\r
                         String tagName = m.getValueAt(row, 2) + "";\r
                         String toolCode = m.getValueAt(row, 3) + "";\r
                         String archs = m.getValueAt(row, 4) + "";\r
-                        Vector<Object> supArch = new Vector<Object>();\r
-                        String[] sArray1 = archs.split(" ");\r
-                        for (int i = 0; i < sArray1.length; ++i) {\r
-                            supArch.add(sArray1[i]);\r
-                        }\r
-                        if (supArch.size() == 0) {\r
-                            supArch.add("IA32");\r
+                        Vector<Object> supArch = null;\r
+                        if (archs.length() > 0) {\r
+                            supArch = new Vector<Object>();\r
+                            String[] sArray1 = archs.split(" ");\r
+                            for (int i = 0; i < sArray1.length; ++i) {\r
+                                supArch.add(sArray1[i]);\r
+                            }\r
                         }\r
+                        \r
                         String contents = m.getValueAt(row, 5) + "";\r
                         \r
                         ffc.updateModuleSAOptionsOpt(moduleKey, row, targetName, toolChain, tagName, toolCode, supArch, contents);\r
@@ -1181,6 +1200,24 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         }\r
         return jButton5;\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
 }  //  @jve:decl-index=0:visual-constraint="10,10"\r
 \r
index e74644fa75a630b7075359e1fee20418822c1c5a..fe565d97edbd0fcb15d2f21596dbdf02794e4c3f 100644 (file)
@@ -31,16 +31,10 @@ import java.util.Comparator;
 import java.util.HashMap;\r
 import java.util.HashSet;\r
 import java.util.Iterator;\r
-import java.util.LinkedHashSet;\r
 import java.util.List;\r
 import java.util.Map;\r
 import java.util.Set;\r
-import java.util.Stack;\r
-import java.util.TreeMap;\r
-import java.util.TreeSet;\r
 import java.util.logging.Logger;\r
-import java.util.regex.Matcher;\r
-import java.util.regex.Pattern;\r
 \r
 /**\r
   GlobalData provide initializing, instoring, querying and update global data.\r
@@ -113,8 +107,6 @@ public class GlobalData {
     private static Map<String, Object> toolChainOptions;\r
     private static Map<String, Object> toolChainFamilyOptions;\r
     private static Map<String, String> toolChainDefinitions;\r
-    private static Map<FpdModuleIdentification, Map<String, Object>> moduleToolChainOptions = new HashMap<FpdModuleIdentification, Map<String, Object>>();;\r
-    private static Map<FpdModuleIdentification, Map<String, Object>> moduleToolChainFamilyOptions = new HashMap<FpdModuleIdentification, Map<String, Object>>();;\r
     ///\r
     ///\r
     ///\r
@@ -705,124 +697,12 @@ public class GlobalData {
         String[] commandList = new String[commands.size()];\r
         return (String[])commands.toArray(commandList);\r
     }\r
-    /*\r
-\r
-     */\r
-    public static String getCommandSetting(String target, String toolChain, \r
-        String arch, String command, String attribute, FpdModuleIdentification fpdModuleId) {\r
-        String[] commandDescription = new String[] {target, toolChain, arch, command, attribute};\r
-        return getCommandSetting(commandDescription, fpdModuleId);\r
-    }\r
-    /*\r
-\r
-     */\r
-    public static String getCommandSetting(String[] commandDescription, FpdModuleIdentification fpdModuleId) {\r
-        if (commandDescription[4].equals("FLAGS")) {\r
-            return getCommandFlags(commandDescription, fpdModuleId);\r
-        }\r
-\r
-        StringBuffer commandDescString = new StringBuffer(32);\r
-\r
-        int i = 0;\r
-        while (true) {\r
-            commandDescString.append(commandDescription[i++]);\r
-            if (i >= commandDescription.length) {\r
-                break;\r
-            }\r
-            commandDescString.append("_");\r
-        }\r
-\r
-        return getCommandSetting(commandDescString.toString());\r
-    }\r
     /*\r
 \r
      */\r
     public static String getCommandSetting(String commandDescString) {\r
         return (String)toolChainDefinitions.get(commandDescString);\r
     }\r
-    /*\r
-\r
-     */\r
-    public static String getCommandFlags(String[] commandDescription, FpdModuleIdentification fpdModuleId) {\r
-        String setting = getSetting(toolChainOptions, commandDescription, fpdModuleId, false);\r
-\r
-        if (setting == null) {\r
-            String commandDesc = commandDescription[4];\r
-            commandDescription[4] = "FAMILY";\r
-            String toolChainFamily = getCommandSetting(commandDescription, fpdModuleId);\r
-            commandDescription[4] = commandDesc;\r
-\r
-            commandDesc = commandDescription[1];\r
-            commandDescription[1] = toolChainFamily;\r
-            setting = getSetting(toolChainFamilyOptions, commandDescription, fpdModuleId, true);\r
-            commandDescription[1] = commandDesc;\r
-        }\r
-\r
-        if (setting == null) {\r
-            setting = "";\r
-        }\r
-        \r
-        \r
-        Set<String> addFlagsSet = new LinkedHashSet<String>();\r
-        Set<String> subFlagsSet = new LinkedHashSet<String>();\r
-        putFlagsToSet(addFlagsSet, setting);\r
-\r
-        return getFlags(addFlagsSet, subFlagsSet);\r
-    }\r
-    /*\r
-\r
-     */\r
-    private static String getSetting(Map<String, Object> optionMap, String[] commandDescription, \r
-        FpdModuleIdentification fpdModuleId, boolean toolChainFamilyFlag) {\r
-\r
-        String setting = (String)getOption(optionMap, commandDescription);\r
-        if (fpdModuleId == null) {\r
-            return setting;\r
-        }\r
-        //\r
-        // module overrides\r
-        //\r
-        //\r
-        // get module xml doc\r
-        //\r
-        Map<String, XmlObject> fpdModule = (Map<String, XmlObject>)fpdModuleSA.get(fpdModuleId);\r
-        if (fpdModuleId == null) {\r
-            return setting;\r
-        }\r
-        SurfaceAreaQuery.push(fpdModule);\r
-        //\r
-        // check if the module has been parsed\r
-        //\r
-        Map<String, Object> moduleOptions = (Map<String, Object>)moduleToolChainOptions.get(fpdModuleId);\r
-        if (moduleOptions == null) {\r
-            //\r
-            // get all the build options of this module\r
-            //\r
-            moduleOptions = new TreeMap<String, Object>(comparator);\r
-            parseBuildOptions(moduleOptions, SurfaceAreaQuery.getOptions(toolChainFamilyFlag));\r
-        }\r
-        //\r
-        // get setting for current qualified command\r
-        //\r
-        Set<String> addSet = new TreeSet<String>();\r
-        Set<String> subSet = new TreeSet<String>();\r
-        putFlagsToSet(addSet, setting);\r
-        String moduleSetting = getOption(moduleOptions, commandDescription);\r
-        if (moduleSetting != null) {\r
-            moduleSetting = parseOptionString(moduleSetting, addSet, subSet);\r
-        }\r
-        //\r
-        // do necessary setting override\r
-        //\r
-        if (moduleSetting == null) {\r
-            setting = getRawFlags(addSet, subSet);\r
-        } else {\r
-            setting = moduleSetting;\r
-        }\r
-\r
-        SurfaceAreaQuery.pop();\r
-        return setting;\r
-    }\r
     /*\r
 \r
      */\r
@@ -834,186 +714,6 @@ public class GlobalData {
         return toolChainDefinitions;\r
     }\r
 \r
-    /**\r
-      Separate the string and instore in set.\r
-       \r
-      <p> String is separated by Java Regulation Expression \r
-      "[^\\\\]?(\".*?[^\\\\]\")[ \t,]+". </p>\r
-      \r
-      <p>For example: </p>\r
-      \r
-      <pre>\r
-        "/nologo", "/W3", "/WX"\r
-        "/C", "/DSTRING_DEFINES_FILE=\"BdsStrDefs.h\""\r
-      </pre>\r
-      \r
-      @param set store the separated string\r
-      @param str string to separate\r
-    **/\r
-    private static void putFlagsToSet(Set<String> set, String str) {\r
-        if (str == null || str.length() == 0) {\r
-            return;\r
-        }\r
-\r
-        Pattern myPattern = Pattern.compile("[^\\\\]?(\".*?[^\\\\]\")[ \t,]+");\r
-        Matcher matcher = myPattern.matcher(str + " ");\r
-        while (matcher.find()) {\r
-            String item = str.substring(matcher.start(1), matcher.end(1));\r
-            set.add(item);\r
-        }\r
-    }\r
-    \r
-    /**\r
-      Generate the final flags string will be used by compile command. \r
-      \r
-      @param add the add flags set\r
-      @param sub the sub flags set\r
-      @return final flags after add set substract sub set\r
-    **/\r
-    private static String getFlags(Set<String> add, Set<String> sub) {\r
-        String result = "";\r
-        add.removeAll(sub);\r
-        Iterator iter = add.iterator();\r
-        while (iter.hasNext()) {\r
-            String str = (String) iter.next();\r
-            result += str.substring(1, str.length() - 1) + " ";\r
-        }\r
-        return result;\r
-    }\r
-\r
-    /**\r
-      Generate the flags string with original format. The format is defined by \r
-      Java Regulation Expression "[^\\\\]?(\".*?[^\\\\]\")[ \t,]+". </p>\r
-      \r
-      <p>For example: </p>\r
-      \r
-      <pre>\r
-        "/nologo", "/W3", "/WX"\r
-        "/C", "/DSTRING_DEFINES_FILE=\"BdsStrDefs.h\""\r
-      </pre>\r
-      \r
-      @param add the add flags set\r
-      @param sub the sub flags set\r
-      @return flags with original format\r
-    **/\r
-    private static String getRawFlags(Set<String> add, Set<String> sub) {\r
-        String result = null;\r
-        add.removeAll(sub);\r
-        Iterator iter = add.iterator();\r
-        while (iter.hasNext()) {\r
-            String str = (String) iter.next();\r
-            result += "\"" + str.substring(1, str.length() - 1) + "\", ";\r
-        }\r
-        return result;\r
-    }\r
-\r
-    private static String parseOptionString(String optionString, Set<String> addSet, Set<String> subSet) {\r
-        boolean overrideOption = false;\r
-        Pattern pattern = Pattern.compile("ADD\\.\\[(.+)\\]");\r
-        Matcher matcher = pattern.matcher(optionString);\r
-\r
-        while (matcher.find()) {\r
-            overrideOption = true;\r
-            String addOption = optionString.substring(matcher.start(1), matcher.end(1)).trim();\r
-            putFlagsToSet(addSet, addOption);\r
-            \r
-        }\r
-\r
-        pattern = Pattern.compile("SUB\\.\\[(.+)\\]");\r
-        matcher = pattern.matcher(optionString);\r
-\r
-        while (matcher.find()) {\r
-            overrideOption = true;\r
-            String subOption = optionString.substring(matcher.start(1), matcher.end(1)).trim();\r
-            putFlagsToSet(subSet, subOption);\r
-        }\r
-\r
-        if (overrideOption == true) {\r
-            return null;\r
-        }\r
-\r
-        return optionString;\r
-    }\r
-\r
-    public static String getOption(Map<String, Object> options, String[] toolDefString) {\r
-        Stack<Map<String, Object>> stack = new Stack<Map<String, Object>>();\r
-        Map<String, Object> map = options;\r
-        Map<String, Object> lastMap;\r
-        String option = null;\r
-        int length = toolDefString.length - 2;\r
-\r
-        int i = 0;\r
-        String key = null;\r
-        boolean backtrack = false;\r
-        while (true) {\r
-            if (map == null) {\r
-                if (stack.empty()) {\r
-                    break;\r
-                }\r
-                map = (Map<String, Object>)stack.pop();\r
-                if (backtrack) {\r
-                    --i;\r
-                }\r
-                key = "*";\r
-                backtrack = true;\r
-            } else {\r
-                if (i >= length) {\r
-                    break;\r
-                }\r
-                key = toolDefString[i];\r
-                stack.push(map);\r
-                ++i;\r
-                backtrack = false;\r
-            }\r
-            lastMap = map;\r
-            map = (Map<String, Object>)lastMap.get(key);\r
-        }\r
-\r
-        if (map != null) {\r
-            option = (String)map.get(toolDefString[i]);\r
-        }\r
-\r
-        return option;\r
-    }\r
-\r
-    private static void parseBuildOptions(Map<String, Object> optionMap, String[][] options) {\r
-        Map<String, Object> map;\r
-        Map<String, Object> nextMap;\r
-\r
-        for (int i = 0; i < options.length; ++i) {\r
-            map = optionMap;\r
-\r
-            int flagIndex = options[i].length - 1;\r
-            int cmdIndex = flagIndex - 1;\r
-            int archIndex = cmdIndex - 1;\r
-            for (int j = 0; j < cmdIndex; ++j) {\r
-                String s = options[i][j];\r
-                if (s == null || s.trim().length() == 0) {\r
-                    s = "*";\r
-                }\r
-                s = s.trim().toUpperCase();\r
-\r
-                nextMap = (Map<String, Object>)map.get(s);\r
-                if (nextMap == null) {\r
-                    nextMap = new HashMap<String, Object>();\r
-                    map.put(s, nextMap);\r
-                }\r
-\r
-                map = nextMap;\r
-            }\r
-\r
-            String cmd = options[i][cmdIndex];\r
-            String flag = options[i][flagIndex];\r
-            if (cmd == null || cmd.trim().length() == 0) {\r
-                cmd = "*";\r
-            }\r
-            if (flag == null) {\r
-                flag = "";\r
-            }\r
-            map.put(cmd.trim().toUpperCase(), flag.trim().toUpperCase());\r
-        }\r
-    }\r
-\r
 }\r
 \r
 final class KeyComparator implements Comparator<String> {\r
index 544263fac985023ad981e89e126abec9a004dfdd..8ecc71bcece7cb580dcbdafd0490f85fa02d4a7b 100644 (file)
@@ -27,17 +27,12 @@ import java.util.regex.Pattern;
 import org.apache.xmlbeans.XmlNormalizedString;\r
 import org.apache.xmlbeans.XmlObject;\r
 import org.apache.xmlbeans.XmlString;\r
-import org.tianocore.BuildOptionsDocument;\r
 import org.tianocore.BuildTargetList;\r
 import org.tianocore.DataIdDocument;\r
 import org.tianocore.ExternsDocument;\r
 import org.tianocore.FileNameConvention;\r
-import org.tianocore.FvAttributeDocument;\r
 //import org.tianocore.FvImageDocument;\r
-import org.tianocore.FvImagesDocument;\r
-import org.tianocore.FvOptionDocument;\r
 import org.tianocore.GuidDeclarationsDocument;\r
-import org.tianocore.GuidsDocument;\r
 import org.tianocore.LibrariesDocument;\r
 import org.tianocore.LibraryClassDeclarationsDocument;\r
 import org.tianocore.LibraryClassDocument;\r
@@ -45,18 +40,13 @@ import org.tianocore.ModuleSADocument;
 import org.tianocore.ModuleTypeDef;\r
 import org.tianocore.MsaFilesDocument;\r
 import org.tianocore.MsaHeaderDocument;\r
-import org.tianocore.OptionDocument;\r
-import org.tianocore.PPIsDocument;\r
 import org.tianocore.PackageDependenciesDocument;\r
 import org.tianocore.PackageHeadersDocument;\r
-import org.tianocore.PlatformDefinitionsDocument;\r
 import org.tianocore.PpiDeclarationsDocument;\r
 import org.tianocore.ProtocolDeclarationsDocument;\r
 import org.tianocore.SpdHeaderDocument;\r
 import org.tianocore.FilenameDocument.Filename;\r
 import org.tianocore.MsaHeaderDocument.MsaHeader;\r
-import org.tianocore.ProtocolsDocument.Protocols.Protocol;\r
-import org.tianocore.ProtocolsDocument.Protocols.ProtocolNotify;\r
 import org.tianocore.PlatformHeaderDocument;\r
 import org.tianocore.frameworkwizard.platform.ui.id.FpdModuleIdentification;\r
 import org.tianocore.frameworkwizard.platform.ui.id.ModuleIdentification;\r
@@ -313,102 +303,6 @@ public class SurfaceAreaQuery {
                return "UNIFIED";\r
        }\r
 \r
-       /**\r
-        * Retrieve BuildOptions/Option or Arch/Option\r
-        * \r
-        * @param toolChainFamilyFlag\r
-        *            if true, retrieve options for toolchain family; otherwise for\r
-        *            toolchain\r
-        * \r
-        * @returns String[][5] name, target, toolchain, arch, coommand of options\r
-        *          if elements are found at the known xpath. String[0][] if dont\r
-        *          find element.\r
-        * \r
-        * @returns Empty array if nothing is there\r
-        */\r
-       public static String[][] getOptions(boolean toolChainFamilyFlag) {\r
-               String[] xPath;\r
-               String target = null;\r
-               String toolchain = null;\r
-               String toolchainFamily = null;\r
-               List<String> archList = null;\r
-               String cmd = null;\r
-               String targetName = null;\r
-               String optionName = null;\r
-\r
-               if (toolChainFamilyFlag == true) {\r
-                       xPath = new String[] {\r
-                                       "/BuildOptions/Options/Option[not(@ToolChainFamily) and not(@ToolChainTag)]",\r
-                                       "/BuildOptions/Options/Option[@ToolChainFamily]", };\r
-               } else {\r
-                       xPath = new String[] {\r
-                                       "/BuildOptions/Options/Option[not(@ToolChainFamily) and not(@ToolChainTag)]",\r
-                                       "/BuildOptions/Options/Option[@TagName]", };\r
-               }\r
-\r
-               XmlObject[] returns = get("FrameworkPlatformDescription", xPath);\r
-               if (returns == null) {\r
-                       return new String[0][5];\r
-               }\r
-\r
-               List<String[]> optionList = new ArrayList<String[]>();\r
-               OptionDocument.Option option;\r
-\r
-               for (int i = 0; i < returns.length; i++) {\r
-                       option = (OptionDocument.Option) returns[i];\r
-\r
-                       //\r
-                       // Get Target, ToolChain(Family), Arch, Cmd, and Option from Option,\r
-                       // then\r
-                       // put to result[][5] array in above order.\r
-                       //\r
-                       String[] targetList;\r
-                       target = null;//Auber option.getBuildTargets();\r
-                       if (target != null) {\r
-                               targetList = target.split(" ");\r
-                       } else {\r
-                               targetList = new String[1];\r
-                               targetList[0] = null;\r
-                       }\r
-\r
-                       if (toolChainFamilyFlag) {\r
-                               toolchainFamily = option.getToolChainFamily();\r
-                               if (toolchainFamily != null) {\r
-                                       toolchain = toolchainFamily.toString();\r
-                               } else {\r
-                                       toolchain = null;\r
-                               }\r
-                       } else {\r
-                               toolchain = option.getTagName();\r
-                       }\r
-\r
-                       archList = option.getSupArchList();\r
-                       if (archList == null) {\r
-                               archList.add(null);\r
-                       }\r
-\r
-                       cmd = option.getToolCode();\r
-\r
-                       optionName = option.getStringValue();\r
-                       for (int t = 0; t < targetList.length; t++) {\r
-                               for (int j = 0; j < archList.size(); j++) {\r
-                                       optionList.add(new String[] { optionName, targetList[i],\r
-                                                       toolchain, archList.get(j), cmd });\r
-                               }\r
-                       }\r
-               }\r
-\r
-               String[][] result = new String[optionList.size()][5];\r
-               for (int i = 0; i < optionList.size(); i++) {\r
-                       result[i][0] = optionList.get(i)[0];\r
-                       result[i][1] = optionList.get(i)[1];\r
-                       result[i][2] = optionList.get(i)[2];\r
-                       result[i][3] = optionList.get(i)[3];\r
-                       result[i][4] = optionList.get(i)[4];\r
-               }\r
-               return result;\r
-       }\r
-\r
        public static String getBuildTarget() {\r
                String[] xPath = new String[] { "/PlatformDefinitions/BuildTargets" };\r
 \r
@@ -885,7 +779,7 @@ public class SurfaceAreaQuery {
                return result;\r
        }\r
 \r
-\r
+       \r
 \r
        public static XmlObject getFpdBuildOptions() {\r
                String[] xPath = new String[] { "/BuildOptions" };\r
@@ -1352,7 +1246,6 @@ public class SurfaceAreaQuery {
         *         <BuildOptions>.\r
         */\r
        public String getToolChainFamily() {\r
-               String toolChainFamily;\r
                String[] xPath = new String[] { "/BuildOptions" };\r
 \r
                XmlObject[] result = get("FrameworkPlatformDescription", xPath);\r
index b9bb9e5ff3097a917407f143c9fc33ebaa1ca0ab..b30c32264877accc89160db2d0d320728b059733 100644 (file)
@@ -30,10 +30,6 @@ public class FpdModuleIdentification {
     \r
     private ModuleIdentification module;\r
     \r
-    private String target; // Optional\r
-    \r
-    private String toolchain; // Optional\r
-    \r
     public FpdModuleIdentification(String arch, String fvBinding, String sequence, ModuleIdentification module){\r
         this.arch = arch;\r
         this.fvBinding = fvBinding;\r