import org.tianocore.frameworkwizard.common.ui.IInternalFrame;\r
import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery;\r
import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;\r
+import org.tianocore.frameworkwizard.workspace.Workspace;\r
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
\r
import java.awt.FlowLayout;\r
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
//\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
\r
private void showSettingsDlg (int row) {\r
try {\r
- if (ffc.adjustPcd(row)) {\r
+ Vector<String> vExceptions = new Vector<String>();\r
+ if (ffc.adjustPcd(row, vExceptions)) {\r
JOptionPane.showMessageDialog(frame, "Pcd entries sync. with those in MSA files.");\r
docConsole.setSaved(false);\r
}\r
public FpdFrameworkModules(OpeningPlatformType opt) {\r
this(opt.getXmlFpd());\r
docConsole = opt;\r
+ Vector<String> vExceptions = new Vector<String>();\r
+ if (pcdSync(vExceptions)) {\r
+ JOptionPane.showMessageDialog(frame, "PCD in this platform are synchronized with those in MSA files."); \r
+ docConsole.setSaved(false);\r
+ }\r
+ if (vExceptions.size() > 0) {\r
+ String errorMsg = "";\r
+ for (int i = 0; i < vExceptions.size(); ++i) {\r
+ errorMsg += " " + vExceptions.get(i) + "\n";\r
+ }\r
+ JOptionPane.showMessageDialog(frame, "Error occurred during synchronization:" + errorMsg);\r
+ }\r
}\r
\r
private void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {\r
row[pkgVerColForFpdModTable] = mi.getPackageId().getVersion();\r
row[archColForFpdModTable] = saa[i][ffcModArch];\r
try {\r
- row[pathColForFpdModTable] = mi.getPath().substring(System.getenv("WORKSPACE").length() + 1);\r
+ row[pathColForFpdModTable] = mi.getPath().substring(Workspace.getCurrentWorkspace().length() + 1);\r
} catch (Exception e) {\r
JOptionPane.showMessageDialog(frame, "Show FPD Modules:" + e.getMessage());\r
}\r
}\r
\r
showAllModules();\r
-\r
+ \r
}\r
\r
+ private boolean pcdSync(Vector<String> v) {\r
+ boolean synced = false;\r
+ for (int i = 0; i < jTableFpdModules.getRowCount(); ++i) {\r
+ try {\r
+ if (ffc.adjustPcd(i, v)) {\r
+ synced = true;\r
+ }\r
+ }\r
+ catch (Exception exp) {\r
+// JOptionPane.showMessageDialog(frame, exp.getMessage());\r
+ continue;\r
+ }\r
+ }\r
+ return synced;\r
+ \r
+ }\r
+ \r
private void showAllModules() {\r
\r
if (miList == null) {\r
s[pkgNameColForAllModTable] = mi.getPackageId().getName();\r
s[pkgVerColForAllModTable] = mi.getPackageId().getVersion();\r
try {\r
- s[pathColForAllModTable] = mi.getPath().substring(System.getenv("WORKSPACE").length() + 1);\r
+ s[pathColForAllModTable] = mi.getPath().substring(Workspace.getCurrentWorkspace().length() + 1);\r
} catch (Exception e) {\r
JOptionPane.showMessageDialog(frame, "Show All Modules:" + e.getMessage());\r
}\r