]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java
Change radio button in package header editor to a label.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / packaging / ui / SpdLibClassDecls.java
index 5c3260d54dca5ce29b431b4735e2442dbf75eb93..6f660f5b5619b1a5285fdc134a9550fde9a80e13 100644 (file)
@@ -52,7 +52,7 @@ import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
 import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
 import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;\r
 import org.tianocore.frameworkwizard.platform.ui.ListEditor;\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
@@ -200,8 +200,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
     private JScrollPane getJScrollPane() {\r
         if (jScrollPane == null) {\r
             jScrollPane = new JScrollPane();\r
-            jScrollPane.setBounds(new java.awt.Rectangle(12,351,608,253));\r
-            jScrollPane.setPreferredSize(new java.awt.Dimension(500,419));\r
+            jScrollPane.setBounds(new java.awt.Rectangle(12,351,400,253));\r
             jScrollPane.setViewportView(getJTable());\r
         }\r
         return jScrollPane;\r
@@ -310,6 +309,10 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
             if (name != null && name.length() > 0) {\r
                 getLibInstances(lib);\r
                 guid = nameToGuid(name);\r
+                if (guid == null){\r
+                  JOptionPane.showMessageDialog(frame, "Recommended Instance NOT exists.");\r
+                  return;\r
+                }\r
             }\r
             \r
             String[] sa = new String[7];\r
@@ -618,6 +621,15 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
             //\r
             getLibInstances(row[cnClassName]);\r
             String recommendGuid = nameToGuid(row[cnRecInstName]);\r
+            if (row[cnRecInstName].equals("null")) {\r
+                row[cnRecInstName] = null;\r
+            }\r
+            else{\r
+                if (recommendGuid == null) {\r
+                  JOptionPane.showMessageDialog(frame, "Recommended Instance NOT exists.");\r
+                  return;\r
+                }\r
+            }\r
 \r
             sfc.genSpdLibClassDeclarations(row[cnClassName], recommendGuid, row[cnHdrFile], row[cnHelpText], row[cnSupArch], null, null, row[cnRecInstVer], null, row[cnSupMod]);\r
             model.addRow(row);\r
@@ -755,9 +767,9 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
     public void componentResized(ComponentEvent arg0) {\r
         int intPreferredWidth = 500;\r
         \r
-        resizeComponentWidth(this.jTextFieldClass, this.getWidth(), intPreferredWidth);\r
-        resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth);\r
-        resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth-10);\r
+        Tools.resizeComponentWidth(this.jTextFieldClass, this.getWidth(), intPreferredWidth);\r
+        Tools.resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth);\r
+        Tools.resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth-10);\r
         \r
     }\r
     /**\r
@@ -907,23 +919,23 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
     private void getLibInstances(String libClass){\r
         libNameGuidMap.clear();\r
         try {\r
-            GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db", System.getenv("WORKSPACE"));\r
+            WorkspaceProfile.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db", System.getenv("WORKSPACE"));\r
         \r
-            Set<PackageIdentification> spi = GlobalData.getPackageList();\r
+            Set<PackageIdentification> spi = WorkspaceProfile.getPackageList();\r
             Iterator ispi = spi.iterator();\r
             \r
             while (ispi.hasNext()) {\r
                 PackageIdentification pi = (PackageIdentification) ispi.next();\r
 \r
-                Set<ModuleIdentification> smi = GlobalData.getModules(pi);\r
+                Set<ModuleIdentification> smi = WorkspaceProfile.getModules(pi);\r
                 Iterator ismi = smi.iterator();\r
                 while (ismi.hasNext()) {\r
                     ModuleIdentification mi = (ModuleIdentification) ismi.next();\r
-                    Map<String, XmlObject> m = GlobalData.getNativeMsa(mi);\r
+                    Map<String, XmlObject> m = WorkspaceProfile.getNativeMsa(mi);\r
                     SurfaceAreaQuery.setDoc(m);\r
-                    String[] classProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED");\r
-                    for (int i = 0; i < classProduced.length; ++i) {\r
-                        if (classProduced[i].equals(libClass)) {\r
+                    Vector<String> classProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED", mi);\r
+                    for (int i = 0; i < classProduced.size(); ++i) {\r
+                        if (classProduced.get(i).equals(libClass)) {\r
                             libNameGuidMap.put(mi.getName(), mi.getGuid());\r
                         }\r
                     }\r
@@ -939,7 +951,6 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
     private String nameToGuid(String name) {\r
         String s = null;\r
         if (!libNameGuidMap.containsKey(name)) {\r
-            JOptionPane.showMessageDialog(frame, "Recommended Instance NOT exists.");\r
             return s;\r
         }\r
         \r