Fix the invalid warning message when user add a module that does not support platform architectures to this platform.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1918 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jlin16 2006-11-08 08:31:56 +00:00
parent 5f0b744eae
commit 4fd52612c2
3 changed files with 18 additions and 8 deletions

View File

@ -389,18 +389,22 @@ public class FpdFrameworkModules extends IInternalFrame {
String path = modelAllModules.getValueAt(selectedRow, pathColForAllModTable) + "";
ModuleIdentification mi = miList.get(selectedRow);
Vector<String> vArchs = null;
try {
vArchs = WorkspaceProfile.getModuleSupArchs(mi);
}
catch (Exception exp) {
JOptionPane.showMessageDialog(frame, exp.getMessage());
}
vArchs = WorkspaceProfile.getModuleSupArchs(mi);
if (vArchs == null) {
JOptionPane.showMessageDialog(frame, "No Supported Architectures specified in MSA file.");
return;
}
Vector<Object> platformSupArch = new Vector<Object>();
ffc.getPlatformDefsSupportedArchs(platformSupArch);
platformSupArch.retainAll(vArchs);
if (platformSupArch.size() == 0) {
JOptionPane.showMessageDialog(frame, "This Module does not support this platform architectures.");
return;
}
String archsAdded = "";
String mg = mi.getGuid();
String mv = mi.getVersion();
@ -434,7 +438,7 @@ public class FpdFrameworkModules extends IInternalFrame {
//
// check whether archs conform to SupArch of platform.
//
Vector<Object> platformSupArch = new Vector<Object>();
platformSupArch.removeAllElements();
ffc.getPlatformDefsSupportedArchs(platformSupArch);
vArchs.retainAll(platformSupArch);
//

View File

@ -474,6 +474,7 @@ public class FpdPlatformDefs extends IInternalFrame {
getSupportedArchitectures(v);
if (v.size() == 0) {
JOptionPane.showMessageDialog(frame, "Platform must support at least ONE Architecture.");
jCheckBoxIa32.setSelected(true);
return;
}
ffc.setPlatformDefsSupportedArchs(v);
@ -499,6 +500,7 @@ public class FpdPlatformDefs extends IInternalFrame {
getSupportedArchitectures(v);
if (v.size() == 0) {
JOptionPane.showMessageDialog(frame, "Platform must support at least ONE Architecture.");
jCheckBoxX64.setSelected(true);
return;
}
ffc.setPlatformDefsSupportedArchs(v);
@ -524,6 +526,7 @@ public class FpdPlatformDefs extends IInternalFrame {
getSupportedArchitectures(v);
if (v.size() == 0) {
JOptionPane.showMessageDialog(frame, "Platform must support at least ONE Architecture.");
jCheckBoxIpf.setSelected(true);
return;
}
ffc.setPlatformDefsSupportedArchs(v);
@ -551,6 +554,7 @@ public class FpdPlatformDefs extends IInternalFrame {
getSupportedArchitectures(v);
if (v.size() == 0) {
JOptionPane.showMessageDialog(frame, "Platform must support at least ONE Architecture.");
jCheckBoxEbc.setSelected(true);
return;
}
ffc.setPlatformDefsSupportedArchs(v);
@ -578,6 +582,7 @@ public class FpdPlatformDefs extends IInternalFrame {
getSupportedArchitectures(v);
if (v.size() == 0) {
JOptionPane.showMessageDialog(frame, "Platform must support at least ONE Architecture.");
jCheckBoxArm.setSelected(true);
return;
}
ffc.setPlatformDefsSupportedArchs(v);
@ -605,6 +610,7 @@ public class FpdPlatformDefs extends IInternalFrame {
getSupportedArchitectures(v);
if (v.size() == 0) {
JOptionPane.showMessageDialog(frame, "Platform must support at least ONE Architecture.");
jCheckBoxPpc.setSelected(true);
return;
}
ffc.setPlatformDefsSupportedArchs(v);

View File

@ -105,7 +105,7 @@ public class WorkspaceProfile {
return null;
}
public static Vector<String> getModuleSupArchs(ModuleIdentification mi) throws Exception {
public static Vector<String> getModuleSupArchs(ModuleIdentification mi){
Vector<String> vArchs = null;
ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea)getModuleXmlObject(mi);
if (msa.getModuleDefinitions() == null || msa.getModuleDefinitions().getSupportedArchitectures() == null) {