git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@714 6f19259b...
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 3 Jul 2006 01:20:43 +0000 (01:20 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 3 Jul 2006 01:20:43 +0000 (01:20 +0000)
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java

index bfbf783168345f2a2642f8df5c0b07f808655f56..9b4fa0943db5dd85a7e4a5c7d6710c084175ec24 100644 (file)
@@ -52,6 +52,10 @@ import javax.swing.table.TableModel;
 import org.tianocore.PlatformSurfaceAreaDocument;\r
 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;\r
 import java.awt.CardLayout;\r
+import java.util.ArrayList;\r
+import java.util.Iterator;\r
+import java.util.LinkedHashMap;\r
+import java.util.Set;\r
 \r
 public class FpdBuildOptions extends IInternalFrame {\r
 \r
@@ -75,8 +79,9 @@ public class FpdBuildOptions extends IInternalFrame {
     private JScrollPane jScrollPane2 = null;\r
     private JTable jTable2 = null;\r
     private DefaultTableModel ffsTableModel = null;\r
-    private DefaultTableModel imageEntryPointTableModel = null;\r
-    private DefaultTableModel outputDirectoryTableModel = null;\r
+    private DefaultTableModel sectionsTableModel = null;\r
+    private DefaultTableModel sectionTableModel = null;\r
+    private DefaultTableModel subsectionsTableModel = null;\r
     private DefaultTableModel antTaskTableModel = null;\r
     private DefaultTableModel ffsAttributesTableModel = null;\r
     private DefaultTableModel optionsTableModel = null;\r
@@ -89,7 +94,6 @@ public class FpdBuildOptions extends IInternalFrame {
     private JTextField jTextField6 = null;\r
     private JButton jButton8 = null;\r
     private JButton jButton9 = null;\r
-    private JCheckBox jCheckBox5 = null;\r
     private JScrollPane jScrollPane5 = null;\r
     private JTable jTable4 = null;\r
     private JPanel jPanel19 = null;\r
@@ -105,23 +109,6 @@ public class FpdBuildOptions extends IInternalFrame {
     private JTable jTable5 = null;\r
     private JButton jButton10 = null;\r
     private JButton jButton11 = null;\r
-    private JPanel jPanel21 = null;\r
-    private JButton jButton12 = null;\r
-    private JButton jButton13 = null;\r
-    private JLabel jLabel8 = null;\r
-    private JTextField jTextField9 = null;\r
-    private JLabel jLabel13 = null;\r
-    private JTextField jTextField10 = null;\r
-    private JPanel jPanel22 = null;\r
-    private JCheckBox jCheckBox6 = null;\r
-    private JComboBox jComboBox4 = null;\r
-    private JCheckBox jCheckBox7 = null;\r
-    private JComboBox jComboBox5 = null;\r
-    private JCheckBox jCheckBox8 = null;\r
-    private JTextField jTextField11 = null;\r
-    private JButton jButton14 = null;\r
-    private JButton jButton15 = null;\r
-    private JButton jButton16 = null;\r
     private DefaultListModel listModel = new DefaultListModel();\r
     private JButton jButton17 = null;\r
     private JButton jButton18 = null;\r
@@ -142,6 +129,25 @@ public class FpdBuildOptions extends IInternalFrame {
     private JLabel jLabel1 = null;\r
     private JScrollPane jScrollPane = null;\r
     private JTable jTable = null;\r
+    private JLabel jLabel2 = null;\r
+    private JScrollPane jScrollPane1 = null;\r
+    private JTable jTable1 = null;\r
+    private JLabel jLabel4 = null;\r
+    private JScrollPane jScrollPane3 = null;\r
+    private JTable jTable3 = null;\r
+    private JLabel jLabel5 = null;\r
+    private JTextField jTextField = null;\r
+    private JPanel jPanel4 = null;\r
+    private JLabel jLabel6 = null;\r
+    private JButton jButton = null;\r
+    private JButton jButton1 = null;\r
+    private JButton jButton2 = null;\r
+    private JButton jButton3 = null;\r
+    private JLabel jLabel8 = null;\r
+    private JButton jButton6 = null;\r
+    private JButton jButton7 = null;\r
+    private JScrollPane jScrollPane4 = null;\r
+    private JTable jTable6 = null;\r
     /**\r
      * This method initializes jPanel  \r
      *         \r
@@ -483,14 +489,18 @@ public class FpdBuildOptions extends IInternalFrame {
      */\r
     private JPanel getJPanel15() {\r
         if (jPanel15 == null) {\r
+            jLabel5 = new JLabel();\r
+            jLabel5.setText("Encapsulation Type");\r
             FlowLayout flowLayout5 = new FlowLayout();\r
             flowLayout5.setAlignment(java.awt.FlowLayout.RIGHT);\r
             jLabel7 = new JLabel();\r
-            jLabel7.setText("Type");\r
+            jLabel7.setText("FFS Key");\r
             jPanel15 = new JPanel();\r
             jPanel15.setLayout(flowLayout5);\r
             jPanel15.add(jLabel7, null);\r
             jPanel15.add(getJTextField6(), null);\r
+            jPanel15.add(jLabel5, null);\r
+            jPanel15.add(getJTextField(), null);\r
             jPanel15.add(getJButton8(), null);\r
             jPanel15.add(getJButton9(), null);\r
         }\r
@@ -504,16 +514,18 @@ public class FpdBuildOptions extends IInternalFrame {
      */\r
     private JPanel getJPanel16() {\r
         if (jPanel16 == null) {\r
+            jLabel6 = new JLabel();\r
+            jLabel6.setText("Attributes");\r
             FlowLayout flowLayout6 = new FlowLayout();\r
             flowLayout6.setHgap(5);\r
-            flowLayout6.setAlignment(java.awt.FlowLayout.LEFT);\r
+            flowLayout6.setVgap(20);\r
+            flowLayout6.setAlignment(java.awt.FlowLayout.CENTER);\r
             jPanel16 = new JPanel();\r
             jPanel16.setPreferredSize(new java.awt.Dimension(491,130));\r
             jPanel16.setLayout(flowLayout6);\r
-            jPanel16.add(getJCheckBox5(), null);\r
-            jPanel16.add(getJButton17(), null);\r
-            jPanel16.add(getJButton18(), null);\r
+            jPanel16.add(jLabel6, null);\r
             jPanel16.add(getJScrollPane5(), null);\r
+            jPanel16.add(getJPanel4(), null);\r
         }\r
         return jPanel16;\r
     }\r
@@ -538,7 +550,7 @@ public class FpdBuildOptions extends IInternalFrame {
     private JTextField getJTextField6() {\r
         if (jTextField6 == null) {\r
             jTextField6 = new JTextField();\r
-            jTextField6.setPreferredSize(new java.awt.Dimension(150,20));\r
+            jTextField6.setPreferredSize(new java.awt.Dimension(100,20));\r
         }\r
         return jTextField6;\r
     }\r
@@ -561,7 +573,9 @@ public class FpdBuildOptions extends IInternalFrame {
 \r
                 public void actionPerformed(java.awt.event.ActionEvent e) {\r
                     if (jTextField6.getText().length() > 0) {\r
-                        listModel.addElement(jTextField6.getText());\r
+                        String[] row = {jTextField6.getText()};\r
+                        ffsTableModel.addRow(row);\r
+                        ffc.genBuildOptionsFfs(jTextField6.getText(), jTextField.getText());\r
                     }\r
                 }\r
             });\r
@@ -586,26 +600,16 @@ public class FpdBuildOptions extends IInternalFrame {
                 private static final long serialVersionUID = -4002678939178194476L;\r
 \r
                 public void actionPerformed(ActionEvent arg0){\r
+                    if (jTable.getSelectedRow() < 0) {\r
+                        return;\r
+                    }\r
+                    ffc.removeBuildOptionsFfs(jTable.getSelectedRow());\r
                 }\r
             });\r
         }\r
         return jButton9;\r
     }\r
 \r
-    /**\r
-     * This method initializes jCheckBox5      \r
-     *         \r
-     * @return javax.swing.JCheckBox   \r
-     */\r
-    private JCheckBox getJCheckBox5() {\r
-        if (jCheckBox5 == null) {\r
-            jCheckBox5 = new JCheckBox();\r
-            jCheckBox5.setText("Attributes");\r
-            jCheckBox5.setPreferredSize(new java.awt.Dimension(81,20));\r
-        }\r
-        return jCheckBox5;\r
-    }\r
-\r
     /**\r
      * This method initializes jScrollPane5    \r
      *         \r
@@ -632,6 +636,28 @@ public class FpdBuildOptions extends IInternalFrame {
             jTable4.setPreferredSize(new java.awt.Dimension(400,80));\r
             ffsAttributesTableModel.addColumn("Name");\r
             ffsAttributesTableModel.addColumn("Value");\r
+            \r
+            jTable4.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
+            jTable4.getModel().addTableModelListener(new TableModelListener() {\r
+                public void tableChanged(TableModelEvent arg0) {\r
+                    // TODO Auto-generated method stub\r
+                    int row = arg0.getFirstRow();\r
+                    TableModel m = (TableModel)arg0.getSource();\r
+                    if (arg0.getType() == TableModelEvent.UPDATE){\r
+                        //ToDo Data Validition check.\r
+                        String name = m.getValueAt(row, 0) + "";\r
+                        String value = m.getValueAt(row, 1) + "";\r
+                        \r
+                        if (name.length() == 0) {\r
+                            return;\r
+                        }\r
+                        if (value.length() == 0){\r
+                            return;\r
+                        }\r
+                        ffc.updateBuildOptionsFfsAttribute(jTable.getSelectedRow(), row, name, value);\r
+                    }\r
+                }\r
+            });\r
         }\r
         return jTable4;\r
     }\r
@@ -643,10 +669,26 @@ public class FpdBuildOptions extends IInternalFrame {
      */\r
     private JPanel getJPanel19() {\r
         if (jPanel19 == null) {\r
+            jLabel8 = new JLabel();\r
+            jLabel8.setText("Sections");\r
+            jLabel4 = new JLabel();\r
+            jLabel4.setText("Sub-Sections");\r
+            jLabel2 = new JLabel();\r
+            jLabel2.setText("Section");\r
             jPanel19 = new JPanel();\r
-            jPanel19.setLayout(new CardLayout());\r
-            jPanel19.add(getJPanel21(), getJPanel21().getName());\r
-            jPanel19.add(getJPanel22(), getJPanel22().getName());\r
+            jPanel19.setLayout(new FlowLayout());\r
+            jPanel19.add(jLabel2, null);\r
+            jPanel19.add(getJButton(), null);\r
+            jPanel19.add(getJButton1(), null);\r
+            jPanel19.add(getJScrollPane1(), null);\r
+            jPanel19.add(jLabel8, null);\r
+            jPanel19.add(getJButton6(), null);\r
+            jPanel19.add(getJButton7(), null);\r
+            jPanel19.add(getJScrollPane4(), null);\r
+            jPanel19.add(jLabel4, null);\r
+            jPanel19.add(getJButton2(), null);\r
+            jPanel19.add(getJButton3(), null);\r
+            jPanel19.add(getJScrollPane3(), null);\r
         }\r
         return jPanel19;\r
     }\r
@@ -900,279 +942,6 @@ public class FpdBuildOptions extends IInternalFrame {
         return jButton11;\r
     }\r
 \r
-    /**\r
-     * This method initializes jPanel21        \r
-     *         \r
-     * @return javax.swing.JPanel      \r
-     */\r
-    private JPanel getJPanel21() {\r
-        if (jPanel21 == null) {\r
-            jLabel13 = new JLabel();\r
-            jLabel13.setText("EncapsulationTag");\r
-            jLabel8 = new JLabel();\r
-            jLabel8.setText("EncapsulationType");\r
-            jPanel21 = new JPanel();\r
-            jPanel21.setName("jPanel21");\r
-            jPanel21.add(jLabel8, null);\r
-            jPanel21.add(getJTextField9(), null);\r
-            jPanel21.add(jLabel13, null);\r
-            jPanel21.add(getJTextField10(), null);\r
-            jPanel21.add(getJButton12(), null);\r
-            jPanel21.add(getJButton13(), null);\r
-            jPanel21.add(getJButton16(), null);\r
-        }\r
-        return jPanel21;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jButton12       \r
-     *         \r
-     * @return javax.swing.JButton     \r
-     */\r
-    private JButton getJButton12() {\r
-        if (jButton12 == null) {\r
-            jButton12 = new JButton();\r
-            jButton12.setText("Add Sections");\r
-            jButton12.setPreferredSize(new java.awt.Dimension(109,20));\r
-            jButton12.addActionListener(new AbstractAction(){\r
-                /**\r
-                 * \r
-                 */\r
-                private static final long serialVersionUID = 1L;\r
-\r
-                public void actionPerformed(ActionEvent arg0){\r
-                }\r
-            });\r
-        }\r
-        return jButton12;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jButton13       \r
-     *         \r
-     * @return javax.swing.JButton     \r
-     */\r
-    private JButton getJButton13() {\r
-        if (jButton13 == null) {\r
-            jButton13 = new JButton();\r
-            jButton13.setText("Add Section");\r
-            jButton13.setPreferredSize(new java.awt.Dimension(102,20));\r
-            jButton13.addActionListener(new AbstractAction(){\r
-                /**\r
-                 * \r
-                 */\r
-                private static final long serialVersionUID = 1L;\r
-\r
-                public void actionPerformed(ActionEvent arg0){\r
-                    CardLayout cl = (CardLayout)jPanel19.getLayout();\r
-                    cl.last(jPanel19);\r
-                }\r
-            });\r
-        }\r
-        return jButton13;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jTextField9     \r
-     *         \r
-     * @return javax.swing.JTextField  \r
-     */\r
-    private JTextField getJTextField9() {\r
-        if (jTextField9 == null) {\r
-            jTextField9 = new JTextField();\r
-            jTextField9.setPreferredSize(new java.awt.Dimension(250,20));\r
-        }\r
-        return jTextField9;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jTextField10    \r
-     *         \r
-     * @return javax.swing.JTextField  \r
-     */\r
-    private JTextField getJTextField10() {\r
-        if (jTextField10 == null) {\r
-            jTextField10 = new JTextField();\r
-            jTextField10.setPreferredSize(new java.awt.Dimension(250,20));\r
-        }\r
-        return jTextField10;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jPanel22        \r
-     *         \r
-     * @return javax.swing.JPanel      \r
-     */\r
-    private JPanel getJPanel22() {\r
-        if (jPanel22 == null) {\r
-            FlowLayout flowLayout7 = new FlowLayout();\r
-            flowLayout7.setAlignment(java.awt.FlowLayout.LEFT);\r
-            jPanel22 = new JPanel();\r
-            jPanel22.setLayout(flowLayout7);\r
-            jPanel22.setName("jPanel22");\r
-            jPanel22.add(getJCheckBox6(), null);\r
-            jPanel22.add(getJComboBox4(), null);\r
-            jPanel22.add(getJCheckBox7(), null);\r
-            jPanel22.add(getJComboBox5(), null);\r
-            jPanel22.add(getJCheckBox8(), null);\r
-            jPanel22.add(getJTextField11(), null);\r
-            jPanel22.add(getJButton14(), null);\r
-            jPanel22.add(getJButton15(), null);\r
-        }\r
-        return jPanel22;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jCheckBox6      \r
-     *         \r
-     * @return javax.swing.JCheckBox   \r
-     */\r
-    private JCheckBox getJCheckBox6() {\r
-        if (jCheckBox6 == null) {\r
-            jCheckBox6 = new JCheckBox();\r
-            jCheckBox6.setText("Section Type");\r
-            jCheckBox6.setPreferredSize(new java.awt.Dimension(98,20));\r
-        }\r
-        return jCheckBox6;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jComboBox4      \r
-     *         \r
-     * @return javax.swing.JComboBox   \r
-     */\r
-    private JComboBox getJComboBox4() {\r
-        if (jComboBox4 == null) {\r
-            jComboBox4 = new JComboBox();\r
-            jComboBox4.setPreferredSize(new java.awt.Dimension(260,20));\r
-            \r
-            jComboBox4.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");\r
-            jComboBox4.addItem("EFI_SECTION_VERSION");\r
-            jComboBox4.addItem("EFI_SECTION_USER_INTERFACE");\r
-            jComboBox4.addItem("EFI_SECTION_DXE_DEPEX");\r
-            jComboBox4.addItem("EFI_SECTION_PEI_DEPEX");\r
-            jComboBox4.addItem("EFI_SECTION_PE32");\r
-            jComboBox4.addItem("EFI_SECTION_PIC");\r
-            jComboBox4.addItem("EFI_SECTION_TE");\r
-            jComboBox4.addItem("EFI_SECTION_RAW");\r
-            jComboBox4.addItem("EFI_SECTION_COMPRESSION");\r
-            jComboBox4.addItem("EFI_SECTION_GUID_DEFINED");\r
-            jComboBox4.addItem("EFI_SECTION_COMPATIBILITY16");\r
-            jComboBox4.addItem("EFI_SECTION_FIRMWARE_VOLUME_IMAGE");\r
-            jComboBox4.setSelectedIndex(0);\r
-        }\r
-        return jComboBox4;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jCheckBox7      \r
-     *         \r
-     * @return javax.swing.JCheckBox   \r
-     */\r
-    private JCheckBox getJCheckBox7() {\r
-        if (jCheckBox7 == null) {\r
-            jCheckBox7 = new JCheckBox();\r
-            jCheckBox7.setPreferredSize(new java.awt.Dimension(120,20));\r
-            jCheckBox7.setText("Compressible");\r
-        }\r
-        return jCheckBox7;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jComboBox5      \r
-     *         \r
-     * @return javax.swing.JComboBox   \r
-     */\r
-    private JComboBox getJComboBox5() {\r
-        if (jComboBox5 == null) {\r
-            jComboBox5 = new JComboBox();\r
-            jComboBox5.setPreferredSize(new java.awt.Dimension(80,20));\r
-            \r
-            jComboBox5.addItem("false");\r
-            jComboBox5.addItem("true");\r
-            jComboBox5.setSelectedIndex(0);\r
-        }\r
-        return jComboBox5;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jCheckBox8      \r
-     *         \r
-     * @return javax.swing.JCheckBox   \r
-     */\r
-    private JCheckBox getJCheckBox8() {\r
-        if (jCheckBox8 == null) {\r
-            jCheckBox8 = new JCheckBox();\r
-            jCheckBox8.setText("Binding Order");\r
-            jCheckBox8.setPreferredSize(new java.awt.Dimension(103,20));\r
-        }\r
-        return jCheckBox8;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jTextField11    \r
-     *         \r
-     * @return javax.swing.JTextField  \r
-     */\r
-    private JTextField getJTextField11() {\r
-        if (jTextField11 == null) {\r
-            jTextField11 = new JTextField();\r
-            jTextField11.setPreferredSize(new java.awt.Dimension(150,20));\r
-        }\r
-        return jTextField11;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jButton14       \r
-     *         \r
-     * @return javax.swing.JButton     \r
-     */\r
-    private JButton getJButton14() {\r
-        if (jButton14 == null) {\r
-            jButton14 = new JButton();\r
-            jButton14.setText("Add");\r
-            jButton14.setPreferredSize(new java.awt.Dimension(70,20));\r
-            jButton14.addActionListener(new AbstractAction(){\r
-                /**\r
-                 * \r
-                 */\r
-                private static final long serialVersionUID = 1L;\r
-\r
-                public void actionPerformed(ActionEvent arg0){\r
-                }\r
-            });\r
-        }\r
-        return jButton14;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jButton15       \r
-     *         \r
-     * @return javax.swing.JButton     \r
-     */\r
-    private JButton getJButton15() {\r
-        if (jButton15 == null) {\r
-            jButton15 = new JButton();\r
-            jButton15.setPreferredSize(new java.awt.Dimension(70,20));\r
-            jButton15.setText("Delete");\r
-        }\r
-        return jButton15;\r
-    }\r
-\r
-    /**\r
-     * This method initializes jButton16       \r
-     *         \r
-     * @return javax.swing.JButton     \r
-     */\r
-    private JButton getJButton16() {\r
-        if (jButton16 == null) {\r
-            jButton16 = new JButton();\r
-            jButton16.setText("Delete");\r
-            jButton16.setPreferredSize(new java.awt.Dimension(70,20));\r
-        }\r
-        return jButton16;\r
-    }\r
-\r
     /**\r
      * This method initializes jButton17       \r
      *         \r
@@ -1181,8 +950,8 @@ public class FpdBuildOptions extends IInternalFrame {
     private JButton getJButton17() {\r
         if (jButton17 == null) {\r
             jButton17 = new JButton();\r
-            jButton17.setPreferredSize(new java.awt.Dimension(70,20));\r
-            jButton17.setText("Add");\r
+            jButton17.setPreferredSize(new java.awt.Dimension(80,20));\r
+            jButton17.setText("New");\r
             jButton17.addActionListener(new AbstractAction() {\r
                 /**\r
                  * \r
@@ -1190,8 +959,12 @@ public class FpdBuildOptions extends IInternalFrame {
                 private static final long serialVersionUID = 1L;\r
 \r
                 public void actionPerformed(ActionEvent arg0){\r
+                    if (jTable.getSelectedRow() < 0) {\r
+                        return;\r
+                    }\r
                     Object[] o = {"", ""};\r
                     ffsAttributesTableModel.addRow(o);\r
+                    ffc.genBuildOptionsFfsAttribute(jTable.getSelectedRow(), "", "");\r
                 }\r
             });\r
         }\r
@@ -1206,8 +979,8 @@ public class FpdBuildOptions extends IInternalFrame {
     private JButton getJButton18() {\r
         if (jButton18 == null) {\r
             jButton18 = new JButton();\r
-            jButton18.setPreferredSize(new java.awt.Dimension(70,20));\r
-            jButton18.setText("Delete");\r
+            jButton18.setPreferredSize(new java.awt.Dimension(80,20));\r
+            jButton18.setText("Remove");\r
             jButton18.addActionListener(new AbstractAction(){\r
                 /**\r
                  * \r
@@ -1215,8 +988,12 @@ public class FpdBuildOptions extends IInternalFrame {
                 private static final long serialVersionUID = 1L;\r
 \r
                 public void actionPerformed(ActionEvent arg0){\r
+                    if (jTable.getSelectedRow() < 0) {\r
+                        return;\r
+                    }\r
                     if (jTable4.getSelectedRow() >= 0){\r
                         ffsAttributesTableModel.removeRow(jTable4.getSelectedRow());\r
+                        ffc.removeBuildOptionsFfsAttribute(jTable.getSelectedRow(), jTable4.getSelectedRow());\r
                     }\r
                 }\r
             });\r
@@ -1375,10 +1152,316 @@ public class FpdBuildOptions extends IInternalFrame {
             jTable = new JTable(ffsTableModel);\r
             jTable.setShowGrid(false);\r
             jTable.setRowHeight(20);\r
+            \r
+            jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
+            jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\r
+                public void valueChanged(ListSelectionEvent e) {\r
+                    \r
+                    if (e.getValueIsAdjusting()){\r
+                        return;\r
+                    }\r
+                    ListSelectionModel lsm = (ListSelectionModel)e.getSource();\r
+                    if (lsm.isSelectionEmpty()) {\r
+                        return;\r
+                    }\r
+                    else{\r
+                        int row = lsm.getMinSelectionIndex();\r
+                        sectionTableModel.setRowCount(0);\r
+                        sectionsTableModel.setRowCount(0);\r
+                        subsectionsTableModel.setRowCount(0);\r
+                        ffsAttributesTableModel.setRowCount(0);\r
+                        String[] sArray = {"", ""};\r
+                        LinkedHashMap<String, String> lhm = new LinkedHashMap<String, String>();\r
+                        ArrayList<String> alSections = new ArrayList<String>();\r
+                        ArrayList<String> alSection = new ArrayList<String>();\r
+                        ffc.getBuildOptionsFfs(row, sArray, lhm, alSections, alSection);\r
+                        jTextField6.setText(sArray[0]);\r
+                        jTextField.setText(sArray[1]);\r
+                        for (int i = 0; i < alSection.size(); ++i) {\r
+                            String[] sectionRow = {alSection.get(i)};\r
+                            sectionTableModel.addRow(sectionRow);\r
+                        }\r
+                        for (int j = 0; j < alSections.size(); ++j) {\r
+                            String[] sectionsRow = {alSections.get(j)};\r
+                            sectionsTableModel.addRow(sectionsRow);\r
+                        }\r
+                        if (lhm.size() <= 0 ) {\r
+                            return;\r
+                        }\r
+                        Set<String> keySet = lhm.keySet();\r
+                        Iterator<String> is = keySet.iterator();\r
+                        while(is.hasNext()) {\r
+                            String key = is.next();\r
+                            String[] attribRow = {key, lhm.get(key)};\r
+                            ffsAttributesTableModel.addRow(attribRow);\r
+                        }\r
+                    }\r
+                }\r
+            });\r
+            \r
+            jTable.getModel().addTableModelListener(new TableModelListener() {\r
+                public void tableChanged(TableModelEvent arg0) {\r
+                    // TODO Auto-generated method stub\r
+                    int row = arg0.getFirstRow();\r
+                    TableModel m = (TableModel)arg0.getSource();\r
+                    if (arg0.getType() == TableModelEvent.UPDATE){\r
+                        //ToDo Data Validition check.\r
+                        String id = m.getValueAt(row, 0) + "";\r
+                        \r
+                        if (id.length() == 0) {\r
+                            return;\r
+                        }\r
+                       \r
+//                        ffc.updateBuildOptionsUserDefAntTask(row, id, file, execOrder);\r
+                        \r
+                    }\r
+                }\r
+            });\r
         }\r
         return jTable;\r
     }\r
 \r
+    /**\r
+     * This method initializes jScrollPane1    \r
+     *         \r
+     * @return javax.swing.JScrollPane \r
+     */\r
+    private JScrollPane getJScrollPane1() {\r
+        if (jScrollPane1 == null) {\r
+            jScrollPane1 = new JScrollPane();\r
+            jScrollPane1.setPreferredSize(new java.awt.Dimension(500,80));\r
+            jScrollPane1.setViewportView(getJTable1());\r
+        }\r
+        return jScrollPane1;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jTable1 \r
+     *         \r
+     * @return javax.swing.JTable      \r
+     */\r
+    private JTable getJTable1() {\r
+        if (jTable1 == null) {\r
+            sectionTableModel = new DefaultTableModel();\r
+            sectionTableModel.addColumn("SectionType");\r
+            \r
+            jTable1 = new JTable(sectionsTableModel);\r
+        }\r
+        return jTable1;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jScrollPane3    \r
+     *         \r
+     * @return javax.swing.JScrollPane \r
+     */\r
+    private JScrollPane getJScrollPane3() {\r
+        if (jScrollPane3 == null) {\r
+            jScrollPane3 = new JScrollPane();\r
+            jScrollPane3.setPreferredSize(new java.awt.Dimension(500,90));\r
+            jScrollPane3.setViewportView(getJTable3());\r
+        }\r
+        return jScrollPane3;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jTable3 \r
+     *         \r
+     * @return javax.swing.JTable      \r
+     */\r
+    private JTable getJTable3() {\r
+        if (jTable3 == null) {\r
+            subsectionsTableModel = new DefaultTableModel();\r
+            subsectionsTableModel.addColumn("SectionType");\r
+            jTable3 = new JTable(subsectionsTableModel);\r
+        }\r
+        return jTable3;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jTextField      \r
+     *         \r
+     * @return javax.swing.JTextField  \r
+     */\r
+    private JTextField getJTextField() {\r
+        if (jTextField == null) {\r
+            jTextField = new JTextField();\r
+            jTextField.setPreferredSize(new java.awt.Dimension(100,20));\r
+        }\r
+        return jTextField;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jPanel4 \r
+     *         \r
+     * @return javax.swing.JPanel      \r
+     */\r
+    private JPanel getJPanel4() {\r
+        if (jPanel4 == null) {\r
+            jPanel4 = new JPanel();\r
+            jPanel4.setPreferredSize(new java.awt.Dimension(100,100));\r
+            jPanel4.add(getJButton17(), null);\r
+            jPanel4.add(getJButton18(), null);\r
+        }\r
+        return jPanel4;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jButton \r
+     *         \r
+     * @return javax.swing.JButton     \r
+     */\r
+    private JButton getJButton() {\r
+        if (jButton == null) {\r
+            jButton = new JButton();\r
+            jButton.setPreferredSize(new java.awt.Dimension(80,20));\r
+            jButton.setText("New");\r
+        }\r
+        return jButton;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jButton1        \r
+     *         \r
+     * @return javax.swing.JButton     \r
+     */\r
+    private JButton getJButton1() {\r
+        if (jButton1 == null) {\r
+            jButton1 = new JButton();\r
+            jButton1.setPreferredSize(new java.awt.Dimension(80,20));\r
+            jButton1.setText("Remove");\r
+        }\r
+        return jButton1;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jButton2        \r
+     *         \r
+     * @return javax.swing.JButton     \r
+     */\r
+    private JButton getJButton2() {\r
+        if (jButton2 == null) {\r
+            jButton2 = new JButton();\r
+            jButton2.setPreferredSize(new java.awt.Dimension(80,20));\r
+            jButton2.setText("New");\r
+        }\r
+        return jButton2;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jButton3        \r
+     *         \r
+     * @return javax.swing.JButton     \r
+     */\r
+    private JButton getJButton3() {\r
+        if (jButton3 == null) {\r
+            jButton3 = new JButton();\r
+            jButton3.setPreferredSize(new java.awt.Dimension(80,20));\r
+            jButton3.setText("Remove");\r
+        }\r
+        return jButton3;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jButton6        \r
+     *         \r
+     * @return javax.swing.JButton     \r
+     */\r
+    private JButton getJButton6() {\r
+        if (jButton6 == null) {\r
+            jButton6 = new JButton();\r
+            jButton6.setPreferredSize(new java.awt.Dimension(80,20));\r
+            jButton6.setText("New");\r
+        }\r
+        return jButton6;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jButton7        \r
+     *         \r
+     * @return javax.swing.JButton     \r
+     */\r
+    private JButton getJButton7() {\r
+        if (jButton7 == null) {\r
+            jButton7 = new JButton();\r
+            jButton7.setPreferredSize(new java.awt.Dimension(80,20));\r
+            jButton7.setText("Remove");\r
+        }\r
+        return jButton7;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jScrollPane4    \r
+     *         \r
+     * @return javax.swing.JScrollPane \r
+     */\r
+    private JScrollPane getJScrollPane4() {\r
+        if (jScrollPane4 == null) {\r
+            jScrollPane4 = new JScrollPane();\r
+            jScrollPane4.setPreferredSize(new java.awt.Dimension(500,80));\r
+            jScrollPane4.setViewportView(getJTable6());\r
+        }\r
+        return jScrollPane4;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jTable6 \r
+     *         \r
+     * @return javax.swing.JTable      \r
+     */\r
+    private JTable getJTable6() {\r
+        if (jTable6 == null) {\r
+            sectionsTableModel = new DefaultTableModel();\r
+            sectionsTableModel.addColumn("EncapsulationType");\r
+            jTable6 = new JTable(sectionsTableModel);\r
+            \r
+            jTable6.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
+            jTable6.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\r
+                public void valueChanged(ListSelectionEvent e) {\r
+                    if (e.getValueIsAdjusting()){\r
+                        return;\r
+                    }\r
+                    ListSelectionModel lsm = (ListSelectionModel)e.getSource();\r
+                    if (lsm.isSelectionEmpty()) {\r
+                        return;\r
+                    }\r
+                    else{\r
+                        int sectionsRow = lsm.getMinSelectionIndex();\r
+                        if (jTable.getSelectedRow() < 0) {\r
+                            return;\r
+                        }\r
+                        subsectionsTableModel.setRowCount(0);\r
+                        ArrayList<String> al = new ArrayList<String>();\r
+                        ffc.getBuildOptionsFfsSectionsSectionsSection(jTable.getSelectedRow(), sectionsRow, al);\r
+                        for (int i = 0; i < al.size(); ++i) {\r
+                            String[] subsectionRow = {al.get(i)};\r
+                            subsectionsTableModel.addRow(subsectionRow);\r
+                        }\r
+                    }\r
+                }\r
+            });\r
+            \r
+            jTable6.getModel().addTableModelListener(new TableModelListener() {\r
+                public void tableChanged(TableModelEvent arg0) {\r
+                    // TODO Auto-generated method stub\r
+                    int row = arg0.getFirstRow();\r
+                    TableModel m = (TableModel)arg0.getSource();\r
+                    if (arg0.getType() == TableModelEvent.UPDATE){\r
+                        //ToDo Data Validition check.\r
+//                        String targetName = m.getValueAt(row, 0) + "";\r
+//                        String toolChain = m.getValueAt(row, 1) + "";\r
+//                        String supArch = m.getValueAt(row, 2) + "";\r
+//                        String toolCmd = m.getValueAt(row, 3) + "";\r
+//                        String tagName = m.getValueAt(row, 4) + "";\r
+//                        String contents = m.getValueAt(row, 5) + "";\r
+//                        ffc.updateBuildOptionsOpt(row, targetName, toolChain, tagName, toolCmd, supArch, contents);\r
+                    }\r
+                }\r
+            });\r
+        }\r
+        return jTable6;\r
+    }\r
+\r
     /**\r
      * @param args\r
      */\r
@@ -1405,20 +1488,21 @@ public class FpdBuildOptions extends IInternalFrame {
     private void init(FpdFileContents ffc) {\r
         initOptionTable();\r
         initAntTaskTable();\r
+        initFfsTable();\r
         this.addInternalFrameListener(new InternalFrameAdapter(){\r
             public void internalFrameDeactivated(InternalFrameEvent e){\r
                 if (jTable.isEditing()) {\r
                     jTable.getCellEditor().stopCellEditing();\r
                 }\r
-//                if (jTable1.isEditing()) {\r
-//                    jTable1.getCellEditor().stopCellEditing();\r
-//                }\r
+                if (jTable1.isEditing()) {\r
+                    jTable1.getCellEditor().stopCellEditing();\r
+                }\r
                 if (jTable2.isEditing()) {\r
                     jTable2.getCellEditor().stopCellEditing();\r
                 }\r
-//                if (jTable3.isEditing()) {\r
-//                    jTable3.getCellEditor().stopCellEditing();\r
-//                }\r
+                if (jTable3.isEditing()) {\r
+                    jTable3.getCellEditor().stopCellEditing();\r
+                }\r
                 if (jTable4.isEditing()) {\r
                     jTable4.getCellEditor().stopCellEditing();\r
                 }\r
@@ -1451,13 +1535,25 @@ public class FpdBuildOptions extends IInternalFrame {
             antTaskTableModel.addRow(saa[i]);\r
         }\r
     }\r
+    \r
+    private void initFfsTable(){\r
+        int ffsCount = ffc.getBuildOptionsFfsCount();\r
+        if (ffsCount < 0) {\r
+            return;\r
+        }\r
+        String[][] saa = new String[ffsCount][1];\r
+        ffc.getBuildOptionsFfsKey(saa);\r
+        for (int i = 0; i < saa.length; ++i) {\r
+            ffsTableModel.addRow(saa[i]);\r
+        }\r
+    }\r
     /**\r
      * This method initializes this\r
      * \r
      * @return void\r
      */\r
     private void initialize() {\r
-        this.setSize(722, 439);\r
+        this.setSize(722, 577);\r
         this.setTitle("FPD Build Options");\r
         this.setContentPane(getJContentPane());\r
     }\r
index d97f2a7cba0d101f4dca1c78367ee0fa0732434a..3d34eb5b63d44cd39dd1f03bea19a6d162fc4c12 100644 (file)
@@ -32,6 +32,7 @@ import org.apache.xmlbeans.XmlOptions;
 import org.tianocore.AntTaskDocument;\r
 import org.tianocore.BuildOptionsDocument;\r
 import org.tianocore.DynamicPcdBuildDefinitionsDocument;\r
+import org.tianocore.EfiSectionType;\r
 import org.tianocore.FlashDefinitionFileDocument;\r
 import org.tianocore.FlashDocument;\r
 import org.tianocore.FrameworkModulesDocument;\r
@@ -1144,16 +1145,13 @@ public class FpdFileContents {
         int i = 0;\r
         while(li.hasNext()) {\r
             OptionDocument.Option opt = (OptionDocument.Option)li.next();\r
-//            saa[i][0] = opt.getBuildTargets();\r
+            if (opt.getBuildTargets() != null) {\r
+                saa[i][0] = listToString(opt.getBuildTargets());\r
+            }\r
             saa[i][1] = opt.getToolChainFamily();\r
             if (opt.getSupArchList() != null){\r
-                Object[] archs = opt.getSupArchList().toArray();\r
-                saa[i][2] = " ";\r
-                for (int j = 0; j < archs.length; ++j){\r
-                    saa[i][2] += archs[j];\r
-                    saa[i][2] += " ";\r
-                }\r
-                saa[i][2] = saa[i][2].trim();\r
+                saa[i][2] = listToString(opt.getSupArchList());\r
+\r
             }\r
             saa[i][3] = opt.getToolCode();\r
             saa[i][4] = opt.getTagName();\r
@@ -1163,6 +1161,210 @@ public class FpdFileContents {
         }\r
     }\r
     \r
+    public void genBuildOptionsFfs(String ffsKey, String type) {\r
+        BuildOptionsDocument.BuildOptions.Ffs ffs = getfpdBuildOpts().addNewFfs();\r
+        ffs.setFfsKey(ffsKey);\r
+        if (type != null) {\r
+            ffs.addNewSections().setEncapsulationType(type);\r
+        }\r
+    }\r
+    \r
+    public void genBuildOptionsFfsAttribute(int i, String name, String value) {\r
+        BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);\r
+        BuildOptionsDocument.BuildOptions.Ffs.Attribute attrib = ffs.addNewAttribute();\r
+        attrib.setName(name);\r
+        attrib.setValue(value);\r
+    }\r
+    \r
+    /**update jth attribute of ith ffs.\r
+     * @param i\r
+     * @param j\r
+     */\r
+    public void updateBuildOptionsFfsAttribute(int i, int j, String name, String value){\r
+        BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);\r
+        XmlCursor cursor = ffs.newCursor();\r
+        QName qAttrib = new QName(xmlNs, "Attribute");\r
+        if (cursor.toChild(qAttrib)) {\r
+            for (int k = 0; k < j; ++k) {\r
+                cursor.toNextSibling(qAttrib);\r
+            }\r
+            BuildOptionsDocument.BuildOptions.Ffs.Attribute attrib = (BuildOptionsDocument.BuildOptions.Ffs.Attribute)cursor.getObject();\r
+            attrib.setName(name);\r
+            attrib.setValue(value);\r
+        }\r
+        cursor.dispose();\r
+    }\r
+    \r
+    public void removeBuildOptionsFfsAttribute(int i, int j){\r
+        BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);\r
+        XmlCursor cursor = ffs.newCursor();\r
+        QName qAttrib = new QName(xmlNs, "Attribute");\r
+        if (cursor.toChild(qAttrib)) {\r
+            for (int k = 0; k < j; ++k) {\r
+                cursor.toNextSibling(qAttrib);\r
+            }\r
+            cursor.removeXml();\r
+        }\r
+        cursor.dispose();\r
+    }\r
+    \r
+    public void genBuildOptionsFfsSectionsSection(int i, String sectionType) {\r
+        BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);\r
+        if (ffs == null) {\r
+            return;\r
+        }\r
+        BuildOptionsDocument.BuildOptions.Ffs.Sections sections = ffs.getSections();\r
+        \r
+        if (sections == null){\r
+            sections = ffs.addNewSections();\r
+        }\r
+        sections.addNewSection().setSectionType(EfiSectionType.Enum.forString(sectionType));\r
+    }\r
+    \r
+    public void genBuildOptionsFfsSectionsSections(int i, String encapType) {\r
+        BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);\r
+        if (ffs == null) {\r
+            return;\r
+        }\r
+        BuildOptionsDocument.BuildOptions.Ffs.Sections sections = ffs.getSections();\r
+        \r
+        if (sections == null){\r
+            sections = ffs.addNewSections();\r
+        }\r
+        sections.addNewSections().setEncapsulationType(encapType);\r
+    }\r
+    \r
+    public void genBuildOptionsFfsSectionsSectionsSection(int i, int j, String type) {\r
+        BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);\r
+        if (ffs == null) {\r
+            return;\r
+        }\r
+        BuildOptionsDocument.BuildOptions.Ffs.Sections sections = ffs.getSections();\r
+        XmlCursor cursor = sections.newCursor();\r
+        QName qSections = new QName(xmlNs, "Sections");\r
+        if (cursor.toChild(qSections)){\r
+            for (int k = 0; k < j; ++k) {\r
+                cursor.toNextSibling(qSections);\r
+            }\r
+            BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2 sections2 = (BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2)cursor.getObject();\r
+            sections2.addNewSection().setSectionType(EfiSectionType.Enum.forString(type));\r
+        }\r
+        cursor.dispose();\r
+    }\r
+    \r
+    public void getBuildOptionsFfsSectionsSectionsSection(int i, int j, ArrayList<String> al) {\r
+        BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);\r
+        if (ffs == null) {\r
+            return;\r
+        }\r
+        BuildOptionsDocument.BuildOptions.Ffs.Sections sections = ffs.getSections();\r
+        XmlCursor cursor = sections.newCursor();\r
+        QName qSections = new QName(xmlNs, "Sections");\r
+        if (cursor.toChild(qSections)){\r
+            for (int k = 0; k < j; ++k) {\r
+                cursor.toNextSibling(qSections);\r
+            }\r
+            BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2 sections2 = (BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2)cursor.getObject();\r
+            if (sections2.getSectionList() == null){\r
+                cursor.dispose();\r
+                return;\r
+            }\r
+            ListIterator<BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2.Section> li = sections2.getSectionList().listIterator();\r
+            while(li.hasNext()) {\r
+                BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2.Section section = li.next();\r
+                al.add(section.getSectionType().toString());\r
+            }\r
+        }\r
+        cursor.dispose();\r
+        \r
+    }\r
+    \r
+    public int getBuildOptionsFfsCount(){\r
+        if (getfpdBuildOpts().getFfsList() == null) {\r
+            return 0;\r
+        }\r
+        return getfpdBuildOpts().getFfsList().size();\r
+    }\r
+    \r
+    public void getBuildOptionsFfsKey(String[][] saa) {\r
+        if (getfpdBuildOpts().getFfsList() == null) {\r
+            return;\r
+        }\r
+        ListIterator<BuildOptionsDocument.BuildOptions.Ffs> li = getfpdBuildOpts().getFfsList().listIterator();\r
+        int i = 0;\r
+        while(li.hasNext()){\r
+            BuildOptionsDocument.BuildOptions.Ffs ffs = li.next();\r
+            saa[i][0] = ffs.getFfsKey();\r
+            ++i;\r
+        }\r
+    }\r
+    \r
+    /**Get ith FFS key and contents.\r
+     * @param saa\r
+     */\r
+    public void getBuildOptionsFfs(int i, String[] sa, LinkedHashMap<String, String> ffsAttribMap, ArrayList<String> firstLevelSections, ArrayList<String> firstLevelSection) {\r
+        BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);\r
+     \r
+        if (ffs != null) {\r
+         \r
+            sa[0] = ffs.getFfsKey();\r
+            if (ffs.getSections() != null) {\r
+                if(ffs.getSections().getEncapsulationType() != null){\r
+                    sa[1] = ffs.getSections().getEncapsulationType();\r
+                }\r
+                if (ffs.getSections().getSectionList() != null){\r
+                    ListIterator<BuildOptionsDocument.BuildOptions.Ffs.Sections.Section> li = ffs.getSections().getSectionList().listIterator();\r
+                    while (li.hasNext()) {\r
+                        firstLevelSection.add(li.next().getSectionType().toString());\r
+                    }\r
+                }\r
+                if (ffs.getSections().getSectionsList() != null) {\r
+                    ListIterator<BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2> li = ffs.getSections().getSectionsList().listIterator();\r
+                    while(li.hasNext()) {\r
+                        firstLevelSections.add(li.next().getEncapsulationType());\r
+                    }\r
+                }\r
+            }\r
+            if (ffs.getAttributeList() != null) {\r
+                ListIterator<BuildOptionsDocument.BuildOptions.Ffs.Attribute> li = ffs.getAttributeList().listIterator();\r
+                while(li.hasNext()) {\r
+                    BuildOptionsDocument.BuildOptions.Ffs.Attribute attrib = li.next();\r
+                    ffsAttribMap.put(attrib.getName(), attrib.getValue());\r
+                }\r
+                \r
+            }\r
+        }\r
+\r
+        \r
+    }\r
+    \r
+    private BuildOptionsDocument.BuildOptions.Ffs getFfs(int i) {\r
+        XmlObject o = getfpdBuildOpts();\r
+        BuildOptionsDocument.BuildOptions.Ffs ffs = null;\r
+        \r
+        XmlCursor cursor = o.newCursor();\r
+        QName qFfs = new QName(xmlNs, "Ffs");\r
+        if (cursor.toChild(qFfs)) {\r
+            for (int j = 0; j < i; ++j) {\r
+                cursor.toNextSibling(qFfs);\r
+            }\r
+            ffs = (BuildOptionsDocument.BuildOptions.Ffs)cursor.getObject();\r
+        }\r
+        cursor.dispose();\r
+        return ffs;\r
+    }\r
+    \r
+    public void removeBuildOptionsFfs(int i) {\r
+        BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);\r
+        if (ffs == null){\r
+            return;\r
+        }\r
+        \r
+        XmlCursor cursor = ffs.newCursor();\r
+        cursor.removeXml();\r
+        cursor.dispose();\r
+    }\r
+    \r
     public PlatformDefinitionsDocument.PlatformDefinitions getfpdPlatformDefs(){\r
         if (fpdPlatformDefs == null){\r
             fpdPlatformDefs = fpdRoot.addNewPlatformDefinitions();\r