import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+ import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
import org.tizen.emulator.manager.EmulatorManager;
import org.tizen.emulator.manager.logging.EMLogger;
+import org.tizen.emulator.manager.platform.ProfileList;
+import org.tizen.emulator.manager.plugin.EMPlugin;
import org.tizen.emulator.manager.resources.FilePathResources;
+ import org.tizen.emulator.manager.resources.FontResources;
import org.tizen.emulator.manager.resources.ImageResources;
import org.tizen.emulator.manager.resources.StringResources;
import org.tizen.emulator.manager.tool.About;
}
});
+ Text plugin = new Text(textComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER);
+ plugin.setEditable(false);
+ String list = "";
+ for (EMPlugin p : ProfileList.getPluginList()) {
+ if (!list.isEmpty()) {
+ list = list + StringResources.NEW_LINE;
+ }
+ list = list + p.getPlatformName() + ": " + p.getPackageVersion();
+ }
+ plugin.setText(list);
+ data = new FormData();
+ data.top = new FormAttachment(visit, spacing);
+ data.left = new FormAttachment(0, spacing);
+ data.width = 240;
+ data.height = 40;
+ plugin.setLayoutData(data);
++
+ visit.setFont(FontResources.ABOUT_TEXT.getFont());
+ workspace.setFont(FontResources.ABOUT_TEXT.getFont());
+ contents.setFont(FontResources.ABOUT_TEXT.getFont());
++ plugin.setFont(FontResources.ABOUT_TEXT.getFont());
}
private static GridLayout getGridLayout(int numColumns, boolean makeColumnEqualWidth) {
private void createUsability() {}
private void settingProperty() {
- ObjectFactory factory = EmulatorVMList.getInstance().getObjectFactory();
- EmulatorConfiguration ec = property.getConfiguration();
- ec.setBaseInformation(factory.createBaseInformationType());
- ec.setUsability(factory.createUsabilityType());
- ec.setDevice(factory.createDeviceType());
-
- ec.getBaseInformation().setName(newVM.vmsName);
- ec.getBaseInformation().setArchitecture(newVM.baseImage.getCpu());
- ec.getBaseInformation().setPlatform(newVM.baseImage.getPlatformName());
-
- ec.getBaseInformation().setDiskImage(factory.createBaseInformationTypeDiskImage());
- if (newVM.baseImage.isStandard()) {
- ec.getBaseInformation().getDiskImage().setType("standard"); //$NON-NLS-1$
- } else {
- ec.getBaseInformation().getDiskImage().setType("custom"); //$NON-NLS-1$
- }
-
- if (newVM.baseImage.getVersion() != null) {
- ec.getBaseInformation().getDiskImage().setVersion(newVM.baseImage.getVersion());
- } else {
- ec.getBaseInformation().getDiskImage().setVersion("Standard"); //$NON-NLS-1$
- }
- if (newVM.baseImage.getName() != null) {
- ec.getBaseInformation().getDiskImage().setBase(newVM.baseImage.getName());
- }
-
- //
- ec.getBaseInformation().getDiskImage().setProfile(newVM.baseImage.getProfile());
- ec.getBaseInformation().getDiskImage().setBaseDiskImage(factory.createDiskImageFormatType());
- ec.getBaseInformation().getDiskImage().setCurrentDiskImage(factory.createDiskImageFormatType());
- // TODO :
- ec.getBaseInformation().getDiskImage().getBaseDiskImage().setFormat("qcow2"); //$NON-NLS-1$
- ec.getBaseInformation().getDiskImage().getBaseDiskImage().setValue(newVM.baseImagePath);
-
- if (newVM.baseImage.isStandard() && !newVM.baseImage.getBinaryVersion().isEmpty()) {
- ec.getBaseInformation().getDiskImage().getBaseDiskImage().setVersion(newVM.baseImage.getBinaryVersion());
- }
- ec.getBaseInformation().getDiskImage().getCurrentDiskImage().setFormat("qcow2"); //$NON-NLS-1$
- //ec.getBaseInformation().getDiskImage().getCurrentDiskImage().setValue(
- // folder.getAbsolutePath() + File.separator + "emulimg-" + newVM.imageName + "." + Architecture.x86.toString());
- ec.getBaseInformation().getDiskImage().getCurrentDiskImage().setValue(customPath);
-
- if (swapPath != null) {
- ec.getBaseInformation().getDiskImage().setSwapDiskImage(factory.createDiskImageFormatType());
- ec.getBaseInformation().getDiskImage().getSwapDiskImage().setFormat("qcow2"); //$NON-NLS-1$
- ec.getBaseInformation().getDiskImage().getSwapDiskImage().setValue(swapPath);
- }
-
- ec.getUsability().setLogging(factory.createUsabilityTypeLogging());
- ec.getUsability().getLogging().setLevel("NONE"); //$NON-NLS-1$
- ec.getUsability().setHwVirtualization(newVM.isHWVirtualization);
- /*&& CheckVirtualization.getInstance().isSupportVirtualization());*/
- ec.getUsability().setHwGLAcceleration(newVM.isGLAcceleration);
- ec.getUsability().setSupportSuspend(newVM.isSupportSuspend);
-
- ec.getUsability().setFileSharing(factory.createUsabilityTypeFileSharing());
- if (!newVM.fileSharePath.isEmpty()) {
- ec.getUsability().getFileSharing().setPath(newVM.fileSharePath);
- }
-
- ec.getDevice().setDisplay(factory.createDisplayType());
- ec.getDevice().getDisplay().setResolution(factory.createDisplayTypeResolution());
- ec.getDevice().getDisplay().getResolution().setWidth(newVM.resolution.getResolution().getWidth());
- ec.getDevice().getDisplay().getResolution().setHeight(newVM.resolution.getResolution().getHeight());
-
- ec.getDevice().getDisplay().setDensity(factory.createDisplayTypeDensity());
- ec.getDevice().getDisplay().getDensity().setUnit("dpi"); //$NON-NLS-1$
- ec.getDevice().getDisplay().getDensity().setValue(newVM.dpi);
-
- ec.getDevice().getDisplay().setSkinPath(factory.createDisplayTypeSkinPath());
- if (newVM.skin != null) {
- ec.getDevice().getDisplay().getSkinPath().setPath(newVM.skin.getPath());
- } else if (newVM.skinPath != null) {
- ec.getDevice().getDisplay().getSkinPath().setPath(newVM.skinPath);
- }
+
- ////// CPU //////
- ec.getDevice().setCPU(factory.createCpuType());
- ec.getDevice().getCPU().setValue(factory.createCpuTypeValue());
- ec.getDevice().getCPU().getValue().setUnit("cpu"); //$NON-NLS-1$
- if (newVM.cpu == 0) {
- int max = CPU.getMaxCpuNum();
- newVM.cpu = max > 4 ? 4 : max;
- }
- ec.getDevice().getCPU().getValue().setValue(newVM.cpu);
-
-
- ec.getDevice().setRAM(factory.createRamType());
- ec.getDevice().getRAM().setSize(factory.createRamTypeSize());
- ec.getDevice().getRAM().getSize().setUnit("MiB"); //$NON-NLS-1$
- ec.getDevice().getRAM().getSize().setValue(newVM.ramSize);
-
- if (newVM.maxTouchCount >= 0) {
- ec.getDevice().setTouch(factory.createTouchType());
- ec.getDevice().getTouch().setMaxTouchPoint(newVM.maxTouchCount);
- }
-
- if (newVM.addOptions != null) {
- ec.getUsability().setAdvancedOptions(newVM.addOptions);
- }
-
- if(newVM.ociOptions != null) {
- //////OCI DEVICE//////
- ec.setOci(factory.createOciType());
- ec.getOci().setOciOptions(newVM.ociOptions);
- }
-
- // extended option
- if (newVM.extendedOptions != null) {
- ec.getExtendedOption().addAll(newVM.extendedOptions);
- }
-
- // advanced option
- if (newVM.advancedOptionList.size() > 0) {
- if (ec.getAdvancedOption() == null) {
- ec.setAdvancedOption(factory.createAdvancedOptionType());
- } else {
- ec.getAdvancedOption().getOption().clear();
- }
- ec.getAdvancedOption().getOption().addAll(newVM.advancedOptionList);
- }
+ newVM.childImagePath = customPath;
+ newVM.swapImagePath = swapPath;
+ property.settingConfiguration();
}
public static VMProperty create(VMPropertyValue newVM) throws VMWorkerException {