]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
1. Make SPD editor tables bigger.and table now focus the entry added.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdFrameworkModules.java
index 2ab4d65d2b9521f86f871929289c1b4721e214c7..cb2a5aa4206911a218c98be99153f0235e39e4d9 100644 (file)
@@ -14,6 +14,7 @@ import javax.swing.ListSelectionModel;
 import javax.swing.table.DefaultTableModel;\r
 \r
 import org.tianocore.PlatformSurfaceAreaDocument;\r
+import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;\r
 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;\r
 import org.tianocore.frameworkwizard.platform.ui.global.GlobalData;\r
 import org.tianocore.frameworkwizard.platform.ui.id.ModuleIdentification;\r
@@ -54,7 +55,7 @@ public class FpdFrameworkModules extends IInternalFrame {
     private FpdModuleSA settingDlg = null;\r
     \r
     private FpdFileContents ffc = null;\r
-    \r
+    private OpeningPlatformType docConsole = null;\r
     private Map<String, String> fpdMsa = null;\r
     \r
     private ArrayList<ModuleIdentification> miList = null;\r
@@ -198,7 +199,16 @@ public class FpdFrameworkModules extends IInternalFrame {
                         row[4] = mi.getPackage().getVersion();\r
                     }\r
                     model1.addRow(row);\r
-                    ffc.addFrameworkModulesPcdBuildDefs(miList.get(selectedRow), null);\r
+                    \r
+                    docConsole.setSaved(false);\r
+                    try{\r
+                        ffc.addFrameworkModulesPcdBuildDefs(miList.get(selectedRow), null);\r
+                    }\r
+                    catch (Exception exception) {\r
+                        JOptionPane.showMessageDialog(frame, "PCD Insertion Fail. " + exception.getMessage());\r
+                    }\r
+                    JOptionPane.showMessageDialog(frame, "This Module Added Successfully.");\r
+                    jTable1.changeSelection(model1.getRowCount()-1, 0, false, false);\r
                 }\r
             });\r
         }\r
@@ -277,7 +287,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                     if (settingDlg == null) {\r
                         settingDlg = new FpdModuleSA(ffc);\r
                     }\r
-                    \r
+                    docConsole.setSaved(false);\r
                     String mg = model1.getValueAt(selectedRow, 1)+"";\r
                     String mv = model1.getValueAt(selectedRow, 2)+"";\r
                     String pg = model1.getValueAt(selectedRow, 3)+"";\r
@@ -312,6 +322,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                     String pv = model1.getValueAt(selectedRow, 4).toString();\r
                     model1.removeRow(selectedRow);\r
                     fpdMsa.remove(mg+mv+pg+pv);\r
+                    docConsole.setSaved(false);\r
                     ffc.removeModuleSA(selectedRow);\r
                 }\r
             });\r
@@ -341,6 +352,11 @@ public class FpdFrameworkModules extends IInternalFrame {
         \r
     }\r
     \r
+    public FpdFrameworkModules(OpeningPlatformType opt) {\r
+        this(opt.getXmlFpd());\r
+        docConsole = opt;\r
+    }\r
+    \r
     private void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {\r
         try {\r
             GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db", System.getenv("WORKSPACE"));\r