Added some checks to see if the attributes were set - clears up some warning messages...
authorlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 16 Jul 2006 08:26:44 +0000 (08:26 +0000)
committerlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 16 Jul 2006 08:26:44 +0000 (08:26 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1024 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdFileContents.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java

index 2aaf6e2..3b5c686 100644 (file)
@@ -340,22 +340,29 @@ public class SpdFileContents {
               if (instanceVer != null){\r
                 lc.setRecommendedInstanceVersion(instanceVer);\r
               } else {\r
-                lc.unsetRecommendedInstanceVersion();\r
+                if (lc.isSetRecommendedInstanceVersion()) {\r
+                  lc.unsetRecommendedInstanceVersion();\r
+                }\r
               }\r
             } else {\r
-              lc.unsetRecommendedInstanceGuid();\r
-              lc.unsetRecommendedInstanceVersion();\r
+              if (lc.isSetRecommendedInstanceGuid()) {\r
+                lc.unsetRecommendedInstanceGuid();\r
+              }\r
             }\r
 \r
             if (stringToList(hdrAttribArch) != null){\r
               lc.setSupArchList(stringToList(hdrAttribArch));\r
             } else {\r
-              lc.unsetSupArchList();\r
+              if (lc.isSetSupArchList()) {\r
+                lc.unsetSupArchList();\r
+              }\r
             }\r
             if (stringToList(hdrAttribModType) != null){\r
               lc.setSupModuleList(stringToList(hdrAttribModType));\r
             } else {\r
-              lc.unsetSupModuleList();\r
+              if (lc.isSetSupModuleList()) {\r
+                lc.unsetSupModuleList();\r
+              }\r
             }\r
         }\r
         \r
@@ -397,22 +404,28 @@ public class SpdFileContents {
             e.setGuidValue(guid);\r
             e.setHelpText(hlp);\r
             if (stringToList(guidTypeList) != null) {\r
-                e.setGuidTypeList(stringToList(guidTypeList));\r
+              e.setGuidTypeList(stringToList(guidTypeList));\r
             }\r
             else{\r
+              if (e.isSetGuidTypeList()) {\r
                 e.unsetGuidTypeList();\r
+              }\r
             }\r
             if (stringToList(archList) != null){\r
                 e.setSupArchList(stringToList(archList));\r
             }\r
             else{\r
+              if (e.isSetSupArchList()) {\r
                 e.unsetSupArchList();\r
+              }\r
             }\r
             if (stringToList(modTypeList) != null) {\r
                 e.setSupModuleList(stringToList(modTypeList));\r
             }\r
             else{\r
+              if (e.isSetSupModuleList()) {\r
                 e.unsetSupModuleList();\r
+              }\r
             }\r
             \r
         }\r
@@ -440,13 +453,17 @@ public class SpdFileContents {
                 e.setSupArchList(stringToList(archList));\r
             }\r
             else{\r
+              if (e.isSetSupArchList()) {\r
                 e.unsetSupArchList();\r
+              }\r
             }\r
             if (stringToList(modTypeList) != null) {\r
                 e.setSupModuleList(stringToList(modTypeList));\r
             }\r
             else{\r
+              if (e.isSetSupModuleList()) {\r
                 e.unsetSupModuleList();\r
+              }\r
             }\r
         }\r
         cursor.dispose();\r
@@ -473,13 +490,17 @@ public class SpdFileContents {
                 e.setSupArchList(stringToList(archList));\r
             }\r
             else{\r
+              if (e.isSetSupArchList()) {\r
                 e.unsetSupArchList();\r
+              }\r
             }\r
             if (stringToList(modTypeList) != null) {\r
                 e.setSupModuleList(stringToList(modTypeList));\r
             }\r
             else{\r
+              if (e.isSetSupModuleList()) {\r
                 e.unsetSupModuleList();\r
+              }\r
             }\r
         }\r
         cursor.dispose();\r
@@ -989,11 +1010,18 @@ public class SpdFileContents {
 */\r
         if (hdrAttribArch != null) {\r
             lc.setSupArchList(stringToList(hdrAttribArch));\r
+        } else {\r
+          if (lc.isSetSupArchList()) {\r
+            lc.unsetSupArchList();\r
+          }\r
         }\r
+\r
         if (hdrAttribModType != null) {\r
           lc.setSupModuleList(stringToList(hdrAttribModType));\r
         } else {\r
-          lc.unsetSupModuleList();\r
+          if (lc.isSetSupModuleList()) {\r
+            lc.unsetSupModuleList();\r
+          }\r
         }\r
         \r
     }\r
@@ -1278,12 +1306,16 @@ public class SpdFileContents {
         if (archList != null){\r
           pe.setSupArchList(stringToList(archList));\r
         } else {\r
-          pe.unsetSupArchList();\r
+          if (pe.isSetSupArchList()) {\r
+            pe.unsetSupArchList();\r
+          }\r
         }\r
         if (modTypeList != null){\r
           pe.setSupModuleList(stringToList(modTypeList));\r
         } else {\r
-          pe.unsetSupModuleList();\r
+          if (pe.isSetSupModuleList()) {\r
+            pe.unsetSupModuleList();\r
+          }\r
         }\r
     }\r
 \r
index 4d35348..dade30d 100644 (file)
@@ -251,7 +251,6 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
            vModule.add("UEFI_DRIVER");\r
            vModule.add("UEFI_APPLICATION");\r
            vModule.add("USER_DEFINED");\r
-           vModule.add("NONE");\r
 \r
            jTable.getColumnModel().getColumn(cnSupMod).setCellEditor(new ListEditor(vModule));\r
           \r
@@ -293,12 +292,8 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
                arch = m.getValueAt(row, cnSupArch).toString();\r
             }\r
             String module = null;\r
-                   // if (lsm.isSelectionEmpty()) {\r
             if (m.getValueAt(row, cnSupMod) != null) {\r
                 module = m.getValueAt(row, cnSupMod).toString();\r
-                if (module == "NONE") {\r
-                  module = null;\r
-                }\r
             }\r
             String[] rowData = {lib, hdr, hlp};\r
             if (!dataValidation(rowData)) {\r
@@ -308,7 +303,9 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
             \r
 // LAH            getLibInstances(lib);\r
 \r
-// LAH            String guid = nameToGuid(name);\r
+            if (name != null) {\r
+              String guid = nameToGuid(name);\r
+            }\r
             \r
             // LAH WAS sfc.updateSpdLibClass(row, lib, hdr, hlp, guid, ver, arch, module);\r
             sfc.updateSpdLibClass(row, lib, hdr, hlp, null, null, arch, module);\r
@@ -589,8 +586,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
             //\r
             //convert to GUID before storing recommended lib instance.\r
             //\r
-            getLibInstances(row[0]);\r
-\r
+            getLibInstances(row[cnClassName]);\r
 // LAH            recommendGuid = nameToGuid(row[3]);\r
 \r
 // LAH WAS             sfc.genSpdLibClassDeclarations(row[0], recommendGuid, row[1], row[2], row[5], null, null, row[4], null, row[6]);\r