Fix the problem "update action multiple times fail".
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 26 May 2006 06:53:56 +0000 (06:53 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 26 May 2006 06:53:56 +0000 (06:53 +0000)
Enhanced GUID value editor.

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

Tools/Source/PackageEditor/src/org/tianocore/common/Tools.java
Tools/Source/PackageEditor/src/org/tianocore/packaging/GenGuidDialog.java [new file with mode: 0644]
Tools/Source/PackageEditor/src/org/tianocore/packaging/GuidEditor.java [new file with mode: 0644]
Tools/Source/PackageEditor/src/org/tianocore/packaging/SpdFileContents.java
Tools/Source/PackageEditor/src/org/tianocore/packaging/UpdateGuids.java
Tools/Source/PackageEditor/src/org/tianocore/packaging/UpdateLibraryClass.java
Tools/Source/PackageEditor/src/org/tianocore/packaging/UpdateMsaFile.java
Tools/Source/PackageEditor/src/org/tianocore/packaging/UpdatePCD.java
Tools/Source/PackageEditor/src/org/tianocore/packaging/UpdatePkgHeader.java
Tools/Source/PackageEditor/src/org/tianocore/packaging/UpdatePpi.java
Tools/Source/PackageEditor/src/org/tianocore/packaging/UpdateProtocols.java

index e372812..311370d 100644 (file)
@@ -25,6 +25,8 @@ import java.util.UUID;
 **/\r
 public class Tools {\r
        \r
+        public static final String guidArrayPat = "0x[a-fA-F0-9]{1,8},( )*0x[a-fA-F0-9]{1,4},( )*0x[a-fA-F0-9]{1,4}(,( )*\\{)?(,?( )*0x[a-fA-F0-9]{1,2}){8}( )*(\\})?";\r
+       public static final String guidRegistryPat = "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}";\r
        /**\r
          get current date and time, then return\r
          @return String\r
@@ -70,4 +72,88 @@ public class Tools {
                return UUID.randomUUID().toString();\r
        }\r
        \r
+    public static String formatGuidString (String guidNameConv) {\r
+        String[] strList;\r
+        String guid = "";\r
+        int index = 0;\r
+        if (guidNameConv\r
+                        .matches(Tools.guidRegistryPat)) {\r
+            strList = guidNameConv.split("-");\r
+            guid = "0x" + strList[0] + ", ";\r
+            guid = guid + "0x" + strList[1] + ", ";\r
+            guid = guid + "0x" + strList[2] + ", ";\r
+//            guid = guid + "{";\r
+            guid = guid + "0x" + strList[3].substring(0, 2) + ", ";\r
+            guid = guid + "0x" + strList[3].substring(2, 4);\r
+\r
+            while (index < strList[4].length()) {\r
+                guid = guid + ", ";\r
+                guid = guid + "0x" + strList[4].substring(index, index + 2);\r
+                index = index + 2;\r
+            }\r
+//            guid = guid + "}";\r
+            return guid;\r
+        }\r
+        else if (guidNameConv\r
+                        .matches(Tools.guidArrayPat)) {\r
+            strList = guidNameConv.split(",");\r
+            \r
+            //\r
+            // chang ANSI c form to registry form\r
+            //\r
+            for (int i = 0; i < strList.length; i++){\r
+                strList[i] = strList[i].substring(strList[i].lastIndexOf("x") + 1);\r
+            }\r
+            if (strList[strList.length - 1].endsWith("}")) {\r
+                strList[strList.length -1] = strList[strList.length-1].substring(0, strList[strList.length-1].length()-1); \r
+            }\r
+            //\r
+            //inserting necessary leading zeros\r
+            //\r
+            \r
+            int segLen = strList[0].length();\r
+            if (segLen < 8){\r
+                for (int i = 0; i < 8 - segLen; ++i){\r
+                    strList[0] = "0" + strList[0];\r
+                }\r
+            }\r
+            \r
+            segLen = strList[1].length();\r
+            if (segLen < 4){\r
+                for (int i = 0; i < 4 - segLen; ++i){\r
+                    strList[1] = "0" + strList[1];\r
+                }\r
+            }\r
+            segLen = strList[2].length();\r
+            if (segLen < 4){\r
+                for (int i = 0; i < 4 - segLen; ++i){\r
+                    strList[2] = "0" + strList[2];\r
+                }\r
+            }\r
+            for (int i = 3; i < 11; ++i) {\r
+                segLen = strList[i].length();\r
+                if (segLen < 2){\r
+                    strList[i] = "0" + strList[i];\r
+                }\r
+            }\r
+            \r
+            for (int i = 0; i < 3; i++){\r
+                guid += strList[i] + "-";\r
+            }\r
+            \r
+            guid += strList[3];\r
+            guid += strList[4] + "-";\r
+            \r
+            for (int i = 5; i < strList.length; ++i){\r
+                guid += strList[i];\r
+            }\r
+            \r
+            \r
+            return guid;\r
+        } else {\r
+            \r
+            return "0";\r
+\r
+        }\r
+    }\r
 }\r
diff --git a/Tools/Source/PackageEditor/src/org/tianocore/packaging/GenGuidDialog.java b/Tools/Source/PackageEditor/src/org/tianocore/packaging/GenGuidDialog.java
new file mode 100644 (file)
index 0000000..c58010a
--- /dev/null
@@ -0,0 +1,391 @@
+/** @file\r
+  Java class GenGuidDialog.\r
\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+package org.tianocore.packaging;\r
+\r
+import java.awt.BorderLayout;\r
+import java.awt.Dimension;\r
+import java.awt.Toolkit;\r
+\r
+import javax.swing.JPanel;\r
+import javax.swing.JDialog;\r
+import java.awt.GridLayout;\r
+\r
+import javax.swing.JFrame;\r
+import javax.swing.JOptionPane;\r
+import javax.swing.JTextField;\r
+import javax.swing.JLabel;\r
+import javax.swing.JRadioButton;\r
+import javax.swing.ButtonGroup;\r
+import javax.swing.JButton;\r
+\r
+import org.tianocore.common.Tools;\r
+\r
+import java.awt.FlowLayout;\r
+import java.awt.event.ActionEvent;\r
+import java.awt.event.ActionListener;\r
+import java.awt.event.WindowAdapter;\r
+import java.awt.event.WindowEvent;\r
+\r
+/**\r
+ Dialog for GUID generation. \r
+ @since PackageEditor 1.0\r
+**/\r
+public class GenGuidDialog extends JDialog implements ActionListener{\r
+\r
+    static private JFrame frame;\r
+    private JPanel jContentPane = null;\r
+    private JPanel jPanel = null;\r
+    private JPanel jPanel1 = null;\r
+    private JPanel jPanel2 = null;\r
+    private JPanel jPanel3 = null;\r
+    private JPanel jPanel4 = null;\r
+    private JTextField jTextField = null;\r
+    private JLabel jLabel = null;\r
+    private JRadioButton jRadioButton = null;\r
+    private JRadioButton jRadioButton1 = null;\r
+    private JButton jButton = null;\r
+    private JButton jButton1 = null;\r
+    private JButton jButton2 = null;\r
+    \r
+//    private String guid = null;\r
+\r
+    public void actionPerformed(ActionEvent arg0) {\r
+        // TODO Auto-generated method stub\r
+        if (arg0.getSource() == jButton1){\r
+            String uuid = Tools.generateUuidString();\r
+            if (jRadioButton1.isSelected()) {\r
+                jTextField.setText(uuid);\r
+            }\r
+            else {\r
+                //ToDo: transform to comma-sep guid\r
+                String s = Tools.formatGuidString(uuid);\r
+                if (s.equals("0")) {\r
+                    JOptionPane.showMessageDialog(frame, "Check GUID Value, it don't conform to the schema.");\r
+                    return;\r
+                }\r
+                jTextField.setText(s);\r
+            }\r
+        }\r
+        \r
+        if (arg0.getSource() == jRadioButton1){\r
+            \r
+            //ToDo: check text field value against RegExp and transform if needed\r
+            if (jTextField.getText().matches(Tools.guidRegistryPat)){\r
+                return;\r
+            }\r
+            if (jTextField.getText().matches(Tools.guidArrayPat)) {\r
+                jTextField.setText(Tools.formatGuidString(jTextField.getText()));\r
+                return;\r
+            }\r
+            \r
+            JOptionPane.showMessageDialog(frame, "Check GUID Value, it don't conform to the schema.");\r
+                    \r
+        }\r
+        \r
+        if (arg0.getSource() == jRadioButton){\r
+            \r
+            //ToDo: check text field value against RegExp and transform if needed\r
+            if (jTextField.getText().matches(Tools.guidArrayPat)){\r
+                return;\r
+            }\r
+            if (jTextField.getText().matches(Tools.guidRegistryPat)) {\r
+                jTextField.setText(Tools.formatGuidString(jTextField.getText()));\r
+                return;\r
+            }\r
+            \r
+            JOptionPane.showMessageDialog(frame, "Check GUID Value, it don't conform to the schema.");\r
+            \r
+        }\r
+        \r
+        if (arg0.getSource() == jButton2){\r
+//            if (jTextField.getText().matches(Tools.guidArrayPat) \r
+//                            || jTextField.getText().matches(Tools.guidRegistryPat)){\r
+//                this.setVisible(false);\r
+//            }\r
+//            else {\r
+//                JOptionPane.showMessageDialog(frame, "Incorrect GUID Value Format.");\r
+//            }\r
+            this.dispose();\r
+        }\r
+        \r
+        if (arg0.getSource() == jButton){\r
+            this.dispose();\r
+        }\r
+    }\r
+\r
+    /**\r
+     * This method initializes jPanel  \r
+     *         \r
+     * @return javax.swing.JPanel      \r
+     */\r
+    private JPanel getJPanel() {\r
+        if (jPanel == null) {\r
+            FlowLayout flowLayout = new FlowLayout();\r
+            flowLayout.setVgap(10);\r
+            jPanel = new JPanel();\r
+            jPanel.setLayout(flowLayout);\r
+            jPanel.setPreferredSize(new java.awt.Dimension(100,30));\r
+            jPanel.add(getJButton1(), null);\r
+            jPanel.add(getJButton2(), null);\r
+            jPanel.add(getJButton(), null);\r
+        }\r
+        return jPanel;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jPanel1 \r
+     *         \r
+     * @return javax.swing.JPanel      \r
+     */\r
+    private JPanel getJPanel1() {\r
+        if (jPanel1 == null) {\r
+            jPanel1 = new JPanel();\r
+        }\r
+        return jPanel1;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jPanel2 \r
+     *         \r
+     * @return javax.swing.JPanel      \r
+     */\r
+    private JPanel getJPanel2() {\r
+        if (jPanel2 == null) {\r
+            jPanel2 = new JPanel();\r
+        }\r
+        return jPanel2;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jPanel3 \r
+     *         \r
+     * @return javax.swing.JPanel      \r
+     */\r
+    private JPanel getJPanel3() {\r
+        if (jPanel3 == null) {\r
+            jPanel3 = new JPanel();\r
+        }\r
+        return jPanel3;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jPanel4 \r
+     *         \r
+     * @return javax.swing.JPanel      \r
+     */\r
+    private JPanel getJPanel4() {\r
+        if (jPanel4 == null) {\r
+            jLabel = new JLabel();\r
+            jLabel.setText("GUID Value");\r
+            GridLayout gridLayout = new GridLayout();\r
+            gridLayout.setRows(4);\r
+            jPanel4 = new JPanel();\r
+            jPanel4.setLayout(gridLayout);\r
+            jPanel4.add(getJRadioButton1(), null);\r
+            jPanel4.add(getJRadioButton(), null);\r
+            jPanel4.add(jLabel, null);\r
+            jPanel4.add(getJTextField(), null);\r
+            ButtonGroup bg = new ButtonGroup();\r
+            bg.add(jRadioButton1);\r
+            bg.add(jRadioButton);\r
+        }\r
+        return jPanel4;\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.setHorizontalAlignment(JTextField.LEADING);\r
+            jTextField.setPreferredSize(new java.awt.Dimension(100,20));\r
+        }\r
+        return jTextField;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jRadioButton    \r
+     *         \r
+     * @return javax.swing.JRadioButton        \r
+     */\r
+    private JRadioButton getJRadioButton() {\r
+        if (jRadioButton == null) {\r
+            jRadioButton = new JRadioButton();\r
+            jRadioButton.setText("Comma-Seperated Format");\r
+            jRadioButton.addActionListener(this);\r
+        }\r
+        return jRadioButton;\r
+    }\r
+\r
+    /**\r
+     * This method initializes jRadioButton1   \r
+     *         \r
+     * @return javax.swing.JRadioButton        \r
+     */\r
+    private JRadioButton getJRadioButton1() {\r
+        if (jRadioButton1 == null) {\r
+            jRadioButton1 = new JRadioButton();\r
+            jRadioButton1.setText("Registry Format");\r
+            jRadioButton1.setSelected(true);\r
+            jRadioButton1.addActionListener(this);\r
+        }\r
+        return jRadioButton1;\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("Cancel");\r
+            jButton.addActionListener(this);\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.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);\r
+            jButton1.setText("New");\r
+            jButton1.addActionListener(this);\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("Ok");\r
+            jButton2.addActionListener(this);\r
+        }\r
+        return jButton2;\r
+    }\r
+\r
+    /**\r
+     \r
+     @param args\r
+     **/\r
+    public static void main(String[] args) {\r
+        // TODO Auto-generated method stub\r
+        new GenGuidDialog().setVisible(true);\r
+    }\r
+\r
+    public String getGuid(){\r
+        return jTextField.getText();\r
+    }\r
+    \r
+    public void setGuid(String s){\r
+        jTextField.setText(s);\r
+    }\r
+    /**\r
+     * This is the default constructor\r
+     */\r
+    public GenGuidDialog() {\r
+        super();\r
+        initialize();\r
+    }\r
+    \r
+    public GenGuidDialog(ActionListener i){\r
+        super();\r
+        initialize();\r
+        jButton2.addActionListener(i);\r
+        this.addWindowListener(new WindowAdapter(){\r
+\r
+            @Override\r
+            public void windowActivated(WindowEvent arg0) {\r
+                // TODO Auto-generated method stub\r
+                super.windowActivated(arg0);\r
+                if ((jRadioButton1.isSelected() && jTextField.getText().matches(Tools.guidArrayPat))\r
+                                || (jRadioButton.isSelected() && jTextField.getText().matches(Tools.guidRegistryPat))) {\r
+                    jTextField.setText(Tools.formatGuidString(jTextField.getText()));\r
+                }\r
+                \r
+//                if (!jTextField.getText().matches(Tools.guidArrayPat) || !jTextField.getText().matches(Tools.guidRegistryPat)) {\r
+//                  JOptionPane.showMessageDialog(frame, "InitVal: Incorrect GUID Value Format.");\r
+//                  return;\r
+//                }\r
+            }\r
+            \r
+        });\r
+    }\r
+\r
+    /**\r
+     * This method initializes this\r
+     * \r
+     * @return void\r
+     */\r
+    private void initialize() {\r
+        this.setSize(466, 157);\r
+        this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r
+        this.setModal(true);\r
+        this.setTitle("Editing GUID Value");\r
+        this.setContentPane(getJContentPane());\r
+        this.centerWindow();\r
+    }\r
+\r
+    /**\r
+     * This method initializes jContentPane\r
+     * \r
+     * @return javax.swing.JPanel\r
+     */\r
+    private JPanel getJContentPane() {\r
+        if (jContentPane == null) {\r
+            jContentPane = new JPanel();\r
+            jContentPane.setLayout(new BorderLayout());\r
+            jContentPane.add(getJPanel(), java.awt.BorderLayout.EAST);\r
+            jContentPane.add(getJPanel1(), java.awt.BorderLayout.WEST);\r
+            jContentPane.add(getJPanel2(), java.awt.BorderLayout.NORTH);\r
+            jContentPane.add(getJPanel3(), java.awt.BorderLayout.SOUTH);\r
+            jContentPane.add(getJPanel4(), java.awt.BorderLayout.CENTER);\r
+        }\r
+        return jContentPane;\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
+}  //  @jve:decl-index=0:visual-constraint="10,10"\r
diff --git a/Tools/Source/PackageEditor/src/org/tianocore/packaging/GuidEditor.java b/Tools/Source/PackageEditor/src/org/tianocore/packaging/GuidEditor.java
new file mode 100644 (file)
index 0000000..cac74df
--- /dev/null
@@ -0,0 +1,93 @@
+/** @file\r
+ Java class GuidEditor.\r
\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
+**/\r
+package org.tianocore.packaging;\r
+\r
+import java.awt.Component;\r
+import java.awt.event.ActionEvent;\r
+import java.awt.event.ActionListener;\r
+\r
+import javax.swing.AbstractCellEditor;\r
+import javax.swing.JButton;\r
+import javax.swing.JFrame;\r
+import javax.swing.JOptionPane;\r
+import javax.swing.JTable;\r
+import javax.swing.table.TableCellEditor;\r
+\r
+import org.tianocore.common.Tools;\r
+\r
+/**\r
+ Editor for table cell with GUID value.\r
+ @since PackageEditor 1.0\r
+ **/\r
+public class GuidEditor extends AbstractCellEditor implements TableCellEditor, ActionListener {\r
+\r
+    String currentGuid;\r
+    JButton button;\r
+    static JFrame frame;\r
+    GenGuidDialog dialog;\r
+    protected static final String EDIT = "edit";\r
+\r
+    public GuidEditor() {\r
+        \r
+        button = new JButton();\r
+        button.setActionCommand(EDIT);\r
+        button.addActionListener(this);\r
+        button.setBorderPainted(false);\r
+\r
+        \r
+        dialog = new GenGuidDialog(this);\r
+        \r
+    }\r
+\r
+    /* (non-Javadoc)\r
+     * @see javax.swing.table.TableCellEditor#getTableCellEditorComponent(javax.swing.JTable, java.lang.Object, boolean, int, int)\r
+     */\r
+    public Component getTableCellEditorComponent(JTable arg0, Object arg1, boolean arg2, int arg3, int arg4) {\r
+        // TODO Auto-generated method stub\r
+        currentGuid = (String)arg1;\r
+        return button;\r
+    }\r
+\r
+    /* (non-Javadoc)\r
+     * @see javax.swing.CellEditor#getCellEditorValue()\r
+     */\r
+    public Object getCellEditorValue() {\r
+        // TODO Auto-generated method stub\r
+        return currentGuid;\r
+    }\r
+\r
+    /* (non-Javadoc)\r
+     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r
+     */\r
+    public void actionPerformed(ActionEvent arg0) {\r
+        // TODO Auto-generated method stub\r
+        if (EDIT.equals(arg0.getActionCommand())) {\r
+            //The user has clicked the cell, so\r
+            //bring up the dialog.\r
+            button.setText(currentGuid);\r
+            dialog.setGuid(currentGuid);\r
+            dialog.setVisible(true);\r
+\r
+            //Make the renderer reappear.\r
+            fireEditingStopped();\r
+        }\r
+        else { //User pressed dialog's "OK" button.\r
+            currentGuid = dialog.getGuid();\r
+//            button.setText(currentGuid);\r
+//            fireEditingStopped();\r
+        }\r
+\r
+    }\r
+\r
+}\r
index b6e573a..e165656 100644 (file)
@@ -125,6 +125,7 @@ public class SpdFileContents {
             return;\r
         XmlCursor cursor = o.newCursor();\r
         cursor.removeXml();\r
+        spdPcdDefinitions = null;\r
     }\r
 \r
     /**\r
@@ -136,6 +137,7 @@ public class SpdFileContents {
             return;\r
         XmlCursor cursor = o.newCursor();\r
         cursor.removeXml();\r
+        spdPpiDeclarations = null;\r
     }\r
 \r
     /**\r
@@ -147,6 +149,7 @@ public class SpdFileContents {
             return;\r
         XmlCursor cursor = o.newCursor();\r
         cursor.removeXml();\r
+        spdProtocolDeclarations = null;\r
     }\r
 \r
     /**\r
@@ -158,10 +161,11 @@ public class SpdFileContents {
             return;\r
         XmlCursor cursor = o.newCursor();\r
         cursor.removeXml();\r
+        spdGuidDeclarations = null; \r
     }\r
 \r
     /**\r
-     Remove existing spd package header using XmlCursor\r
+     Remove existing spd package include files using XmlCursor\r
     **/\r
     public void removeSpdPkgHeader() {\r
         XmlObject o = psaRoot.getPackageHeaders();\r
@@ -169,6 +173,7 @@ public class SpdFileContents {
             return;\r
         XmlCursor cursor = o.newCursor();\r
         cursor.removeXml();\r
+        spdModHdrs = null;\r
     }\r
 \r
     /**\r
@@ -180,6 +185,7 @@ public class SpdFileContents {
             return;\r
         XmlCursor cursor = o.newCursor();\r
         cursor.removeXml();\r
+        spdMsaFiles = null;\r
     }\r
 \r
     /**\r
@@ -191,7 +197,7 @@ public class SpdFileContents {
             return;\r
         XmlCursor cursor = o.newCursor();\r
         cursor.removeXml();\r
-\r
+        spdLibClassDeclarations = null;\r
     }\r
 \r
     /**\r
index 943a782..6193073 100644 (file)
@@ -24,6 +24,8 @@ import javax.swing.table.*;
 \r
 import org.tianocore.common.Tools;\r
 \r
+import java.awt.Dimension;\r
+import java.awt.Toolkit;\r
 import java.awt.event.ActionEvent;\r
 import java.awt.event.ActionListener;\r
 import java.io.*;\r
@@ -83,10 +85,11 @@ public class UpdateGuids extends JFrame implements ActionListener {
      @return void\r
      **/\r
     private void initialize() {\r
-        this.setSize(604, 553);\r
+        this.setSize(669, 568);\r
         this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r
         this.setTitle("Update GUID Declarations");\r
         this.setContentPane(getJContentPane());\r
+        this.centerWindow();\r
     }\r
 \r
     /**\r
@@ -114,7 +117,7 @@ public class UpdateGuids extends JFrame implements ActionListener {
     private JScrollPane getJScrollPane() {\r
         if (jScrollPane == null) {\r
             jScrollPane = new JScrollPane();\r
-            jScrollPane.setBounds(new java.awt.Rectangle(38, 45, 453, 419));\r
+            jScrollPane.setBounds(new java.awt.Rectangle(38,45,586,315));\r
             jScrollPane.setViewportView(getJTable());\r
         }\r
         return jScrollPane;\r
@@ -147,6 +150,7 @@ public class UpdateGuids extends JFrame implements ActionListener {
                 i++;\r
             }\r
 \r
+            jTable.getColumnModel().getColumn(2).setCellEditor(new GuidEditor());\r
         }\r
         return jTable;\r
     }\r
@@ -226,4 +230,20 @@ public class UpdateGuids extends JFrame implements ActionListener {
         }\r
         return jButton;\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
 } //  @jve:decl-index=0:visual-constraint="11,7"\r
index 8e796d4..4bd6a13 100644 (file)
@@ -24,6 +24,8 @@ import javax.swing.table.*;
 \r
 import org.tianocore.common.Tools;\r
 \r
+import java.awt.Dimension;\r
+import java.awt.Toolkit;\r
 import java.awt.event.ActionEvent;\r
 import java.awt.event.ActionListener;\r
 import java.io.*;\r
@@ -88,6 +90,23 @@ public class UpdateLibraryClass extends JFrame implements ActionListener {
         this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r
         this.setTitle("Update Library Class Declarations");\r
         this.setContentPane(getJContentPane());\r
+        this.centerWindow();\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
index c6fc235..4327fd5 100644 (file)
@@ -24,6 +24,8 @@ import javax.swing.table.*;
 \r
 import org.tianocore.common.Tools;\r
 \r
+import java.awt.Dimension;\r
+import java.awt.Toolkit;\r
 import java.awt.event.ActionEvent;\r
 import java.awt.event.ActionListener;\r
 \r
@@ -86,8 +88,24 @@ public class UpdateMsaFile extends JFrame implements ActionListener {
         this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r
         this.setTitle("Update MSA Files");\r
         this.setContentPane(getJContentPane());\r
+        this.centerWindow();\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
      This method initializes jContentPane\r
      \r
index 44d8970..765e331 100644 (file)
@@ -26,6 +26,8 @@ import javax.swing.table.*;
 \r
 import org.tianocore.common.Tools;\r
 \r
+import java.awt.Dimension;\r
+import java.awt.Toolkit;\r
 import java.awt.event.ActionEvent;\r
 import java.awt.event.ActionListener;\r
 import java.io.*;\r
@@ -92,8 +94,24 @@ public class UpdatePCD extends JFrame implements ActionListener {
         this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r
         this.setTitle("Update PCD Definitions");\r
         this.setContentPane(getJContentPane());\r
+        this.centerWindow();\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
      This method initializes jContentPane\r
      \r
index 77c8ff5..5f9356c 100644 (file)
@@ -26,6 +26,8 @@ import javax.swing.table.*;
 \r
 import org.tianocore.common.Tools;\r
 \r
+import java.awt.Dimension;\r
+import java.awt.Toolkit;\r
 import java.awt.event.ActionEvent;\r
 import java.awt.event.ActionListener;\r
 import java.io.*;\r
@@ -90,8 +92,24 @@ public class UpdatePkgHeader extends JFrame implements ActionListener {
         this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r
         this.setTitle("Update Package Headers");\r
         this.setContentPane(getJContentPane());\r
+        this.centerWindow();\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
      This method initializes jContentPane\r
      \r
index 17fb13f..be58e1c 100644 (file)
@@ -24,6 +24,8 @@ import javax.swing.table.*;
 \r
 import org.tianocore.common.Tools;\r
 \r
+import java.awt.Dimension;\r
+import java.awt.Toolkit;\r
 import java.awt.event.ActionEvent;\r
 import java.awt.event.ActionListener;\r
 import java.io.*;\r
@@ -88,8 +90,24 @@ public class UpdatePpi extends JFrame implements ActionListener {
         this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r
         this.setTitle("Update PPI Declarations");\r
         this.setContentPane(getJContentPane());\r
+        this.centerWindow();\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
      This method initializes jContentPane\r
      \r
@@ -148,6 +166,7 @@ public class UpdatePpi extends JFrame implements ActionListener {
                 i++;\r
             }\r
 \r
+            jTable.getColumnModel().getColumn(2).setCellEditor(new GuidEditor());\r
         }\r
         return jTable;\r
     }\r
index 5521867..4408ec1 100644 (file)
@@ -24,6 +24,8 @@ import javax.swing.table.*;
 \r
 import org.tianocore.common.Tools;\r
 \r
+import java.awt.Dimension;\r
+import java.awt.Toolkit;\r
 import java.awt.event.ActionEvent;\r
 import java.awt.event.ActionListener;\r
 import java.io.*;\r
@@ -88,8 +90,25 @@ public class UpdateProtocols extends JFrame implements ActionListener {
         this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r
         this.setTitle("Update Protocol Declarations");\r
         this.setContentPane(getJContentPane());\r
+        this.centerWindow();\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
      This method initializes jContentPane\r
      \r
@@ -148,6 +167,8 @@ public class UpdateProtocols extends JFrame implements ActionListener {
                 i++;\r
             }\r
 \r
+            jTable.getColumnModel().getColumn(2).setCellEditor(new GuidEditor());\r
+\r
         }\r
         return jTable;\r
     }\r