- Item list is changed when click profile button.
Change-Id: I8d0d29ddb62b73cd1917998dc1a1cca0f42ba93b
Signed-off-by: minkee.lee <minkee.lee@samsung.com>
import org.eclipse.swt.widgets.Shell;
import org.tizen.emulator.manager.devices.DeviceTemplateValue;
+import org.tizen.emulator.manager.platform.Profile;
+import org.tizen.emulator.manager.platform.ProfileList;
+import org.tizen.emulator.manager.ui.renewal.dialoghandler.DeviceTemplateDialogHandler;
import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem;
import org.tizen.emulator.manager.ui.renewal.item.modify.comp.PropertyValue;
import org.tizen.emulator.manager.vms.VMProperty;
// - init body
super.create(new PropertyValue(value), itemList);
+ }
+
+ public void setItemValue(VMProperty property) {
}
- public void setItemValue(VMProperty property) {
+ @Override
+ public void changeItemList(String profile) {
+
+ Profile prop = ProfileList.getProfile(profile);
+ System.out.println("profile: " + prop);
+ if (prop != null) {
+ propertyValue = new PropertyValue(prop.getDefaultTemplate().getValue());
+ for (ModifyDialogItem item : itemList) {
+ item.setInitialValue(propertyValue);
+ }
+ }
+ DeviceTemplateDialogHandler.changeItemList(itemList, profile);
+
+ // update dialog layout
+ layoutScrolledComposite();
+ }
+ @Override
+ public void sortItem(String profile) {
+ DeviceTemplateDialogHandler.sortItem(itemList, profile);
}
import org.tizen.emulator.manager.vms.xml.template2.ItemList2;
import org.tizen.emulator.manager.vms.xml.template2.Option;
-public class ItemListLoader {
+public class ItemListUtil {
/** Get UI item for device-template dialog. */
public static List<ModifyDialogItem> getDeviceTemplateItemList(ItemList2 itemList2) {
private static List<CheckItemData> getCheckBoxDataList(Item item) {
List<CheckItemData> dataList = new ArrayList<CheckItemData>();
for (Item subItem : item.getItem()) {
- dataList.add(new CheckItemData(subItem.getName(), subItem.getTitle(), true));
+ dataList.add(new CheckItemData(subItem.getName(), subItem.getTitle()));
}
return dataList;
}
return null;
}
+
}
public class ModifyDialog extends Dialog {
private Composite scrolledContent;
- private List<ModifyDialogItem> itemList;
+ protected List<ModifyDialogItem> itemList;
private final static int BUTTON_STYLE = SWT.OK | SWT.CANCEL;
- private PropertyValue propertyValue;
+ protected PropertyValue propertyValue;
public ModifyDialog(Shell parent, String title, int width, int height) {
super(parent, title, width, height, BUTTON_STYLE);
makeModifyItem();
}
+ public void changeItemList(String profile) {
+ // override this.
+ }
+
+ public void sortItem(String profile) {
+ // override this.
+ }
+
private void makeModifyItem() {
for (ModifyDialogItem item : itemList) {
item.setDialog(this);
// TODO we need default value for dialog
item.setInitialValue(propertyValue);
-
item.create(scrolledContent);
+ item.setVisible();
}
+ // sort composite
+ sortItem(propertyValue.getProfile());
+
// set scrolled-content size
computeScrolledContentSize();
}
import org.tizen.emulator.manager.ui.renewal.MainDialog;
import org.tizen.emulator.manager.ui.renewal.dialog.DIALOG_MODE;
import org.tizen.emulator.manager.ui.renewal.dialog.DeviceTemplateModifyDialog;
-import org.tizen.emulator.manager.ui.renewal.dialog.ItemListLoader;
+import org.tizen.emulator.manager.ui.renewal.dialog.ItemListUtil;
+import org.tizen.emulator.manager.ui.renewal.item.ItemType;
import org.tizen.emulator.manager.ui.renewal.item.modify.common.ConnectivityItem;
import org.tizen.emulator.manager.ui.renewal.item.modify.common.DisplayItem;
import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem;
DeviceTemplateModifyDialog dialog
= new DeviceTemplateModifyDialog(MainDialog.getShell(), TITLE_DETAIL, SWT.OK);
dialog.setDialogMode(DIALOG_MODE.DETAIL);
- dialog.create(new PropertyValue(itemValue), getItemList(null));
+ dialog.create(new PropertyValue(itemValue), getItemList(itemValue));
dialog.open();
}
}
-
private static DeviceTemplateValue createDialog(
String dialogTitle, DIALOG_MODE mode, DeviceTemplateValue value) {
new DeviceTemplateModifyDialog(MainDialog.getShell(), dialogTitle);
dialog.setDialogMode(mode);
- dialog.create(value, getItemList(null));
+ dialog.create(value, getItemList(value));
int retValue = dialog.open();
if (retValue == SWT.OK) {
return null;
}
+ // Get All item list and change using profile item list
+ public static List<ModifyDialogItem> getInitialItemList(String profile) {
+ if (profile == null || profile.isEmpty()) {
+ profile = "mobile";
+ }
+
+ // change AllItemlist using profile item list.
+ List<ModifyDialogItem> allItemList = getAllItemList();
+ changeItemList(allItemList, getItemList(profile) );
+
+ return allItemList;
+ }
+
+
+ private static List<ModifyDialogItem> getItemList(String profile) {
+ List<ModifyDialogItem> profileItemList = itemListMap.get(profile);
+ if (profileItemList == null) {
+ profileItemList = loadItemList(profile);
+ if (profileItemList == null || profileItemList.size() == 0) {
+ EMLogger.getLogger().info("Failed to load template item list. Use default item list");
+ profileItemList = getDefaultItemList();
+
+ }
+ itemListMap.put(profile, profileItemList);
+ }
+ return profileItemList;
+ }
+
+
+ public static void changeItemList(List<ModifyDialogItem> currentItemList, String profile) {
+ changeItemList(currentItemList, getItemList(profile));
+ }
+
+
+ public static void sortItem(List<ModifyDialogItem> currentItemList, String profile) {
+ sortItem(currentItemList, getItemList(profile));
+ }
+
+ /** Sort composite in currenItemList
+ * - Move item which exist in profileItemList to first
+ * - Traverse profileItemList backward
+ */
+ private static void sortItem(List<ModifyDialogItem> currentItemList,
+ List<ModifyDialogItem> profileItemList ) {
+ for (int i = profileItemList.size() - 1; i >= 0 ; i--) {
+ ModifyDialogItem profileItem = profileItemList.get(i);
+ for (ModifyDialogItem currentItem : currentItemList) {
+ if (currentItem.getName().equals(profileItem.getName())) {
+ currentItem.moveItemAbove();
+ }
+ }
+ }
+ }
+
+
+ private static void changeItemList(List<ModifyDialogItem> currentItemList,
+ List<ModifyDialogItem> profileItemList ) {
+
+ sortItem(currentItemList, profileItemList);
+
+ // - set visible for each item. : call setUse()
+ // - set UI data with new one.
+ for (ModifyDialogItem currentItem : currentItemList) {
+ boolean exist = false;
+ for (ModifyDialogItem profileItem : profileItemList) {
+ if (currentItem.getName().equals(profileItem.getName())) {
+ exist = true;
+ currentItem.changeItem(profileItem);
+ break;
+ }
+ }
+ currentItem.setItemVisible(exist);
+ }
+
+ }
+
+
+
+ private static List<ModifyDialogItem> getAllItemList() {
+
+ List<ModifyDialogItem> allItemList = itemListMap.get("all");
+ if (allItemList == null) {
+ itemListMap.put("mobile", loadItemList("mobile"));
+ itemListMap.put("tv", loadItemList("tv"));
+ itemListMap.put("wearable", loadItemList("wearable"));
+
+ allItemList = createAllItemList();
+ itemListMap.put("all", allItemList);
+ }
+ return allItemList;
+ }
+
+
+ private static List<ModifyDialogItem> createAllItemList() {
+ List<ModifyDialogItem> allItemList = new ArrayList<ModifyDialogItem>();
+
+ for (String key : itemListMap.keySet()) {
+ addItems(allItemList, itemListMap.get(key));
+ }
+
+ return allItemList;
+ }
+
+
+ // Add items from srcList to destList except duplicated item.
+ private static void addItems(List<ModifyDialogItem> destList,
+ List<ModifyDialogItem> srcList) {
+
+ for (ModifyDialogItem srcItem : srcList) {
+
+ // check if srcItem exists in destList.
+ ModifyDialogItem existItem = null;
+ for (ModifyDialogItem destItem : destList) {
+ if (destItem.getName().equals(srcItem.getName())) {
+ existItem = destItem;
+ break;
+ }
+ }
+ if (existItem != null) {
+ mergeItem(existItem, srcItem);
+
+ } else {
+ destList.add(srcItem.cloneItem());
+ }
+ }
+
+ }
+
+ private static void mergeItem(ModifyDialogItem destItem, ModifyDialogItem srcItem) {
+ // some items need merge.
+
+ // checkbox item.
+ if (srcItem.getType().equals(ItemType.CHECK_LABEL)) {
+ destItem.mergeUIData(srcItem);
+ }
+ }
private static List<ModifyDialogItem> getItemList(DeviceTemplateValue value) {
if (itemListMap == null) {
} else {
profile = value.getProfile();
}
+ return getInitialItemList(profile);
+ }
- List<ModifyDialogItem> itemList = itemListMap.get(profile);
- if (itemList == null) {
- itemList = loadItemList(profile);
- itemListMap.put(profile, itemList);
- }
- if (itemList == null || itemList.size() == 0) {
- EMLogger.getLogger().info("Failed to load template item list. Use default item list");
- return getDefaultItemList();
+ private static List<ModifyDialogItem> loadItemList(String profile) {
- } else {
- return itemListMap.get(profile);
+ // 1. use real xml.
+ String filePath = getTemplatePath(profile);
+ ItemList2 itemList2 = loadItemList(new File(filePath));
+ if (itemList2 != null) {
+ return ItemListUtil.getDeviceTemplateItemList(itemList2);
}
+ // 2. use default xml. (in source)
+ filePath = getDefaultTemplatePath(profile);
+ itemList2 = loadItemList(new File(filePath));
+ if (itemList2 != null) {
+ return ItemListUtil.getDeviceTemplateItemList(itemList2);
+ }
+
+ // 3. return default item list.
+ return getDefaultItemList();
}
- private static List<ModifyDialogItem> loadItemList(String profile) {
- // load XML
- // - TODO Fix file path.
- String filePath = "xsd" + File.separator + "template-ui-mobile.xml";
- ItemList2 xmlStruct = (ItemList2)TemplateLoader.loadTemplate(new File(filePath), ItemList2.class);
+ private static ItemList2 loadItemList(File file) {
+ if (!file.exists()) {
+ return null;
+ }
+ return (ItemList2)TemplateLoader.loadTemplate(file, ItemList2.class);
+ }
+
- return ItemListLoader.getDeviceTemplateItemList(xmlStruct);
+ private static String getTemplatePath(String profile) {
+ // TODO return real xml path.
+ return "";
}
+
+ private static String getDefaultTemplatePath(String profile) {
+ //
+ String filePath = "";
+ if (profile.equals("tv")) {
+ filePath = "xsd" + File.separator + "devicetemplate-ui-tv.xml";
+
+ } else if (profile.equals("wearable")) {
+ filePath = "xsd" + File.separator + "devicetemplate-ui-wearable.xml";
+
+ } else {
+ filePath = "xsd" + File.separator + "devicetemplate-ui-mobile.xml";
+ }
+ return filePath;
+ }
// default.
public static List<ModifyDialogItem> getDefaultItemList() {
List<ModifyDialogItem> itemList = new ArrayList<ModifyDialogItem>();
- itemList.add(new NameItem("deviceTemplateName", "Device Name"));
+ itemList.add(new NameItem("name", "Device Name"));
itemList.add(new ProfileItem());
itemList.add(new DisplayItem(null));
itemList.add(new RamSizeItem());
itemList.add(new ConnectivityItem(null));
itemList.add(new CameraItem(null));
-
-
return itemList;
}
package org.tizen.emulator.manager.ui.renewal.item.modify.common;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
-import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
-import org.tizen.emulator.manager.ui.renewal.dialog.DIALOG_MODE;
+import org.tizen.emulator.manager.ui.renewal.item.ItemType;
import org.tizen.emulator.manager.ui.renewal.item.modify.comp.ModifyItem;
import org.tizen.emulator.manager.ui.renewal.item.modify.comp.PropertyValue;
import org.tizen.emulator.manager.ui.renewal.item.modify.comp.SubTreeModifyItem;
public class CheckBoxItem extends ModifyDialogItem {
- protected ModifyItem item;
private final int ROW_HEIGHT = ModifyItem.ITEM_HEIGHT + ModifyItem.LINE_WIDTH;
private int rowNum;
private final int numColumns;
}
protected List<CheckItemData> dataList;
+ protected Map<String, Boolean> valueMap = new HashMap<String, Boolean>();
public CheckBoxItem(String name, String title, int numColomn,
TreeModifyItem treeRoot, List<CheckItemData> dataList) {
- super(name, title);
+ super(name, title, ItemType.CHECK_LABEL);
this.numColumns = numColomn;
this.dataList = dataList;
initSubTreeItem(treeRoot);
}
+
+ public List<CheckItemData> getDataList() {
+ return dataList;
+ }
+
+ public CheckBoxItem(String name, String title, int numColomn,
+ List<CheckItemData> dataList) {
+ super(name, title, ItemType.CHECK_LABEL);
+ this.numColumns = numColomn;
+ this.dataList = dataList;
+ init();
+ }
+
private void initSubTreeItem(TreeModifyItem treeRoot) {
initDataList();
item = new SubTreeModifyItem();
treeRoot.addSubItem((SubTreeModifyItem)item);
}
+ @Override
+ public ModifyDialogItem cloneItem() {
+ List<CheckItemData> dataList = new ArrayList<CheckItemData>();
+ dataList.addAll(this.dataList);
+ return new CheckBoxItem(getName(), getTitle(), numColumns, dataList);
+ }
- public CheckBoxItem(String name, String title, int numColomn,
- List<CheckItemData> dataList) {
- super(name, title);
- this.numColumns = numColomn;
- this.dataList = dataList;
- init();
+
+ @Override
+ public void mergeUIData(ModifyDialogItem srcDialogItem) {
+ if (!(srcDialogItem instanceof CheckBoxItem)) {
+ return;
+ }
+ CheckBoxItem srcItem = (CheckBoxItem)srcDialogItem;
+
+ for (CheckItemData srcData : srcItem.getDataList()) {
+ boolean exist = false;
+ for (CheckItemData destData : dataList) {
+ if (srcData.getName().equals(destData.getName())) {
+ exist = true;
+ break;
+ }
+ }
+ if (!exist) {
+ dataList.add((CheckItemData)srcData.clone());
+ }
+ }
}
+ @Override
+ public void changeItem(ModifyDialogItem srcDialogItem) {
+
+ if (!(srcDialogItem instanceof CheckBoxItem)) {
+ return;
+ }
+ CheckBoxItem srcItem = (CheckBoxItem)srcDialogItem;
+
+ dataList.clear();
+ for (CheckItemData data : srcItem.getDataList()) {
+ dataList.add((CheckItemData)data.clone());
+ }
+
+ if (item == null || item.getItemComp() == null || item.getItemComp().isDisposed()) {
+ return;
+ }
+
+ // 1. add new subItems.
+ for (CheckItemData data : dataList) {
+ boolean isItemExist = false;
+ for (CheckBoxSubItem subItem : subItemList) {
+ if (data.getName().equals(subItem.getName())) {
+ isItemExist = true;
+ break;
+ }
+ }
+
+ if (isItemExist) {
+
+ } else {
+ CheckBoxSubItem newItem = new CheckBoxSubItem(this, item.getBody(),
+ data.getName(), data.getTitle(), valueMap.get(data.getName()));
+ newItem.create(null);
+ subItemList.add(newItem);
+
+ }
+ }
+
+ // 2. set isUse()
+ for (CheckBoxSubItem subItem : subItemList) {
+ boolean isDataExist = false;
+ for (CheckItemData data : dataList) {
+ if (data.getName().equals(subItem.getName())) {
+ isDataExist = true;
+ subItem.setChecked(getChecked(data.getName()));
+ break;
+ }
+ }
+ subItem.setUse(isDataExist);
+ }
+
+ // 3. layout subitems.
+ layoutCheckBoxSubItems();
+
+ }
+
+
+ private boolean getChecked(String name) {
+ Boolean isCheck = valueMap.get(name);
+ if (isCheck == null) {
+ return false;
+ }
+ return isCheck;
+ }
+
+
+ private void layoutCheckBoxSubItems() {
+
+ // layout subitems
+ int top = 0;
+ int left = 0;
+ int width = ModifyItem.BODY_CONTENT_WIDTH / numColumns;
+ int columnIndex = 0;
+ int rowIndex = 0;
+ for (CheckBoxSubItem subItem : subItemList) {
+ FormData data = new FormData();
+ if (subItem.isUse()) {
+ left = ModifyItem.BODY_MARGIN_LEFT + columnIndex * width;
+ top = rowIndex * ROW_HEIGHT;
+ data.left = new FormAttachment(0, left);
+ data.top = new FormAttachment(0, top);
+ data.height = ROW_HEIGHT;
+ data.width = width;
+
+ columnIndex++;
+ if (columnIndex == numColumns) {
+ columnIndex = 0;
+ rowIndex++;
+ }
+ } else {
+ data.width = 0;
+ data.height = 0;
+
+ }
+ subItem.setLayoutData(data);
+
+ }
+
+
+ // layout this items (title, body)
+ initRowNum();
+ item.updateLayout(getContentHeight());
+
+
+ }
+
public void setDefaultData() {
// override if need
}
private void initRowNum() {
+ rowNum = 0;
if (dataList == null || dataList.isEmpty()) {
rowNum = 1;
protected void createCheckBoxItems(ModifyItem item) {
- item.setBodyLayoutGrid(numColumns);
+ item.setBodyLayoutForm();
- CheckBoxSubItem checkBoxItem;
+ CheckBoxSubItem checkBoxSubItem;
subItemList.clear(); //
for (int i=0 ; i < dataList.size() ; i++) {
CheckItemData checkItemData = dataList.get(i);
- checkBoxItem = new CheckBoxSubItem(this, item.getBody(),
- checkItemData.getName(), checkItemData.getTitle(), checkItemData.isChecked());
-
- // set checkbox item layout
- GridData data = new GridData();
- data.heightHint = ROW_HEIGHT;
- data.widthHint = ModifyItem.BODY_CONTENT_WIDTH / numColumns;
- checkBoxItem.create(data);
-
- subItemList.add(checkBoxItem);
+ String name = checkItemData.getName();
+ checkBoxSubItem = new CheckBoxSubItem(this, item.getBody(),
+ name, checkItemData.getTitle(), getChecked(name));
+ checkBoxSubItem.create(null);
+ subItemList.add(checkBoxSubItem);
}
+
+ layoutCheckBoxSubItems();
}
+
public void checkBoxSelected() {
getDialog().checkValid();
}
@Override
public void setInitialValue(PropertyValue value) {
- if (getDialog().getDialogMode() == DIALOG_MODE.MODIFY) {
- List<CheckItemData> dataList = value.getCheckBoxOptions(getName());
- for (CheckItemData data : dataList) {
- String name = data.getName();
- boolean isChecked = data.isChecked();
- for (CheckItemData ownData : this.dataList) {
- if (ownData.getName().equals(name)) {
- ownData.setChecked(isChecked);
- }
- }
- }
-
- } else {
- for (CheckItemData data : this.dataList) {
- data.setChecked(true);
- }
- }
+ Map<String, Boolean> valueMap = value.getCheckBoxOptions(getName());
+ this.valueMap = valueMap;
+// if (getDialog().getDialogMode() == DIALOG_MODE.MODIFY) {
+//
+//
+// } else {
+// for (CheckItemData data : this.dataList) {
+// data.setChecked(true);
+// }
+// }
}
@Override
public void setValue(PropertyValue value) {
-
- List<CheckItemData> dataList = new ArrayList<CheckItemData>();
+ valueMap.clear();
for (CheckBoxSubItem subItem : getSubItemList()) {
- dataList.add(new CheckItemData(
- subItem.getName(),
- subItem.getTitle(), subItem.isChecked()));
+ valueMap.put(subItem.getName(), subItem.isChecked());
}
- value.setCheckBoxOptions(getName(), dataList);
+ value.setCheckBoxOptions(getName(), valueMap);
}
private Composite comp;
private CheckBoxButton checkBox; // TODO
+ private boolean isUse = true;
+
public static final int CHECK_BOX_WIDTH = 15;
private final int CHECK_BOX_HEIGHT = 14;
public static final int SPACING = 2;
this.isChecked = isChecked;
}
+ public Composite getComp() {
+ return comp;
+ }
+
+ public void setLayoutData(Object layoutData) {
+
+ comp.setLayoutData(layoutData);
+ }
+
+ public void setUse(boolean isUse) {
+ this.isUse = isUse;
+ }
+
+ public boolean isUse() {
+ return isUse;
+ }
+
public void create(Object layoutData) {
// init comp
comp = new Composite(parentComp, SWT.NONE);
- comp.setLayoutData(layoutData);
+ if (layoutData != null) {
+ comp.setLayoutData(layoutData);
+ }
comp.setLayout(new FormLayout());
createCheckBox();
}
+
private void createCheckBox() {
FormData data = new FormData(CHECK_BOX_WIDTH, CHECK_BOX_HEIGHT);
public void setChecked(boolean isChecked) {
this.isChecked = isChecked;
+ checkBox.setSelection(isChecked);
}
+
// public
}
public class CheckItemData {
private String name;
private String title;
- private boolean isChecked;
public String getTitle() {
return title;
}
+
+ @Override
+ public Object clone() {
+ return new CheckItemData(name, title);
+ }
+
public void setTitle(String title) {
this.title = title;
}
this.name = name;
}
- public boolean isChecked() {
- return isChecked;
- }
-
- public void setChecked(boolean isChecked) {
- this.isChecked = isChecked;
- }
-
public CheckItemData(String name, String title) {
- this(name, title, false);
- }
-
- public CheckItemData(String name, String title, boolean isChecked) {
this.name = name;
this.title = title;
- this.isChecked = isChecked;
}
+
}
public abstract class ComboItem extends ModifyDialogItem {
- private ComboBox comboBox;
+ protected ComboBox comboBox;
public ComboItem(String name, String title) {
super(name, title);
// This is called when combo item is selected
// TODO override this.
}
+
}
public class ConnectivityItem extends CheckBoxItem {
-// private final ModifyItem item;
-
private static final String TITLE = "Device";
private static final String NAME = "device";
// private final ImageResources TITLE_ICON_RESOURCE = ImageResources.ICON_TITLE_DEVICE;
public class DisplayItem extends ModifyDialogItem {
- private final ModifyItem item;
-
private static final String TITLE = "Display";
private static final String NAME = "display";
private final ImageResources TITLE_ICON_RESOURCE = ImageResources.ICON_TITLE_DISPLAY;
this.resList = resList;
}
+ @Override
+ public ModifyDialogItem cloneItem() {
+ List<RESOLUTION> resList = new ArrayList<RESOLUTION>();
+ resList.addAll(this.resList);
+ return new DisplayItem(resList);
+ }
+
@Override
public void create(Composite parent) {
data.height = ModifyItem.WIDGET_HEIGHT;
resolutionCombo = new ComboBox(getDialog().getShell(), comp, SWT.NONE);
resolutionCombo.setLayoutData(data);
+ addResolutionComboListener();
}
private void initResolutionCombo() {
+ if (resolutionCombo == null || resolutionCombo.isDisposed() ) {
+ return;
+ }
+
+ resolutionCombo.clear();
+
// default.
if (resList == null) {
resList = new ArrayList<RESOLUTION>();
resList.add(RESOLUTION.QHD);
}
- addResolutionComboListener();
-
if (resList.size() == 0) {
return;
}
}
// select combobox
+ int index = -1;
for (int i=0 ; i < resolutionCombo.getItemList().size() ; i++) {
String str = resolutionCombo.getItemList().get(i);
if (str.equals(re)) {
- resolutionCombo.select(i);
+ index = i;
break;
}
}
- resolutionComboSelected(re);
+ if (index == -1) {
+ resolutionCombo.select(0);
+ resolution = resList.get(0);
+ } else {
+ resolutionCombo.select(index);
+ }
+ resolutionComboSelected(re);
+ // close popup if it is opened.
+ resolutionCombo.closeComboBox();
}
}
private void selectSize() {
- // TODO default value
- sizeTextBox.setText("5.0");
+ if (sizeTextBox == null || sizeTextBox.isDisposed()) {
+ return;
+ }
- displaySize = sizeTextBox.getValue();
+ sizeTextBox.setText(displaySize);
getDialog().checkValid();
}
return true;
}
+ public List<RESOLUTION> getResolutionList() {
+ return resList;
+ }
+ @Override
+ public void changeItem(ModifyDialogItem srcDialogItem) {
+
+ if (!(srcDialogItem instanceof DisplayItem)) {
+ return;
+ }
+
+ // change size
+ DisplayItem srcItem = (DisplayItem)srcDialogItem;
+ resList = srcItem.getResolutionList();
+ initResolutionCombo();
+
+ // change size
+ selectSize();
+
+
+ }
+
+
}
/** set dialog data to property value */
public void setValue(PropertyValue value);
+
+ public abstract ModifyDialogItem cloneItem();
}
// TODO Auto-generated method stub
}
+
+ @Override
+ public ModifyDialogItem cloneItem() {
+ return new ImageItem();
+ }
}
package org.tizen.emulator.manager.ui.renewal.item.modify.common;
+import org.eclipse.swt.layout.GridData;
import org.tizen.emulator.manager.renewal.resources.ImageResources;
import org.tizen.emulator.manager.ui.renewal.dialog.ModifyDialog;
import org.tizen.emulator.manager.ui.renewal.item.modify.comp.IconItemTitle;
public abstract class ModifyDialogItem implements IModifyDialogItem {
+ protected ModifyItem item;
+
private String title;
private String name;
+ private String type = "";
+
private ModifyDialog dialog;
- public ModifyDialogItem(String name, String title) {
+ // decide item's visibility in dialog
+ private final boolean isUse = true;
+
+ public ModifyDialogItem(String name, String title, String type) {
+ this(name, title);
+ if (type != null) {
+ this.type = type;
+ }
+ }
+
+ public void mergeUIData(ModifyDialogItem srcDialogItem) {
+ // override this.
+ }
+
+ public void changeItem(ModifyDialogItem srcDialogItem) {
+ // override this.
+ }
+
+
+ public ModifyDialogItem(String name, String title) {
this.title = title;
this.name = name;
}
+ public String getType() {
+ return type;
+ }
+
public String getName() {
return name;
}
public boolean isValid() {
return true;
}
+
+
+ public void setItemVisible(boolean isVisible) {
+ if (item == null || item.getItemComp() == null
+ || item.getItemComp().isDisposed()) {
+ return;
+ }
+
+ GridData data = (GridData)item.getItemComp().getLayoutData();
+ if (isVisible) {
+ data.heightHint = item.getItemHeight() + ModifyItem.LINE_WIDTH;
+
+ } else {
+ data.heightHint = 0;
+ }
+ }
+
+ public void setVisible() {
+ setItemVisible(isUse);
+ }
+
+ public void moveItemAbove() {
+ if (item == null || item.getItemComp() == null
+ || item.getItemComp().isDisposed()) {
+ return;
+ }
+ item.getItemComp().moveAbove(null); // move to top
+ }
}
this.value = value.getName();
}
+ @Override
+ public void changeItem(ModifyDialogItem srcDialogItem) {
+ if (textBox == null || textBox.isDisposed()) {
+ return;
+ }
+ textBox.setText(value);
+
+ }
+
@Override
public void textModified() {
value.setName(this.value);
}
+
+ @Override
+ public ModifyDialogItem cloneItem() {
+ return new NameItem(getName(), getTitle());
+ }
+
}
public class ProcessorItem extends ComboItem {
- private final ModifyItem item;
-
private static final String TITLE = "Processor";
private static final String NAME = "processor";
private final ImageResources TITLE_ICON_RESOURCE = ImageResources.ICON_TITLE_PROCESSOR;
public ProcessorItem() {
super(NAME, TITLE);
item = new ModifyItem();
-
-
}
@Override
WidgetHelper.drawText(canvas, String.valueOf(cpuNum), SWT.NONE);
}
- private void initProcessorCombo() {
-
+ private void initComboList() {
// init combo list
for (CPU r : CPU.values()) {
addComboItem(r.toString());
}
+ }
+ private void selectItem() {
// select item
int index = 0;
for (int i=0 ; i < getComboItemList().size() ; i++) {
comboSelected();
}
+ private void initProcessorCombo() {
+ initComboList();
+ selectItem();
+ }
private void comboSelected() {
value.setCpuNum(cpuNum);
}
+
+ @Override
+ public ModifyDialogItem cloneItem() {
+ // TODO ProcessorItem(TreeModifyItem treeRoot) ??
+ return new ProcessorItem();
+ }
}
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
+import org.tizen.emulator.manager.platform.Profile;
+import org.tizen.emulator.manager.platform.ProfileList;
import org.tizen.emulator.manager.renewal.resources.ImageResources;
import org.tizen.emulator.manager.ui.renewal.item.modify.comp.ModifyItem;
import org.tizen.emulator.manager.ui.renewal.item.modify.comp.PropertyValue;
public class ProfileItem extends ModifyDialogItem {
-
- private ModifyItem item;
private Canvas imageCanvas;
private String currentProfile = "mobile"; // TODO this is temp default.
private final int IMAGE_SPACING = 4;
// TODO profileList from XML ?
- private final String[] profileList = new String[]{MOBILE,WEARABLE,TV};
+ private final String[] buttonList = new String[]{MOBILE,WEARABLE,TV};
private final Map<String, ImageRadioButton> buttonMap =
private void createProfileButton() {
item.getBody().setLayout(new FormLayout());
+
+ // create button
+ for (Profile profile : ProfileList.getProfileList()) {
+ String name = profile.getName();
+ if (name.equals(MOBILE)) {
+ createMobileButton();
+
+ } else if (name.equals(WEARABLE)) {
+ createWearableButton();
+
+ } else if (name.equals(TV)) {
+ createTVButton();
+ }
+ }
+
+ // TODO for test
+// createWearableButton();
+// createTVButton();
+
+
+ // layout
+ int top = (ModifyItem.ITEM_HEIGHT - PROFILE_IMAGE_HEIGHT) / 2;
+ int left = ModifyItem.BODY_MARGIN_LEFT;
+ for (String profile : buttonList) {
+ ImageRadioButton button = buttonMap.get(profile);
+ if (button == null) {
+ continue;
+ }
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, top);
+ data.left = new FormAttachment(0, left);
+ data.width = PROFILE_IMAGE_WIDTH;
+ data.height = PROFILE_IMAGE_HEIGHT;
+ button.setLayoutData(data);
+ left += (PROFILE_IMAGE_WIDTH + IMAGE_SPACING);
+ }
+
+ addSelectListener();
+ selectButton();
+
+ }
+
+ private void createMobileButton() {
ImageRadioButton mobileButton = new ImageRadioButton(item.getBody());
mobileButton.setImage(WSTATE.NORMAL, ImageResources.BTN_PROFILE_MOBILE_UNSELECTED_NML);
mobileButton.setImage(WSTATE.HOVER, ImageResources.BTN_PROFILE_MOBILE_UNSELECTED_HOVER);
mobileButton.setImage(WSTATE.SELECTED, ImageResources.BTN_PROFILE_MOBILE_SELECTED);
mobileButton.setToolTipText(MOBILE);
+ buttonMap.put(MOBILE, mobileButton);
+ }
+ private void createWearableButton() {
ImageRadioButton wearableButton = new ImageRadioButton(item.getBody());
wearableButton.setImage(WSTATE.NORMAL, ImageResources.BTN_PROFILE_WEARABLE_UNSELECTED_NML);
wearableButton.setImage(WSTATE.HOVER, ImageResources.BTN_PROFILE_WEARABLE_UNSELECTED_HOVER);
wearableButton.setImage(WSTATE.SELECTED, ImageResources.BTN_PROFILE_WEARABLE_SELECTED);
wearableButton.setToolTipText(WEARABLE);
+ buttonMap.put(WEARABLE, wearableButton);
+ }
+ private void createTVButton() {
ImageRadioButton tvButton = new ImageRadioButton(item.getBody());
tvButton.setImage(WSTATE.NORMAL, ImageResources.BTN_PROFILE_TV_UNSELECTED_NML);
tvButton.setImage(WSTATE.HOVER, ImageResources.BTN_PROFILE_TV_UNSELECTED_HOVER);
tvButton.setImage(WSTATE.SELECTED, ImageResources.BTN_PROFILE_TV_SELECTED);
tvButton.setToolTipText(TV);
-
-
- int top = (ModifyItem.ITEM_HEIGHT - PROFILE_IMAGE_HEIGHT) / 2;
-
- FormData data = new FormData();
- data.top = new FormAttachment(0, top);
- data.left = new FormAttachment(0, ModifyItem.BODY_MARGIN_LEFT);
- data.width = PROFILE_IMAGE_WIDTH;
- data.height = PROFILE_IMAGE_HEIGHT;
- mobileButton.setLayoutData(data);
-
- data = new FormData();
- data.top = new FormAttachment(0, top);
- data.left = new FormAttachment(mobileButton, IMAGE_SPACING);
- data.width = PROFILE_IMAGE_WIDTH;
- data.height = PROFILE_IMAGE_HEIGHT;
- wearableButton.setLayoutData(data);
-
- data = new FormData();
- data.top = new FormAttachment(0, top);
- data.left = new FormAttachment(wearableButton, IMAGE_SPACING);
- data.width = PROFILE_IMAGE_WIDTH;
- data.height = PROFILE_IMAGE_HEIGHT;
- tvButton.setLayoutData(data);
-
- buttonMap.put(MOBILE, mobileButton);
- buttonMap.put(WEARABLE, wearableButton);
buttonMap.put(TV, tvButton);
-
- addSelectListener();
- selectButton();
-
}
-
private void addSelectListener() {
for (final String profile : buttonMap.keySet()) {
@Override
public void handleEvent(Event e) {
if (e.type == SWT.Selection) {
- currentProfile = profile;
+ if (!currentProfile.equals(profile)) {
+// System.out.println("profile changed : " + profile);
+ currentProfile = profile;
+ getDialog().changeItemList(profile);
+ }
}
}
});
}
+ @Override
+ public ModifyDialogItem cloneItem() {
+ return new ProfileItem();
+ }
+
}
public class RamSizeItem extends ComboItem {
- private final ModifyItem item;
-
private static final String TITLE = "Ram";
private static final String NAME = "ram";
addComboItem(r.toString());
}
+ selectItem();
+
+ }
+
+ private void selectItem() {
+ if (comboBox == null || comboBox.isDisposed()) {
+ return;
+ }
+
// select item
int index = 0;
for (int i=0 ; i < getComboItemList().size() ; i++) {
getDialog().checkValid();
}
+
+ @Override
+ public void changeItem(ModifyDialogItem srcDialogItem) {
+ selectItem();
+ }
+
private void addLabel() {
FormData data = new FormData();
int left = ModifyItem.BODY_MARGIN_LEFT + COMBO_WIDTH + 6;
// TODO override this.
comboSelected();
}
+
+ @Override
+ public ModifyDialogItem cloneItem() {
+ // TODO RamSizeItem(TreeModifyItem treeRoot) ??
+ return new RamSizeItem();
+ }
}
public class SensorItem extends CheckBoxItem {
-// private final ModifyItem item;
-
private static final String TITLE = "Sensor";
private static final String NAME = "sensor";
private final ImageResources TITLE_ICON_RESOURCE = ImageResources.ICON_TITLE_SENSOR;
dataList.add(new CheckItemData("accel", "Accelerometer"));
dataList.add(new CheckItemData("gyro", "Gyroscope"));
dataList.add(new CheckItemData("proxi", "Proximity"));
- dataList.add(new CheckItemData("geo-magnetic", "Geo-magnetic"));
+ dataList.add(new CheckItemData("geo", "Geo-magnetic"));
dataList.add(new CheckItemData("light", "Light"));
dataList.add(new CheckItemData("haptic", "Haptic"));
dataList.add(new CheckItemData("pressure", "Pressure"));
public abstract class TextInputBoxItem extends ModifyDialogItem {
- private ModifyItem item;
- private TextInputBox textBox;
+ protected TextInputBox textBox;
protected String value = "";
makeBody(textBoxWidth);
+
}
textBox = new TextInputBox(item.getBody(), SWT.NONE);
textBox.setLayoutData(data);
+ textBox.setText(value);
addTextListener();
}
public abstract class TextLabelItem extends ModifyDialogItem {
- private ModifyItem item;
private Canvas canvas;
protected String value = "";
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Layout;
import org.tizen.emulator.manager.renewal.resources.ColorResources;
import org.tizen.emulator.manager.ui.renewal.dialog.VMModifyDialog;
private int itemHeight = ITEM_HEIGHT;
- protected int getItemHeight() {
+ public int getItemHeight() {
return itemHeight;
}
setBodyLayoutGrid(1);
}
+ public void setBodyLayout(Layout layout) {
+ bodyComp.setLayout(layout);
+ }
+
+ public void setBodyLayoutForm() {
+ setBodyLayout(new FormLayout());
+ }
+
public void setBodyLayoutGrid(int numColumns) {
GridLayout layout = new GridLayout();
layout.numColumns = numColumns;
comp.setLayout(layout);
}
+ // update Item height;
+ public void updateLayout(int height) {
+ this.itemHeight = height;
+ GridData data = (GridData)comp.getLayoutData();
+ data.heightHint = getItemHeight() + LINE_WIDTH;
+ comp.layout(true,true);
+ }
+
}
package org.tizen.emulator.manager.ui.renewal.item.modify.comp;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
import org.tizen.emulator.manager.devices.DeviceTemplateValue;
import org.tizen.emulator.manager.devices.SubDevice;
import org.tizen.emulator.manager.devices.SubDeviceItem;
import org.tizen.emulator.manager.platform.Skin;
-import org.tizen.emulator.manager.ui.renewal.item.modify.common.CheckItemData;
import org.tizen.emulator.manager.vms.RESOLUTION;
import org.tizen.emulator.manager.vms.SKIN_SHAPE;
import org.tizen.emulator.manager.vms.VMPropertyValue;
public void setCheckBoxOptions(String name,
- List<CheckItemData> dataList) {
+ Map<String, Boolean> valueMap) {
if (isVMValue()) {
// TODO
} else if (isTemplateValue()) {
SubDevice subDevice = new SubDevice(name);
- for (CheckItemData data : dataList) {
- SubDeviceItem subDeviceItem = new SubDeviceItem(data.getName());
- subDeviceItem.setSupport(data.isChecked());
+ for (String key : valueMap.keySet()) {
+ SubDeviceItem subDeviceItem = new SubDeviceItem(key);
+ subDeviceItem.setSupport(valueMap.get(key));
subDevice.addSubDeviceItem(subDeviceItem);
}
templateValue.addOrUpdateSubDevices(subDevice);
}
- public List<CheckItemData> getCheckBoxOptions(String name) {
- List<CheckItemData> dataList = new ArrayList<CheckItemData>();
+ public Map<String, Boolean> getCheckBoxOptions(String name) {
+ Map<String, Boolean> valueMap = new HashMap<String, Boolean>();
// TODO
if (isVMValue()) {
// TODO
for (SubDevice subDevice : templateValue.getAdditionalDevices()) {
if (subDevice.getName().equals(name)) {
for (SubDeviceItem subDeviceItem : subDevice.getItems()) {
- CheckItemData data = new CheckItemData(
- subDeviceItem.getId(), "", subDeviceItem.isSupport());
- dataList.add(data);
+ valueMap.put(subDeviceItem.getId(), subDeviceItem.isSupport());
+
}
}
}
}
- return dataList;
+ return valueMap;
}
public class CameraItem extends CheckBoxItem {
-// private final ModifyItem item;
-
private static final String TITLE = "Camera";
private static final String NAME = "camera";
// private final ImageResources TITLE_ICON_RESOURCE = ImageResources.ICON_TITLE_SENSOR;
import org.eclipse.swt.widgets.Composite;
import org.tizen.emulator.manager.ui.renewal.item.modify.common.ComboItem;
+import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem;
import org.tizen.emulator.manager.ui.renewal.item.modify.comp.PropertyValue;
import org.tizen.emulator.manager.ui.renewal.item.modify.comp.TreeItemTitle;
import org.tizen.emulator.manager.ui.renewal.item.modify.comp.TreeModifyItem;
private static final String TITLE = "Device";
private static final String NAME = "deviceTemplate";
- private final TreeModifyItem item;
+ private final TreeModifyItem treeModifyItem;
private final int COMBO_WIDTH = 200;
public TreeModifyItem getTreeRoot() {
- return item;
+ return (TreeModifyItem)item;
}
public DeviceTemplateItem() {
super(NAME, TITLE);
- item = new TreeModifyItem();
+// item = new TreeModifyItem();
+ treeModifyItem = new TreeModifyItem();
+ item = treeModifyItem;
}
@Override
public void create(Composite parent) {
- item.init(parent);
- item.setItemTitle(new TreeItemTitle(item, getTitle()));
- item.create();
+ treeModifyItem.init(parent);
+ treeModifyItem.setItemTitle(new TreeItemTitle(treeModifyItem, getTitle()));
+ treeModifyItem.create();
- item.setModifyDialogItem(this);
+ treeModifyItem.setModifyDialogItem(this);
- createCombo(item, COMBO_WIDTH);
+ createCombo(treeModifyItem, COMBO_WIDTH);
}
@Override
public int getHeight() {
- return item.getHeight();
+ return treeModifyItem.getHeight();
}
@Override
// TODO Auto-generated method stub
}
+
+ @Override
+ public ModifyDialogItem cloneItem() {
+ return new DeviceTemplateItem();
+ }
}
}
+ public void clear() {
+ if (items != null) {
+ items.clear();
+ }
+ }
+
public Shell getParentShell() {
return parentShell;
}
+ public void closeComboBox() {
+ popup.close();
+ }
+
private void drawText() {
textCanvas.addPaintListener(new PaintListener() {
return false;
}
+ public void close() {
+ if (!isClosed()) {
+ dispose();
+ }
+ }
+
private void initCanvas() {
popupCanvas = new Canvas(popupShell, SWT.DOUBLE_BUFFERED);
popupCanvas.setForeground(ColorResources.CONTENT_FONT.getColor());
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!-- This file describes dialog for device template create/modify -->
+
+<ItemList xmlns="http://www.tizen.org/em/template" version="2.0">
+ <information profile="mobile" />
+
+ <itemGroup name="default">
+ <item name="name" title="Device Name" type="textInput"/>
+ <item name="profile" title="Profile"/>
+ <item name="display" title="Display" type="label">
+ <item name="resolution" title="Resolution" type="combo">
+ <!-- name, width, height, dpi -->
+ <option name="wvga"> WVGA,480,800,233 </option>
+ <option name="wsvga"> WSVGA,600,1024,207 </option>
+ <option name="WSVGA"> WSVGA,600,1024,207 </option>
+ <option name="qhd"> qHD,540,960,220 </option>
+ <option name="hd"> HD,720,1280,306 </option>
+ <option name="WXGA"> WXGA,1280,800,300 </option>
+ <option name="FULLHD"> FULLHD,1080,1920,314 </option>
+ <option name="WQXGA"> WQXGA,2560,1600,301 </option>
+ </item>
+ <item name="size" title="Size" type="textInput" />
+ <item name="skin" title="Skin" type="combo"/>
+ </item>
+ <item name="processors" title="Processorse" type="combo" />
+ <item name="ramSize" title="Ram" type="combo" >
+ <option name="list">512,768,1024</option>
+ </item>
+
+ <item name="sensor" title="Sensor" type="checkLabel" >
+ <item name="accel" title="Accelerometer" type="checkbox" />
+ <item name="gyro" title="Gyroscope" type="checkbox" />
+ <item name="geo" title="Geo-magnetic" type="checkbox" />
+ <item name="proxi" title="Proximity" type="checkbox"/>
+ <item name="light" title="Light" type="checkbox"/>
+ <item name="haptic" title="Haptic" type="checkbox"/>
+ <item name="press" title="Pressure" type="checkbox"/>
+ <item name="uv" title="Ultraviolet" type="checkbox"/>
+ <item name="hrm" title="Heartbeat Rate" type="checkbox"/>
+<!-- <item name="test" title="Test"/> -->
+ <option name="numColumn">3</option>
+ </item>
+ <item name="connectivity" title="Connectivity" type="checkLabel">
+ <item name="nfc" title="NFC" type="checkbox" />
+ <option name="numColumn">3</option>
+ </item>
+ <item name="camera" title="Camera" type="checkLabel">
+ <item name="rear" title="Rear" type="checkbox" />
+ <item name="front" title="Front" type="checkbox" />
+ <option name="numColumn">2</option>
+ </item>
+ </itemGroup>
+
+</ItemList>
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!-- This file describes dialog for device template create/modify -->
+
+<ItemList xmlns="http://www.tizen.org/em/template" version="2.0">
+ <information profile="mobile" />
+
+ <itemGroup name="default">
+ <item name="name" title="Device Name" type="textInput"/>
+ <item name="profile" title="Profile"/>
+ <item name="display" title="Display" type="label">
+ <item name="resolution" title="Resolution" type="combo">
+ <!-- name, width, height, dpi -->
+ <option name="WXGA"> WXGA,1280,800,300 </option>
+ <option name="WQXGA"> WQXGA,2560,1600,301 </option>
+ <option name="FULLHD"> FULLHD,1920,1080,314 </option>
+ </item>
+ <item name="size" title="Size" type="textInput" />
+ <item name="skin" title="Skin" type="combo"/>
+ </item>
+ <item name="processors" title="Processorse" type="combo" />
+ <item name="ramSize" title="Ram" type="combo" >
+ <option name="list">512,768,1024</option>
+ </item>
+ </itemGroup>
+
+</ItemList>
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!-- This file describes dialog for device template create/modify -->
+
+<ItemList xmlns="http://www.tizen.org/em/template" version="2.0">
+ <information profile="mobile" />
+
+ <itemGroup name="default">
+ <item name="name" title="Device Name" type="textInput"/>
+ <item name="profile" title="Profile"/>
+ <item name="display" title="Display" type="label">
+ <item name="resolution" title="Resolution" type="combo">
+ <!-- name, width, height, dpi -->
+ <option name="320"> ,320,320,316 </option>
+ <option name="hvga"> HVGA,320,480,160 </option>
+<!-- <option name="wvga"> WVGA,480,800,233 </option> -->
+<!-- <option name="wsvga"> WSVGA,600,1024,207 </option> -->
+<!-- <option name="WSVGA"> WSVGA,600,1024,207 </option> -->
+<!-- <option name="qhd"> qHD,540,960,220 </option> -->
+<!-- <option name="hd"> HD,720,1280,306 </option> -->
+<!-- <option name="WXGA"> WXGA,1280,800,300 </option> -->
+<!-- <option name="WQXGA"> WQXGA,2560,1600,301 </option> -->
+<!-- <option name="FULLHD"> FULLHD,1080,1920,314 </option> -->
+ </item>
+ <item name="size" title="Size" type="textInput" />
+ <item name="skin" title="Skin" type="combo"/>
+ </item>
+ <item name="processors" title="Processorse" type="combo" />
+ <item name="ramSize" title="Ram" type="combo" >
+ <option name="list">512,768,1024</option>
+ </item>
+
+ <item name="sensor" title="Sensor" type="checkLabel" >
+ <item name="accel" title="Accelerometer" type="checkbox" />
+ <item name="gyro" title="Gyroscope" type="checkbox" />
+ <item name="geo" title="Geo-magnetic" type="checkbox" />
+ <item name="proxi" title="Proximity" type="checkbox"/>
+ <item name="light" title="Light" type="checkbox"/>
+ <item name="haptic" title="Haptic" type="checkbox"/>
+ <item name="press" title="Pressure" type="checkbox"/>
+ <item name="uv" title="Ultraviolet" type="checkbox"/>
+ <item name="hrm" title="Heartbeat Rate" type="checkbox"/>
+
+ <option name="numColumn">3</option>
+ </item>
+ <item name="connectivity" title="Connectivity" type="checkLabel">
+ <item name="nfc" title="NFC" type="checkbox" />
+ <option name="numColumn">3</option>
+ </item>
+ <item name="camera" title="Camera" type="checkLabel">
+<!-- <item name="rear" title="Rear" type="checkbox" /> -->
+ <item name="front" title="Front" type="checkbox" />
+ <option name="numColumn">2</option>
+ </item>
+ </itemGroup>
+
+</ItemList>
+