import javax.swing.JList;\r
import javax.swing.JOptionPane;\r
\r
+import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;\r
+import org.tianocore.MsaHeaderDocument.MsaHeader;\r
+import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;\r
+import org.tianocore.PlatformHeaderDocument.PlatformHeader;\r
+import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;\r
+import org.tianocore.SpdHeaderDocument.SpdHeader;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
+import org.tianocore.frameworkwizard.platform.PlatformIdentification;\r
+\r
/**\r
The class is used to provides some useful interfaces \r
\r
//\r
return hexString.trim();\r
}\r
+ \r
+ public static ModuleIdentification getId(String path, ModuleSurfaceArea msa) {\r
+ MsaHeader head = msa.getMsaHeader();\r
+ String name = head.getModuleName();\r
+ String guid = head.getGuidValue();\r
+ String version = head.getVersion();\r
+ ModuleIdentification id = new ModuleIdentification(name, guid, version, path);\r
+ return id;\r
+ }\r
+\r
+ public static PackageIdentification getId(String path, PackageSurfaceArea spd) {\r
+ SpdHeader head = spd.getSpdHeader();\r
+ String name = head.getPackageName();\r
+ String guid = head.getGuidValue();\r
+ String version = head.getVersion();\r
+ PackageIdentification id = new PackageIdentification(name, guid, version, path);\r
+ return id;\r
+ }\r
+\r
+ public static PlatformIdentification getId(String path, PlatformSurfaceArea fpd) {\r
+ PlatformHeader head = fpd.getPlatformHeader();\r
+ String name = head.getPlatformName();\r
+ String guid = head.getGuidValue();\r
+ String version = head.getVersion();\r
+ PlatformIdentification id = new PlatformIdentification(name, guid, version, path);\r
+ return id;\r
+ }\r
}\r