[Title] initial upload
authorSon Hyunjun <hj79.son@samsung.com>
Thu, 15 Mar 2012 05:03:59 +0000 (14:03 +0900)
committerSon Hyunjun <hj79.son@samsung.com>
Thu, 15 Mar 2012 05:03:59 +0000 (14:03 +0900)
[Type] Feature
[Module] EmulatorManager
[Priority] Major
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]

48 files changed:
.classpath [new file with mode: 0644]
.gitignore
.project [new file with mode: 0644]
build.xml [new file with mode: 0644]
jaxb_src/org/tizen/emulator/manager/vms/xml/BaseInformationType.java [new file with mode: 0644]
jaxb_src/org/tizen/emulator/manager/vms/xml/DeviceType.java [new file with mode: 0644]
jaxb_src/org/tizen/emulator/manager/vms/xml/DiskImageFormatType.java [new file with mode: 0644]
jaxb_src/org/tizen/emulator/manager/vms/xml/DisplayType.java [new file with mode: 0644]
jaxb_src/org/tizen/emulator/manager/vms/xml/EmulatorConfiguration.java [new file with mode: 0644]
jaxb_src/org/tizen/emulator/manager/vms/xml/ObjectFactory.java [new file with mode: 0644]
jaxb_src/org/tizen/emulator/manager/vms/xml/RamType.java [new file with mode: 0644]
jaxb_src/org/tizen/emulator/manager/vms/xml/SkinType.java [new file with mode: 0644]
jaxb_src/org/tizen/emulator/manager/vms/xml/StorageType.java [new file with mode: 0644]
jaxb_src/org/tizen/emulator/manager/vms/xml/UsabilityType.java [new file with mode: 0644]
jaxb_src/org/tizen/emulator/manager/vms/xml/package-info.java [new file with mode: 0644]
lib/swt/cocoa-macosx/src.zip [new file with mode: 0644]
lib/swt/cocoa-macosx/swt-debug.jar [new file with mode: 0644]
lib/swt/cocoa-macosx/swt.jar [new file with mode: 0644]
lib/swt/gtk-linux/src.zip [new file with mode: 0644]
lib/swt/gtk-linux/swt-debug.jar [new file with mode: 0644]
lib/swt/gtk-linux/swt.jar [new file with mode: 0644]
lib/swt/win32-win32/src.zip [new file with mode: 0644]
lib/swt/win32-win32/swt-debug.jar [new file with mode: 0644]
lib/swt/win32-win32/swt.jar [new file with mode: 0644]
res/folder.gif [new file with mode: 0755]
src/org/tizen/emulator/manager/EmulatorManager.java [new file with mode: 0644]
src/org/tizen/emulator/manager/FileIO.java [new file with mode: 0644]
src/org/tizen/emulator/manager/PortHelper.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/MainDialog.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/table/ContentProvider.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/table/ContextMenu.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/table/RowItem.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/table/VMsTable.java [new file with mode: 0644]
src/org/tizen/emulator/manager/vms/EmulatorVMs.java [new file with mode: 0644]
src/org/tizen/emulator/manager/vms/VMsProperty.java [new file with mode: 0644]
src/org/tizen/emulator/manager/vt/VirtualTargetForm.java [new file with mode: 0644]
src/org/tizen/emulator/manager/vt/VirtualTargetHelper.java [new file with mode: 0644]
src/org/tizen/emulator/manager/vt/VirtualTargetProcess.java [new file with mode: 0644]
src/org/tizen/emulator/manager/vt/VirtualTargetResource.java [new file with mode: 0644]
src/org/tizen/emulator/manager/vt/VirtualTargetWidget.java [new file with mode: 0644]
test/tizen_vms/arm/test1/test1.xml [new file with mode: 0644]
test/tizen_vms/arm/test2/test2.xml [new file with mode: 0644]
test/tizen_vms/x86/test1/test1.xml [new file with mode: 0644]
test/tizen_vms/x86/test2/test2.xml [new file with mode: 0644]
test/tizen_vms/x86/test3/test3.xml [new file with mode: 0644]
test/tizen_vms/x86/test4/test4.xml [new file with mode: 0644]
xsd/em.xml [new file with mode: 0644]
xsd/em.xsd [new file with mode: 0644]

diff --git a/.classpath b/.classpath
new file mode 100644 (file)
index 0000000..c8d7645
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="src" path="jaxb_src"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry combineaccessrules="false" kind="src" path="/Libraries"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>
index e69de29..ba077a4 100644 (file)
@@ -0,0 +1 @@
+bin
diff --git a/.project b/.project
new file mode 100644 (file)
index 0000000..519cda9
--- /dev/null
+++ b/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>EmulatorManager</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/build.xml b/build.xml
new file mode 100644 (file)
index 0000000..d70b83e
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" standalone="yes"?>
+<project name="emulator-manager" basedir="." default="jar">
+    <path id="classpath">
+        <fileset dir="lib/swt/gtk-linux" includes="swt.jar" />
+    </path>
+    
+    <target name="compile">
+        <echo message="compiling..." />
+        <!-- remove hidden .xxx -->
+        <delete dir="bin" excludes=".*"/>
+        <mkdir dir="bin" />
+        <javac fork="true" srcdir="src:jaxb_src" destdir="bin" debug="on" memorymaximumsize="128m">
+               <classpath refid="classpath" />
+        </javac>
+    </target>
+    
+    <target name="jar" depends="compile">
+        <echo message="creating emulator-manager.jar..." />
+        <jar jarfile="emulator-manager.jar" basedir="bin" duplicate="add">
+               <manifest>
+                       <attribute name="Main-Class" value="org.tizen.emulator.manager.EmulatorManager"/>
+                <attribute name="Class-path" value="swt.jar"/>
+               </manifest>
+<!--            <fileset dir="src" includes="**/*.properties"/> -->
+        </jar>
+    </target>
+
+<!--
+    <target name="dist" depends="jar">
+        <copy file="./emulator-manager.jar" tofile="../dist/emulator-manager.jar"/>
+    </target>
+-->
+
+</project>
\ No newline at end of file
diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/BaseInformationType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/BaseInformationType.java
new file mode 100644 (file)
index 0000000..6bfd76c
--- /dev/null
@@ -0,0 +1,301 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2012.03.14 at 10:40:42 오후 KST 
+//
+
+
+package org.tizen.emulator.manager.vms.xml;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ * <p>Java class for baseInformationType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="baseInformationType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="architecture">
+ *           &lt;simpleType>
+ *             &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ *               &lt;enumeration value="x86"/>
+ *               &lt;enumeration value="ARM"/>
+ *             &lt;/restriction>
+ *           &lt;/simpleType>
+ *         &lt;/element>
+ *         &lt;element name="diskImage">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element name="baseDiskImage" type="{http://www.tizen.org/em}diskImageFormatType"/>
+ *                   &lt;element name="currentDiskImage" type="{http://www.tizen.org/em}diskImageFormatType"/>
+ *                 &lt;/sequence>
+ *                 &lt;attribute name="type" use="required">
+ *                   &lt;simpleType>
+ *                     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ *                       &lt;enumeration value="standard"/>
+ *                       &lt;enumeration value="custom"/>
+ *                     &lt;/restriction>
+ *                   &lt;/simpleType>
+ *                 &lt;/attribute>
+ *                 &lt;attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "baseInformationType", propOrder = {
+    "name",
+    "architecture",
+    "diskImage"
+})
+public class BaseInformationType {
+
+    @XmlElement(required = true)
+    protected String name;
+    @XmlElement(required = true)
+    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+    protected String architecture;
+    @XmlElement(required = true)
+    protected BaseInformationType.DiskImage diskImage;
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+    /**
+     * Gets the value of the architecture property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getArchitecture() {
+        return architecture;
+    }
+
+    /**
+     * Sets the value of the architecture property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setArchitecture(String value) {
+        this.architecture = value;
+    }
+
+    /**
+     * Gets the value of the diskImage property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BaseInformationType.DiskImage }
+     *     
+     */
+    public BaseInformationType.DiskImage getDiskImage() {
+        return diskImage;
+    }
+
+    /**
+     * Sets the value of the diskImage property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BaseInformationType.DiskImage }
+     *     
+     */
+    public void setDiskImage(BaseInformationType.DiskImage value) {
+        this.diskImage = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="baseDiskImage" type="{http://www.tizen.org/em}diskImageFormatType"/>
+     *         &lt;element name="currentDiskImage" type="{http://www.tizen.org/em}diskImageFormatType"/>
+     *       &lt;/sequence>
+     *       &lt;attribute name="type" use="required">
+     *         &lt;simpleType>
+     *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+     *             &lt;enumeration value="standard"/>
+     *             &lt;enumeration value="custom"/>
+     *           &lt;/restriction>
+     *         &lt;/simpleType>
+     *       &lt;/attribute>
+     *       &lt;attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "baseDiskImage",
+        "currentDiskImage"
+    })
+    public static class DiskImage {
+
+        @XmlElement(required = true)
+        protected DiskImageFormatType baseDiskImage;
+        @XmlElement(required = true)
+        protected DiskImageFormatType currentDiskImage;
+        @XmlAttribute(required = true)
+        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+        protected String type;
+        @XmlAttribute
+        protected String version;
+
+        /**
+         * Gets the value of the baseDiskImage property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link DiskImageFormatType }
+         *     
+         */
+        public DiskImageFormatType getBaseDiskImage() {
+            return baseDiskImage;
+        }
+
+        /**
+         * Sets the value of the baseDiskImage property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link DiskImageFormatType }
+         *     
+         */
+        public void setBaseDiskImage(DiskImageFormatType value) {
+            this.baseDiskImage = value;
+        }
+
+        /**
+         * Gets the value of the currentDiskImage property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link DiskImageFormatType }
+         *     
+         */
+        public DiskImageFormatType getCurrentDiskImage() {
+            return currentDiskImage;
+        }
+
+        /**
+         * Sets the value of the currentDiskImage property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link DiskImageFormatType }
+         *     
+         */
+        public void setCurrentDiskImage(DiskImageFormatType value) {
+            this.currentDiskImage = value;
+        }
+
+        /**
+         * Gets the value of the type property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getType() {
+            return type;
+        }
+
+        /**
+         * Sets the value of the type property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setType(String value) {
+            this.type = value;
+        }
+
+        /**
+         * Gets the value of the version property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getVersion() {
+            return version;
+        }
+
+        /**
+         * Sets the value of the version property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setVersion(String value) {
+            this.version = value;
+        }
+
+    }
+
+}
diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/DeviceType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/DeviceType.java
new file mode 100644 (file)
index 0000000..1fa8fb4
--- /dev/null
@@ -0,0 +1,125 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2012.03.14 at 10:40:42 오후 KST 
+//
+
+
+package org.tizen.emulator.manager.vms.xml;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for deviceType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="deviceType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="display" type="{http://www.tizen.org/em}displayType"/>
+ *         &lt;element name="storage" type="{http://www.tizen.org/em}storageType"/>
+ *         &lt;element name="RAM" type="{http://www.tizen.org/em}ramType"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "deviceType", propOrder = {
+    "display",
+    "storage",
+    "ram"
+})
+public class DeviceType {
+
+    @XmlElement(required = true)
+    protected DisplayType display;
+    @XmlElement(required = true)
+    protected StorageType storage;
+    @XmlElement(name = "RAM", required = true)
+    protected RamType ram;
+
+    /**
+     * Gets the value of the display property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link DisplayType }
+     *     
+     */
+    public DisplayType getDisplay() {
+        return display;
+    }
+
+    /**
+     * Sets the value of the display property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link DisplayType }
+     *     
+     */
+    public void setDisplay(DisplayType value) {
+        this.display = value;
+    }
+
+    /**
+     * Gets the value of the storage property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link StorageType }
+     *     
+     */
+    public StorageType getStorage() {
+        return storage;
+    }
+
+    /**
+     * Sets the value of the storage property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link StorageType }
+     *     
+     */
+    public void setStorage(StorageType value) {
+        this.storage = value;
+    }
+
+    /**
+     * Gets the value of the ram property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link RamType }
+     *     
+     */
+    public RamType getRAM() {
+        return ram;
+    }
+
+    /**
+     * Sets the value of the ram property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link RamType }
+     *     
+     */
+    public void setRAM(RamType value) {
+        this.ram = value;
+    }
+
+}
diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/DiskImageFormatType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/DiskImageFormatType.java
new file mode 100644 (file)
index 0000000..63fa8af
--- /dev/null
@@ -0,0 +1,105 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2012.03.14 at 10:40:42 오후 KST 
+//
+
+
+package org.tizen.emulator.manager.vms.xml;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ * <p>Java class for diskImageFormatType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="diskImageFormatType">
+ *   &lt;simpleContent>
+ *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *       &lt;attribute name="format" use="required">
+ *         &lt;simpleType>
+ *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ *             &lt;enumeration value="qcow2"/>
+ *             &lt;enumeration value="qed"/>
+ *             &lt;enumeration value="raw"/>
+ *           &lt;/restriction>
+ *         &lt;/simpleType>
+ *       &lt;/attribute>
+ *     &lt;/extension>
+ *   &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "diskImageFormatType", propOrder = {
+    "value"
+})
+public class DiskImageFormatType {
+
+    @XmlValue
+    protected String value;
+    @XmlAttribute(required = true)
+    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+    protected String format;
+
+    /**
+     * Gets the value of the value property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    /**
+     * Gets the value of the format property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getFormat() {
+        return format;
+    }
+
+    /**
+     * Sets the value of the format property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setFormat(String value) {
+        this.format = value;
+    }
+
+}
diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/DisplayType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/DisplayType.java
new file mode 100644 (file)
index 0000000..427b1fa
--- /dev/null
@@ -0,0 +1,269 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2012.03.14 at 10:40:42 오후 KST 
+//
+
+
+package org.tizen.emulator.manager.vms.xml;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ * <p>Java class for displayType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="displayType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="resolution">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element name="width" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *                   &lt;element name="height" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *                 &lt;/sequence>
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="density">
+ *           &lt;complexType>
+ *             &lt;simpleContent>
+ *               &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>int">
+ *                 &lt;attribute name="unit" use="required">
+ *                   &lt;simpleType>
+ *                     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ *                       &lt;enumeration value="dpi"/>
+ *                     &lt;/restriction>
+ *                   &lt;/simpleType>
+ *                 &lt;/attribute>
+ *               &lt;/extension>
+ *             &lt;/simpleContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "displayType", propOrder = {
+    "resolution",
+    "density"
+})
+public class DisplayType {
+
+    @XmlElement(required = true)
+    protected DisplayType.Resolution resolution;
+    @XmlElement(required = true)
+    protected DisplayType.Density density;
+
+    /**
+     * Gets the value of the resolution property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link DisplayType.Resolution }
+     *     
+     */
+    public DisplayType.Resolution getResolution() {
+        return resolution;
+    }
+
+    /**
+     * Sets the value of the resolution property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link DisplayType.Resolution }
+     *     
+     */
+    public void setResolution(DisplayType.Resolution value) {
+        this.resolution = value;
+    }
+
+    /**
+     * Gets the value of the density property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link DisplayType.Density }
+     *     
+     */
+    public DisplayType.Density getDensity() {
+        return density;
+    }
+
+    /**
+     * Sets the value of the density property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link DisplayType.Density }
+     *     
+     */
+    public void setDensity(DisplayType.Density value) {
+        this.density = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;simpleContent>
+     *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>int">
+     *       &lt;attribute name="unit" use="required">
+     *         &lt;simpleType>
+     *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+     *             &lt;enumeration value="dpi"/>
+     *           &lt;/restriction>
+     *         &lt;/simpleType>
+     *       &lt;/attribute>
+     *     &lt;/extension>
+     *   &lt;/simpleContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "value"
+    })
+    public static class Density {
+
+        @XmlValue
+        protected int value;
+        @XmlAttribute(required = true)
+        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+        protected String unit;
+
+        /**
+         * Gets the value of the value property.
+         * 
+         */
+        public int getValue() {
+            return value;
+        }
+
+        /**
+         * Sets the value of the value property.
+         * 
+         */
+        public void setValue(int value) {
+            this.value = value;
+        }
+
+        /**
+         * Gets the value of the unit property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getUnit() {
+            return unit;
+        }
+
+        /**
+         * Sets the value of the unit property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setUnit(String value) {
+            this.unit = value;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="width" type="{http://www.w3.org/2001/XMLSchema}int"/>
+     *         &lt;element name="height" type="{http://www.w3.org/2001/XMLSchema}int"/>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "width",
+        "height"
+    })
+    public static class Resolution {
+
+        protected int width;
+        protected int height;
+
+        /**
+         * Gets the value of the width property.
+         * 
+         */
+        public int getWidth() {
+            return width;
+        }
+
+        /**
+         * Sets the value of the width property.
+         * 
+         */
+        public void setWidth(int value) {
+            this.width = value;
+        }
+
+        /**
+         * Gets the value of the height property.
+         * 
+         */
+        public int getHeight() {
+            return height;
+        }
+
+        /**
+         * Sets the value of the height property.
+         * 
+         */
+        public void setHeight(int value) {
+            this.height = value;
+        }
+
+    }
+
+}
diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/EmulatorConfiguration.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/EmulatorConfiguration.java
new file mode 100644 (file)
index 0000000..72f3337
--- /dev/null
@@ -0,0 +1,154 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2012.03.14 at 10:40:42 오후 KST 
+//
+
+
+package org.tizen.emulator.manager.vms.xml;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="baseInformation" type="{http://www.tizen.org/em}baseInformationType"/>
+ *         &lt;element name="usability" type="{http://www.tizen.org/em}usabilityType"/>
+ *         &lt;element name="device" type="{http://www.tizen.org/em}deviceType"/>
+ *         &lt;element name="skin" type="{http://www.tizen.org/em}skinType" minOccurs="0"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+    "baseInformation",
+    "usability",
+    "device",
+    "skin"
+})
+@XmlRootElement(name = "EmulatorConfiguration")
+public class EmulatorConfiguration {
+
+    @XmlElement(required = true)
+    protected BaseInformationType baseInformation;
+    @XmlElement(required = true)
+    protected UsabilityType usability;
+    @XmlElement(required = true)
+    protected DeviceType device;
+    protected SkinType skin;
+
+    /**
+     * Gets the value of the baseInformation property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link BaseInformationType }
+     *     
+     */
+    public BaseInformationType getBaseInformation() {
+        return baseInformation;
+    }
+
+    /**
+     * Sets the value of the baseInformation property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link BaseInformationType }
+     *     
+     */
+    public void setBaseInformation(BaseInformationType value) {
+        this.baseInformation = value;
+    }
+
+    /**
+     * Gets the value of the usability property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link UsabilityType }
+     *     
+     */
+    public UsabilityType getUsability() {
+        return usability;
+    }
+
+    /**
+     * Sets the value of the usability property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link UsabilityType }
+     *     
+     */
+    public void setUsability(UsabilityType value) {
+        this.usability = value;
+    }
+
+    /**
+     * Gets the value of the device property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link DeviceType }
+     *     
+     */
+    public DeviceType getDevice() {
+        return device;
+    }
+
+    /**
+     * Sets the value of the device property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link DeviceType }
+     *     
+     */
+    public void setDevice(DeviceType value) {
+        this.device = value;
+    }
+
+    /**
+     * Gets the value of the skin property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link SkinType }
+     *     
+     */
+    public SkinType getSkin() {
+        return skin;
+    }
+
+    /**
+     * Sets the value of the skin property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link SkinType }
+     *     
+     */
+    public void setSkin(SkinType value) {
+        this.skin = value;
+    }
+
+}
diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/ObjectFactory.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/ObjectFactory.java
new file mode 100644 (file)
index 0000000..2b181b1
--- /dev/null
@@ -0,0 +1,167 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2012.03.14 at 10:40:42 오후 KST 
+//
+
+
+package org.tizen.emulator.manager.vms.xml;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the org.tizen.emulator.manager.vms.xml package. 
+ * <p>An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.tizen.emulator.manager.vms.xml
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link DisplayType }
+     * 
+     */
+    public DisplayType createDisplayType() {
+        return new DisplayType();
+    }
+
+    /**
+     * Create an instance of {@link UsabilityType }
+     * 
+     */
+    public UsabilityType createUsabilityType() {
+        return new UsabilityType();
+    }
+
+    /**
+     * Create an instance of {@link BaseInformationType }
+     * 
+     */
+    public BaseInformationType createBaseInformationType() {
+        return new BaseInformationType();
+    }
+
+    /**
+     * Create an instance of {@link RamType.Size }
+     * 
+     */
+    public RamType.Size createRamTypeSize() {
+        return new RamType.Size();
+    }
+
+    /**
+     * Create an instance of {@link StorageType.SDCard }
+     * 
+     */
+    public StorageType.SDCard createStorageTypeSDCard() {
+        return new StorageType.SDCard();
+    }
+
+    /**
+     * Create an instance of {@link EmulatorConfiguration }
+     * 
+     */
+    public EmulatorConfiguration createEmulatorConfiguration() {
+        return new EmulatorConfiguration();
+    }
+
+    /**
+     * Create an instance of {@link DisplayType.Density }
+     * 
+     */
+    public DisplayType.Density createDisplayTypeDensity() {
+        return new DisplayType.Density();
+    }
+
+    /**
+     * Create an instance of {@link UsabilityType.Logging }
+     * 
+     */
+    public UsabilityType.Logging createUsabilityTypeLogging() {
+        return new UsabilityType.Logging();
+    }
+
+    /**
+     * Create an instance of {@link SkinType }
+     * 
+     */
+    public SkinType createSkinType() {
+        return new SkinType();
+    }
+
+    /**
+     * Create an instance of {@link RamType }
+     * 
+     */
+    public RamType createRamType() {
+        return new RamType();
+    }
+
+    /**
+     * Create an instance of {@link DeviceType }
+     * 
+     */
+    public DeviceType createDeviceType() {
+        return new DeviceType();
+    }
+
+    /**
+     * Create an instance of {@link DisplayType.Resolution }
+     * 
+     */
+    public DisplayType.Resolution createDisplayTypeResolution() {
+        return new DisplayType.Resolution();
+    }
+
+    /**
+     * Create an instance of {@link BaseInformationType.DiskImage }
+     * 
+     */
+    public BaseInformationType.DiskImage createBaseInformationTypeDiskImage() {
+        return new BaseInformationType.DiskImage();
+    }
+
+    /**
+     * Create an instance of {@link UsabilityType.FileSharing }
+     * 
+     */
+    public UsabilityType.FileSharing createUsabilityTypeFileSharing() {
+        return new UsabilityType.FileSharing();
+    }
+
+    /**
+     * Create an instance of {@link DiskImageFormatType }
+     * 
+     */
+    public DiskImageFormatType createDiskImageFormatType() {
+        return new DiskImageFormatType();
+    }
+
+    /**
+     * Create an instance of {@link StorageType }
+     * 
+     */
+    public StorageType createStorageType() {
+        return new StorageType();
+    }
+
+}
diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/RamType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/RamType.java
new file mode 100644 (file)
index 0000000..198c88b
--- /dev/null
@@ -0,0 +1,165 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2012.03.14 at 10:40:42 오후 KST 
+//
+
+
+package org.tizen.emulator.manager.vms.xml;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ * <p>Java class for ramType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="ramType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="size">
+ *           &lt;complexType>
+ *             &lt;simpleContent>
+ *               &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>int">
+ *                 &lt;attribute name="unit" use="required">
+ *                   &lt;simpleType>
+ *                     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ *                       &lt;enumeration value="MiB"/>
+ *                     &lt;/restriction>
+ *                   &lt;/simpleType>
+ *                 &lt;/attribute>
+ *               &lt;/extension>
+ *             &lt;/simpleContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ramType", propOrder = {
+    "size"
+})
+public class RamType {
+
+    @XmlElement(required = true)
+    protected RamType.Size size;
+
+    /**
+     * Gets the value of the size property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link RamType.Size }
+     *     
+     */
+    public RamType.Size getSize() {
+        return size;
+    }
+
+    /**
+     * Sets the value of the size property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link RamType.Size }
+     *     
+     */
+    public void setSize(RamType.Size value) {
+        this.size = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;simpleContent>
+     *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>int">
+     *       &lt;attribute name="unit" use="required">
+     *         &lt;simpleType>
+     *           &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+     *             &lt;enumeration value="MiB"/>
+     *           &lt;/restriction>
+     *         &lt;/simpleType>
+     *       &lt;/attribute>
+     *     &lt;/extension>
+     *   &lt;/simpleContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "value"
+    })
+    public static class Size {
+
+        @XmlValue
+        protected int value;
+        @XmlAttribute(required = true)
+        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+        protected String unit;
+
+        /**
+         * Gets the value of the value property.
+         * 
+         */
+        public int getValue() {
+            return value;
+        }
+
+        /**
+         * Sets the value of the value property.
+         * 
+         */
+        public void setValue(int value) {
+            this.value = value;
+        }
+
+        /**
+         * Gets the value of the unit property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getUnit() {
+            return unit;
+        }
+
+        /**
+         * Sets the value of the unit property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setUnit(String value) {
+            this.unit = value;
+        }
+
+    }
+
+}
diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/SkinType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/SkinType.java
new file mode 100644 (file)
index 0000000..1775fa9
--- /dev/null
@@ -0,0 +1,67 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2012.03.14 at 10:40:42 오후 KST 
+//
+
+
+package org.tizen.emulator.manager.vms.xml;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for skinType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="skinType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="excutionArguments" type="{http://www.tizen.org/em}displayType" minOccurs="0"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "skinType", propOrder = {
+    "excutionArguments"
+})
+public class SkinType {
+
+    protected DisplayType excutionArguments;
+
+    /**
+     * Gets the value of the excutionArguments property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link DisplayType }
+     *     
+     */
+    public DisplayType getExcutionArguments() {
+        return excutionArguments;
+    }
+
+    /**
+     * Sets the value of the excutionArguments property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link DisplayType }
+     *     
+     */
+    public void setExcutionArguments(DisplayType value) {
+        this.excutionArguments = value;
+    }
+
+}
diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/StorageType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/StorageType.java
new file mode 100644 (file)
index 0000000..95ff31b
--- /dev/null
@@ -0,0 +1,133 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2012.03.14 at 10:40:42 오후 KST 
+//
+
+
+package org.tizen.emulator.manager.vms.xml;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for storageType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="storageType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="SDCard">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element name="diskImage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                 &lt;/sequence>
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "storageType", propOrder = {
+    "sdCard"
+})
+public class StorageType {
+
+    @XmlElement(name = "SDCard", required = true)
+    protected StorageType.SDCard sdCard;
+
+    /**
+     * Gets the value of the sdCard property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link StorageType.SDCard }
+     *     
+     */
+    public StorageType.SDCard getSDCard() {
+        return sdCard;
+    }
+
+    /**
+     * Sets the value of the sdCard property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link StorageType.SDCard }
+     *     
+     */
+    public void setSDCard(StorageType.SDCard value) {
+        this.sdCard = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="diskImage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "diskImage"
+    })
+    public static class SDCard {
+
+        protected String diskImage;
+
+        /**
+         * Gets the value of the diskImage property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getDiskImage() {
+            return diskImage;
+        }
+
+        /**
+         * Sets the value of the diskImage property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setDiskImage(String value) {
+            this.diskImage = value;
+        }
+
+    }
+
+}
diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/UsabilityType.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/UsabilityType.java
new file mode 100644 (file)
index 0000000..2440ac1
--- /dev/null
@@ -0,0 +1,270 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2012.03.14 at 10:40:42 오후 KST 
+//
+
+
+package org.tizen.emulator.manager.vms.xml;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+
+/**
+ * <p>Java class for usabilityType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="usabilityType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="logging">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element name="level">
+ *                     &lt;simpleType>
+ *                       &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ *                         &lt;enumeration value="NONE"/>
+ *                         &lt;enumeration value="SEVERE"/>
+ *                         &lt;enumeration value="WARNING"/>
+ *                         &lt;enumeration value="INFO"/>
+ *                         &lt;enumeration value="DEBUG"/>
+ *                         &lt;enumeration value="ALL"/>
+ *                       &lt;/restriction>
+ *                     &lt;/simpleType>
+ *                   &lt;/element>
+ *                 &lt;/sequence>
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="fileSharing">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 &lt;sequence>
+ *                   &lt;element name="path" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                 &lt;/sequence>
+ *               &lt;/restriction>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="hwVirtualization" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "usabilityType", propOrder = {
+    "logging",
+    "fileSharing",
+    "hwVirtualization"
+})
+public class UsabilityType {
+
+    @XmlElement(required = true)
+    protected UsabilityType.Logging logging;
+    @XmlElement(required = true)
+    protected UsabilityType.FileSharing fileSharing;
+    protected boolean hwVirtualization;
+
+    /**
+     * Gets the value of the logging property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link UsabilityType.Logging }
+     *     
+     */
+    public UsabilityType.Logging getLogging() {
+        return logging;
+    }
+
+    /**
+     * Sets the value of the logging property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link UsabilityType.Logging }
+     *     
+     */
+    public void setLogging(UsabilityType.Logging value) {
+        this.logging = value;
+    }
+
+    /**
+     * Gets the value of the fileSharing property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link UsabilityType.FileSharing }
+     *     
+     */
+    public UsabilityType.FileSharing getFileSharing() {
+        return fileSharing;
+    }
+
+    /**
+     * Sets the value of the fileSharing property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link UsabilityType.FileSharing }
+     *     
+     */
+    public void setFileSharing(UsabilityType.FileSharing value) {
+        this.fileSharing = value;
+    }
+
+    /**
+     * Gets the value of the hwVirtualization property.
+     * 
+     */
+    public boolean isHwVirtualization() {
+        return hwVirtualization;
+    }
+
+    /**
+     * Sets the value of the hwVirtualization property.
+     * 
+     */
+    public void setHwVirtualization(boolean value) {
+        this.hwVirtualization = value;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="path" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "path"
+    })
+    public static class FileSharing {
+
+        protected String path;
+
+        /**
+         * Gets the value of the path property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getPath() {
+            return path;
+        }
+
+        /**
+         * Sets the value of the path property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setPath(String value) {
+            this.path = value;
+        }
+
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       &lt;sequence>
+     *         &lt;element name="level">
+     *           &lt;simpleType>
+     *             &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+     *               &lt;enumeration value="NONE"/>
+     *               &lt;enumeration value="SEVERE"/>
+     *               &lt;enumeration value="WARNING"/>
+     *               &lt;enumeration value="INFO"/>
+     *               &lt;enumeration value="DEBUG"/>
+     *               &lt;enumeration value="ALL"/>
+     *             &lt;/restriction>
+     *           &lt;/simpleType>
+     *         &lt;/element>
+     *       &lt;/sequence>
+     *     &lt;/restriction>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "level"
+    })
+    public static class Logging {
+
+        @XmlElement(required = true)
+        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+        protected String level;
+
+        /**
+         * Gets the value of the level property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getLevel() {
+            return level;
+        }
+
+        /**
+         * Sets the value of the level property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setLevel(String value) {
+            this.level = value;
+        }
+
+    }
+
+}
diff --git a/jaxb_src/org/tizen/emulator/manager/vms/xml/package-info.java b/jaxb_src/org/tizen/emulator/manager/vms/xml/package-info.java
new file mode 100644 (file)
index 0000000..8e92c16
--- /dev/null
@@ -0,0 +1,9 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2012.03.14 at 10:40:42 오후 KST 
+//
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tizen.org/em", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.tizen.emulator.manager.vms.xml;
diff --git a/lib/swt/cocoa-macosx/src.zip b/lib/swt/cocoa-macosx/src.zip
new file mode 100644 (file)
index 0000000..295729b
Binary files /dev/null and b/lib/swt/cocoa-macosx/src.zip differ
diff --git a/lib/swt/cocoa-macosx/swt-debug.jar b/lib/swt/cocoa-macosx/swt-debug.jar
new file mode 100644 (file)
index 0000000..07f3bbc
Binary files /dev/null and b/lib/swt/cocoa-macosx/swt-debug.jar differ
diff --git a/lib/swt/cocoa-macosx/swt.jar b/lib/swt/cocoa-macosx/swt.jar
new file mode 100644 (file)
index 0000000..54bf3a8
Binary files /dev/null and b/lib/swt/cocoa-macosx/swt.jar differ
diff --git a/lib/swt/gtk-linux/src.zip b/lib/swt/gtk-linux/src.zip
new file mode 100644 (file)
index 0000000..c7e0731
Binary files /dev/null and b/lib/swt/gtk-linux/src.zip differ
diff --git a/lib/swt/gtk-linux/swt-debug.jar b/lib/swt/gtk-linux/swt-debug.jar
new file mode 100644 (file)
index 0000000..78a1519
Binary files /dev/null and b/lib/swt/gtk-linux/swt-debug.jar differ
diff --git a/lib/swt/gtk-linux/swt.jar b/lib/swt/gtk-linux/swt.jar
new file mode 100644 (file)
index 0000000..2d78756
Binary files /dev/null and b/lib/swt/gtk-linux/swt.jar differ
diff --git a/lib/swt/win32-win32/src.zip b/lib/swt/win32-win32/src.zip
new file mode 100644 (file)
index 0000000..78fab0b
Binary files /dev/null and b/lib/swt/win32-win32/src.zip differ
diff --git a/lib/swt/win32-win32/swt-debug.jar b/lib/swt/win32-win32/swt-debug.jar
new file mode 100644 (file)
index 0000000..f52cf53
Binary files /dev/null and b/lib/swt/win32-win32/swt-debug.jar differ
diff --git a/lib/swt/win32-win32/swt.jar b/lib/swt/win32-win32/swt.jar
new file mode 100644 (file)
index 0000000..237d388
Binary files /dev/null and b/lib/swt/win32-win32/swt.jar differ
diff --git a/res/folder.gif b/res/folder.gif
new file mode 100755 (executable)
index 0000000..ab20874
Binary files /dev/null and b/res/folder.gif differ
diff --git a/src/org/tizen/emulator/manager/EmulatorManager.java b/src/org/tizen/emulator/manager/EmulatorManager.java
new file mode 100644 (file)
index 0000000..95fc40a
--- /dev/null
@@ -0,0 +1,140 @@
+package org.tizen.emulator.manager;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.net.Socket;
+import java.net.UnknownHostException;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MessageBox;
+import org.tizen.emulator.manager.ui.MainDialog;
+import org.tizen.emulator.manager.vms.EmulatorVMs;
+import org.tizen.emulator.manager.vms.VMsProperty;
+
+public class EmulatorManager {
+       private static EmulatorManager instance;
+       
+       private MainDialog mainDialog;
+       public static void env_init() {
+               String defaultPath = EmulatorVMs.getInstance().getVMsBaseDirectory();
+               File fi = new File(defaultPath);
+               if(!fi.exists())
+                       fi.mkdirs();
+       }
+       
+       public static void main(String[] args) {
+               if(args.length > 0) {
+                       EmulatorVMs.getInstance().setVMsBaseDirectory(args[1]);
+               }
+               else {
+                       EmulatorVMs.getInstance().setVMsBaseDirectory(FileIO.getInstance().getTizenVmsArchPath());
+               }
+               
+               env_init();
+               
+               try {
+                       EmulatorVMs.getInstance().loadProperties();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+               
+               instance = new EmulatorManager();
+               instance.DrawUI();
+       }
+
+       public static EmulatorManager getInstance() {
+               return instance;
+       }
+       
+       private void DrawUI() {
+               mainDialog = new MainDialog();
+               mainDialog.draw();
+       }
+       
+       public void launchVM(VMsProperty property) {
+               Runtime run = Runtime.getRuntime();
+               Process pr = null;
+               String binary;
+               String kvm = "";
+               boolean exists = false;
+               int portNo; 
+               String  StrPortNo = "";
+               int c;
+               //check if there is another Emulator instance with the same name
+               String PortPath = new FileIO().getTizenVmsArchPath() + "/" + property.getName() + "/.port";
+               File file = new File(PortPath);
+               exists  = file.exists();
+               if(exists) {
+               try {
+                       FileReader in = new FileReader(PortPath); 
+                       while((c=in.read()) != '\n') {
+                               StrPortNo = StrPortNo + (char)c;
+                       }
+                       in.close();
+                       } catch(Exception e1) {
+                               e1.printStackTrace();
+                       }
+                       
+               try {
+                       Socket so = new Socket("localhost", Integer.parseInt(StrPortNo));
+                       MessageBox alert = new MessageBox(mainDialog.getShell(), SWT.OK);
+                       alert.setMessage("Can not start the target: " + property.getName() +"\nVirtual target with the same name is running now!");
+                       alert.open();
+                       return;
+                       } catch (UnknownHostException e) {
+                               // TODO Auto-generated catch block
+                               e.printStackTrace();
+                       } catch (IOException e) {
+                               // means portNo not in use
+                       }
+               }
+               
+               //check available port number.
+               portNo = new PortHelper().getPortNo();
+               if(portNo == -1) {
+                       MessageBox alert = new MessageBox(mainDialog.getShell(), SWT.OK);
+                       alert.setMessage("Can not execute emulator.\n All available ports are in use.");
+                       alert.open();
+                       return;
+       }
+               
+       if (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1)
+               binary = "/qemu-system-i386.exe";
+       else
+               binary = "/qemu-system-i386";
+       
+       if (System.getProperty("os.name").toLowerCase().indexOf("linux") > -1 && property.getConfiguration().getUsability().isHwVirtualization()) {
+               File fi = new File("/dev/kvm");
+               exists = fi.exists();
+               if(exists)
+                       kvm = "-enable-kvm";
+       }
+               FileIO fio = new FileIO();
+               // make cmd to run emulator
+               try {
+                       String cmd = System.getProperty("user.dir") + binary
+                                       + " --skin-args width=" + property.getConfiguration().getDevice().getDisplay().getResolution().getWidth() + " height=" + property.getConfiguration().getDevice().getDisplay().getResolution().getHeight() 
+                                       //+ " --qemu-args -drive file=emulimg.x86,if=virtio"
+                                       + " --qemu-args -drive file=" + EmulatorVMs.getInstance().getVMsBaseDirectory() + "/" + property.getName() + "/emulimg-" + property.getName() + ".x86,if=virtio"
+                                       + " -boot c -append \"console=ttyS0 video=uvesafb:ywrap,"
+                                       + property.getConfiguration().getDevice().getDisplay().getResolution().getWidth() + "x" + property.getConfiguration().getDevice().getDisplay().getResolution().getHeight() + "-32@60"
+                                       + " sdb_port=" + portNo
+                                       + " dpi=" + property.getConfiguration().getDevice().getDisplay().getDensity().getValue() 
+                                       + " root=/dev/vda rw"
+                                       + " ip=10.0.2.16::10.0.2.2:255.255.255.0::eth0:none 5\""
+                                       + " -serial file:emulator.klog"
+                                       + " -m " + property.getConfiguration().getDevice().getRAM().getSize().getValue()
+                                       + " -M maru-x86-machine -net nic,model=virtio -soundhw all -usb -usbdevice maru-touchscreen -vga maru -bios bios.bin -L ."
+                                       //      + " -kernel bzImage "
+                                       + " -kernel " + fio.getKernelPath() + "/"+ "bzImage "
+                                       + " -usbdevice keyboard -net user -rtc base=utc "
+                                       + kvm
+                                       + " -redir tcp:1202:10.0.2.16:22";
+                       System.out.println(cmd);
+                       pr = run.exec(cmd);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               }
+       }
+}
diff --git a/src/org/tizen/emulator/manager/FileIO.java b/src/org/tizen/emulator/manager/FileIO.java
new file mode 100644 (file)
index 0000000..2f64573
--- /dev/null
@@ -0,0 +1,117 @@
+package org.tizen.emulator.manager;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.tizen.emulator.manager.vms.EmulatorVMs;
+
+public class FileIO {
+       File dir1 = new File(".");
+       File dir2 = new File("..");
+       File dir3 = new File("../../");
+       private final static String arch_suffix = "/x86";
+       private final static String icon_suffix = "/skins/icons/vtm.ico";
+       private final static String data_suffix = "/data";
+       private final static String conf_suffix = "/conf";
+       private final static String vms_suffix = "/.tizen_vms";
+       private final static String baseimg_suffix = "/emulimg-1.0.x86";
+       private final static String etc_suffix = "/etc";
+       private final static String log_suffix = "/logs";
+       private final static String bin_suffix = "/bin";
+       private final static String x86_kernel_suffix = "/bzImage";
+       
+       static FileIO instance = null;
+
+       static {
+               synchronized(FileIO.class) {
+                       instance = new FileIO();
+               }
+       }
+       public static FileIO getInstance() {
+               return instance;
+       }
+       
+       String getSdkRoot() throws IOException {
+               return dir3.getCanonicalPath();
+       }       
+       
+       String getSdbPath() throws IOException {
+               String sdb_suffix;
+               String root_dir = getSdkRoot();
+               StringBuffer sb = new StringBuffer(root_dir);
+               if (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1)
+                       sdb_suffix = "/SDK/sdb/sdb.exe";
+               else
+                       sdb_suffix = "/SDK/sdb/sdb";
+               
+               return sb.append(sdb_suffix).toString();
+       }
+
+       public String getBinPath() throws IOException {
+               String temp = dir2.getCanonicalPath();
+               return temp + bin_suffix;
+               //return dir1.getCanonicalPath();
+       }
+       
+       String getArchPath() throws IOException {
+               String temp =  dir2.getCanonicalPath();
+               StringBuffer sb = new StringBuffer(temp);
+               return sb.append(arch_suffix).toString();
+       }
+
+       // ~/tizen_sdk/Emulator/skins/icons/vtm.ico
+       String getIconPath() throws IOException {
+               String temp =  dir2.getCanonicalPath();
+               StringBuffer sb = new StringBuffer(temp);
+               return sb.append(icon_suffix).toString();
+       }
+       
+       public String getDataPath() throws IOException {
+               String temp =  getArchPath();
+               StringBuffer sb = new StringBuffer(temp);
+               return sb.append(data_suffix).toString();
+       }
+       
+       String getConfPath() throws IOException {
+               String temp =  getArchPath();
+               StringBuffer sb = new StringBuffer(temp);
+               return sb.append(conf_suffix).toString();
+       }
+       
+       String getTizenVmsPath() {
+               
+               String temp = System.getProperty("user.home");
+               StringBuffer sb = new StringBuffer(temp);
+               return sb.append(vms_suffix).toString();
+               //return EmulatorVMs.getInstance().getVMsBaseDirectory();
+       }
+       
+       String getTizenVmsArchPath() {
+               return getTizenVmsPath() + arch_suffix;
+       }
+       
+       public String getBaseimgPath() throws IOException{
+               String temp = getArchPath();
+               StringBuffer sb = new StringBuffer(temp);
+               return sb.append(baseimg_suffix).toString();
+       }
+       
+       String getEtcPath() throws IOException {
+               String temp =  dir2.getCanonicalPath();
+               StringBuffer sb = new StringBuffer(temp);
+               return sb.append(etc_suffix).toString();
+       }
+       String getKernelPath() throws IOException {
+               String temp =  getDataPath();
+               StringBuffer sb = new StringBuffer(temp);
+               return sb.append(x86_kernel_suffix).toString();
+       }
+       
+       public String getVirtualTargetPath(String name) {
+               return getTizenVmsArchPath() + "/" + name;
+       }
+       
+       public String getVirtualTargetLogPath(String name) {
+               return getVirtualTargetPath(name) + log_suffix;
+       }
+}
\ No newline at end of file
diff --git a/src/org/tizen/emulator/manager/PortHelper.java b/src/org/tizen/emulator/manager/PortHelper.java
new file mode 100644 (file)
index 0000000..101d0c8
--- /dev/null
@@ -0,0 +1,25 @@
+package org.tizen.emulator.manager;
+
+import java.io.IOException;
+import java.net.Socket;
+import java.net.UnknownHostException;
+
+public class PortHelper {
+       Socket so;
+       int getPortNo()
+       {
+               int port;
+               for(port=26100;port < 26200; port += 10) {
+                       try {
+                               so = new Socket("localhost", port+1);
+                       } catch (UnknownHostException e) {
+                               // TODO Auto-generated catch block
+                               e.printStackTrace();
+                       } catch (IOException e) {
+                               // TODO Auto-generated catch block
+                               return port;
+                       }
+               }
+               return -1;
+       }
+}
diff --git a/src/org/tizen/emulator/manager/ui/MainDialog.java b/src/org/tizen/emulator/manager/ui/MainDialog.java
new file mode 100644 (file)
index 0000000..b3e9dcf
--- /dev/null
@@ -0,0 +1,479 @@
+package org.tizen.emulator.manager.ui;
+
+import java.io.File;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.tizen.emulator.manager.ui.table.VMsTable;
+import org.tizen.emulator.manager.vms.EmulatorVMs;
+import org.tizen.emulator.manager.vms.VMsProperty;
+import org.tizen.emulator.manager.vms.VMsProperty.Architecture;
+import org.tizen.emulator.manager.vms.xml.DisplayType.Resolution;
+import org.tizen.emulator.manager.vt.VirtualTargetForm;
+import org.tizen.emulator.manager.vt.VirtualTargetWidget;
+
+public class MainDialog {
+       Display display;
+       Shell shell;
+
+       public Button x86RadioButton;
+       public Button armRadioButton;
+       
+       private SashForm sashForm;
+       private Table detailTable;
+       private TableColumn tableColumn;
+       private boolean isDetailOpened = false;
+       private boolean isCreateOpened = false;
+       private boolean isCreateState  = false;
+       private boolean isModifyState  = false;
+
+       // Launch, Create, Modify, Cancel, Confirm
+       private Button leftButton;
+       private Button rightButton;
+
+       private Button deleteButton;
+       private Button resetButton;
+       
+       private VMsTable imageListTable;
+       
+       private VMsProperty currentProperty;
+
+       public void draw() {
+               this.display = new Display();
+               shell = new Shell(display);
+               shell.setSize(700, 500);
+               shell.setText("Emulator Manager");
+               shell.setLayout(new FillLayout());
+
+               drawInternal();
+               
+               shell.open();
+               
+               while(!shell.isDisposed()) {
+                       if(!display.readAndDispatch()) display.sleep();
+               }
+
+               display.dispose();
+       }
+
+       private void drawInternal() {   
+               
+               Composite mainComposite = new Composite(shell, SWT.NONE);
+               mainComposite.setLayout(new GridLayout(1, false));
+
+               {
+                       Composite archComposite = new Composite(mainComposite, SWT.NONE);
+                       archComposite.setLayout(new GridLayout(1, false));
+                       archComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+                       Group architectureGroup = new Group(archComposite, SWT.NONE);
+                       architectureGroup.setText("Emulator Architecture");
+                       architectureGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+                       architectureGroup.setLayout(new GridLayout(2, false));
+
+                       x86RadioButton = new Button(architectureGroup, SWT.RADIO);
+                       x86RadioButton.setData(Architecture.x86);
+                       x86RadioButton.setText("X86");
+                       x86RadioButton.setSelection(true);
+
+                       armRadioButton = new Button(architectureGroup, SWT.RADIO);
+                       armRadioButton.setData(Architecture.ARM);
+                       armRadioButton.setText("ARM");
+                       armRadioButton.setSelection(false);
+                       armRadioButton.setEnabled(false);
+
+                       sashForm = new SashForm(mainComposite, SWT.HORIZONTAL);
+                       sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+                       sashForm.setLayout(new FillLayout());
+                       {
+                               imageListTable = new VMsTable(this, sashForm);
+                               SelectionListener archSelectionListener = new SelectionListener() {
+                                       @Override
+                                       public void widgetSelected(SelectionEvent e) {
+                                               imageListTable.refreshTableList();
+                                       }
+                                       @Override
+                                       public void widgetDefaultSelected(SelectionEvent e) {
+                                               imageListTable.refreshTableList();
+                                       }
+
+                               };
+                               x86RadioButton.addSelectionListener(archSelectionListener);
+                               armRadioButton.addSelectionListener(archSelectionListener);
+
+                               final Composite rightView = new Composite(sashForm, SWT.FILL);
+                               GridLayout gl = new GridLayout(1, false);
+                               gl.horizontalSpacing = 0;
+                               gl.verticalSpacing = 0;
+                               gl.marginBottom = 0;
+                               gl.marginHeight = 0;
+                               gl.marginLeft = 0;
+                               gl.marginRight = 0;
+                               gl.marginTop = 0;
+                               gl.marginWidth = 0;
+                               rightView.setLayout(gl);
+                               
+                               detailTable = new Table(rightView, SWT.BORDER);
+                               detailTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
+                               detailTable.setHeaderVisible(true);
+                               detailTable.setLinesVisible(true);
+
+                               detailTable.addListener(SWT.MeasureItem, new Listener() {
+                                       @Override
+                                       public void handleEvent(Event event) {
+                                               // TODO
+                                               event.height = 25;
+                                       }
+                                       
+                               });
+
+                               tableColumn = new TableColumn(detailTable, SWT.NONE);
+                               tableColumn.setText("Detail");
+                               TableColumn tableColumn2 = new TableColumn(detailTable, SWT.NONE);
+                               tableColumn2.setText("");
+                               
+                               Composite bottomComposite = new Composite(rightView, SWT.NONE);
+                               bottomComposite.setLayout(new GridLayout(2, false));
+                               bottomComposite.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, true, false));
+                               leftButton = new Button(bottomComposite, SWT.PUSH);
+                               leftButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+                               leftButton.setText("Launch");
+                               leftButton.addSelectionListener(new SelectionListener() {
+
+                                       @Override
+                                       public void widgetSelected(SelectionEvent e) {
+                                               String type = leftButton.getText();
+                                               if (type.equals("Launch")) {
+                                                       // TODO
+                                               } else if (type.equals("Cancel")) {
+                                                       if (!isDetailOpened) {
+                                                               closeCreateView();
+                                                               closeDetailView();
+                                                       } else {
+                                                               openDetailView(currentProperty);
+                                                       }
+                                               }
+                                       }
+
+                                       @Override
+                                       public void widgetDefaultSelected(SelectionEvent e) {
+                                               
+                                       }
+                                       
+                               });
+                               rightButton = new Button(bottomComposite, SWT.PUSH);
+                               rightButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+                               rightButton.setText("Modify");
+                               rightButton.addSelectionListener(new SelectionListener() {
+                                       @Override
+                                       public void widgetSelected(SelectionEvent e) {
+                                               String type = rightButton.getText();
+                                               if (type.equals("Modify")) {
+                                                       openModifyView(currentProperty);
+                                               } else if (type.equals("Confirm")) {
+                                                       VMsProperty pro = vt.confirm();
+                                                       if (pro == null) {
+                                                               if (!isDetailOpened) {
+                                                                       if (isModifyState) {
+                                                                               closeModifyView();
+                                                                       } else if (isCreateState) {
+                                                                               closeCreateView();
+                                                                       }
+                                                               } else {
+                                                                       openDetailView(currentProperty);
+                                                               }
+                                                       } else {  // successs
+                                                               refreshProperties();
+                                                               openDetailView(pro);
+                                                       }
+                                               }
+                                       }
+                                       @Override
+                                       public void widgetDefaultSelected(SelectionEvent e) {
+                                       }
+                               });
+                       }       
+                               
+                       sashForm.setWeights(new int[] { 100, 0 });
+
+                       Composite buttonComposite = new Composite(mainComposite, SWT.NONE);
+                       buttonComposite.setLayoutData(new GridData(SWT.LEFT, SWT.BOTTOM, true, false));
+                       buttonComposite.setLayout(new FillLayout());
+
+                       Button refreshButton = new Button(buttonComposite, SWT.PUSH);
+                       refreshButton.setText("Refresh");
+                       refreshButton.addSelectionListener(new SelectionListener() {
+                               @Override
+                               public void widgetSelected(SelectionEvent e) {
+                                       refreshProperties();
+                               }
+                               
+                               @Override
+                               public void widgetDefaultSelected(SelectionEvent e) {}
+                       });
+                               
+                       deleteButton = new Button(buttonComposite, SWT.PUSH);
+                       deleteButton.setText("Delete");
+                       deleteButton.addSelectionListener(new SelectionListener() {
+                               @Override
+                               public void widgetSelected(SelectionEvent e) {
+                                       deleteVirtualTarget(currentProperty);
+                                       closeDetailView();
+                                       refreshProperties();
+                               }
+                               @Override
+                               public void widgetDefaultSelected(SelectionEvent e) {
+                               }
+                       });
+                       //deleteButton.setImage(display.getSystemImage(SWT.ICON_ERROR));
+                       resetButton = new Button(buttonComposite, SWT.PUSH);
+                       resetButton.setText("Reset");
+                       //resetButton.setImage(display.getSystemImage(SWT.ICON_WARNING));
+
+                       //TODO
+                       resetButton.setEnabled(false);
+               }
+       }
+       
+       // TOOD : error checking
+       public void deleteVirtualTarget(VMsProperty property) {
+               String path = EmulatorVMs.getInstance().getVMsBaseDirectory()
+                                     + File.separator + property.getArch().toString()
+                                     + File.separator + property.getName();
+
+               File vtFolder = new File(path);
+               if (vtFolder.exists()) {
+                       for (File dir : vtFolder.listFiles()) {
+                               if (dir.isFile()) {
+                                       dir.delete();
+                               } else { // directory
+                                       for (File sub : dir.listFiles()) {
+                                               if (dir.isFile()) {
+                                                       dir.delete();
+                                               }
+                                       }
+                                       dir.delete();
+                               }
+                       }
+                       vtFolder.delete();
+               }
+       }
+
+       public void refreshProperties() {
+               EmulatorVMs.getInstance().refreshProperties();
+               imageListTable.refreshTableList();
+       }
+
+       public Shell getShell() {
+               return shell;
+       }
+               
+       public void closeDetailView()
+       {
+               if (isModifyState) {
+                       closeModifyView();
+               } else if (isCreateState) {
+                       closeCreateView();
+               }
+
+               sashForm.setWeights(new int[] { 100, 0 });
+               isDetailOpened = false;
+       }
+       
+       public void openDetailView(VMsProperty property)
+       {
+               if (isModifyState) {
+                       closeModifyView();
+               } else if (isCreateState) {
+                       closeCreateView();
+               }
+
+               currentProperty = property;
+
+               detailTable.removeAll();
+               tableColumn.setText("Detail");
+
+               String path;
+               TableItem item = new TableItem(detailTable, SWT.NONE);
+               item.setText(new String[] { "Image Name", property.getName()} );
+
+               item = new TableItem(detailTable, SWT.NONE);
+               path = property.getConfiguration().getBaseInformation().getDiskImage().getBaseDiskImage().getValue();
+               item.setText(new String[] { "BaseImage", path.substring(path.lastIndexOf("/") + 1, path.length())} );
+
+               item = new TableItem(detailTable, SWT.NONE);
+               Resolution re = property.getConfiguration().getDevice().getDisplay().getResolution();
+               item.setText(new String[] { "Display Resolution", re.getWidth() + "x" + re.getHeight()} );
+
+               item = new TableItem(detailTable, SWT.NONE);
+               item.setText(new String[] { "Display Density", String.valueOf(property.getConfiguration().getDevice().getDisplay().getDensity().getValue())} );
+
+               item = new TableItem(detailTable, SWT.NONE);
+               TableItem item2 = new TableItem(detailTable, SWT.NONE);
+               path = property.getConfiguration().getDevice().getStorage().getSDCard().getDiskImage();
+               if (path == null) {
+                       path = "";
+               }
+               path = path.substring(path.lastIndexOf("/") + 1, path.length());
+               if (!path.isEmpty() && !path.toLowerCase().equals("none")) {
+                       item.setText(new String[] { "SDCard Type", "Supported"} );
+                       item2.setText(new String[] { "SDCard Path", path} );
+               } else {
+                       item.setText(new String[] { "SDCard Type", "Not supported"} );
+                       item2.setText(new String[] { "SDCard Path", "None"} );
+               }
+
+               item = new TableItem(detailTable, SWT.NONE);
+               item.setText(new String[] { "Ram Size", String.valueOf(property.getConfiguration().getDevice().getRAM().getSize().getValue()) + " MB"} );
+
+               item = new TableItem(detailTable, SWT.NONE);
+               item2 = new TableItem(detailTable, SWT.NONE);
+               path = property.getConfiguration().getUsability().getFileSharing().getPath();
+               if (path == null) {
+                       path = "";
+               }
+               path = path.substring(path.lastIndexOf("/") + 1, path.length());
+               if (!path.isEmpty() && !path.toLowerCase().equals("none")) {
+                       item.setText(new String[] { "File Sharing Type", "Supported"} );
+                       item2.setText(new String[] { "File Sharing Path", path} );
+               } else {
+                       item.setText(new String[] { "File Sharing Type", "Not supported"} );
+                       item2.setText(new String[] { "File Sharing Path", "None"} );
+               }
+
+               // check default image
+               if (property.getName().equals("default")) {
+                       deleteButton.setEnabled(false);
+                       rightButton.setEnabled(false);
+               } else {
+                       deleteButton.setEnabled(true);
+                       rightButton.setEnabled(true);
+               }
+               detailTable.getColumn(0).pack();
+               detailTable.getColumn(1).pack();
+               
+               if(isDetailOpened)
+                       return;
+               
+//             for(int i = 1; i <= 50; i += 2) {
+//                     EmulatorManager.sashForm.setWeights(new int[] { 100 - i, i });
+//             }
+               
+               sashForm.setWeights(new int[] { 60, 40 });
+               isDetailOpened = true;
+       }
+       
+       VirtualTargetForm vt = null;
+       public void openModifyView(VMsProperty property)
+       {
+               if (isModifyState) {
+                       if (vt != null) {
+                               vt.close();
+                               vt = null;
+                       }
+               } else if (isCreateState) {
+                       closeCreateView();
+               }
+
+               isModifyState = true;
+               deleteButton.setEnabled(false);
+               //resetButton.setEnabled(false);
+
+               detailTable.removeAll();
+               tableColumn.setText("Modify");
+
+               VirtualTargetWidget widget = new VirtualTargetWidget();
+               widget.display = display;
+               widget.table = detailTable;
+               widget.cancelButton = leftButton;
+               widget.confirmButton = rightButton;
+
+               vt = new VirtualTargetForm();
+               vt.create(widget, property, true, false);
+               detailTable.getColumn(1).pack();
+               detailTable.getColumn(0).pack();
+       }
+       
+       public void closeModifyView()
+       {
+               rightButton.setText("Modify");
+               leftButton.setText("Launch");
+               rightButton.setEnabled(true);
+               leftButton.setEnabled(true);
+               deleteButton.setEnabled(true);
+               //resetButton.setEnabled(true);
+               if (vt != null) {
+                       vt.close();
+                       vt = null;
+               }
+               isModifyState = false;
+       }
+       
+       public void openCreateView(boolean isDefault)
+       {
+               if (isModifyState) {
+                       closeModifyView();
+               } else if (isCreateState) {
+                       if (vt != null) {
+                               vt.close();
+                               vt = null;
+                       }
+               }
+
+               isCreateState = true;
+               deleteButton.setEnabled(false);
+               //resetButton.setEnabled(false);
+
+               detailTable.removeAll();
+               tableColumn.setText("Create");
+
+               VirtualTargetWidget widget = new VirtualTargetWidget();
+               widget.display = display;
+               widget.table = detailTable;
+               widget.cancelButton = leftButton;
+               widget.confirmButton = rightButton;
+
+               vt = new VirtualTargetForm();
+               vt.create(widget, null, false, isDefault);
+               detailTable.getColumn(1).pack();
+               detailTable.getColumn(0).pack();
+               if (!isCreateOpened && !isDetailOpened) {
+                       sashForm.setWeights(new int[] { 60, 40 });
+                       isCreateOpened = true;
+               }
+       }
+       
+       public void closeCreateView()
+       {
+               rightButton.setText("Modify");
+               leftButton.setText("Launch");
+               rightButton.setEnabled(true);
+               leftButton.setEnabled(true);
+               deleteButton.setEnabled(true);
+               //resetButton.setEnabled(true);
+               if (vt != null) {
+                       vt.close();
+                       vt = null;
+               }
+               isCreateState = false;
+               
+               if (!isDetailOpened) {
+                       sashForm.setWeights(new int[] { 100, 0 });
+                       isCreateOpened = false;
+               }
+       }
+}
diff --git a/src/org/tizen/emulator/manager/ui/table/ContentProvider.java b/src/org/tizen/emulator/manager/ui/table/ContentProvider.java
new file mode 100644 (file)
index 0000000..d735825
--- /dev/null
@@ -0,0 +1,38 @@
+package org.tizen.emulator.manager.ui.table;
+
+import org.tizen.emulator.manager.vms.VMsProperty;
+import org.tizen.emulator.manager.vms.xml.DeviceType;
+import org.tizen.emulator.manager.vms.xml.DisplayType;
+
+
+// TODO: Support dynamic column editing...
+public class ContentProvider {
+       static final int numberOfColumns = 4;
+       
+       String[] columnTitles = new String[] { "Name", "Resolution", "Density", "RAM size" };
+       
+       public String[] getColumnTitles() {
+               return columnTitles;
+       }
+
+       public int getNumberOfColumns() {
+               return numberOfColumns;
+       }
+       
+       public String[] getColumnContents(VMsProperty property) {
+               String[] texts = new String[numberOfColumns];
+               
+               texts[0] = property.getName();
+               
+               DeviceType deviceType = property.getConfiguration().getDevice();
+               DisplayType displayType = deviceType.getDisplay();
+               texts[1] = displayType.getResolution().getWidth()
+                               + " x " + displayType.getResolution().getHeight();
+               
+               texts[2] = displayType.getDensity().getValue() + "";
+               texts[3] = deviceType.getRAM().getSize().getValue() + "";
+                               
+               return texts;
+       }
+
+}
diff --git a/src/org/tizen/emulator/manager/ui/table/ContextMenu.java b/src/org/tizen/emulator/manager/ui/table/ContextMenu.java
new file mode 100644 (file)
index 0000000..92375c7
--- /dev/null
@@ -0,0 +1,92 @@
+package org.tizen.emulator.manager.ui.table;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.tizen.emulator.manager.EmulatorManager;
+import org.tizen.emulator.manager.vms.VMsProperty;
+
+public class ContextMenu {
+       Menu treeMenu;
+
+       public Menu getMenu() {
+               return treeMenu;
+       }
+
+       public void prepare(final Tree vmsTree) {
+               treeMenu = new Menu(vmsTree);
+               
+               final MenuItem launchItem = new MenuItem(treeMenu, SWT.NONE);
+               launchItem.setText("Launch");
+               launchItem.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               if(vmsTree.getSelectionCount() > 1)
+                                       return;
+                               
+                               VMsProperty property = ((PropertyContent)vmsTree.getSelection()[0].getData()).property;
+                               EmulatorManager.getInstance().launchVM(property);
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                       }
+               });
+               final MenuItem modifyItem = new MenuItem(treeMenu, SWT.NONE);
+               modifyItem.setText("Modify");
+               final MenuItem deleteItem = new MenuItem(treeMenu, SWT.NONE);
+               deleteItem.setText("Delete");
+               final MenuItem resetItem = new MenuItem(treeMenu, SWT.NONE);
+               resetItem.setText("Reset");
+               
+               new MenuItem(treeMenu, SWT.SEPARATOR);
+               
+               final MenuItem createItem = new MenuItem(treeMenu, SWT.NONE);
+               createItem.setText("Create");           
+               
+               treeMenu.addMenuListener(new MenuListener() {
+                       @Override
+                       public void menuShown(MenuEvent e) {
+                               if(vmsTree.getSelectionCount() == 0)
+                                       return;
+                               
+                               for(MenuItem menuItem : treeMenu.getItems()) {
+                                       menuItem.setEnabled(true);
+                               }
+                               
+                               if(vmsTree.getSelectionCount() > 1) {
+                                       for(TreeItem treeItem : vmsTree.getSelection()) {
+                                               RowItem rowItem = (RowItem)treeItem.getData();
+                                               if(rowItem instanceof TreeMarker) {
+                                                       deleteItem.setEnabled(false);
+                                                       resetItem.setEnabled(false);
+                                                       break;
+                                               }
+                                       }
+                                       createItem.setEnabled(false);
+                                       launchItem.setEnabled(false);
+                                       modifyItem.setEnabled(false);
+                               }
+                               else {
+                                       if(vmsTree.getSelection()[0].getData() instanceof TreeMarker) {
+                                               launchItem.setEnabled(false);
+                                               deleteItem.setEnabled(false);
+                                               resetItem.setEnabled(false);
+                                               modifyItem.setEnabled(false);
+                                               
+                                               return;
+                                       }
+                               }
+                       }
+                       
+                       @Override
+                       public void menuHidden(MenuEvent e) {}
+               });
+       }
+
+}
diff --git a/src/org/tizen/emulator/manager/ui/table/RowItem.java b/src/org/tizen/emulator/manager/ui/table/RowItem.java
new file mode 100644 (file)
index 0000000..1cabdd6
--- /dev/null
@@ -0,0 +1,39 @@
+package org.tizen.emulator.manager.ui.table;
+
+import org.eclipse.swt.widgets.TreeItem;
+import org.tizen.emulator.manager.vms.VMsProperty;
+
+public abstract class RowItem {}
+
+class PropertyContent extends RowItem {
+       VMsProperty property;
+       
+       public PropertyContent(VMsProperty property, ContentProvider provider, TreeItem item) {
+               this.property = property;
+               item.setText(provider.getColumnContents(property));
+       }
+}
+
+abstract class TreeMarker extends RowItem {
+       public TreeMarker(String text, TreeItem item) {
+               item.setText(text);
+       }       
+}
+
+class CreateMarker extends TreeMarker {
+       public CreateMarker(TreeItem item) {
+               super("<< Create new VM >>\t\t", item);
+       }
+}
+
+class StandardVMsMarker extends TreeMarker {
+       public StandardVMsMarker(String version, TreeItem item) {
+               super(version, item);
+       }
+}
+
+class CustomVMsMarker extends TreeMarker {
+       public CustomVMsMarker(TreeItem item) {
+               super("Custom", item);
+       }
+}
diff --git a/src/org/tizen/emulator/manager/ui/table/VMsTable.java b/src/org/tizen/emulator/manager/ui/table/VMsTable.java
new file mode 100644 (file)
index 0000000..e71ecd2
--- /dev/null
@@ -0,0 +1,174 @@
+package org.tizen.emulator.manager.ui.table;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+import org.tizen.emulator.manager.EmulatorManager;
+import org.tizen.emulator.manager.ui.MainDialog;
+import org.tizen.emulator.manager.vms.EmulatorVMs;
+import org.tizen.emulator.manager.vms.VMsProperty;
+import org.tizen.emulator.manager.vms.VMsProperty.Architecture;
+import org.tizen.emulator.manager.vms.VMsProperty.FSImageType;
+
+public class VMsTable {
+       MainDialog mainDialog;
+       
+       Tree vmsTree;
+       ContentProvider contentProvider = new ContentProvider();
+       ContextMenu contextMenu = new ContextMenu();
+       
+       EmulatorVMs fsImage = EmulatorVMs.getInstance();
+       
+       public VMsTable(MainDialog mainDialog, Composite parent) {
+               this.mainDialog = mainDialog;
+               
+               this.vmsTree = new Tree(parent, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
+               
+               vmsTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+               
+               vmsTree.setHeaderVisible(true);
+               vmsTree.setLinesVisible(true);
+               
+               for(String columnTitle : contentProvider.getColumnTitles()) {
+                       TreeColumn treeColumn = new TreeColumn(vmsTree, SWT.NONE);
+                       treeColumn.setText(columnTitle);
+               }
+                               
+               refreshTableList();
+               pack();
+
+               contextMenu.prepare(vmsTree);
+               Menu tableMenu = contextMenu.getMenu();
+               vmsTree.setMenu(tableMenu);
+               
+               vmsTree.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               if(vmsTree.getSelectionCount() == 0)
+                                       return;
+                               
+                               if(vmsTree.getSelectionCount() > 1) {
+                                       VMsTable.this.mainDialog.closeDetailView();
+                               }
+                               else {
+                                       Object data = vmsTree.getSelection()[0].getData();
+                                       
+                                       if(!(data instanceof RowItem))
+                                               return;
+                                       
+                                       if (vmsTree.getSelection()[0].getData() instanceof CreateMarker) {
+                                               if (vmsTree.getSelection()[0].getParentItem().getText().equals("Custom")) {
+                                                       VMsTable.this.mainDialog.openCreateView(false);
+                                               } else {
+                                                       VMsTable.this.mainDialog.openCreateView(true);
+                                               }
+                                               return;
+                                       }
+
+                                       if(vmsTree.getSelection()[0].getData() instanceof TreeMarker) {
+                                               VMsTable.this.mainDialog.closeDetailView();
+                                               return;
+                                       }
+                                                                               
+                                       PropertyContent content = (PropertyContent)data;
+                                       VMsTable.this.mainDialog.openDetailView(content.property);
+                               }
+                       }
+                       
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               if(vmsTree.getSelectionCount() > 1) {
+                                       return;
+                               }
+                               if(vmsTree.getSelection()[0].getData() instanceof TreeMarker)
+                                       return;
+
+                               VMsProperty property = ((PropertyContent)vmsTree.getSelection()[0].getData()).property;
+                               EmulatorManager.getInstance().launchVM(property);
+                       }
+               });
+       }
+       
+       private void pack() {
+               for(TreeColumn column : vmsTree.getColumns()) {
+                       column.pack();
+               }
+               vmsTree.pack();
+       }
+
+       public void refreshTableList() {
+               refreshTableList(null);
+       }
+       
+       private void refreshTableList(String text) {
+               boolean x86Selected = mainDialog.x86RadioButton.getSelection();
+               boolean armSelected = mainDialog.armRadioButton.getSelection();         
+               
+               vmsTree.removeAll();
+               
+               VMsProperty[] properties = (VMsProperty[])fsImage.getProperties();
+
+               RowItem rowItem = null;
+               
+               TreeItem customItem = new TreeItem(vmsTree, SWT.NONE);
+               rowItem = new CustomVMsMarker(customItem);
+               customItem.setData(rowItem);
+               
+               TreeItem createItem = new TreeItem(customItem, SWT.NONE);
+               rowItem = new CreateMarker(createItem);
+               createItem.setData(rowItem);
+               
+               Map<String, TreeItem> itemsMap = new HashMap<String, TreeItem>();
+               
+               for(int i = 0; i < properties.length; ++i) {
+                       if((properties[i].getArch() == Architecture.x86 && x86Selected) ||
+                                       (properties[i].getArch() == Architecture.ARM && armSelected)){
+                               if(text != null && !properties[i].getName().startsWith(text)) {
+                                       continue;
+                               }
+
+                               TreeItem propertyItem = null;
+                               if(FSImageType.standard == properties[i].getImageType()) {
+                                       String version = properties[i].getConfiguration().getBaseInformation().getDiskImage().getVersion();
+                                       propertyItem = itemsMap.get(version);
+                                       if(propertyItem == null) {
+                                               propertyItem = new TreeItem(vmsTree, SWT.NONE);
+                                               rowItem = new StandardVMsMarker(version, propertyItem);
+                                               propertyItem.setData(rowItem);
+                                               
+                                               createItem = new TreeItem(propertyItem, SWT.NONE);
+                                               rowItem = new CreateMarker(createItem);
+                                               createItem.setData(rowItem);
+                                               
+                                               itemsMap.put(version, propertyItem);
+                                       }
+                                               
+                                       propertyItem = new TreeItem(propertyItem, SWT.NONE);
+                               }
+                               else {
+                                       propertyItem = new TreeItem(customItem, SWT.NONE);                                      
+                               }
+                               
+                               rowItem = new PropertyContent(properties[i], contentProvider, propertyItem);
+                               propertyItem.setData(rowItem);
+                       }
+               }
+               
+               
+               createItem.setExpanded(true);
+               customItem.setExpanded(true);
+               for(TreeItem item : itemsMap.values()) {
+                       item.setExpanded(true);
+               }
+               
+       }       
+}
\ No newline at end of file
diff --git a/src/org/tizen/emulator/manager/vms/EmulatorVMs.java b/src/org/tizen/emulator/manager/vms/EmulatorVMs.java
new file mode 100644 (file)
index 0000000..9535d98
--- /dev/null
@@ -0,0 +1,202 @@
+package org.tizen.emulator.manager.vms;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.transform.stream.StreamSource;
+
+import org.tizen.emulator.manager.vms.VMsProperty.Architecture;
+import org.tizen.emulator.manager.vms.xml.EmulatorConfiguration;
+import org.tizen.emulator.manager.vms.xml.ObjectFactory;
+
+
+public class EmulatorVMs {
+       static EmulatorVMs instance = null;
+
+       static {
+               synchronized(EmulatorVMs.class) {
+                       instance = new EmulatorVMs();
+               }
+       }
+       
+       String vmsBaseDirectoryName = System.getProperty("user.dir") + 
+                       File.separator + "test" + File.separator + "tizen_vms";
+       List<VMsProperty> propertiesList = new ArrayList<VMsProperty>();
+       
+       ObjectFactory objectFactory = new ObjectFactory();
+       
+       public static EmulatorVMs getInstance() {
+               return instance;
+       }
+       
+       public void setVMsBaseDirectory(String baseVMsDir) {
+               vmsBaseDirectoryName = baseVMsDir;
+       }       
+       
+       public String getVMsBaseDirectory() {
+               return this.vmsBaseDirectoryName;
+       }
+       
+       public ObjectFactory getObjectFactory() {
+               return objectFactory;
+       }
+       
+       public void refreshProperties() {
+               try {
+                       loadProperties();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+       
+       public void loadProperties() throws Exception {
+               propertiesList.clear();
+               // traverse VMs...
+               File vmsBaseDirectory = new File(vmsBaseDirectoryName);
+               
+               for(File archDir : vmsBaseDirectory.listFiles(new FileFilter() {
+                       
+                       @Override
+                       public boolean accept(File pathname) {
+                               if(!pathname.isDirectory())
+                                       return false;
+                               
+                               if("x86".equals(pathname.getName()) || "arm".equals(pathname.getName()))
+                                       return true;
+                               
+                               return false;
+                       }
+               })) {
+                       
+                       for(File vmsDir : archDir.listFiles(new FileFilter() {
+                               
+                               @Override
+                               public boolean accept(File pathname) {
+                                       if(!pathname.isDirectory())
+                                               return false;
+                                       
+                                       return true;
+                               }
+                       })) {
+                               
+                               String configFilename = vmsDir.getName() + ".xml";
+                               File configFile = new File(vmsDir, configFilename);
+                               if(!configFile.exists())
+                                       throw new Exception(); // FIXME
+                               
+                               VMsProperty property = parseXML(configFile);
+                               
+                               propertiesList.add(property);
+                       }
+               }
+       }
+
+       private VMsProperty parseXML(File configFile) {
+               JAXBContext context = null;
+               JAXBElement<EmulatorConfiguration> element = null;
+               
+               try {
+                       context = JAXBContext.newInstance(EmulatorConfiguration.class);
+                       
+                       Unmarshaller unmarshaller = context.createUnmarshaller();
+                       element = unmarshaller.unmarshal(new StreamSource(configFile), EmulatorConfiguration.class);
+               } catch (JAXBException e) {
+                       e.printStackTrace();
+               }
+               
+               return new VMsProperty(configFile, element.getValue());
+       }
+       
+       public VMsProperty getProperty(String name) {
+               if(name == null) return null;
+               
+               for(VMsProperty property : propertiesList) {
+                       if(name.equals(property.getName()))
+                                       return property;
+               }
+               
+               return null;
+       }
+       
+       public VMsProperty[] getProperties() {
+               return propertiesList.toArray(new VMsProperty[propertiesList.size()]);
+       }       
+
+       public boolean storeXML(VMsProperty property) {
+               JAXBContext context = null;
+               
+               try {
+                       context = JAXBContext.newInstance(EmulatorConfiguration.class);
+                       Marshaller marshaller = context.createMarshaller();
+                       marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+                       marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+                       
+                       if(!property.configFile.exists()) {
+                               property.configFile.getParentFile().mkdirs();
+                       }
+                               
+                       marshaller.marshal(property.getConfiguration(), new FileOutputStream(property.configFile));
+               } catch (JAXBException e) {
+                       e.printStackTrace();
+                       
+                       return false;
+               } catch (FileNotFoundException e) {
+                       e.printStackTrace();
+                       
+                       return false;
+               }
+               
+               return true;
+       }
+       
+       public VMsProperty getNewProperty(String name, Architecture arch) {
+               String configDirectoryName = vmsBaseDirectoryName + File.separator + 
+                               arch.toString() + File.separator + name;
+               String configFilename = configDirectoryName + File.separator + name + ".xml";
+       
+               File configFile = new File(configFilename);
+               
+               EmulatorConfiguration ec = objectFactory.createEmulatorConfiguration();
+               
+//             ec.setBaseInformation(objectFactory.createBaseInformationType());
+//             ec.setUsability(objectFactory.createUsabilityType());
+//             ec.setSkin(objectFactory.createSkinType());
+//             
+//             ec.getBaseInformation().setName(name);
+//             ec.getBaseInformation().setArchitecture(arch.toString());
+//             ec.getBaseInformation().getDiskImage().setType("standard");
+//             ec.getBaseInformation().getDiskImage().setBaseDiskImage(objectFactory.createDiskImageFormatType());
+//             ec.getBaseInformation().getDiskImage().getBaseDiskImage().setFormat("qcow2");
+//             ec.getBaseInformation().getDiskImage().getBaseDiskImage().setValue("path");
+//             .
+//             .
+//             .
+               
+               return new VMsProperty(configFile, ec);
+       }
+       
+       public static void main(String[] args) {
+               EmulatorVMs fsImage = EmulatorVMs.getInstance();
+               try {
+                       fsImage.loadProperties();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+               
+               for(VMsProperty property : fsImage.getProperties()) {
+                       System.out.println(property.getName());
+               }
+               
+               VMsProperty property = fsImage.getNewProperty("test6", Architecture.x86);
+               fsImage.storeXML(property);
+       }
+}
diff --git a/src/org/tizen/emulator/manager/vms/VMsProperty.java b/src/org/tizen/emulator/manager/vms/VMsProperty.java
new file mode 100644 (file)
index 0000000..273d54b
--- /dev/null
@@ -0,0 +1,69 @@
+package org.tizen.emulator.manager.vms;
+
+import java.io.File;
+
+import org.tizen.emulator.manager.vms.xml.EmulatorConfiguration;
+
+public class VMsProperty {
+       File configFile;
+       
+       EmulatorConfiguration rootElement;
+       
+       public VMsProperty(File configFile, EmulatorConfiguration element) {
+               this.configFile = configFile;
+               this.rootElement = element;
+       }       
+
+       public String getName() {
+               if(rootElement.getBaseInformation() == null)
+                       return null;
+               
+               return rootElement.getBaseInformation().getName();
+       }
+       public Architecture getArch() {
+               if(rootElement.getBaseInformation() == null)
+                       return null;
+               
+               return Architecture.x86.toString().equals(rootElement.getBaseInformation().getArchitecture()) ? 
+                               Architecture.x86 : Architecture.ARM;
+       }
+       public FSImageType getImageType() {
+               if(rootElement.getBaseInformation() == null || rootElement.getBaseInformation().getDiskImage() == null)
+                       return null;
+
+               return FSImageType.standard.toString().equals(rootElement.getBaseInformation().getDiskImage().getType()) ?
+                               FSImageType.standard : FSImageType.custom;
+       }
+       
+       public EmulatorConfiguration getConfiguration() {
+               return rootElement;
+       }
+       
+       public enum Architecture {
+               x86("x86"), ARM("ARM");
+               
+               private String arch;
+               
+               Architecture(String arch) {
+                       this.arch = arch;
+               }
+
+               public String toString() {
+                       return arch;
+               }
+       };
+
+       public enum FSImageType {
+               standard("standard"), custom("custom");
+               
+               private String type;
+               
+               FSImageType(String type) {
+                       this.type = type;
+               }
+
+               public String toString() {
+                       return type;
+               }       
+       };
+}
\ No newline at end of file
diff --git a/src/org/tizen/emulator/manager/vt/VirtualTargetForm.java b/src/org/tizen/emulator/manager/vt/VirtualTargetForm.java
new file mode 100644 (file)
index 0000000..f4e46d5
--- /dev/null
@@ -0,0 +1,440 @@
+package org.tizen.emulator.manager.vt;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.TableEditor;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.tizen.emulator.manager.vms.VMsProperty;
+
+public class VirtualTargetForm {
+       protected VirtualTargetHelper   helper;
+       protected VirtualTargetWidget   widget;
+       protected VirtualTargetProcess  process;
+       protected VMsProperty                   property;
+       protected Image                                 image           = null;
+       protected boolean                               isModify        = false;
+       protected VirtualTargetValue    oldTarget       = null;
+       protected VirtualTargetValue    newTarget       = null;
+
+       public void create(VirtualTargetWidget widget, VMsProperty property, boolean isModify, boolean isDefaultImage) {
+               this.helper = new VirtualTargetHelper();
+               if (isModify) {
+                       this.process = new ModifyVirtualTargetProcess();
+               } else {
+                       this.process = new CreateVirtualTargetProcess();
+               }
+               this.widget     = widget;
+               this.property   = property;
+               this.isModify   = isModify;
+               this.image      = new Image(widget.display, "res/folder.gif");
+
+               if (isModify) {
+                       oldTarget = new VirtualTargetValue();
+                       helper.settingTargetValue(property, oldTarget);
+                       newTarget = new VirtualTargetValue(oldTarget);
+               } else {
+                       oldTarget = new VirtualTargetValue();
+                       oldTarget.defaultSetting();
+                       oldTarget.isDefaultImage = isDefaultImage;
+                       newTarget = new VirtualTargetValue(oldTarget);
+               }
+
+               createNameArea(widget.table);
+               createBaseImageArea(widget.table);
+               createDisplayArea(widget.table);
+               createSDCardArea(widget.table);
+               createRamSizeArea(widget.table);
+               createFileShareArea(widget.table);
+
+               widget.cancelButton.setText("Cancel");
+               widget.confirmButton.setText("Confirm");
+               if (!isModify) {
+                       widget.confirmButton.setEnabled(false);
+               }
+       }
+
+       static final int MAX_NAME_LEN = 20;
+       private void createNameArea(Table table) {
+               TableItem item = new TableItem(table, SWT.NONE);
+               item.setText(0, "Image Name");
+
+               widget.imageNameText = new Text(table, SWT.BORDER);
+               widget.imageNameText.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
+               widget.imageNameText.setTextLimit(MAX_NAME_LEN);
+               widget.imageNameText.setText(oldTarget.imageName);
+               
+               TableEditor editor = new TableEditor(table);
+               editor.grabHorizontal = true;
+               editor.setEditor(widget.imageNameText, item, 1);
+
+               if (isModify) {
+                       widget.imageNameText.setEnabled(false);
+               } else {
+                       widget.nameinfoLabel = new Label(table, SWT.WRAP);
+                       widget.nameinfoLabel.setText("Input image name");
+                       widget.imageNameText .addModifyListener(new ModifyListener() {
+                               @Override
+                               public void modifyText(ModifyEvent e) {
+                                       newTarget.imageName = widget.imageNameText.getText();
+                                       checkImageName();
+                                       
+                               }
+                       });
+
+                       TableItem item2 = new TableItem(table, SWT.NONE);
+                       editor = new TableEditor(table);
+                       editor.grabHorizontal = true;
+                       editor.setEditor(widget.nameinfoLabel, item2, 1);
+               }
+       }
+
+       private void checkImageName() {
+               if (newTarget.imageName.length() == MAX_NAME_LEN) {
+                       widget.nameinfoLabel.setText("Max of length is 20.");
+                       widget.confirmButton.setEnabled(false);
+                       return;
+               }
+               
+               if (!helper.checkString(newTarget.imageName)) {
+                       widget.nameinfoLabel.setText("Name is invalid!");
+                       widget.confirmButton.setEnabled(false);
+                       return;
+               }
+               
+               if (!oldTarget.imageName.equals(newTarget.imageName)
+                   && helper.checkDupulicateName(newTarget.imageName)) {
+                       widget.nameinfoLabel.setText("The same name exists!");
+                       widget.confirmButton.setEnabled(false);
+                       return;
+               }
+
+               widget.nameinfoLabel.setText("Input image name");
+               if (newTarget.imageName.isEmpty()) {
+                       widget.confirmButton.setEnabled(false);
+               } else {
+                       if (oldTarget.isDefaultImage) {
+                               widget.confirmButton.setEnabled(true);
+                       } else {
+                               if (!newTarget.baseImagePath.isEmpty()) {
+                                       widget.confirmButton.setEnabled(true);
+                               } else {
+                                       widget.confirmButton.setEnabled(false);
+                               }
+                       }
+               }
+               
+       }
+
+       private void createBaseImageArea(Table table) {
+               TableItem item = new TableItem(table, SWT.NONE);
+               if (!isModify) {
+                       if (oldTarget.isDefaultImage) {
+                               item.setText(0, "Default BaseImage");
+                       } else {
+                               item.setText(0, "Choose BaseImage");
+                       }
+               } else {
+                       item.setText(0, "BaseImage");
+               }
+
+               widget.selectBaseImageButton = new Button(table, SWT.PUSH);
+               widget.selectBaseImageButton.setImage(image);
+               if (isModify) {
+                       widget.selectBaseImageButton.setText(oldTarget.baseImagePath.substring(oldTarget.baseImagePath.lastIndexOf("/") + 1, oldTarget.baseImagePath.length()));
+               } else {
+                       if (oldTarget.isDefaultImage == true) {
+                               widget.selectBaseImageButton.setText("None");
+                       } else {
+                               widget.selectBaseImageButton.setText("");
+                               widget.selectBaseImageButton.addSelectionListener(new SelectionListener() {
+                                       @Override
+                                       public void widgetSelected(SelectionEvent e) {
+                                               if (widget.baseImageFD == null) {
+                                                       // TODO : x86 is hardcording
+                                                       widget.baseImageFD = new FileDialog(widget.table.getShell(), SWT.OPEN);
+                                                       widget.baseImageFD.setText(String.format("Select existing Base Image(%s)", "x86"));
+                                                       String[] filter = {String.format("*.%s", "x86")};
+                                                       String[] filterName = {String.format("Disk Image Files(*.%s)", "x86")};
+                                                       widget.baseImageFD.setFilterExtensions(filter);
+                                                       widget.baseImageFD.setFilterNames(filterName);
+                                               }
+       
+                                               String path = widget.baseImageFD.open();
+                                               if(path != null) {
+                                                       newTarget.baseImagePath = path;
+                                                       widget.selectBaseImageButton.setText(path.substring(path.lastIndexOf("/") + 1, path.length()));
+                                                       checkImageName();
+                                               }
+                                       }
+                                       @Override
+                                       public void widgetDefaultSelected(SelectionEvent e) {   
+                                       }
+                               });
+                       }
+               }
+
+               if (oldTarget.isDefaultImage || isModify) {
+                       widget.selectBaseImageButton.setEnabled(false);
+               } else {
+                       widget.selectBaseImageButton.setEnabled(true);
+               }
+
+               TableEditor editor = new TableEditor(table);
+               editor.grabHorizontal = true;
+               editor.setEditor(widget.selectBaseImageButton, item, 1);
+       }
+
+       private void createDisplayArea(Table table) {
+               TableItem item1 = new TableItem(table, SWT.NONE);
+               TableItem item2 = new TableItem(table, SWT.NONE);
+
+               item1.setText(0, "Display Resolution");
+
+               widget.resolutionCombo = helper.makeCombo(table);
+               helper.addComboItem(widget.resolutionCombo, DisplayResoultion.getInstance().getList(),
+                                                       DisplayResoultion.getInstance().findIndex(oldTarget.resolution));
+
+               widget.resolutionCombo.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               newTarget.resolution = widget.resolutionCombo.getItem(widget.resolutionCombo.getSelectionIndex());
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+
+                       }
+               });
+
+               TableEditor editor = new TableEditor(table);
+               editor.grabHorizontal = true;
+               editor.setEditor(widget.resolutionCombo, item1, 1);
+
+               item2.setText(0, "Display Density ");
+
+               widget.DIPspinner = new Spinner(table, SWT.READ_ONLY | SWT.BORDER);
+               widget.DIPspinner.setValues(oldTarget.dpi, 0, 10000, 0, 1, 1);
+               widget.DIPspinner.addModifyListener(new ModifyListener() {
+                       @Override
+                       public void modifyText(ModifyEvent e) {
+                               newTarget.dpi = widget.DIPspinner.getSelection();
+                       }
+               });
+
+               editor = new TableEditor(table);
+               editor.grabHorizontal = true;
+               editor.setEditor(widget.DIPspinner, item2, 1);
+       }
+
+       private void createSDCardArea(Table table) {
+               TableItem item1 = new TableItem(table, SWT.NONE);
+               TableItem item2 = new TableItem(table, SWT.NONE);
+
+               item1.setText(0, "SDCard Type");
+
+               widget.SDCardTypeCombo = helper.makeCombo(table);
+               helper.addComboItem(widget.SDCardTypeCombo, SupportType.getInstance().getList());
+               widget.SDCardTypeCombo.select(oldTarget.isSDCardSupport == true ? 0 : 1);
+        widget.SDCardTypeCombo.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               int index = widget.SDCardTypeCombo.getSelectionIndex();
+                               if (index == 0) { // supported
+                                       newTarget.isSDCardSupport = true;
+                                       widget.SDCardPathCombo.setEnabled(true);
+                               } else if (index == 1) { // not supported
+                                       newTarget.isSDCardSupport = false;
+                                       widget.SDCardPathCombo.setEnabled(false);
+                               }
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                       }
+               
+        });
+
+               TableEditor editor = new TableEditor(table);
+               editor.grabHorizontal = true;
+               editor.setEditor(widget.SDCardTypeCombo, item1, 1);
+
+               item2.setText(0,"SDCard Path ");
+
+               widget.SDCardPathCombo = helper.makeCombo(table);
+               helper.addComboItem(widget.SDCardPathCombo, SDCard.getInstance().getList());
+               if (oldTarget.isSDCardSupport == true) {
+                       widget.SDCardPathCombo.add(oldTarget.SDCardPath.substring(oldTarget.SDCardPath.lastIndexOf("/") + 1, oldTarget.SDCardPath.length()), 0);
+               } else {
+                       widget.SDCardPathCombo.add("None", 0);
+               }
+               widget.SDCardPathCombo.add("--Select Exist SDCard--", SDCard.getInstance().size() + 1);
+               widget.SDCardPathCombo.select(0);
+               widget.SDCardPathCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+               widget.SDCardPathCombo.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               int i = widget.SDCardPathCombo.getSelectionIndex();
+                               if (i == SDCard.getInstance().size() + 1) { // Select Exist SDCard
+                                       if (widget.SDImageFD == null) {
+                                               widget.SDImageFD = new FileDialog(widget.table.getShell(), SWT.OPEN);
+                                               widget.SDImageFD.setText("Select an existing SD card");
+                                               String[] filter = {"*.img"};
+                                               String[] filterName = {"SD Card Image Files(*.img)"};
+                                               widget.SDImageFD.setFilterExtensions(filter);
+                                               widget.SDImageFD.setFilterNames(filterName);
+                                       }
+                                       String path = widget.SDImageFD.open();
+                                       if(path != null) {
+                                               newTarget.SDCardPath = path;
+                                               widget.SDCardPathCombo.remove(0);
+                                               widget.SDCardPathCombo.add(path.substring(path.lastIndexOf("/") + 1, path.length()), 0);
+                                               widget.SDCardPathCombo.select(0);
+                                       }
+                               } else if (i != 0) {
+                                       newTarget.SDCardPath = widget.SDCardPathCombo.getItem(i);
+                               }
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                       }
+               });
+
+               if (oldTarget.isSDCardSupport == true) {
+                       widget.SDCardPathCombo.setEnabled(true);
+               } else {
+                       widget.SDCardPathCombo.setEnabled(false);
+               }
+
+               editor = new TableEditor(table);
+               editor.grabHorizontal = true;
+               editor.setEditor(widget.SDCardPathCombo, item2, 1);
+       }
+
+       private void createRamSizeArea(Table table) {
+               TableItem item1 = new TableItem(table, SWT.NONE);
+
+               item1.setText(0, "Ram Size ");
+               
+               widget.ramSizeCombo = helper.makeCombo(table);
+               helper.addComboItem(widget.ramSizeCombo, RamSize.getInstance().getList(),
+                               RamSize.getInstance().findIndex(String.valueOf(oldTarget.ramSize)));
+               widget.ramSizeCombo.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               String str = widget.ramSizeCombo.getItem(widget.ramSizeCombo.getSelectionIndex());
+                               newTarget.ramSize = Integer.valueOf(str.substring(0, str.length()-3));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                       }
+               });
+
+               TableEditor editor = new TableEditor(table);
+               editor.grabHorizontal = true;
+               editor.setEditor(widget.ramSizeCombo, item1, 1);
+       }
+
+       private void createFileShareArea(Table table) {
+               TableItem item1 = new TableItem(table, SWT.NONE);
+               TableItem item2 = new TableItem(table, SWT.NONE);
+
+               item1.setText(0, "File Sharing Type ");
+
+               widget.shareTypeCombo = helper.makeCombo(table);
+               helper.addComboItem(widget.shareTypeCombo, SupportType.getInstance().getList());
+               widget.shareTypeCombo.select(oldTarget.isFileShareSupport == true ? 0 : 1);
+               widget.shareTypeCombo.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               int index = widget.shareTypeCombo.getSelectionIndex();
+                               if (index == 0) { // supported
+                                       newTarget.isFileShareSupport = true;
+                                       widget.selectShareFolderButton.setEnabled(true);
+                               } else if (index == 1) { // not supported
+                                       newTarget.isFileShareSupport = false;
+                                       widget.selectShareFolderButton.setEnabled(false);
+                               }
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                       }
+        });
+
+               TableEditor editor = new TableEditor(table);
+               editor.grabHorizontal = true;
+               editor.setEditor(widget.shareTypeCombo, item1, 1);
+
+               item2.setText(0, "File Sharing Path ");
+               
+               widget.selectShareFolderButton = new Button(table, SWT.PUSH);
+               widget.selectShareFolderButton.setImage(image);
+               if (oldTarget.isFileShareSupport == true) {
+                       widget.selectShareFolderButton.setText(oldTarget.fileSharePath.substring(oldTarget.fileSharePath.lastIndexOf("/") + 1, oldTarget.fileSharePath.length()));
+               } else {
+                       widget.selectShareFolderButton.setText("None");
+               }
+               widget.selectShareFolderButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               if (widget.shareFileDD == null) {
+                                       widget.shareFileDD = new DirectoryDialog(widget.table.getShell(), SWT.OPEN);
+                                       widget.shareFileDD.setText("Select a Direcory");
+                               }
+                               String path = widget.shareFileDD.open();
+                               if(path != null) {
+                                       newTarget.fileSharePath = path;
+                                       widget.selectShareFolderButton.setText(path.substring(path.lastIndexOf("/") + 1, path.length()));
+                               }
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {   
+                       }
+               });
+
+               if (oldTarget.isFileShareSupport == true) {
+                       widget.selectShareFolderButton.setEnabled(true);
+               } else {
+                       widget.selectShareFolderButton.setEnabled(false);
+               }
+               editor = new TableEditor(table);
+               editor.grabHorizontal = true;
+               editor.setEditor(widget.selectShareFolderButton, item2, 1);
+       }
+
+       public void close() {
+               widget.close();
+       }
+
+       public VMsProperty confirm() {
+               VMsProperty p = null;
+               if (isModify) {
+                       p = process.modify(property, oldTarget, newTarget);
+               } else {
+                       p = process.create(property, oldTarget, newTarget);
+               }
+               MessageBox msg = new MessageBox(widget.table.getShell(), SWT.ICON_INFORMATION);
+               msg.setText("INFO");
+               if (p != null) {
+                       if (isModify) {
+                               msg.setMessage("Success modifying virtual target!");    
+                       } else {
+                               msg.setMessage("Success creating virtual target!");     
+                       }
+               } else {
+                       msg.setMessage(process.getErrorMessage());
+               }
+               msg.open();
+               return p;
+       }
+}
diff --git a/src/org/tizen/emulator/manager/vt/VirtualTargetHelper.java b/src/org/tizen/emulator/manager/vt/VirtualTargetHelper.java
new file mode 100644 (file)
index 0000000..d245b55
--- /dev/null
@@ -0,0 +1,100 @@
+package org.tizen.emulator.manager.vt;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.tizen.emulator.manager.vms.EmulatorVMs;
+import org.tizen.emulator.manager.vms.VMsProperty;
+import org.tizen.emulator.manager.vms.VMsProperty.Architecture;
+import org.tizen.emulator.manager.vms.xml.DisplayType.Resolution;
+
+class VirtualTargetHelper {
+       public boolean checkString(String t) {
+               for(char ch : t.toCharArray()) {
+                       if((ch >= 'a' && ch <= 'z') || 
+                                       (ch >= 'A' && ch <= 'Z') || 
+                                       (ch >='0' && ch <= '9') || 
+                                       (ch == '-') || (ch == '_')) {
+                               
+                       } else {
+                               return false;
+                       }
+
+               }
+               return true;
+       }
+
+       public boolean checkDupulicateName(String t) {
+               // TODO : only x86
+               VMsProperty[] properties = (VMsProperty[])EmulatorVMs.getInstance().getProperties();
+               for (VMsProperty p : properties) {
+                       if (p.getArch() !=  Architecture.x86) {
+                               continue;
+                       }
+                       if (p.getName().equals(t)) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+
+       public Combo makeCombo(Composite composite) {
+               Combo combo = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
+               combo.addListener(SWT.MouseWheel, new Listener() {
+
+                       @Override
+                       public void handleEvent(Event event) {
+                               event.doit = false;
+                               
+                       }
+               });
+               
+               GridData gd = new GridData(GridData.FILL, GridData.FILL, true, false);
+               combo.setLayoutData(gd);
+               return combo;
+       }
+       
+       public void addComboItem(Combo combo, Object[] items) {
+               addComboItem(combo, items, 0);
+       }
+
+       public void addComboItem(Combo combo, Object[] items, int defaultIndex) {
+               if (items == null || items.length == 0)
+                       return;
+
+               for (int i = 0; i < items.length; i++)
+                       combo.add(items[i].toString());
+
+               combo.select(defaultIndex);
+       }
+
+       public void settingTargetValue(VMsProperty property, VirtualTargetValue oldTarget) {
+               oldTarget.imageName = property.getName();
+               
+               oldTarget.isDefaultImage = property.getConfiguration().getBaseInformation().getDiskImage().getType().equals("standard") ? true : false;
+               oldTarget.baseImagePath = property.getConfiguration().getBaseInformation().getDiskImage().getBaseDiskImage().getValue();
+
+               Resolution re = property.getConfiguration().getDevice().getDisplay().getResolution();
+               oldTarget.resolutionType = re;
+               oldTarget.resolution = String.valueOf(re.getWidth()) + "x" + String.valueOf(re.getHeight());
+               oldTarget.dpi = property.getConfiguration().getDevice().getDisplay().getDensity().getValue();
+               oldTarget.SDCardPath = property.getConfiguration().getDevice().getStorage().getSDCard().getDiskImage();
+               if (oldTarget.SDCardPath != null && !oldTarget.SDCardPath.toLowerCase().equals("none")) {
+                       oldTarget.isSDCardSupport = true;
+               } else if (oldTarget.SDCardPath == null) {
+                       oldTarget.SDCardPath = "";
+               }
+               
+               oldTarget.fileSharePath = property.getConfiguration().getUsability().getFileSharing().getPath();
+               if (oldTarget.fileSharePath  != null && !oldTarget.fileSharePath.toLowerCase().equals("none")) {
+                       oldTarget.isFileShareSupport = true;
+               } else if (oldTarget.fileSharePath == null) {
+                       oldTarget.fileSharePath = "";
+               }
+               oldTarget.ramSize = property.getConfiguration().getDevice().getRAM().getSize().getValue();
+       }
+
+}
diff --git a/src/org/tizen/emulator/manager/vt/VirtualTargetProcess.java b/src/org/tizen/emulator/manager/vt/VirtualTargetProcess.java
new file mode 100644 (file)
index 0000000..d6cb435
--- /dev/null
@@ -0,0 +1,394 @@
+package org.tizen.emulator.manager.vt;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.emulator.manager.FileIO;
+import org.tizen.emulator.manager.vms.EmulatorVMs;
+import org.tizen.emulator.manager.vms.VMsProperty;
+import org.tizen.emulator.manager.vms.VMsProperty.Architecture;
+import org.tizen.emulator.manager.vms.xml.EmulatorConfiguration;
+import org.tizen.emulator.manager.vms.xml.ObjectFactory;
+
+class VirtualTargetProcess {
+       protected FileIO filePath;
+       private   String errorMessage;
+
+       public VirtualTargetProcess() {
+               filePath = new FileIO();
+               errorMessage = "Throw unknown error";
+       }
+
+       public VMsProperty modify(VMsProperty property,
+                       VirtualTargetValue oldTarget, VirtualTargetValue newTarget) {
+               return null;
+       }
+       public VMsProperty create(VMsProperty property,
+                       VirtualTargetValue oldTarget, VirtualTargetValue newTarget) {
+               return null;
+       }
+
+       public String getErrorMessage() {
+               return errorMessage;
+       }
+
+       public void setErrorMessage(String errorMessage) {
+               this.errorMessage = errorMessage;
+       }
+}
+
+class ModifyVirtualTargetProcess extends VirtualTargetProcess {
+       public VMsProperty modify(VMsProperty property,
+                       VirtualTargetValue oldTarget, VirtualTargetValue newTarget) {
+               if (!newTarget.resolution.equals(oldTarget.resolution)) {
+                       int i = newTarget.resolution.indexOf('x');
+                       oldTarget.resolutionType.setWidth(Integer.valueOf(newTarget.resolution.substring(0,i)));
+                       oldTarget.resolutionType.setHeight(Integer.valueOf(newTarget.resolution.substring(i+1,newTarget.resolution.length())));
+                       property.getConfiguration().getDevice().getDisplay().setResolution(oldTarget.resolutionType);
+               }
+               
+               if (newTarget.dpi != oldTarget.dpi) {
+                       property.getConfiguration().getDevice().getDisplay().getDensity().setValue(newTarget.dpi);
+               }
+
+               if (newTarget.isSDCardSupport != oldTarget.isSDCardSupport) {
+                       if (newTarget.isSDCardSupport) {
+                               if (!modifySDCard(newTarget)) {
+                                       return null;
+                               }
+                               property.getConfiguration().getDevice().getStorage().getSDCard().setDiskImage(newTarget.SDCardPath);
+                       } else {
+                               property.getConfiguration().getDevice().getStorage().getSDCard().setDiskImage("none");
+                       }
+               } else if (newTarget.isSDCardSupport && !newTarget.SDCardPath.equals(oldTarget.SDCardPath)) {
+                       if (!modifySDCard(newTarget)) {
+                               return null;
+                       }
+                       property.getConfiguration().getDevice().getStorage().getSDCard().setDiskImage(newTarget.SDCardPath);
+               }
+               
+               if (newTarget.ramSize != oldTarget.ramSize) {
+                       property.getConfiguration().getDevice().getRAM().getSize().setValue(newTarget.ramSize);
+               }
+               
+               if (newTarget.isFileShareSupport != oldTarget.isFileShareSupport) {
+                       if (newTarget.isFileShareSupport) {
+                               property.getConfiguration().getUsability().getFileSharing().setPath(newTarget.fileSharePath);
+                       } else {
+                               property.getConfiguration().getUsability().getFileSharing().setPath("none");
+                       }
+               } else if (newTarget.isFileShareSupport && !newTarget.fileSharePath.equals(oldTarget.fileSharePath)) {
+                       property.getConfiguration().getUsability().getFileSharing().setPath(newTarget.fileSharePath);
+               }
+
+               EmulatorVMs.getInstance().storeXML(property);
+
+               return property;
+       }
+
+       private boolean modifySDCard(VirtualTargetValue newTarget) {
+               if (newTarget.SDCardPath.endsWith("MB")) { // New
+                       String sdCardName = "sdcard_"+newTarget.SDCardPath.substring(0, newTarget.SDCardPath.length() - 3)+".img";
+                       String dataPath;
+                       try {
+                               dataPath = filePath.getDataPath() +"/" +sdCardName;
+                       } catch (IOException e1) {
+                               setErrorMessage("SD Card image create failed!");
+                               return false;
+                       }
+
+                       File src  = new File(dataPath);
+                       if(!src.exists()) {
+                               setErrorMessage("SD Card image create failed!");
+                               return false;
+                       }
+
+                       File dest = new File(filePath.getVirtualTargetPath(newTarget.imageName) + "/" + sdCardName);
+                       try {
+                               dest.createNewFile();
+                               newTarget.SDCardPath = dest.getAbsolutePath();
+                       } catch (IOException e) {
+                               setErrorMessage("SD Card image create failed!");
+                               return false;
+                       }
+                       
+                       FileReader in  = null;
+                       FileWriter out = null;
+                       try {
+                               in  = new FileReader(src);
+                               out = new FileWriter(dest);
+                               
+                               int c;
+                               while((c = in.read()) != -1) {
+                                       out.write(c);
+                               }
+                       } catch (FileNotFoundException e) {
+                               setErrorMessage("SD Card image create failed!");
+                               return false;
+                       } catch (IOException e) {
+                               setErrorMessage("SD Card image create failed!");
+                               return false;
+                       }finally {
+                               try {
+                                       if (in != null) in.close();
+                                       if (out != null) out.close();
+                               } catch (IOException e) {
+                               }
+                       }
+               } else {
+                       if (newTarget.SDCardPath == null || newTarget.SDCardPath.isEmpty()) {
+                               setErrorMessage("You didn't select an existing sdcard image!");
+                               return false;
+                       }
+                       
+                       if (newTarget.SDCardPath.equals("None")) {
+                               setErrorMessage("You didn't select an existing sdcard image!");
+                               return false;
+                       }
+               }
+
+               return true;
+       }
+}
+class CreateVirtualTargetProcess extends VirtualTargetProcess {
+       private String folderPath  = null;
+       private VMsProperty property;
+       //private VirtualTargetValue oldTarget;
+       private VirtualTargetValue newTarget;
+
+       public VMsProperty create(VMsProperty property,
+                       VirtualTargetValue oldTarget, VirtualTargetValue newTarget) {
+               //this.oldTarget = oldTarget;
+               this.newTarget = newTarget;
+
+               this.property = EmulatorVMs.getInstance().getNewProperty
+                                       (newTarget.imageName, Architecture.x86);
+
+               if (this.property == null) {
+                       setErrorMessage("Create failed virtual target property");
+                       return null;
+               }
+
+               // make directory
+               File folder = new File(filePath.getVirtualTargetPath(newTarget.imageName));
+               folderPath = folder.getAbsolutePath() + "/";
+
+               File log = new File(filePath.getVirtualTargetLogPath(newTarget.imageName));
+               settingProperty();
+
+               if (!createDiskImage()) {
+                       return null;
+               }
+
+               if (!createFileShare()) {
+                       return null;
+               }
+               
+               if (!createDisplay()) {
+                       return null;
+               }
+               
+               if (!createRam()) {
+                       return null;
+               }
+
+               if (!createSDCard()) {
+                       return null;
+               }
+
+               folder.mkdirs();
+               log.mkdir();
+               EmulatorVMs.getInstance().storeXML(this.property);
+               return this.property;
+       }
+
+       private ObjectFactory factory;
+       private EmulatorConfiguration ec;
+       private void settingProperty() {
+               factory = EmulatorVMs.getInstance().getObjectFactory();
+               ec = property.getConfiguration();
+               ec.setBaseInformation(factory.createBaseInformationType());
+               ec.setUsability(factory.createUsabilityType());
+               ec.setDevice(factory.createDeviceType());
+               
+               ec.getBaseInformation().setName(newTarget.imageName);
+               ec.getBaseInformation().setArchitecture(Architecture.x86.toString());
+       }
+
+       private boolean createDiskImage() {
+               ec.getBaseInformation().setDiskImage(factory.createBaseInformationTypeDiskImage());
+               if (newTarget.isDefaultImage) {
+                       ec.getBaseInformation().getDiskImage().setType("standard");
+                       // TODO : get version
+                       ec.getBaseInformation().getDiskImage().setVersion("1.0");
+               } else {
+                       ec.getBaseInformation().getDiskImage().setType("custom");
+               }
+
+               //
+               ec.getBaseInformation().getDiskImage().setBaseDiskImage(factory.createDiskImageFormatType());
+               ec.getBaseInformation().getDiskImage().setCurrentDiskImage(factory.createDiskImageFormatType());
+
+               if (newTarget.baseImagePath == null || newTarget.baseImagePath.isEmpty()) {
+                       try {
+                               newTarget.baseImagePath = filePath.getBaseimgPath();
+                       } catch (IOException e) {
+                               setErrorMessage("Base image does not exist.");
+                               return false;
+                       }
+               }
+               
+               if (!new File(newTarget.baseImagePath).exists()) {
+                       setErrorMessage("Base image does not exist.");
+                       return false;
+               }
+               
+               String exe_path;
+               try {
+                       exe_path = String.format("%s/qemu-img", filePath.getBinPath());
+               } catch (IOException e1) {
+                       e1.printStackTrace();
+                       return false;
+               }
+
+               List<String> cmd = new ArrayList<String>();
+               cmd.add(exe_path);
+               cmd.add("create");
+               cmd.add("-b");
+               cmd.add(newTarget.baseImagePath);
+               cmd.add("-f");
+               cmd.add("qcow2");
+               cmd.add(String.format("%semulimg-%s.%s", folderPath, newTarget.imageName, Architecture.x86.toString()));
+               ProcessBuilder pb = new ProcessBuilder(cmd);
+               try {
+                       pb.start();
+               } catch (IOException e) {
+                       setErrorMessage("Emulator image create failed!");
+                       return false;
+               }
+
+               // TODO :
+               ec.getBaseInformation().getDiskImage().getBaseDiskImage().setFormat("qcow2");
+               ec.getBaseInformation().getDiskImage().getBaseDiskImage().setValue(newTarget.baseImagePath);
+               ec.getBaseInformation().getDiskImage().getCurrentDiskImage().setFormat("qcow2");
+               ec.getBaseInformation().getDiskImage().getCurrentDiskImage().setValue(
+                               String.format("%semulimg-%s.%s", folderPath, newTarget.imageName, Architecture.x86.toString()));
+               return true;
+       }
+
+       // usability
+       private boolean createFileShare() {
+               ec.getUsability().setLogging(factory.createUsabilityTypeLogging());
+               ec.getUsability().getLogging().setLevel("NONE");
+               ec.getUsability().setHwVirtualization(true);
+
+               if (newTarget.isFileShareSupport) {
+                       if (newTarget.fileSharePath == null || newTarget.fileSharePath.isEmpty()) {
+                               setErrorMessage("You didn't select share path");
+                               return false;
+                       }
+               }
+               ec.getUsability().setFileSharing(factory.createUsabilityTypeFileSharing());
+               ec.getUsability().getFileSharing().setPath(newTarget.fileSharePath.isEmpty()
+                                                                               ? "none" : newTarget.fileSharePath);
+               return true;
+       }
+
+       // Device
+       private boolean createDisplay() {
+               ec.getDevice().setDisplay(factory.createDisplayType());
+
+               int i = newTarget.resolution.indexOf('x');
+               ec.getDevice().getDisplay().setResolution(factory.createDisplayTypeResolution());
+               ec.getDevice().getDisplay().getResolution().setWidth(Integer.valueOf(newTarget.resolution.substring(0,i)));
+               ec.getDevice().getDisplay().getResolution().setHeight(Integer.valueOf(newTarget.resolution.substring(i+1,newTarget.resolution.length())));
+               
+               ec.getDevice().getDisplay().setDensity(factory.createDisplayTypeDensity());
+               ec.getDevice().getDisplay().getDensity().setUnit("dpi");
+               ec.getDevice().getDisplay().getDensity().setValue(newTarget.dpi);
+               return true;
+       }
+
+       private boolean createRam() {
+               ec.getDevice().setRAM(factory.createRamType());
+               ec.getDevice().getRAM().setSize(factory.createRamTypeSize());
+               ec.getDevice().getRAM().getSize().setUnit("MiB");
+               ec.getDevice().getRAM().getSize().setValue(newTarget.ramSize);
+               return true;
+       }
+
+       private boolean createSDCard() {
+               ec.getDevice().setStorage(factory.createStorageType());
+               
+               if (newTarget.isSDCardSupport) {
+                       if (newTarget.SDCardPath.endsWith("MB")) { // New
+                               String sdCardName = "sdcard_"+newTarget.SDCardPath.substring(0, newTarget.SDCardPath.length() - 3)+".img";
+                               String dataPath;
+                               try {
+                                       dataPath = filePath.getDataPath() +"/" +sdCardName;
+                               } catch (IOException e1) {
+                                       setErrorMessage("SD Card image create failed!");
+                                       return false;
+                               }
+
+                               File src  = new File(dataPath);
+                               if(!src.exists()) {
+                                       setErrorMessage("SD Card image create failed!");
+                                       return false;
+                               }
+
+                               File dest = new File(folderPath + sdCardName);
+                               try {
+                                       dest.createNewFile();
+                                       newTarget.SDCardPath = dest.getAbsolutePath();
+                               } catch (IOException e) {
+                                       setErrorMessage("SD Card image create failed!");
+                                       return false;
+                               }
+                               
+                               FileReader in  = null;
+                               FileWriter out = null;
+                               try {
+                                       in  = new FileReader(src);
+                                       out = new FileWriter(dest);
+                                       
+                                       int c;
+                                       while((c = in.read()) != -1) {
+                                               out.write(c);
+                                       }
+                               } catch (FileNotFoundException e) {
+                                       setErrorMessage("SD Card image create failed!");
+                                       return false;
+                               } catch (IOException e) {
+                                       setErrorMessage("SD Card image create failed!");
+                                       return false;
+                               }finally {
+                                       try {
+                                               if (in != null) in.close();
+                                               if (out != null) out.close();
+                                       } catch (IOException e) {
+                                       }
+                               }
+                       } else {
+                               if (newTarget.SDCardPath == null || newTarget.SDCardPath.isEmpty()) {
+                                       setErrorMessage("You didn't select an existing sdcard image!");
+                                       return false;
+                               }
+                               if (newTarget.SDCardPath.equals("None")) {
+                                       setErrorMessage("You didn't select an existing sdcard image!");
+                                       return false;
+                               }
+                       }
+               }
+               
+               ec.getDevice().getStorage().setSDCard(factory.createStorageTypeSDCard());
+               ec.getDevice().getStorage().getSDCard().setDiskImage(
+                               newTarget.isSDCardSupport ? newTarget.SDCardPath : "none");
+               return true;
+       }
+}
diff --git a/src/org/tizen/emulator/manager/vt/VirtualTargetResource.java b/src/org/tizen/emulator/manager/vt/VirtualTargetResource.java
new file mode 100644 (file)
index 0000000..b4cded5
--- /dev/null
@@ -0,0 +1,159 @@
+package org.tizen.emulator.manager.vt;
+
+import java.util.ArrayList;
+
+class StringArrayResource
+{
+       private ArrayList<String> list;
+       private int defaultIndex = 0;
+
+       public StringArrayResource()
+       {
+               list = new ArrayList<String>();
+       }
+
+       public void add(int index, String element)
+       {
+               list.add(index, element);
+       }
+
+       public String[] getList()
+       {
+               return list.toArray(new String[size()]);
+       }
+       
+       public int size()
+       {
+               return list.size();
+       }
+       
+       public int getDefaultIndex()
+       {
+               return defaultIndex;
+       }
+       
+       public void setDefaultIndex(int index) {
+               defaultIndex = index;
+       }
+}
+
+class SupportType extends StringArrayResource
+{
+       private static SupportType support = new SupportType();
+       public static SupportType getInstance()
+       {
+               return support;
+       }
+
+       private SupportType()
+       {
+               add(0, "Supported");
+               add(1, "Not supported");
+               
+               setDefaultIndex(1);
+       }
+
+       public int findIndex(String type) {
+               String[] strArray = getList();
+               String s = null;
+               for (int i = 0; i < strArray.length; i++) {
+                       s = strArray[i];
+                       if (s.equals(type)) {
+                               return i;
+                       }
+               }
+               return getDefaultIndex();
+       }
+}
+
+class DisplayResoultion extends StringArrayResource
+{
+       private static DisplayResoultion resolution = new DisplayResoultion();
+       public static DisplayResoultion getInstance()
+       {
+               return resolution;
+       }
+
+       private DisplayResoultion()
+       {
+               add(0, "320x480");
+               add(1, "480x800");
+               add(2, "600x1024");
+               add(3, "720X1280");
+               
+               setDefaultIndex(3);
+       }
+       
+       public int findIndex(String r) {
+               String[] strArray = getList();
+               String s = null;
+               for (int i = 0; i < strArray.length; i++) {
+                       s = strArray[i];
+                       if (s.equals(r)) {
+                               return i;
+                       }
+               }
+               return getDefaultIndex();
+       }
+}
+
+class SDCard extends StringArrayResource
+{
+       private static SDCard capacity = new SDCard();
+       public static SDCard getInstance()
+       {
+               return capacity;
+       }
+
+       private SDCard()
+       {
+               add(0, "256 MB");
+               add(1, "512 MB");
+               add(2, "1024 MB");
+               add(3, "1536 MB");
+
+               setDefaultIndex(1);
+       }
+       
+       public int findIndex(String type) {
+               String[] strArray = getList();
+               String s = null;
+               for (int i = 0; i < strArray.length; i++) {
+                       s = strArray[i];
+                       if (s.contains(type)) {
+                               return i;
+                       }
+               }
+               return getDefaultIndex();
+       }
+}
+
+class RamSize extends StringArrayResource
+{
+       private static RamSize size = new RamSize();
+       public static RamSize getInstance()
+       {
+               return size;
+       }
+
+       private RamSize()
+       {
+               add(0, "512 MB");
+               add(1, "768 MB");
+               add(2, "1024 MB");
+               
+               setDefaultIndex(0);
+       }
+       
+       public int findIndex(String size) {
+               String[] strArray = getList();
+               String s = null;
+               for (int i = 0; i < strArray.length; i++) {
+                       s = strArray[i];
+                       if (s.contains(size)) {
+                               return i;
+                       }
+               }
+               return getDefaultIndex();
+       }
+}
diff --git a/src/org/tizen/emulator/manager/vt/VirtualTargetWidget.java b/src/org/tizen/emulator/manager/vt/VirtualTargetWidget.java
new file mode 100644 (file)
index 0000000..21ea3e8
--- /dev/null
@@ -0,0 +1,118 @@
+package org.tizen.emulator.manager.vt;
+
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Text;
+import org.tizen.emulator.manager.vms.xml.DisplayType.Resolution;
+
+public class VirtualTargetWidget {
+       public Display display;
+       public Table table;
+
+       public Text  imageNameText;
+       public Label nameinfoLabel;
+
+       public Button selectBaseImageButton;
+       public FileDialog baseImageFD;
+
+       public Combo resolutionCombo;
+       public Spinner DIPspinner;
+
+       public Combo  SDCardTypeCombo;
+       public Combo  SDCardPathCombo;
+       public FileDialog SDImageFD;
+       
+       public Combo ramSizeCombo;
+
+       public Combo  shareTypeCombo;
+       public Button selectShareFolderButton;
+       public DirectoryDialog shareFileDD;
+
+       public Button cancelButton;
+       public Button confirmButton;
+       
+       public void close() {
+               imageNameText.dispose();
+               if (nameinfoLabel != null)
+                       nameinfoLabel.dispose();
+               selectBaseImageButton.dispose();
+               resolutionCombo.dispose();
+               DIPspinner.dispose();
+               SDCardTypeCombo.dispose();
+               SDCardPathCombo.dispose();
+               ramSizeCombo.dispose();
+               shareTypeCombo.dispose();
+               selectShareFolderButton.dispose();
+       }
+}
+
+class VirtualTargetValue {
+       public String imageName;
+       
+       public boolean isDefaultImage;
+       public String baseImagePath;
+
+       public Resolution resolutionType;
+       public String resolution;
+       public int dpi;
+
+       public boolean isSDCardSupport;
+       public String SDCardPath;
+       
+       public int ramSize;
+       
+       public boolean isFileShareSupport; 
+       public String fileSharePath;
+
+       public VirtualTargetValue() {
+       }
+
+       public VirtualTargetValue(VirtualTargetValue oldTarget) {
+               imageName                       = oldTarget.imageName;
+
+               isDefaultImage          = oldTarget.isDefaultImage;
+               baseImagePath           = oldTarget.baseImagePath;
+
+               resolutionType          = oldTarget.resolutionType;
+               resolution                      = oldTarget.resolution;
+               dpi                             = oldTarget.dpi;
+
+               isSDCardSupport         = oldTarget.isSDCardSupport;
+               SDCardPath                      = oldTarget.SDCardPath;
+               
+               ramSize                         = oldTarget.ramSize;
+               
+               isFileShareSupport      = oldTarget.isFileShareSupport; 
+               fileSharePath           = oldTarget.fileSharePath;
+       }
+       
+       public void defaultSetting() {
+               imageName                       = "";
+               
+               isDefaultImage          = true;
+               baseImagePath           = "";
+
+               // TODO
+               // HD(720x1280)
+               resolutionType          = new Resolution();
+               resolutionType.setWidth(720);
+               resolutionType.setHeight(1280);
+               resolution                      = "720x1280";
+               dpi                             = 2070;
+
+               isSDCardSupport         = false;
+               SDCardPath                      = "";
+               
+               ramSize                         = 512;
+               
+               isFileShareSupport      = false; 
+               fileSharePath           = "";
+       }
+}
+
diff --git a/test/tizen_vms/arm/test1/test1.xml b/test/tizen_vms/arm/test1/test1.xml
new file mode 100644 (file)
index 0000000..2215293
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<EmulatorConfiguration xmlns="http://www.tizen.org/em" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.tizen.org/em em.xsd ">
+  <baseInformation>
+    <name>test1</name>
+    <architecture>ARM</architecture>
+    <diskImage type="standard" version="1.0">
+      <baseDiskImage format="qcow2">baseDiskImage</baseDiskImage>
+      <currentDiskImage format="qcow2">currentDiskImage</currentDiskImage>
+    </diskImage>
+  </baseInformation>
+  <usability>
+    <logging>
+      <level>NONE</level>
+    </logging>
+    <fileSharing>
+      <path>path</path>
+    </fileSharing>
+    <hwVirtualization>true</hwVirtualization>
+  </usability>
+  <device>
+    <display>
+      <resolution>
+        <width>480</width>
+        <height>800</height>
+      </resolution>
+      <density unit="dpi">2070</density>
+    </display>
+    <storage>
+      <SDCard/>
+    </storage>
+    <RAM>
+      <size unit="MiB">512</size>
+    </RAM>
+  </device>
+</EmulatorConfiguration>
diff --git a/test/tizen_vms/arm/test2/test2.xml b/test/tizen_vms/arm/test2/test2.xml
new file mode 100644 (file)
index 0000000..14fb33c
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<EmulatorConfiguration xmlns="http://www.tizen.org/em" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.tizen.org/em ../xsd/em.xsd ">
+  <baseInformation>
+    <name>test2</name>
+    <architecture>ARM</architecture>
+    <diskImage type="custom">
+      <baseDiskImage format="qcow2">baseDiskImage</baseDiskImage>
+      <currentDiskImage format="qcow2">currentDiskImage</currentDiskImage>
+    </diskImage>
+  </baseInformation>
+  <usability>
+    <logging>
+      <level>NONE</level>
+    </logging>
+    <fileSharing />
+    <hwVirtualization>true</hwVirtualization>
+  </usability>
+  <device>
+    <display>
+      <resolution>
+        <width>720</width>
+        <height>1280</height>
+      </resolution>
+      <density unit="dpi">2070</density>
+    </display>
+    <storage>
+      <SDCard/>
+    </storage>
+    <RAM>
+      <size unit="MiB">512</size>
+    </RAM>
+  </device>
+</EmulatorConfiguration>
diff --git a/test/tizen_vms/x86/test1/test1.xml b/test/tizen_vms/x86/test1/test1.xml
new file mode 100644 (file)
index 0000000..34f758d
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<EmulatorConfiguration xmlns="http://www.tizen.org/em" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.tizen.org/em em.xsd ">
+  <baseInformation>
+    <name>test1</name>
+    <architecture>x86</architecture>
+    <diskImage type="standard" version="1.0">
+      <baseDiskImage format="qcow2">baseDiskImage</baseDiskImage>
+      <currentDiskImage format="qcow2">currentDiskImage</currentDiskImage>
+    </diskImage>
+  </baseInformation>
+  <usability>
+    <logging>
+      <level>NONE</level>
+    </logging>
+    <fileSharing />
+    <hwVirtualization>true</hwVirtualization>
+  </usability>
+  <device>
+    <display>
+      <resolution>
+        <width>480</width>
+        <height>800</height>
+      </resolution>
+      <density unit="dpi">2070</density>
+    </display>
+    <storage>
+      <SDCard/>
+    </storage>
+    <RAM>
+      <size unit="MiB">512</size>
+    </RAM>
+  </device>
+</EmulatorConfiguration>
diff --git a/test/tizen_vms/x86/test2/test2.xml b/test/tizen_vms/x86/test2/test2.xml
new file mode 100644 (file)
index 0000000..4458635
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<EmulatorConfiguration xmlns="http://www.tizen.org/em">
+    <baseInformation>
+        <name>test2</name>
+        <architecture>x86</architecture>
+        <diskImage version="1.0" type="standard">
+            <baseDiskImage format="qcow2">baseDiskImage</baseDiskImage>
+            <currentDiskImage format="qcow2">currentDiskImage</currentDiskImage>
+        </diskImage>
+    </baseInformation>
+    <usability>
+        <logging>
+            <level>NONE</level>
+        </logging>
+        <fileSharing>
+            <path>path</path>
+        </fileSharing>
+        <hwVirtualization>true</hwVirtualization>
+    </usability>
+    <device>
+        <display>
+            <resolution>
+                <width>1024</width>
+                <height>800</height>
+            </resolution>
+            <density unit="dpi">2070</density>
+        </display>
+        <storage>
+            <SDCard/>
+        </storage>
+        <RAM>
+            <size unit="MiB">512</size>
+        </RAM>
+    </device>
+</EmulatorConfiguration>
diff --git a/test/tizen_vms/x86/test3/test3.xml b/test/tizen_vms/x86/test3/test3.xml
new file mode 100644 (file)
index 0000000..8ea494e
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<EmulatorConfiguration xmlns="http://www.tizen.org/em" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.tizen.org/em ../xsd/em.xsd ">
+  <baseInformation>
+    <name>test3</name>
+    <architecture>x86</architecture>
+    <diskImage type="standard" version="1.0">
+      <baseDiskImage format="qcow2">baseDiskImage</baseDiskImage>
+      <currentDiskImage format="qcow2">currentDiskImage</currentDiskImage>
+    </diskImage>
+  </baseInformation>
+  <usability>
+    <logging>
+      <level>NONE</level>
+    </logging>
+    <fileSharing>
+      <path>path</path>
+    </fileSharing>
+    <hwVirtualization>true</hwVirtualization>
+  </usability>
+  <device>
+    <display>
+      <resolution>
+        <width>720</width>
+        <height>1280</height>
+      </resolution>
+      <density unit="dpi">2070</density>
+    </display>
+    <storage>
+      <SDCard/>
+    </storage>
+    <RAM>
+      <size unit="MiB">512</size>
+    </RAM>
+  </device>
+</EmulatorConfiguration>
diff --git a/test/tizen_vms/x86/test4/test4.xml b/test/tizen_vms/x86/test4/test4.xml
new file mode 100644 (file)
index 0000000..7eb5a8e
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<EmulatorConfiguration xmlns="http://www.tizen.org/em" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.tizen.org/em ../xsd/em.xsd ">
+  <baseInformation>
+    <name>test4</name>
+    <architecture>x86</architecture>
+    <diskImage type="custom">
+      <baseDiskImage format="qcow2">baseDiskImage</baseDiskImage>
+      <currentDiskImage format="qcow2">currentDiskImage</currentDiskImage>
+    </diskImage>
+  </baseInformation>
+  <usability>
+    <logging>
+      <level>NONE</level>
+    </logging>
+    <fileSharing />
+    <hwVirtualization>true</hwVirtualization>
+  </usability>
+  <device>
+    <display>
+      <resolution>
+        <width>720</width>
+        <height>1280</height>
+      </resolution>
+      <density unit="dpi">2070</density>
+    </display>
+    <storage>
+      <SDCard/>
+    </storage>
+    <RAM>
+      <size unit="MiB">512</size>
+    </RAM>
+  </device>
+</EmulatorConfiguration>
diff --git a/xsd/em.xml b/xsd/em.xml
new file mode 100644 (file)
index 0000000..13c6685
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<EmulatorConfiguration xmlns="http://www.tizen.org/em" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.tizen.org/em em.xsd ">
+  <baseInformation>
+    <name>name</name>
+    <architecture>x86</architecture>
+    <diskImage type="standard">
+      <baseDiskImage format="qcow2">baseDiskImage</baseDiskImage>
+      <currentDiskImage format="qcow2">currentDiskImage</currentDiskImage>
+    </diskImage>
+  </baseInformation>
+  <usability>
+    <logging>
+      <level>NONE</level>
+    </logging>
+    <fileSharing/>
+    <hwVirtualization>true</hwVirtualization>
+  </usability>
+  <device>
+    <display>
+      <resolution>
+        <width>0</width>
+        <height>0</height>
+      </resolution>
+      <density unit="dpi">0</density>
+    </display>
+    <storage>
+      <SDCard/>
+    </storage>
+    <RAM>
+      <size unit="MiB">0</size>
+    </RAM>
+  </device>
+</EmulatorConfiguration>
diff --git a/xsd/em.xsd b/xsd/em.xsd
new file mode 100644 (file)
index 0000000..8d29c8a
--- /dev/null
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.tizen.org/em"
+       xmlns:em="http://www.tizen.org/em" elementFormDefault="qualified">
+
+       <element name="EmulatorConfiguration">
+               <complexType>
+                       <sequence>
+                               <element name="baseInformation" type="em:baseInformationType"
+                                       minOccurs="1" maxOccurs="1" />
+                               <element name="usability" type="em:usabilityType" minOccurs="1"
+                                       maxOccurs="1" />
+                               <element name="device" type="em:deviceType" minOccurs="1"
+                                       maxOccurs="1" />
+                               <element name="skin" type="em:skinType" minOccurs="0"
+                                       maxOccurs="1" />
+                       </sequence>
+               </complexType>
+       </element>
+
+       <complexType name="baseInformationType">
+               <sequence>
+                       <element name="name" type="string" minOccurs="1" maxOccurs="1" />
+                       <element name="architecture" minOccurs="1" maxOccurs="1">
+                               <simpleType>
+                                       <restriction base="NMTOKEN">
+                                               <enumeration value="x86" />
+                                               <enumeration value="ARM" />
+                                       </restriction>
+                               </simpleType>
+                       </element>
+                       <element name="diskImage" minOccurs="1" maxOccurs="1">
+                               <complexType>
+                                       <sequence>
+                                               <element name="baseDiskImage" type="em:diskImageFormatType"
+                                                       minOccurs="1" maxOccurs="1" />
+                                               <element name="currentDiskImage" type="em:diskImageFormatType"
+                                                       minOccurs="1" maxOccurs="1" />
+                                       </sequence>
+                                       <attribute name="type" use="required">
+                                               <simpleType>
+                                                       <restriction base="NMTOKEN">
+                                                               <enumeration value="standard" />
+                                                               <enumeration value="custom" />
+                                                       </restriction>
+                                               </simpleType>
+                                       </attribute>
+                                       <attribute name="version" type="string" use="optional" />
+                               </complexType>
+                       </element>
+               </sequence>
+       </complexType>
+
+       <complexType name="diskImageFormatType">
+               <simpleContent>
+                       <extension base="string">
+                               <attribute name="format" use="required">
+                                       <simpleType>
+                                               <restriction base="NMTOKEN">
+                                                       <enumeration value="qcow2" />
+                                                       <enumeration value="qed" />
+                                                       <enumeration value="raw" />
+                                               </restriction>
+                                       </simpleType>
+                               </attribute>
+                       </extension>
+               </simpleContent>
+       </complexType>
+
+       <complexType name="usabilityType">
+               <sequence>
+                       <element name="logging" minOccurs="1" maxOccurs="1">
+                               <complexType>
+                                       <sequence>
+                                               <element name="level" minOccurs="1" maxOccurs="1">
+                                                       <simpleType>
+                                                               <restriction base="NMTOKEN">
+                                                                       <enumeration value="NONE" />
+                                                                       <enumeration value="SEVERE" />
+                                                                       <enumeration value="WARNING" />
+                                                                       <enumeration value="INFO" />
+                                                                       <enumeration value="DEBUG" />
+                                                                       <enumeration value="ALL" />
+                                                               </restriction>
+                                                       </simpleType>
+                                               </element>
+                                       </sequence>
+                               </complexType>
+                       </element>
+                       <element name="fileSharing" minOccurs="1" maxOccurs="1">
+                               <complexType>
+                                       <sequence>
+                                               <element name="path" type="string" minOccurs="0" />
+                                       </sequence>
+                               </complexType>
+                       </element>
+                       <element name="hwVirtualization" type="boolean" minOccurs="1" maxOccurs="1" />
+               </sequence>
+       </complexType>
+
+       <complexType name="deviceType">
+               <sequence>
+                       <element name="display" type="em:displayType" minOccurs="1"
+                               maxOccurs="1" />
+                       <element name="storage" type="em:storageType" minOccurs="1"
+                               maxOccurs="1" />
+                       <element name="RAM" type="em:ramType" minOccurs="1"
+                               maxOccurs="1" />
+               </sequence>
+       </complexType>
+
+       <complexType name="displayType">
+               <sequence>
+                       <element name="resolution" minOccurs="1" maxOccurs="1">
+                               <complexType>
+                                       <sequence>
+                                               <element name="width" type="int" minOccurs="1" maxOccurs="1" />
+                                               <element name="height" type="int" minOccurs="1" maxOccurs="1" />
+                                       </sequence>
+                               </complexType>
+                       </element>
+                       <element name="density" minOccurs="1" maxOccurs="1">
+                               <complexType>
+                                       <simpleContent>
+                                               <extension base="int">
+                                                       <attribute name="unit" use="required">
+                                                               <simpleType>
+                                                                       <restriction base="NMTOKEN">
+                                                                               <enumeration value="dpi" />
+                                                                       </restriction>
+                                                               </simpleType>
+                                                       </attribute>
+                                               </extension>
+                                       </simpleContent>
+                               </complexType>
+                       </element>
+               </sequence>
+       </complexType>
+
+       <complexType name="storageType">
+               <sequence>
+                       <element name="SDCard" minOccurs="1" maxOccurs="1">
+                               <complexType>
+                                       <sequence>
+                                               <element name="diskImage" type="string" minOccurs="0"
+                                                       maxOccurs="1" />
+                                       </sequence>
+                               </complexType>
+                       </element>
+               </sequence>
+       </complexType>
+
+       <complexType name="ramType">
+               <sequence>
+                       <element name="size" minOccurs="1" maxOccurs="1">
+                               <complexType>
+                                       <simpleContent>
+                                               <extension base="int">
+                                                       <attribute name="unit" use="required">
+                                                               <simpleType>
+                                                                       <restriction base="NMTOKEN">
+                                                                               <enumeration value="MiB" />
+                                                                       </restriction>
+                                                               </simpleType>
+                                                       </attribute>
+                                               </extension>
+                                       </simpleContent>
+                               </complexType>
+                       </element>
+               </sequence>
+       </complexType>
+
+       <complexType name="skinType">
+               <sequence>
+                       <element name="excutionArguments" type="em:displayType"
+                               minOccurs="0" maxOccurs="1" />
+               </sequence>
+       </complexType>
+
+</schema>