]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java
1.change GlobalData to WorkspaceProfile.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdModuleSA.java
index a34fa5a28a7e625f499992241d9cfcccedfa6eb7..ed3b6e20297bbcea4b09bf9c5d18b647dc0a7320 100644 (file)
@@ -25,7 +25,7 @@ import javax.swing.table.TableModel;
 \r
 import org.tianocore.frameworkwizard.common.DataValidation;\r
 import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;\r
-import org.tianocore.frameworkwizard.platform.ui.global.GlobalData;\r
+import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;\r
 import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery;\r
 import org.tianocore.frameworkwizard.platform.ui.id.ModuleIdentification;\r
 import org.tianocore.frameworkwizard.platform.ui.id.PackageIdentification;\r
@@ -151,6 +151,10 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         // display pcd for key.\r
         //\r
         model.setRowCount(0);\r
+        jTextAreaPcdHelp.setText("");\r
+        jComboBoxItemType.setSelectedIndex(-1);\r
+        jTextFieldMaxDatumSize.setText("");\r
+        jTextFieldPcdDefault.setText("");\r
         int pcdCount = ffc.getPcdDataCount(i);\r
         if (pcdCount != 0) {\r
             String[][] saa = new String[pcdCount][7];\r
@@ -175,7 +179,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             String[][] saa = new String[instanceCount][5];\r
             ffc.getLibraryInstances(key, saa);\r
             for (int i = 0; i < saa.length; ++i) {\r
-                ModuleIdentification mi = GlobalData.getModuleId(saa[i][1] + " " + saa[i][2] + " " + saa[i][3] + " " + saa[i][4]);\r
+                ModuleIdentification mi = WorkspaceProfile.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
@@ -221,7 +225,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
     }\r
     \r
     private void resolveLibraryInstances(String key) {\r
-        ModuleIdentification mi = GlobalData.getModuleId(key);\r
+        ModuleIdentification mi = WorkspaceProfile.getModuleId(key);\r
         PackageIdentification[] depPkgList = null;\r
         try{\r
             //\r
@@ -288,7 +292,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         ArrayList<String> al = new ArrayList<String>();\r
         \r
         for (int i = 0; i < depPkgList.length; ++i) {\r
-            Set<ModuleIdentification> smi = GlobalData.getModules(depPkgList[i]);\r
+            Set<ModuleIdentification> smi = WorkspaceProfile.getModules(depPkgList[i]);\r
             Iterator ismi = smi.iterator();\r
             while(ismi.hasNext()) {\r
                 ModuleIdentification mi = (ModuleIdentification)ismi.next();\r
@@ -319,7 +323,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
     }\r
     \r
     private void removeInstance(String key) {\r
-        ModuleIdentification mi = GlobalData.getModuleId(key); \r
+        ModuleIdentification mi = WorkspaceProfile.getModuleId(key); \r
         //\r
         // remove pcd information of instance from current ModuleSA\r
         //\r
@@ -629,11 +633,11 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         ffc.getLibraryInstances(moduleKey, saa);\r
         \r
         try{\r
-            if (ffc.getPcdBuildDataInfo(GlobalData.getModuleId(moduleKey), cName, tsGuid, sa)) {\r
+            if (ffc.getPcdBuildDataInfo(WorkspaceProfile.getModuleId(moduleKey), cName, tsGuid, sa)) {\r
                 return;\r
             }\r
             for (int j = 0; j < saa.length; ++j) {\r
-                if (ffc.getPcdBuildDataInfo(GlobalData.getModuleId(saa[j][1] + " " + saa[j][2] + " " + saa[j][3] + " " + saa[j][4]),\r
+                if (ffc.getPcdBuildDataInfo(WorkspaceProfile.getModuleId(saa[j][1] + " " + saa[j][2] + " " + saa[j][3] + " " + saa[j][4]),\r
                                             cName, tsGuid, sa)) {\r
                     return;\r
                 }\r
@@ -841,8 +845,8 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                         while(li.hasNext()) {\r
                             String instance = li.next();\r
                             String[] s = {"", "", "", "", ""};\r
-                            if (GlobalData.getModuleId(instance) != null) {\r
-                                s[0] = GlobalData.getModuleId(instance).getName();\r
+                            if (WorkspaceProfile.getModuleId(instance) != null) {\r
+                                s[0] = WorkspaceProfile.getModuleId(instance).getName();\r
                             }\r
                             \r
                             String[] instancePart = instance.split(" ");\r
@@ -981,7 +985,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                     libInstanceTableModel.getValueAt(row, 2) + " " +\r
                     libInstanceTableModel.getValueAt(row, 3) + " " +\r
                     libInstanceTableModel.getValueAt(row, 4);\r
-                    ModuleIdentification libMi = GlobalData.getModuleId(instanceValue);\r
+                    ModuleIdentification libMi = WorkspaceProfile.getModuleId(instanceValue);\r
                     ffc.genLibraryInstance(libMi, moduleKey);\r
                     //\r
                     // Add pcd information of selected instance to current moduleSA\r
@@ -1438,6 +1442,10 @@ private JComboBox getJComboBoxItemType() {
                 if (jComboBoxItemType.getItemCount() == 3) {\r
                     if (!jComboBoxItemType.getSelectedItem().equals("DYNAMIC")) {\r
                         pcdDynamicToNonDynamic(jTablePcd.getValueAt(row, 0)+"", jTablePcd.getValueAt(row, 1)+"");\r
+                        if (jComboBoxItemType.getSelectedItem().equals("FIXED_AT_BUILD")) {\r
+                            jTextFieldPcdDefault.setText("");\r
+                            jTextFieldPcdDefault.setEnabled(true);\r
+                        }\r
                     }\r
                     else{\r
                         pcdNonDynamicToDynamic(jTablePcd.getValueAt(row, 0)+"", jTablePcd.getValueAt(row, 1)+"");\r