- Introduced experimental check logic.
Change-Id: Ibd4c46fce1beb0544f003c68863b6a37c034b241
Signed-off-by: minkee.lee <minkee.lee@samsung.com>
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
-//import org.tizen.emulator.manager.console.Action;
-//import org.tizen.emulator.manager.console.CommandLineParser;
import org.tizen.emulator.manager.console.Action;
import org.tizen.emulator.manager.console.CommandLineParser;
import org.tizen.emulator.manager.job.CheckGPU;
return mode;
}
+ public static boolean isInhouseMode() {
+ if (mode == ManagerModeType.INHOUSE_MODE) {
+ return true;
+ }
+ return false;
+ }
+
public static MainDialog getMainDialog() {
return mainDialog;
}
import java.util.List;
import java.util.Set;
+import org.tizen.emulator.manager.EmulatorManager;
import org.tizen.emulator.manager.ui.detail.item.property.BaseImageViewItem;
import org.tizen.emulator.manager.ui.detail.item.property.DisplayViewItem;
import org.tizen.emulator.manager.ui.detail.item.property.FileShareViewItem;
import org.tizen.emulator.manager.ui.detail.item.property.MaxTouchViewItem;
import org.tizen.emulator.manager.ui.detail.item.property.ProcessorViewItem;
import org.tizen.emulator.manager.ui.detail.item.property.RamSizeItem;
+import org.tizen.emulator.manager.ui.detail.item.property.SuspendSupportViewItem;
import org.tizen.emulator.manager.ui.detail.item.property.VMNameViewItem;
import org.tizen.emulator.manager.ui.detail.item.template.CheckLabelViewItem;
import org.tizen.emulator.manager.ui.detail.item.template.ComboViewItem;
public static String ITEM_DISPLAY = "display";
public static String ITEM_RAM_SIZE = "ramSize";
public static String ITEM_MAX_TOUCH = "maxTouch";
+ public static String ITEM_SUSPEND_SUPPORT = "suspendSupport";
public static String ITEM_FILE_SHARE = "fileShare";
public static String ITEM_HW_SUPPORT = "hwSupport";
public static String ITEM_PROCESSORS = "processors";
continue;
}
+ if (checkExperimental(item) && !EmulatorManager.isInhouseMode()) {
+ continue;
+ }
+
if (itemName.equals(ITEM_VM_NAME)) {
itemList.add(new VMNameViewItem(item, currentLineLabel));
} else if (itemName.equals(ITEM_MAX_TOUCH)) {
itemList.add(new MaxTouchViewItem(item, currentLineLabel));
+ } else if (itemName.equals(ITEM_SUSPEND_SUPPORT)) {
+ itemList.add(new SuspendSupportViewItem(item, currentLineLabel));
+
} else if (itemName.equals(ITEM_FILE_SHARE)) {
itemList.add(new FileShareViewItem(item, currentLineLabel));
return false;
}
+
+ private boolean checkExperimental(Item item) {
+ for (Option opt : item.getOption()) {
+ if (opt.getName().equals(OptionType.EXPERIMENTAL.getName())) {
+ if (opt.getValue().equals(OptionType.VALUE_TRUE)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
}
--- /dev/null
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Minkee Lee <minkee.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * Sangho Park <sangho1206.park@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+
+package org.tizen.emulator.manager.ui.detail.item.property;
+
+import org.tizen.emulator.manager.ui.detail.item.ItemState;
+import org.tizen.emulator.manager.ui.detail.item.LineLabelViewItem;
+import org.tizen.emulator.manager.ui.detail.item.template.OnOffViewItem;
+import org.tizen.emulator.manager.vms.VMPropertyValue;
+import org.tizen.emulator.manager.vms.xml.template.Item;
+
+public class SuspendSupportViewItem extends OnOffViewItem {
+
+ public SuspendSupportViewItem(Item template,
+ LineLabelViewItem lineLabelViewItem) {
+ super(template, lineLabelViewItem);
+ }
+
+ @Override
+ public ItemState checkValue() {
+ itemState.setNormal();
+ if (getValue() == true) {
+ itemState.setWarning("This is incomplete feature. It may not work properly.");
+ }
+ return itemState;
+ }
+
+ @Override
+ public String getItemValue(VMPropertyValue value) {
+ return value.isSupportSuspend ? VALUE_ON : VALUE_OFF;
+ }
+
+ @Override
+ public void setValue(VMPropertyValue value) {
+ value.isSupportSuspend = newValue;
+ }
+
+}
protected String name;
- //private boolean oldValue;
- private boolean newValue;
+ protected boolean oldValue;
+ protected boolean newValue;
public static String VALUE_ON = "on";
public static String VALUE_OFF = "off";
protected int INPUTBOX_WIDTH = 175;
// for Modify view
- private Label buttonLabel;
- private ImageButton onOffButton;
+ protected Label buttonLabel;
+ protected ImageButton onOffButton;
public OnOffViewItem(Item template, LineLabelViewItem lineLabelViewItem) {
parseOption(template.getOption());
}
+ public boolean getValue() {
+ return newValue;
+ }
+
@Override
public void drawDetail() {
valueLabel = new ImageLabel(compList.get(0), SWT.NONE);
// Set string value("on" / "off") in Info view.
@Override
public boolean settingDetailItem(VMPropertyValue value) {
- String onOffVal = value.getAdvancedOptionValue(name).toLowerCase();
- if (onOffVal.equals(VALUE_ON)) {
+ boolean val = getItemValue(value).equals(VALUE_ON) ? true : false;
+ if (val == true) {
valueLabel.setText(StringResources.SUPPORTED);
} else {
valueLabel.setText(StringResources.NOT_SUPPORTED);
newValue = true;
buttonLabel.setText(StringResources.SUPPORTED);
}
- if (!isCreateMode()) {
- getListener().ChangeValue(getThis());
+ if (isCreateMode()) {
+ getListener().changeCreateConfirmButton();
+
+ } else {
+ getListener().changeModifyConfirmButton(getThis());
}
}
@Override
public boolean settingModifyItem(VMPropertyValue value) {
onOffButton.setEnabled(true);
- boolean onOff = value.getAdvancedOptionValue(name).toLowerCase().equals(VALUE_ON)
- ? true : false;
+ boolean onOff = getItemValue(value).equals(VALUE_ON) ? true : false;
// newValue = oldValue = onOff;
newValue = onOff;
return true;
}
+
+ @Override
+ public String getItemValue(VMPropertyValue value) {
+ return value.getAdvancedOptionValue(name).toLowerCase();
+ }
}