Fix the invalid warning message when user add a module that does not support platform...
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 8 Nov 2006 08:31:56 +0000 (08:31 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 8 Nov 2006 08:31:56 +0000 (08:31 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1918 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdPlatformDefs.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/WorkspaceProfile.java

index d8b1934..00243c2 100644 (file)
@@ -389,18 +389,22 @@ public class FpdFrameworkModules extends IInternalFrame {
         String path = modelAllModules.getValueAt(selectedRow, pathColForAllModTable) + "";\r
         ModuleIdentification mi = miList.get(selectedRow);\r
         Vector<String> vArchs = null;\r
-        try {\r
-            vArchs = WorkspaceProfile.getModuleSupArchs(mi);\r
-        }\r
-        catch (Exception exp) {\r
-            JOptionPane.showMessageDialog(frame, exp.getMessage());\r
-        }\r
+\r
+        vArchs = WorkspaceProfile.getModuleSupArchs(mi);\r
 \r
         if (vArchs == null) {\r
             JOptionPane.showMessageDialog(frame, "No Supported Architectures specified in MSA file.");\r
             return;\r
         }\r
 \r
+        Vector<Object> platformSupArch = new Vector<Object>();\r
+        ffc.getPlatformDefsSupportedArchs(platformSupArch);\r
+        platformSupArch.retainAll(vArchs);\r
+        if (platformSupArch.size() == 0) {\r
+            JOptionPane.showMessageDialog(frame, "This Module does not support this platform architectures.");\r
+            return;\r
+        }\r
+        \r
         String archsAdded = "";\r
         String mg = mi.getGuid();\r
         String mv = mi.getVersion();\r
@@ -434,7 +438,7 @@ public class FpdFrameworkModules extends IInternalFrame {
         //\r
         // check whether archs conform to SupArch of platform.\r
         //\r
-        Vector<Object> platformSupArch = new Vector<Object>();\r
+        platformSupArch.removeAllElements();\r
         ffc.getPlatformDefsSupportedArchs(platformSupArch);\r
         vArchs.retainAll(platformSupArch);\r
         //\r
index f7d8b01..5f1e76d 100644 (file)
@@ -474,6 +474,7 @@ public class FpdPlatformDefs extends IInternalFrame {
                     getSupportedArchitectures(v);\r
                     if (v.size() == 0) {\r
                         JOptionPane.showMessageDialog(frame, "Platform must support at least ONE Architecture.");\r
+                        jCheckBoxIa32.setSelected(true);\r
                         return;\r
                     }\r
                     ffc.setPlatformDefsSupportedArchs(v);\r
@@ -499,6 +500,7 @@ public class FpdPlatformDefs extends IInternalFrame {
                     getSupportedArchitectures(v);\r
                     if (v.size() == 0) {\r
                         JOptionPane.showMessageDialog(frame, "Platform must support at least ONE Architecture.");\r
+                        jCheckBoxX64.setSelected(true);\r
                         return;\r
                     }\r
                     ffc.setPlatformDefsSupportedArchs(v);\r
@@ -524,6 +526,7 @@ public class FpdPlatformDefs extends IInternalFrame {
                     getSupportedArchitectures(v);\r
                     if (v.size() == 0) {\r
                         JOptionPane.showMessageDialog(frame, "Platform must support at least ONE Architecture.");\r
+                        jCheckBoxIpf.setSelected(true);\r
                         return;\r
                     }\r
                     ffc.setPlatformDefsSupportedArchs(v);\r
@@ -551,6 +554,7 @@ public class FpdPlatformDefs extends IInternalFrame {
                     getSupportedArchitectures(v);\r
                     if (v.size() == 0) {\r
                         JOptionPane.showMessageDialog(frame, "Platform must support at least ONE Architecture.");\r
+                        jCheckBoxEbc.setSelected(true);\r
                         return;\r
                     }\r
                     ffc.setPlatformDefsSupportedArchs(v);\r
@@ -578,6 +582,7 @@ public class FpdPlatformDefs extends IInternalFrame {
                     getSupportedArchitectures(v);\r
                     if (v.size() == 0) {\r
                         JOptionPane.showMessageDialog(frame, "Platform must support at least ONE Architecture.");\r
+                        jCheckBoxArm.setSelected(true);\r
                         return;\r
                     }\r
                     ffc.setPlatformDefsSupportedArchs(v);\r
@@ -605,6 +610,7 @@ public class FpdPlatformDefs extends IInternalFrame {
                     getSupportedArchitectures(v);\r
                     if (v.size() == 0) {\r
                         JOptionPane.showMessageDialog(frame, "Platform must support at least ONE  Architecture.");\r
+                        jCheckBoxPpc.setSelected(true);\r
                         return;\r
                     }\r
                     ffc.setPlatformDefsSupportedArchs(v);\r
index 0f79653..b06a97b 100644 (file)
@@ -105,7 +105,7 @@ public class WorkspaceProfile {
         return null;\r
     }\r
     \r
-    public static Vector<String> getModuleSupArchs(ModuleIdentification mi) throws Exception {\r
+    public static Vector<String> getModuleSupArchs(ModuleIdentification mi){\r
         Vector<String> vArchs = null;\r
         ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea)getModuleXmlObject(mi);\r
         if (msa.getModuleDefinitions() == null || msa.getModuleDefinitions().getSupportedArchitectures() == null) {\r