]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java
1. Make SPD editor tables bigger.and table now focus the entry added.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / packaging / ui / SpdGuidDecls.java
index 6fe9d43bb2aced958d1dcba78c790bb755f05d4c..91f4ba64de10d3e4179d4b67a029e7669de685a7 100644 (file)
@@ -38,6 +38,7 @@ import javax.swing.table.TableModel;
 import org.tianocore.PackageSurfaceAreaDocument;\r
 import org.tianocore.frameworkwizard.common.DataValidation;\r
 import org.tianocore.frameworkwizard.common.Tools;\r
+import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;\r
 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;\r
 import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
 import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;\r
@@ -57,6 +58,8 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
     static JFrame frame;\r
     \r
     private SpdFileContents sfc = null;\r
+    \r
+    private OpeningPackageType docConsole = null;\r
 \r
     private JTable jTable = null;\r
 \r
@@ -161,7 +164,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
     protected JScrollPane getJScrollPane() {\r
         if (jScrollPane == null) {\r
             jScrollPane = new JScrollPane();\r
-            jScrollPane.setBounds(new java.awt.Rectangle(5,256,472,196));\r
+            jScrollPane.setBounds(new java.awt.Rectangle(5,256,472,292));\r
             jScrollPane.setViewportView(getJTable());\r
         }\r
         return jScrollPane;\r
@@ -249,6 +252,9 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
        int row = arg0.getFirstRow();\r
        TableModel m = (TableModel)arg0.getSource();\r
        if (arg0.getType() == TableModelEvent.UPDATE){\r
+           if (docConsole != null) {\r
+               docConsole.setSaved(false);\r
+           }\r
            updateRow(row, m);\r
        }\r
    }\r
@@ -372,6 +378,11 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
         sfc = new SpdFileContents(inPsa);\r
         init(sfc);\r
     }\r
+    \r
+    public SpdGuidDecls(OpeningPackageType opt) {\r
+        this(opt.getXmlSpd());\r
+        docConsole = opt;\r
+    }\r
     /**\r
       This method initializes this\r
       \r
@@ -504,6 +515,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r
      */\r
     public void actionPerformed(ActionEvent arg0) {\r
+        \r
         if (arg0.getSource() == jButtonOk) {\r
             this.save();\r
             this.dispose();\r
@@ -537,7 +549,11 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
             if (!dataValidation(row)) {\r
                 return;\r
             }\r
+            if (docConsole != null) {\r
+                docConsole.setSaved(false);\r
+            }\r
             model.addRow(row);\r
+            jTable.changeSelection(model.getRowCount()-1, 0, false, false);\r
             addRow(row);\r
         }\r
         //\r