}
/**
+ * Returns a list of PlatformPathInfo by flattening platform.
+ */
+ public static List<PlatformPathInfo> flattenPlatformPathInfos() {
+ return flattenPlatformPathInfos(getPlatformPathInfos());
+ }
+
+ /**
+ * Returns a list of PlatformPathInfo by flattening platform.
+ */
+ public static List<PlatformPathInfo> flattenPlatformPathInfos(List<PlatformPathInfo> profileInfos) {
+ List<PlatformPathInfo> list = new ArrayList<PlatformPathInfo>();
+ for (PlatformPathInfo profileInfo : profileInfos) {
+ for (String version : profileInfo.getVersions()) {
+ list.add(new PlatformPathInfo(profileInfo.getProfile(), version, profileInfo.getPlatformPath(version)));
+ }
+ }
+ return list;
+ }
+
+ /**
* Returns a list of PlatformPathInfo including the given profile.<br>
* Otherwise, returns null if the profile is null or cannot be found.
*/
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.tizen.common.core.application.InstallPathConfig;
+import org.tizen.common.core.application.PlatformPathInfo;
public class Template {
protected Logger logger = LoggerFactory.getLogger( getClass() );
private List<String> icons;
private String category;
private List<Template> templates;
+ private PlatformPathInfo platformInfo = InstallPathConfig.getLatestPlatformPathInfo();
public Template(Category parent, String name, String descPath) {
this(name, descPath, null);
this.icons = icons;
}
+ public PlatformPathInfo getPlatformInfo() {
+ return platformInfo;
+ }
+
+ public void setPlatformInfo(PlatformPathInfo platformInfo) {
+ if (platformInfo != null)
+ this.platformInfo = platformInfo;
+ }
+
public void addTemplates(Object[] templates) {
for (Object template : templates) {
if (template instanceof Template) {
@Override
public String toString() {
- return "Template [name=" + name + ", samplePath=" + samplePath + ", category=" + category + "]";
+ return "Template [name=" + name + ", samplePath=" + samplePath + ", category=" + category + ", platformInfo=" + platformInfo + "]";
}
}