Mobile Template: Added viewer-type(spice mode) option.
authorminkee.lee <minkee.lee@samsung.com>
Thu, 11 Sep 2014 08:06:59 +0000 (17:06 +0900)
committerminkee.lee <minkee.lee@samsung.com>
Wed, 17 Sep 2014 06:38:41 +0000 (15:38 +0900)
Change-Id: I03cba5806fbdbde74e795e7de94722704ed77d37
Signed-off-by: minkee.lee <minkee.lee@samsung.com>
plugin-project/mobile-plugin/src/org/tizen/emulator/manager/mobile/ui/detail/ItemListFactory.java
plugin-project/mobile-plugin/src/org/tizen/emulator/manager/mobile/vms/Launcher.java
template/x86-kiran-template.xml

index 4fbe97c..c3e9be3 100644 (file)
@@ -35,6 +35,17 @@ import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.EmulatorManager.ManagerModeType;
 import org.tizen.emulator.manager.ui.detail.item.CommonItemListFactory;
 import org.tizen.emulator.manager.ui.detail.item.IViewItem;
+import org.tizen.emulator.manager.ui.detail.item.ItemType;
+import org.tizen.emulator.manager.ui.detail.item.LineLabelViewItem;
+import org.tizen.emulator.manager.ui.detail.item.template.CheckLabelViewItem;
+import org.tizen.emulator.manager.ui.detail.item.template.ComboViewItem;
+import org.tizen.emulator.manager.ui.detail.item.template.FileViewItem;
+import org.tizen.emulator.manager.ui.detail.item.template.LabelViewItem;
+import org.tizen.emulator.manager.ui.detail.item.template.OnOffViewItem;
+import org.tizen.emulator.manager.ui.detail.item.template.TextViewItem;
+import org.tizen.emulator.manager.vms.helper.CheckingRunningEmulator;
+import org.tizen.emulator.manager.vms.xml.template.DeviceList;
+import org.tizen.emulator.manager.vms.xml.template.Item;
 import org.tizen.emulator.manager.vms.xml.template.ItemList;
 
 public class ItemListFactory extends CommonItemListFactory {
@@ -67,6 +78,51 @@ public class ItemListFactory extends CommonItemListFactory {
                }
        }
 
+       // Override if need
+       public void makeDeviceItemList(List<? extends IViewItem> list, DeviceList deviceList) {
+
+               if (deviceList != null) {
+                       List<IViewItem> itemList = (List<IViewItem>)list;
+                       List<Item> deviceItemList = deviceList.getItem();
+                       LineLabelViewItem currentLineLabel = null;   // Top categorizing item
+
+                       for (Item item : deviceItemList) {
+                               String type = item.getType();
+                               String name = item.getName();
+
+                               if (name.equals(CheckingRunningEmulator.OPTION_VIEWER)) {
+                                       if (EmulatorManager.isLinux()) {
+                                               itemList.add(new LabelViewItem(item, currentLineLabel));
+                                       }
+                                       continue;
+                               }
+
+                               if (type.equals(ItemType.LINE_LABEL.getName())) { // Top categorizing item
+                                       currentLineLabel = new LineLabelViewItem(item);
+                                       itemList.add(currentLineLabel);
+
+                               } else if (type.equals(ItemType.TOGGLE.getName())) {
+                                       itemList.add(new OnOffViewItem(item, currentLineLabel));
+
+                               } else if (type.equals(ItemType.LABEL.getName())) {
+                                       itemList.add(new LabelViewItem(item, currentLineLabel));
+
+                               } else if (type.equals(ItemType.COMBO.getName())) {
+                                       itemList.add(new ComboViewItem(item, currentLineLabel));
+
+                               } else if (type.equals(ItemType.FILE.getName())) {
+                                       itemList.add(new FileViewItem(item, currentLineLabel));
+
+                               } else if (type.equals(ItemType.CHECK_LABEL.getName())) {
+                                       itemList.add(new CheckLabelViewItem(item, currentLineLabel));
+
+                               } else if (type.equals(ItemType.TEXT.getName())) {
+                                       itemList.add(new TextViewItem(item, currentLineLabel));
+                               }
+                       }
+               }
+       }
+
 
        @Override
        public void makeCustomItemList(List<? extends IViewItem> itemList,
index fee776d..91ea905 100644 (file)
@@ -43,7 +43,6 @@ import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.EmulatorManager.ManagerModeType;
 import org.tizen.emulator.manager.console.RemoteManager;
 import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.mobile.ui.detail.TNFCItem;
 import org.tizen.emulator.manager.resources.FilePathResources;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.tool.CheckVirtualization;
@@ -431,8 +430,6 @@ public class Launcher implements ILauncher {
                                        cmd.add(sb.toString());
                                }
                        }
-
-
                }
 
                /* append user added options if exists */
@@ -445,7 +442,8 @@ public class Launcher implements ILauncher {
                }
 
                /* spice options */
-               if (RemoteManager.getSpiceMode()) {
+               if (RemoteManager.getSpiceMode()
+                               || CheckingRunningEmulator.isRemote(property)) {
                        cmd.add("-spice");
                        cmd.add("disable-ticketing");
                        cmd.add("-device");
index afb7421..6eee363 100644 (file)
 
 <!-- Followings are drawn as check box in Emulator Manager vm property UI.-->
        <deviceList>
+               <item type="lineLabel" name="advancedOption" title="Advanced Option"/>
+               <item type="label" name="viewer" title="Viewer">
+                       <item type="combo" name="type" title="Type">
+                               <option name="list">Native, Web</option>
+                               <option name="defaultOnCreate">Native</option>
+                       </item>
+               </item>
                <item type="checkLabel" name="sensor" title="Sensor">
                        <item type="checkbox" name="accel" title="Accelerometer"/>
                        <item type="checkbox" name="gyro" title="Gyroscope"/>