private static String toolEmulatorEtcPath;
private static String toolEmulatorRemotePath;
private static String toolEmulatorDevicePath;
+ private static String toolEmulatorDataPath;
// Platform
private static String platformSkinsPath;
toolEmulatorEtcPath = toolEmulatorPath + etc_suffix;
toolEmulatorRemotePath = toolEmulatorPath + remote_suffix;
toolEmulatorDevicePath = toolEmulatorPath + device_suffix;
+ toolEmulatorDataPath = toolEmulatorPath + data_suffix;
sdkDataSdcardPath = toolEmulatorPath + storages_suffix + sdcard_suffix;
sdkDataSwapPath = toolEmulatorPath + storages_suffix + swap_suffix;
return toolEmulatorDevicePath;
}
+ public static String getToolEmulatorDataPath() {
+ return toolEmulatorDataPath;
+ }
+
// emulator common check tool
public static String getEmulatorCheckToolPath() {
return getToolEmulatorBinPath();
import org.eclipse.swt.SWT;
import org.tizen.emulator.manager.devices.DeviceTemplateValue;
import org.tizen.emulator.manager.logging.EMLogger;
+import org.tizen.emulator.manager.resources.FilePathResources;
import org.tizen.emulator.manager.template.TemplateLoader;
import org.tizen.emulator.manager.ui.renewal.MainDialog;
import org.tizen.emulator.manager.ui.renewal.dialog.DIALOG_MODE;
public static final String TITLE_DETAIL = "Detail Information";
public static Map<String, List<ModifyDialogItem>> itemListMap;
+ private static final String DIALOG_XML_FILE_PREFIX = "devicetemplate-dialog-";
+ public static final String DIALOG_XML_FILE_MOBILE = DIALOG_XML_FILE_PREFIX + "mobile.xml";
+ public static final String DIALOG_XML_FILE_WEABLE = DIALOG_XML_FILE_PREFIX + "wearable.xml";
+ public static final String DIALOG_XML_FILE_TV = DIALOG_XML_FILE_PREFIX + "tv.xml";
+
+
+
public static void detail(DeviceTemplateValue value) {
if (value == null) {
return;
private static List<ModifyDialogItem> loadItemList(String profile) {
- // 1. use real xml.
+ // 1. use xml in deploy path.
String filePath = getTemplatePath(profile);
ItemList2 itemList2 = loadItemList(new File(filePath));
- if (itemList2 != null) {
- return ItemListUtil.getDeviceTemplateItemList(itemList2);
+ if (itemList2 == null) {
+ // 2. use default xml. (in source)
+ filePath = getDefaultTemplatePath(profile);
+ itemList2 = loadItemList(new File(filePath));
}
- // 2. use default xml. (in source)
- filePath = getDefaultTemplatePath(profile);
- itemList2 = loadItemList(new File(filePath));
if (itemList2 != null) {
+ EMLogger.getLogger().info("Device-template dialog file loaded : " + filePath);
return ItemListUtil.getDeviceTemplateItemList(itemList2);
}
// 3. return default item list.
+ EMLogger.getLogger().info("Load Default device-template item-list : " + profile);
return getDefaultItemList();
}
private static String getTemplatePath(String profile) {
- // TODO return real xml path.
- return "";
+ return FilePathResources.getToolEmulatorDataPath() + File.separator
+ + getTemplateFileName(profile);
}
private static String getDefaultTemplatePath(String profile) {
- //
- String filePath = "";
+ return "xsd" + File.separator
+ + getTemplateFileName(profile);
+
+ }
+
+
+ private static String getTemplateFileName(String profile) {
+ String fileName = "";
if (profile.equals("tv")) {
- filePath = "xsd" + File.separator + "devicetemplate-ui-tv.xml";
+ fileName += DIALOG_XML_FILE_TV;
} else if (profile.equals("wearable")) {
- filePath = "xsd" + File.separator + "devicetemplate-ui-wearable.xml";
+ fileName += DIALOG_XML_FILE_WEABLE;
} else {
- filePath = "xsd" + File.separator + "devicetemplate-ui-mobile.xml";
+ fileName += DIALOG_XML_FILE_MOBILE;
}
- return filePath;
+ return fileName;
}
+
+
// default.
public static List<ModifyDialogItem> getDefaultItemList() {
List<ModifyDialogItem> itemList = new ArrayList<ModifyDialogItem>();