[Desc.] seperate project emulator-manager and mobile-plugin and make mobile plugin
[Issue] N/A
Signed-off-by: jihye kim <jihye1128.kim@samsung.com>
-bin
-lib
-build
+emulator-manager/bin
+mobile-plugin/bin
+emulator-manager/lib
+mobile-plugin/lib
+emulator-manager/build
+mobile-plugin/build
emulator-manager.jar
emulator-manager.exe
-about.properties
+emulator-manager/emulator-manager.jar
+emulator-manager/emulator-manager.exe
+emulator-manager/about.properties
+emulator-manager/em-plugins
+mobile-plugin/mobile-plugin.jar
<path id="classpath">
<fileset dir="lib" includes="${swt.file}" />
</path>
+
+ <path id="plugin.classpath">
+ <fileset dir="lib" includes="${swt.file}" />
+ <fileset dir="" includes="${jar.file}" />
+ </path>
<target name="clean">
<echo message="cleaning..." />
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// 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.07.17 at 07:23:49 PM KST
+// Generated on: 2013.07.22 at 03:22:38 PM KST
//
* <element name="currentDiskImage" type="{http://www.tizen.org/em}diskImageFormatType"/>
* <element name="swapDiskImage" type="{http://www.tizen.org/em}diskImageFormatType"/>
* </sequence>
+ * <attribute name="profile" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="type" use="required">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
* <element name="currentDiskImage" type="{http://www.tizen.org/em}diskImageFormatType"/>
* <element name="swapDiskImage" type="{http://www.tizen.org/em}diskImageFormatType"/>
* </sequence>
+ * <attribute name="profile" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="type" use="required">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
protected DiskImageFormatType currentDiskImage;
@XmlElement(required = true)
protected DiskImageFormatType swapDiskImage;
+ @XmlAttribute
+ protected String profile;
@XmlAttribute(required = true)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String type;
}
/**
+ * Gets the value of the profile property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getProfile() {
+ return profile;
+ }
+
+ /**
+ * Sets the value of the profile property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setProfile(String value) {
+ this.profile = value;
+ }
+
+ /**
* Gets the value of the type property.
*
* @return
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// 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.07.17 at 07:23:49 PM KST
+// Generated on: 2013.07.22 at 03:22:38 PM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// 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.07.17 at 07:23:49 PM KST
+// Generated on: 2013.07.22 at 03:22:38 PM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// 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.07.17 at 07:23:49 PM KST
+// Generated on: 2013.07.22 at 03:22:38 PM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// 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.07.17 at 07:23:49 PM KST
+// Generated on: 2013.07.22 at 03:22:38 PM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// 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.07.17 at 07:23:49 PM KST
+// Generated on: 2013.07.22 at 03:22:38 PM KST
//
}
/**
- * Create an instance of {@link EmulatorConfiguration }
+ * Create an instance of {@link UsabilityType.FileSharing }
*
*/
- public EmulatorConfiguration createEmulatorConfiguration() {
- return new EmulatorConfiguration();
+ public UsabilityType.FileSharing createUsabilityTypeFileSharing() {
+ return new UsabilityType.FileSharing();
}
/**
- * Create an instance of {@link BaseInformationType }
+ * Create an instance of {@link RamType }
*
*/
- public BaseInformationType createBaseInformationType() {
- return new BaseInformationType();
+ public RamType createRamType() {
+ return new RamType();
}
/**
- * Create an instance of {@link TouchType }
+ * Create an instance of {@link DisplayType }
*
*/
- public TouchType createTouchType() {
- return new TouchType();
+ public DisplayType createDisplayType() {
+ return new DisplayType();
}
/**
- * Create an instance of {@link DisplayType.Resolution }
+ * Create an instance of {@link SkinType }
*
*/
- public DisplayType.Resolution createDisplayTypeResolution() {
- return new DisplayType.Resolution();
+ public SkinType createSkinType() {
+ return new SkinType();
}
/**
- * Create an instance of {@link DisplayType.Density }
+ * Create an instance of {@link EmulatorConfiguration }
*
*/
- public DisplayType.Density createDisplayTypeDensity() {
- return new DisplayType.Density();
+ public EmulatorConfiguration createEmulatorConfiguration() {
+ return new EmulatorConfiguration();
}
/**
- * Create an instance of {@link SkinType }
+ * Create an instance of {@link DisplayType.Density }
*
*/
- public SkinType createSkinType() {
- return new SkinType();
+ public DisplayType.Density createDisplayTypeDensity() {
+ return new DisplayType.Density();
}
/**
- * Create an instance of {@link DeviceType }
+ * Create an instance of {@link DisplayType.SkinPath }
*
*/
- public DeviceType createDeviceType() {
- return new DeviceType();
+ public DisplayType.SkinPath createDisplayTypeSkinPath() {
+ return new DisplayType.SkinPath();
}
/**
- * Create an instance of {@link UsabilityType.FileSharing }
+ * Create an instance of {@link DisplayType.Resolution }
*
*/
- public UsabilityType.FileSharing createUsabilityTypeFileSharing() {
- return new UsabilityType.FileSharing();
+ public DisplayType.Resolution createDisplayTypeResolution() {
+ return new DisplayType.Resolution();
}
/**
- * Create an instance of {@link UsabilityType }
+ * Create an instance of {@link TouchType }
*
*/
- public UsabilityType createUsabilityType() {
- return new UsabilityType();
+ public TouchType createTouchType() {
+ return new TouchType();
}
/**
}
/**
- * Create an instance of {@link RamType.Size }
+ * Create an instance of {@link DiskImageFormatType }
*
*/
- public RamType.Size createRamTypeSize() {
- return new RamType.Size();
+ public DiskImageFormatType createDiskImageFormatType() {
+ return new DiskImageFormatType();
}
/**
- * Create an instance of {@link RamType }
+ * Create an instance of {@link BaseInformationType.DiskImage }
*
*/
- public RamType createRamType() {
- return new RamType();
+ public BaseInformationType.DiskImage createBaseInformationTypeDiskImage() {
+ return new BaseInformationType.DiskImage();
}
/**
- * Create an instance of {@link BaseInformationType.DiskImage }
+ * Create an instance of {@link UsabilityType }
*
*/
- public BaseInformationType.DiskImage createBaseInformationTypeDiskImage() {
- return new BaseInformationType.DiskImage();
+ public UsabilityType createUsabilityType() {
+ return new UsabilityType();
}
/**
- * Create an instance of {@link DisplayType }
+ * Create an instance of {@link DeviceType }
*
*/
- public DisplayType createDisplayType() {
- return new DisplayType();
+ public DeviceType createDeviceType() {
+ return new DeviceType();
}
/**
- * Create an instance of {@link DiskImageFormatType }
+ * Create an instance of {@link BaseInformationType }
*
*/
- public DiskImageFormatType createDiskImageFormatType() {
- return new DiskImageFormatType();
+ public BaseInformationType createBaseInformationType() {
+ return new BaseInformationType();
}
/**
- * Create an instance of {@link DisplayType.SkinPath }
+ * Create an instance of {@link RamType.Size }
*
*/
- public DisplayType.SkinPath createDisplayTypeSkinPath() {
- return new DisplayType.SkinPath();
+ public RamType.Size createRamTypeSize() {
+ return new RamType.Size();
}
}
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// 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.07.17 at 07:23:49 PM KST
+// Generated on: 2013.07.22 at 03:22:38 PM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// 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.07.17 at 07:23:49 PM KST
+// Generated on: 2013.07.22 at 03:22:38 PM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// 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.07.17 at 07:23:49 PM KST
+// Generated on: 2013.07.22 at 03:22:38 PM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// 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.07.17 at 07:23:49 PM KST
+// Generated on: 2013.07.22 at 03:22:38 PM KST
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10
// 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.07.17 at 07:23:49 PM KST
+// Generated on: 2013.07.22 at 03:22:38 PM KST
//
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tizen.org/em", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
import org.tizen.emulator.manager.platform.CustomPlatform;
import org.tizen.emulator.manager.platform.Platform;
import org.tizen.emulator.manager.platform.TotalPlatform;
+import org.tizen.emulator.manager.plugin.EMPluginList;
import org.tizen.emulator.manager.resources.FilePathResources;
import org.tizen.emulator.manager.resources.StringResources;
import org.tizen.emulator.manager.tool.About;
//EmulatorVMs.getInstance().loadProperties();
EmulatorManager.makePlatformList();
+ EMPluginList.loadPlugins();
if (isConsoleMode) {
EmulatorManager.startConsoleProcessor();
throw new IOException("Image name is null. This image can not add.");
}
version = prop.getProperty(StringResources.IMAGE_VERSION, platform.getName());
- domain = prop.getProperty(StringResources.PRODUCT_DOMAIN, "Phone");
+ domain = prop.getProperty(StringResources.PRODUCT_DOMAIN, "phone").toLowerCase();
cpu = prop.getProperty(StringResources.TARGET_CPU, "x86");
cpu = cpu.toLowerCase();
} else {
this.name = name;
this.cpu = cpu;
+ // TODO
+ this.domain = "phone";
}
}
if (EmulatorManager.getManagerMode() == ManagerModeType.INHOUSE_MODE) {
imageList.add(new CustomBaseImage(this, "arm", "arm"));
}
+ // TODO
+ this.profile = imageList.get(0).getDomain();
} catch (IOException e) {
// TODO
}
public class Platform {
protected String platformName = null;
protected String platformPath = null;
+ protected String profile = null;
//protected String version = null;
protected static int id = 1;
for (BaseImage i : imageList) {
if (i.getCpu().equals("x86")) {
i.setID(id++);
+ // TODO
+ profile = i.getDomain();
break;
}
}
return platformName;
}
+ public String getProfile() {
+ return profile;
+ }
+
public void clearVMs() {
for (BaseImage base : imageList) {
base.clearVMsList();
--- /dev/null
+package org.tizen.emulator.manager.plugin;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+
+import org.tizen.emulator.manager.logging.EMLogger;
+
+public class EMPluginList {
+ private static ArrayList<Extension> exList = new ArrayList<Extension>();
+ static public ArrayList<Extension> getExtensionList() {
+ return exList;
+ }
+
+ static public Extension getExtension(String point) {
+ for (Extension p : exList) {
+ if (p.getPoint().equals(point)) {
+ return p;
+ }
+ }
+ return null;
+ }
+
+ private static boolean init = false;
+ static private void initialize() {
+ init = true;
+ for (String point : PluginStringResources.getPointList()) {
+ exList.add(new Extension(point));
+ }
+ }
+
+ static public void loadPlugins() {
+ if (!init) {
+ initialize();
+ }
+ File plugins = new File(PluginStringResources.PluginDir);
+ if (plugins.exists() && plugins.isDirectory()) {
+ for (File plugin : plugins.listFiles()) {
+ JarFile jarFile = null;
+ if (plugin.isFile()) {
+ try {
+ jarFile = new JarFile(plugin.getAbsolutePath());
+ } catch (IOException e) {
+ EMLogger.addStaticLog("Faile to load plugin jar file: " + e.getMessage());
+ continue;
+ }
+ Attributes attr = null;
+ try {
+ attr = jarFile.getManifest().getMainAttributes();
+ } catch (IOException e) {
+ EMLogger.addStaticLog("Faile to load Manifest file: " + e.getMessage());
+ }
+ if (attr != null) {
+ for (Extension ex : exList) {
+ ex.add(attr, plugin);
+ EMLogger.addStaticLog("Success to add plugin: " + plugin.getName());
+ }
+ }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+package org.tizen.emulator.manager.plugin;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.jar.Attributes;
+
+import org.tizen.emulator.manager.logging.EMLogger;
+
+public class Extension {
+ private String point;
+ private ArrayList<ExtensionItem> itemList;
+
+ public Extension(String point) {
+ this.point = point;
+ itemList = new ArrayList<ExtensionItem>();
+ }
+
+ public void add(ExtensionItem item) {
+ itemList.add(item);
+ }
+
+ public void add(Attributes attr, File jarFile) {
+ ExtensionItem item = null;
+ try {
+ item = new ExtensionItem(this, attr, jarFile);
+ } catch (IOException e) {
+ EMLogger.getLogger().warning("Fail to create Extension item: " + e.getMessage());
+ return;
+ }
+ itemList.add(item);
+ }
+
+ public ArrayList<ExtensionItem> getItemList() {
+ return itemList;
+ }
+
+ public String getPoint() {
+ return point;
+ }
+}
--- /dev/null
+package org.tizen.emulator.manager.plugin;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.jar.Attributes;
+
+import org.tizen.emulator.manager.logging.EMLogger;
+
+public class ExtensionItem {
+ private Extension extension;
+ private String version;
+ private String profile;
+ private String pointClass;
+ private File jarFile;
+
+ public ExtensionItem(Extension ex, Attributes attr) throws IOException {
+ this(ex, attr, null);
+ }
+
+ public ExtensionItem(Extension ex, Attributes attr, File jarFile) throws IOException {
+ this.extension = ex;
+ pointClass = attr.getValue(extension.getPoint());
+ if (pointClass == null) {
+ throw new IOException("Not found " + extension.getPoint() + " attribute.");
+ }
+ version = attr.getValue(PluginStringResources.PlatformVersion);
+ profile = attr.getValue(PluginStringResources.PlatformProfile);
+ if (profile == null) {
+ throw new IOException("Not found " + "Platform-Profile" + " attribute.");
+ }
+ this.jarFile = jarFile;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public String getProfile() {
+ return profile;
+ }
+
+ public String getPointClass() {
+ return pointClass;
+ }
+
+ public void setJar(File jar) {
+ jarFile = jar;
+ }
+
+ public Object createClass() {
+ URL url = null;
+ try {
+ url = jarFile.toURI().toURL();
+ } catch (MalformedURLException e) {
+ EMLogger.getLogger().warning("Fail to load url from jar file: " + e.getMessage());
+ }
+
+ if (url != null) {
+ URLClassLoader loader = null;
+ loader = URLClassLoader.newInstance(new URL[]{url});
+ if (loader == null) {
+ EMLogger.getLogger().warning("URLClassLoader is null");
+ return null;
+ }
+ @SuppressWarnings("rawtypes")
+ Class classToLoad = null;
+
+ try {
+ classToLoad = Class.forName(pointClass, true, loader);
+ } catch (ClassNotFoundException e) {
+ EMLogger.getLogger().warning("Fail to load point class jar file: " + e.getMessage());
+ }
+
+ try {
+ return classToLoad.newInstance();
+ } catch (InstantiationException e) {
+ EMLogger.getLogger().warning("Fail to create new instance from class: " + e.getMessage());
+ } catch (IllegalAccessException e) {
+ EMLogger.getLogger().warning("Fail to create new instance from class: " + e.getMessage());
+ }
+ }
+ return null;
+ }
+}
--- /dev/null
+package org.tizen.emulator.manager.plugin;
+
+import java.util.ArrayList;
+
+public class PluginStringResources {
+ // extension point
+ // org.tizen.emulator.manager.ui.detail.IItemListFactory
+ public final static String ItemFactory = "Item-Factory";
+
+ public final static String PlatformVersion = "Platform-Version";
+ public final static String PlatformProfile = "Platform-Profile";
+
+ private static ArrayList<String> pointList = new ArrayList<String>();
+ static {
+ pointList.add(ItemFactory);
+ }
+ public static ArrayList<String> getPointList() {
+ return pointList;
+ }
+
+ public final static String PluginDir = "em-plugins";
+}
import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
+
import org.tizen.emulator.manager.resources.ColorResources;
import org.tizen.emulator.manager.ui.detail.PInfoViewPage;
import org.tizen.emulator.manager.ui.detail.PEmptyViewPage;
this.currentPlatform = platform;
listView.drawPlatform(platform, index, isRefresh);
+
}
public void setPlatform(Platform platform) {
}
public void drawCreateVM(BaseImage image, boolean setFocus) {
+ /*
if (isCreateMode) {
setSetFocus(setFocus);
return;
}
+ */
isCreateMode = true;
setSetFocus(setFocus);
import org.tizen.emulator.manager.resources.FontResources;
import org.tizen.emulator.manager.resources.ImageResources;
import org.tizen.emulator.manager.ui.widgets.ImageButton;
-import org.tizen.emulator.manager.vms.VMPropertyValue;
-
-class DetailItemList {
- private static ArrayList<DetailViewItem> list = null;
- public static ArrayList<DetailViewItem> getItemList() {
- //if (list == null) {
- makeList();
- //}
- return list;
- }
-
- private static void makeList() {
- list = new ArrayList<DetailViewItem>();
-
- list.add(new TNameTextItem());
- list.add(new TDisplayItem());
- list.add(new TRAMItem());
- list.add(new TTouchPointItem());
- list.add(new TFileShareItem());
- list.add(new THWSupportItem());
- //list.add(new TTouchPointItem());
- //list.add(new TTouchPointItem());
- //list.add(new THWSupportItem());
- //list.add(new TDisplayItem());
- }
-}
-public abstract class DetailViewItem {
+public abstract class DetailViewItem implements IInfoViewItem, IModifyViewItem {
protected Composite comp = null;
protected DetailViewItem upperItem = null;
protected DetailViewItem downItem = null;
protected DetailViewItem item;
- // for modify
- private DetailViewItemChangeListener listener;
-
- public DetailViewItemChangeListener getListener() {
- return listener;
- }
-
- public void setListener(DetailViewItemChangeListener listener) {
- this.listener = listener;
- }
-
public DetailViewItem() {
this.item = this;
}
return item;
}
- public void setDownItem(DetailViewItem down) {
- this.downItem = down;
+ @Override
+ public void initItem(Composite parent, IInfoViewItem upperItem) {
+ initItem(parent, (DetailViewItem) upperItem);
+ }
+
+ @Override
+ public void initItem(Composite parent, IModifyViewItem upperItem) {
+ initItem(parent, (DetailViewItem) upperItem);
}
protected ArrayList<Composite> compList = new ArrayList<Composite>();
protected static int ITEM_RIGHT_GAP = 0;
private static Image image = null;
- public void initItem(Composite parent, DetailViewItem upperItem) {
+ private void initItem(Composite parent, DetailViewItem upperItem) {
this.upperItem = upperItem;
Composite up;
if (upperItem != null) {
initTitle(true);
}
+ private void setDownItem(DetailViewItem down) {
+ this.downItem = down;
+ }
+
private static int ARROW_BUTTON_WIDTH = 7;
private static int ARROW_BUTTON_HEIGHT = 7;
protected void initTitle(boolean supportMinMode) {
FormData data = new FormData();
data.height = 0;
compList.get(i).setLayoutData(data);
- compList.get(i).getParent().layout(true, false);
+ compList.get(i).layout(true, false);
+ compList.get(i).getParent().layout();
}
if (downItem != null) {
data.height = ITEM_HEIGHT;
compList.get(i).setLayoutData(data);
compList.get(i).getParent().layout(true, false);
+ compList.get(i).getParent().getParent().layout();
}
if (downItem != null) {
downItem.changeUpComposite(compList.get(count-1));
gc.drawText(text, x + offset , y, true);
}
+ @Override
public ArrayList<Composite> getCompositeList() {
return compList;
}
+ @Override
public Composite getTopComposite() {
return compList.get(0);
}
+ @Override
public Composite getBottomComposite() {
return compList.get(compList.size()-1);
}
comp.getParent().layout(true, true);
}
+ @Override
public boolean isCreateMode() {
return isCreateMode;
}
+ @Override
public void setCreateMode(boolean isCreateMode) {
this.isCreateMode = isCreateMode;
}
+ @Override
public int getCount() {
if (isMinMode) {
return 1;
}
}
+ // for modify
+ private DetailViewItemChangeListener listener;
+
+ protected DetailViewItemChangeListener getListener() {
+ return listener;
+ }
+
+ @Override
+ public void setListener(DetailViewItemChangeListener listener) {
+ this.listener = listener;
+ }
+
+ @Override
public void close() {
titleLabel.dispose();
closeItem();
}
-
- protected abstract void init();
- public abstract void setValue(VMPropertyValue value);
- public abstract void drawDetail();
- public abstract void drawModify();
- // for min mode
- public abstract void settingStatus(boolean isRefresh);
- public abstract boolean settingDetailItem(VMPropertyValue value);
- public abstract boolean settingModifyItem(VMPropertyValue value);
- public abstract void closeItem();
}
public interface DetailViewItemChangeListener {
public void ChangeValue(DetailViewItem item);
public void ChangeValue(boolean isChange);
- public void ChangeState(State state);
+ public void ChangeState(ItemChangeState state);
}
--- /dev/null
+package org.tizen.emulator.manager.ui.detail;
+
+import java.util.ArrayList;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.emulator.manager.plugin.ExtensionItem;
+
+public class DetailViewItemList {
+ private ExtensionItem item = null;
+ private DetailViewPage viewPage = null;
+ private Composite infoComp = null;
+ private Composite modifyComp = null;
+ private ArrayList<IInfoViewItem> infoList = null;
+ private ArrayList<IModifyViewItem> modifyList = null;
+
+ public DetailViewItemList(ExtensionItem item, DetailViewPage page) {
+ this.item = item;
+ this.viewPage = page;
+ }
+
+ public String getProfile() {
+ return item.getProfile();
+ }
+
+ public ArrayList<IInfoViewItem> getInfoItemList() {
+ if (infoList == null) {
+ infoComp = new Composite(viewPage.getItemListComposite(), SWT.NONE);
+ infoComp.setLayout(new FormLayout());
+ IItemListFactory f = (IItemListFactory)(item.createClass());
+ infoList = f.getInfoItemList();
+ IInfoViewItem item = null;
+ DetailViewItem up = null;
+ for (int i = 0; i < infoList.size(); i++) {
+ item = infoList.get(i);
+ item.initItem(infoComp, up);
+ item.drawDetail();
+ up = (DetailViewItem) item;
+ }
+ infoComp.layout(true, true);
+ }
+ return infoList;
+ }
+
+ public ArrayList<IModifyViewItem> getModifyItemList() {
+ if (modifyList == null) {
+ modifyComp = new Composite(viewPage.getItemListComposite(), SWT.NONE);
+ modifyComp.setLayout(new FormLayout());
+ IItemListFactory f = (IItemListFactory)(item.createClass());
+ modifyList = f.getModifyItemList();
+
+ IModifyViewItem item = null;
+ DetailViewItem up = null;
+ for (int i = 0; i < modifyList.size(); i++) {
+ item = modifyList.get(i);
+ item.initItem(modifyComp, up);
+ item.drawModify();
+ item.setListener((PModifyViewPage)viewPage);
+ up = (DetailViewItem) item;
+ }
+
+ modifyComp.layout(true, true);
+ }
+ return modifyList;
+ }
+
+ public Composite getInfoComposite() {
+ return infoComp;
+ }
+
+ public Composite getModifyComposite() {
+ return modifyComp;
+ }
+}
package org.tizen.emulator.manager.ui.detail;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
+
import org.tizen.emulator.manager.resources.ColorResources;
import org.tizen.emulator.manager.resources.FontResources;
import org.tizen.emulator.manager.resources.ImageResources;
public abstract int checkItemCount();
+ protected final StackLayout stackLayout = new StackLayout();
public DetailViewPage(VMsDetailView parent, int style) {
this.parent = parent;
view = new Composite((Composite)parent.getComposite(), style);
scrolledList.setBackground(ColorResources.DETAIL_VIEW_PAGE_COLOR.getColor());
itemList.setBackground(ColorResources.DETAIL_VIEW_PAGE_COLOR.getColor());
itemListBack.setLayout(new FormLayout());
- itemList.setLayout(new FormLayout());
+ itemList.setLayout(stackLayout);
//
settingItemList();
//
- scrolledList.setContent(itemList);
+ //scrolledList.setContent(itemList);
FormData data = new FormData();
data.left = new FormAttachment(0, 10);
return view;
}
+ public Composite getItemListComposite() {
+ return itemList;
+ }
+
protected ImageButton topButton = null;
private static int TOP_BUTTON_WIDTH = 21;
private static int TOP_BUTTON_HEIGHT = 21;
public void settingItemList() {
Image image = PatchImageResources.getDetailListView(checkItemCountwithSize());
Image image2 = PatchImageResources.getDetailListView2(checkItemCountwithSize());
- Image image3 = PatchImageResources.getDetailListView2(checkItemCount());
+
itemListBack.setBackgroundImage(image);
scrolledList.setBackgroundImage(image2);
- itemList.setBackgroundImage(image3);
+ //itemList.setBackgroundImage(image3);
FormData data = new FormData();
data.left = new FormAttachment(0, 10);
scrolledList.setSize(data.width, data.height);
scrolledList.setLayoutData(data);
- itemListSize.x = image3.getImageData().width;
- itemListSize.y = image3.getImageData().height;
- itemList.setSize(itemListSize);
-
+ int count = checkItemCount();
+ if (count != 0) {
+ Image image3 = PatchImageResources.getDetailListView2(count);
+ itemListSize.x = image3.getImageData().width;
+ itemListSize.y = image3.getImageData().height;
+ if (stackLayout.topControl != null) {
+ stackLayout.topControl.setBackgroundImage(image3);
+ stackLayout.topControl.setSize(itemListSize);
+ }
+ //itemList.setSize(itemListSize);
+ }
itemListBack.layout(true, false);
}
settingItemList();
}
- protected abstract void drawInitView();
+ public abstract void drawInitView();
public abstract void reset();
public abstract void setFocus(boolean setFocus);
public abstract void drawPropertyView(VMPropertyValue propertyValue, boolean isCreate);
+ public void setItemListSize(int width, int height) {
+ itemListSize.x = width;
+ itemListSize.y = height;
+ }
+
public Point getItemListSize() {
return itemListSize;
}
+
+ public void setStackTop(Composite comp) {
+ stackLayout.topControl = comp;
+ scrolledList.setContent(comp);
+ itemList.layout(true, false);
+ scrolledList.layout();
+ }
}
--- /dev/null
+package org.tizen.emulator.manager.ui.detail;
+
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.emulator.manager.vms.VMPropertyValue;
+
+public interface IInfoViewItem extends IViewItem {
+ public void initItem(Composite parent, IInfoViewItem upperItem);
+
+ public abstract void drawDetail();
+ public abstract boolean settingDetailItem(VMPropertyValue value);
+}
--- /dev/null
+package org.tizen.emulator.manager.ui.detail;
+
+import java.util.ArrayList;
+
+public interface IItemListFactory {
+ public ArrayList<IInfoViewItem> getInfoItemList();
+ public ArrayList<IModifyViewItem> getModifyItemList();
+}
--- /dev/null
+package org.tizen.emulator.manager.ui.detail;
+
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.emulator.manager.vms.VMPropertyValue;
+
+public interface IModifyViewItem extends IViewItem{
+ public void initItem(Composite parent, IModifyViewItem upperItem);
+ public void setListener(DetailViewItemChangeListener listener);
+ public boolean isCreateMode();
+ public void setCreateMode(boolean isCreateMode);
+
+ public abstract void setValue(VMPropertyValue value);
+ public abstract void drawModify();
+ public abstract boolean settingModifyItem(VMPropertyValue value);
+
+}
--- /dev/null
+package org.tizen.emulator.manager.ui.detail;
+
+import java.util.ArrayList;
+
+import org.eclipse.swt.widgets.Composite;
+
+public interface IViewItem {
+ public int getCount();
+ public void close();
+ public ArrayList<Composite> getCompositeList();
+ public Composite getTopComposite();
+ public Composite getBottomComposite();
+
+ public abstract void init();
+ public abstract void settingStatus(boolean isRefresh);
+ public abstract void closeItem();
+}
--- /dev/null
+package org.tizen.emulator.manager.ui.detail;
+
+public enum ItemChangeState {
+ CREATE, MODIFY, CANCEL;
+}
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
+
import org.tizen.emulator.manager.resources.ColorResources;
import org.tizen.emulator.manager.resources.FontResources;
import org.tizen.emulator.manager.ui.VMsDetailView;
super(parent, style);
}
+ private Composite comp;
@Override
- protected void drawInitView() {
+ public void drawInitView() {
+ comp = new Composite(itemList, SWT.NONE);
// write message
- title = new Label(itemList, SWT.NONE);
+ title = new Label(comp, SWT.NONE);
title.setBackground(ColorResources.DETAIL_MIDDLE_COLOR.getColor());
title.setForeground(ColorResources.DETAIL_ENABLE_FONT_COLOR.getColor());
title.setFont(FontResources.DETAIL_LABEL_FONT.getFont());
data = new FormData();
data.width = this.getItemListSize().x;
data.height = this.getItemListSize().y;
- itemList.setLayoutData(data);
+ comp.setLayoutData(data);
+ comp.layout(true, false);
+
+ stackLayout.topControl = comp;
+ scrolledList.setContent(comp);
+ itemList.layout();
}
public void drawEmptyDetailVM() {
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
+
+import org.tizen.emulator.manager.plugin.EMPluginList;
+import org.tizen.emulator.manager.plugin.ExtensionItem;
+import org.tizen.emulator.manager.plugin.Extension;
+import org.tizen.emulator.manager.plugin.PluginStringResources;
import org.tizen.emulator.manager.resources.ImageResources;
import org.tizen.emulator.manager.resources.PatchImageResources;
import org.tizen.emulator.manager.resources.StringResources;
private ImageButton modifyButton;
@Override
- protected void drawInitView() {
+ public void drawInitView() {
modifyButton = new ImageButton(itemListTop, SWT.PUSH);
modifyButton.setImages(ImageResources.MODIFY_BUTTON_NOMAL.getImage(),
ImageResources.MODIFY_BUTTON_HOVER.getImage(),
modifyButton.setToolTipText("modify property of vm");
topButton = modifyButton;
-
- makeDetailView();
makeButton();
+ makeDetailView();
}
- private ArrayList<DetailViewItem> list;
+ private ArrayList<DetailViewItemList> list;
private void makeDetailView() {
- list = DetailItemList.getItemList();
- DetailViewItem item = null;
+ list = new ArrayList<DetailViewItemList>();
+ Extension point = EMPluginList.getExtension(PluginStringResources.ItemFactory);
+ for (ExtensionItem item : point.getItemList()) {
+ list.add(new DetailViewItemList(item, this));
+ }
+/*
+ IInfoViewItem item = null;
DetailViewItem up = null;
for (int i = 0; i < list.size(); i++) {
item = list.get(i);
item.initItem(itemList, up);
item.drawDetail();
- up = item;
+ up = (DetailViewItem) item;
}
itemList.layout(true, true);
+ */
}
private ImageButton exportButton;
@Override
public void drawPropertyView(VMPropertyValue propertyValue, boolean isCreate) {
assert propertyValue == null;
-
- for (DetailViewItem item : list) {
- item.settingDetailItem(propertyValue);
+ for (DetailViewItemList item : list) {
+ if (item.getProfile().equals(propertyValue.profile)) {
+ for (IInfoViewItem i : item.getInfoItemList()) {
+ i.settingDetailItem(propertyValue);
+ }
+ setStackTop(item.getInfoComposite());
+ break;
+ }
}
}
-/*
- @Override
- public void resize(int height) {
- Image image = PatchImageResources.getDetailListView2(checkItemCount());
- itemList.setBackgroundImage(image);
- itemList.setBackground(ColorResources.DETAIL_VIEW_PAGE_COLOR.getColor());
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.top = new FormAttachment(0, 0);
- data.bottom = new FormAttachment(100, -4);
- data.height = image.getImageData().height;
- data.width = image.getImageData().width;
- itemList.setSize(data.width, data.height);
- itemList.setLayoutData(data);
- itemList.redraw();
- }
- */
@Override
public int checkItemCount() {
- if (list == null) {
+ if (list == null || list.isEmpty()) {
return checkItemCountwithSize();
}
- DetailViewItem item = null;
int count = 0;
- for (int i = 0; i < list.size(); i++) {
- item = list.get(i);
- count += item.getCount();
+ for (DetailViewItemList item : list) {
+ if (stackLayout.topControl == item.getInfoComposite()) {
+ for (IInfoViewItem i : item.getInfoItemList()) {
+ count += i.getCount();
+ }
+ break;
+ }
}
return count;
}
@Override
public void reset() {
scrolledList.setOrigin(0, 0);
+ for (DetailViewItemList item : list) {
+ for (IInfoViewItem i : item.getInfoItemList()) {
+ i.settingStatus(true);
+ }
+ }
+ /*
for (int i = 0; i < list.size(); i++) {
list.get(i).settingStatus(true);
}
+ */
}
@Override
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.tizen.emulator.manager.logging.EMLogger;
+import org.tizen.emulator.manager.plugin.EMPluginList;
+import org.tizen.emulator.manager.plugin.ExtensionItem;
+import org.tizen.emulator.manager.plugin.Extension;
+import org.tizen.emulator.manager.plugin.PluginStringResources;
import org.tizen.emulator.manager.resources.ImageResources;
import org.tizen.emulator.manager.resources.PatchImageResources;
import org.tizen.emulator.manager.resources.StringResources;
private ImageButton cancelButton;
private boolean isCreateMode = false;
-
@Override
- protected void drawInitView() {
+ public void drawInitView() {
cancelButton = new ImageButton(itemListTop, SWT.PUSH);
cancelButton.setImages(ImageResources.CANCEL_BUTTON_NOMAL.getImage(),
ImageResources.CANCEL_BUTTON_HOVER.getImage(),
cancelButton.setToolTipText("cancel modification of vm");
topButton = cancelButton;
-
- makeModifyView();
makeButton();
-
+ makeModifyView();
}
protected void cancelModify() {
}
}
- private ArrayList<DetailViewItem> list;
+ private ArrayList<DetailViewItemList> list;
private void makeModifyView() {
- list = DetailItemList.getItemList();
- DetailViewItem item = null;
+ list = new ArrayList<DetailViewItemList>();
+ Extension point = EMPluginList.getExtension(PluginStringResources.ItemFactory);
+ for (ExtensionItem item : point.getItemList()) {
+ list.add(new DetailViewItemList(item, this));
+ }
+ /*
+ IModifyViewItem item = null;
DetailViewItem up = null;
for (int i = 0; i < list.size(); i++) {
item = list.get(i);
item.initItem(itemList, up);
item.drawModify();
item.setListener(this);
- up = item;
+ up = (DetailViewItem) item;
}
itemList.layout(true, true);
+ */
}
private static int CONFIRM_BUTTON_WIDTH = 303;
}
private void modifyVMProperty() {
- for (DetailViewItem item : list) {
- item.setValue(newValue);
+ for (DetailViewItemList item : list) {
+ if (stackLayout.topControl == item.getModifyComposite()) {
+ for (IModifyViewItem i : item.getModifyItemList()) {
+ i.setValue(newValue);
+ }
+ break;
+ }
}
+
// dpi check
if (newValue.dpi < VMProperty.MIN_DPI
|| newValue.dpi > VMProperty.MAX_DPI) {
isCreateMode = isCreate;
oldValue = propertyValue;
newValue = oldValue.clone();
- for (DetailViewItem item : list) {
- item.setCreateMode(isCreate);
- item.settingModifyItem(propertyValue);
+
+ for (DetailViewItemList item : list) {
+ if (item.getProfile().equals(propertyValue.profile)) {
+ for (IModifyViewItem i : item.getModifyItemList()) {
+ i.setCreateMode(isCreate);
+ i.settingModifyItem(propertyValue);
+ }
+ setStackTop(item.getModifyComposite());
+ break;
+ }
}
}
}
@Override
- public void ChangeState(State state) {
- if (state == State.CREATE) {
+ public void ChangeState(ItemChangeState state) {
+ if (state == ItemChangeState.CREATE) {
if (confirmButton.isEnabled()) {
modifyVMProperty();
}
- } else if (state == State.CANCEL) {
+ } else if (state == ItemChangeState.CANCEL) {
cancelModify();
}
}
@Override
public int checkItemCount() {
- if (list == null) {
+ if (list == null || list.isEmpty()) {
return checkItemCountwithSize();
}
- DetailViewItem item = null;
int count = 0;
- for (int i = 0; i < list.size(); i++) {
- item = list.get(i);
- count += item.getCount();
+ for (DetailViewItemList item : list) {
+ if (stackLayout.topControl == item.getModifyComposite()) {
+ for (IModifyViewItem i : item.getModifyItemList()) {
+ count += i.getCount();
+ }
+ break;
+ }
}
return count;
}
@Override
public void reset() {
scrolledList.setOrigin(0, 0);
- for (int i = 0; i < list.size(); i++) {
- list.get(i).settingStatus(true);
+ for (DetailViewItemList item : list) {
+ for (IModifyViewItem i : item.getModifyItemList()) {
+ i.settingStatus(true);
+ }
}
}
@Override
public void setFocus(boolean setFocus) {
- for (int i = 0; i < list.size(); i++) {
- list.get(i).settingStatus(false);
+ for (DetailViewItemList item : list) {
+ for (IModifyViewItem i : item.getModifyItemList()) {
+ i.settingStatus(false);
+ }
}
}
}
}
//
+ ec.getBaseInformation().getDiskImage().setProfile(newVM.profile);
ec.getBaseInformation().getDiskImage().setBaseDiskImage(factory.createDiskImageFormatType());
ec.getBaseInformation().getDiskImage().setCurrentDiskImage(factory.createDiskImageFormatType());
// TODO :
public String vmsName;
public String archType;
+ public String profile;
public String version; // BaseImage version(=platform)
public String baseName; // BaseImage name
public boolean isStandard;
} else {
isStandard = true;
archType = image.getCpu();
+ profile = image.getDomain();
version = image.getVersion();
baseName = image.getName();
baseImagePath = image.getPath();
vmsName = property.getName();
archType = property.getArch().toString();
+ // TODO
+ if (property.getConfiguration().getBaseInformation().getDiskImage().getProfile() != null) {
+ profile = property.getConfiguration().getBaseInformation().getDiskImage().getProfile();
+ } else {
+ profile = "phone";
+ }
+
version = property.getConfiguration().getBaseInformation().getDiskImage().getVersion();
baseName = property.getConfiguration().getBaseInformation().getDiskImage().getBase();
isStandard = property.getConfiguration().getBaseInformation().getDiskImage().getType()
dest.vmsName = this.vmsName;
dest.archType = this.archType;
+ dest.profile = this.profile;
dest.version = this.version;
dest.baseName = this.baseName;
dest.isStandard = this.isStandard;
baseImagePath = "";
baseImagePathName = isStandard ? (archType.equals("x86") ? "( emulimg-2.0.x86 )" : "( emulimg-2.0.arm )") : StringResources.None;
+ // TODO
+ profile = "phone";
settingConfigure(template);
}
<?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">
+<EmulatorConfiguration>
<baseInformation>
<name>name</name>
<architecture>x86</architecture>
<element name="swapDiskImage" type="em:diskImageFormatType"
minOccurs="1" maxOccurs="1" />
</sequence>
+ <attribute name="profile" type="string" use="optional" />
<attribute name="type" use="required">
<simpleType>
<restriction base="NMTOKEN">
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/EmulatorManager"/>
+ <classpathentry kind="lib" path="/EmulatorManager/lib/swt.jar" sourcepath="/EmulatorManager/lib/src.zip"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>mobile-plugin</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>
--- /dev/null
+<?xml version="1.0" standalone="yes"?>
+<project name="mobile-plugin" basedir="." default="make-jar">
+
+ <property name="plugin.file" value="mobile-plugin.jar" />
+ <property name="swt.file" value="swt.jar" />
+ <property name="platform.version" value="default" />
+ <property name="platform.profile" value="phone"/>
+ <property name="item.factory" value="org.tizen.emulator.manager.ui.detail.mobile.ItemListFactory" />
+
+ <path id="classpath">
+ <fileset dir="${em.dir}/lib" includes="${swt.file}" />
+ <fileset dir="${em.dir}" includes="emulator-manager.jar" />
+ </path>
+
+
+ <target name="clean">
+ <echo message="cleaning..." />
+ <delete dir="build" />
+ <delete file="${plugin.file}" />
+ </target>
+
+ <target name="prepare-compile">
+ <echo message="prepare for compile..." />
+ <delete dir="build" />
+ <mkdir dir="build" />
+ </target>
+
+ <target name="compile" depends="prepare-compile">
+ <echo message="compiling..." />
+ <javac encoding="UTF-8" fork="true" srcdir="src" destdir="build" debug="on" memorymaximumsize="128m">
+ <classpath refid="classpath" />
+ </javac>
+ </target>
+
+ <target name="create-jar">
+ <echo message="creating jar..." />
+ <jar jarfile="${plugin.file}" basedir="build" duplicate="add">
+ <manifest>
+ <attribute name="Platform-Version" value="${platform.version}"/>
+ <attribute name="Platform-Profile" value="${platform.profile}"/>
+ <attribute name="Item-Factory" value="${item.factory}"/>
+ </manifest>
+ </jar>
+ <delete dir="build" />
+ <move todir="${em.dir}/em-plugins">
+ <fileset file="${plugin.file}" />
+ </move>
+ </target>
+
+ <target name="make-jar" depends="compile, create-jar" />
+
+ <!-- for dibs system... -->
+ <path id="classpath-dibs">
+ <fileset dir="${classpath.dibs}" includes="${swt.file}" />
+ <fileset dir="${classpath.dibs}" includes="emulator-manager.jar" />
+ </path>
+
+ <target name="compile-dibs" depends="prepare-compile">
+ <echo message="compiling..." />
+ <javac encoding="UTF-8" fork="true" srcdir="src" destdir="build" debug="on" memorymaximumsize="128m">
+ <classpath refid="classpath-dibs" />
+ </javac>
+ </target>
+
+ <target name="create-jar-dibs">
+ <echo message="creating jar..." />
+ <jar jarfile="${plugin.file}" basedir="build" duplicate="add">
+ <manifest>
+ <attribute name="Platform-Version" value="${platform.version}"/>
+ <attribute name="Platform-Profile" value="${platform.profile}"/>
+ <attribute name="Item-Factory" value="${item.factory}"/>
+ </manifest>
+ </jar>
+ <delete dir="build" />
+ <move todir="${classpath.dibs}/em-plugins">
+ <fileset file="${plugin.file}" />
+ </move>
+ </target>
+
+ <target name="make-jar-dibs" depends="compile-dibs, create-jar-dibs" />
+</project>
--- /dev/null
+package org.tizen.emulator.manager.ui.detail.mobile;
+
+import java.util.ArrayList;
+
+import org.tizen.emulator.manager.ui.detail.IInfoViewItem;
+import org.tizen.emulator.manager.ui.detail.IItemListFactory;
+import org.tizen.emulator.manager.ui.detail.IModifyViewItem;
+
+public class ItemListFactory implements IItemListFactory {
+ private static ArrayList<IInfoViewItem> infoList = null;
+ private static ArrayList<IModifyViewItem> modifyList = null;
+
+ @ Override
+ public ArrayList<IInfoViewItem> getInfoItemList() {
+ // if (infoList == null) {
+ makeInfoList();
+ // }
+
+ return infoList;
+ }
+
+ @ Override
+ public ArrayList<IModifyViewItem> getModifyItemList() {
+ // if (modifyList == null) {
+ makeModifyList();
+ // }
+
+ return modifyList;
+ }
+
+ private static void makeInfoList() {
+ infoList = new ArrayList<IInfoViewItem>();
+
+ infoList.add(new TNameTextItem());
+ infoList.add(new TDisplayItem());
+ infoList.add(new TRAMItem());
+ infoList.add(new TTouchPointItem());
+ infoList.add(new TFileShareItem());
+ infoList.add(new THWSupportItem());
+ }
+
+ private static void makeModifyList() {
+ modifyList = new ArrayList<IModifyViewItem>();
+
+ modifyList.add(new TNameTextItem());
+ modifyList.add(new TDisplayItem());
+ modifyList.add(new TRAMItem());
+ modifyList.add(new TTouchPointItem());
+ modifyList.add(new TFileShareItem());
+ modifyList.add(new THWSupportItem());
+ }
+}
*
*/
-package org.tizen.emulator.manager.ui.detail;
-
+package org.tizen.emulator.manager.ui.detail.mobile;
import java.util.ArrayList;
import org.eclipse.swt.SWT;
import org.tizen.emulator.manager.resources.FontResources;
import org.tizen.emulator.manager.resources.ImageResources;
import org.tizen.emulator.manager.resources.PatchImageResources;
+import org.tizen.emulator.manager.ui.detail.DetailViewItem;
+import org.tizen.emulator.manager.ui.detail.ItemChangeState;
import org.tizen.emulator.manager.ui.widgets.ImageCombo;
import org.tizen.emulator.manager.ui.widgets.ImageLabel;
import org.tizen.emulator.manager.ui.widgets.WSTATE;
case SWT.CR:
case SWT.KEYPAD_CR:
///TODO
- getListener().ChangeState(State.CREATE);
+ getListener().ChangeState(ItemChangeState.CREATE);
break;
case SWT.ESC:
- getListener().ChangeState(State.CANCEL);
+ getListener().ChangeState(ItemChangeState.CANCEL);
break;
default:
// TODO
*
*/
-package org.tizen.emulator.manager.ui.detail;
+package org.tizen.emulator.manager.ui.detail.mobile;
import java.io.File;
import org.tizen.emulator.manager.resources.PatchImageResources;
import org.tizen.emulator.manager.resources.StringResources;
import org.tizen.emulator.manager.ui.MainDialog;
+import org.tizen.emulator.manager.ui.detail.DetailViewItem;
import org.tizen.emulator.manager.ui.widgets.ImageButton;
import org.tizen.emulator.manager.ui.widgets.ImageLabel;
import org.tizen.emulator.manager.vms.VMPropertyValue;
private DirectoryDialog sharedFD;
@Override
- protected void init() {
+ public void init() {
title = "File Sharing";
count = 2;
}
*
*/
-package org.tizen.emulator.manager.ui.detail;
+package org.tizen.emulator.manager.ui.detail.mobile;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.tizen.emulator.manager.resources.PatchImageResources;
import org.tizen.emulator.manager.resources.StringResources;
import org.tizen.emulator.manager.tool.CheckVirtualization;
+import org.tizen.emulator.manager.ui.detail.DetailViewItem;
import org.tizen.emulator.manager.ui.widgets.ImageButton;
import org.tizen.emulator.manager.ui.widgets.ImageLabel;
import org.tizen.emulator.manager.vms.VMPropertyValue;
private boolean newGPUSupport;
@Override
- protected void init() {
+ public void init() {
title = "HW Support";
count = 2;
}
*
*/
-package org.tizen.emulator.manager.ui.detail;
+package org.tizen.emulator.manager.ui.detail.mobile;
import java.io.File;
import org.tizen.emulator.manager.ui.MainDialog;
import org.tizen.emulator.manager.ui.MenuHandling;
import org.tizen.emulator.manager.ui.VMsMainView;
+import org.tizen.emulator.manager.ui.detail.DetailViewItem;
+import org.tizen.emulator.manager.ui.detail.ItemChangeState;
import org.tizen.emulator.manager.ui.dialog.MessageDialog;
import org.tizen.emulator.manager.ui.widgets.ImageButton;
import org.tizen.emulator.manager.ui.widgets.ImageLabel;
case SWT.CR:
case SWT.KEYPAD_CR:
///TODO
- getListener().ChangeState(State.CREATE);
+ getListener().ChangeState(ItemChangeState.CREATE);
break;
case SWT.ESC:
- getListener().ChangeState(State.CANCEL);
+ getListener().ChangeState(ItemChangeState.CANCEL);
break;
default:
// TODO
*
*/
-package org.tizen.emulator.manager.ui.detail;
+package org.tizen.emulator.manager.ui.detail.mobile;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.tizen.emulator.manager.resources.FontResources;
import org.tizen.emulator.manager.resources.ImageResources;
import org.tizen.emulator.manager.resources.PatchImageResources;
+import org.tizen.emulator.manager.ui.detail.DetailViewItem;
import org.tizen.emulator.manager.ui.widgets.ImageCombo;
import org.tizen.emulator.manager.ui.widgets.ImageLabel;
import org.tizen.emulator.manager.ui.widgets.WSTATE;
private int newSize;
@Override
- protected void init() {
+ public void init() {
title = "RAM Size";
count = 1;
}
*
*/
-package org.tizen.emulator.manager.ui.detail;
+package org.tizen.emulator.manager.ui.detail.mobile;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.tizen.emulator.manager.resources.PatchImageResources;
+import org.tizen.emulator.manager.ui.detail.DetailViewItem;
import org.tizen.emulator.manager.ui.widgets.ImageLabel;
import org.tizen.emulator.manager.vms.VMPropertyValue;
public class TTouchPointItem extends DetailViewItem {
private int touchPointValue;
@Override
- protected void init() {
+ public void init() {
title = "Max Touch Point";
count = 1;
}
*
*/
-package org.tizen.emulator.manager.ui.detail;
+package org.tizen.emulator.manager.ui.detail.mobile;
import java.util.ArrayList;
public StringArrayResource()
{
list = new ArrayList<String>();
+ list.clear();
}
public void add(int index, String element)
+++ /dev/null
-<?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>
+++ /dev/null
-<?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>
+++ /dev/null
-<?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>
+++ /dev/null
-<?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>480</width>
- <height>800</height>
- </resolution>
- <density unit="dpi">207</density>
- <skinPath>
- <path>emul_480x800</path>
- </skinPath>
- </display>
- <storage>
- <SDCard/>
- </storage>
- <RAM>
- <size unit="MiB">512</size>
- </RAM>
- </device>
-</EmulatorConfiguration>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<EmulatorConfiguration xmlns="http://www.tizen.org/em">
- <baseInformation>
- <name>test3</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>600</width>
- <height>1024</height>
- </resolution>
- <density unit="dpi">224</density>
- <skinPath>
- <path>emul_600x1024</path>
- </skinPath>
- </display>
- <storage>
- <SDCard/>
- </storage>
- <RAM>
- <size unit="MiB">512</size>
- </RAM>
- </device>
-</EmulatorConfiguration>
+++ /dev/null
-<?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>