import org.tizen.emulator.manager.ui.renewal.item.modify.vm.NetTapDeviceItemForWin;
import org.tizen.emulator.manager.ui.renewal.item.modify.vm.NetworkItem;
import org.tizen.emulator.manager.ui.renewal.item.modify.vm.OCIDeviceItem;
+import org.tizen.emulator.manager.ui.renewal.item.modify.vm.SuspendSupportItem;
import org.tizen.emulator.manager.ui.renewal.item.modify.vm.TunerCountryItem;
import org.tizen.emulator.manager.ui.renewal.item.modify.vm.TunerItem;
import org.tizen.emulator.manager.ui.renewal.item.modify.vm.TunerSystemItem;
itemList.add(new ViewerTypeItem(name, item.getTitle(),
VMTemplateUtil.getOptionList(item.getOptions()),
VMTemplateUtil.getCreateDefault(item.getOptions())));
+
+ } else if (name.equals(ItemName.SUSPEND_SUPPORT)) {
+ itemList.add(new SuspendSupportItem(item.getTitle()));
}
}
--- /dev/null
+/* Emulator Manager
+ *
+ * Copyright (C) 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Minkee Lee <minkee.lee@samsung.com>
+ * Jihye Kim <jihye424.kim@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * Sangho Park <sangho.p@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.renewal.item.modify.vm;
+
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.emulator.manager.ui.Messages;
+import org.tizen.emulator.manager.ui.renewal.item.ItemName;
+import org.tizen.emulator.manager.ui.renewal.item.ItemState;
+import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem;
+import org.tizen.emulator.manager.ui.renewal.item.modify.common.OnOffItem;
+import org.tizen.emulator.manager.ui.renewal.item.modify.comp.ModifyItem;
+
+public class SuspendSupportItem extends OnOffItem {
+
+ public SuspendSupportItem(String title) {
+ super(ItemName.SUSPEND_SUPPORT, title);
+ }
+
+ @Override
+ public void create(Composite parent) {
+ item = new ModifyItem(this);
+ item.init(parent);
+ item.setItemHeight(ModifyItem.ITEM_HEIGHT);
+ item.setItemTitle(createItemTitle(item));
+ item.create();
+
+ makeBody();
+
+ }
+
+ private void makeBody() {
+ if (getItemListComp().isDetailMode()) {
+ createDetailItem(getLabelText(isOn));
+ return;
+ }
+
+ // create on off item
+ createOnOff();
+
+ // set value
+ if (getItemListComp().isCreateMode()) {
+ isOn = false; // default
+ }
+ setOnOff();
+
+ }
+
+ @Override
+ public void setInitialValue() {
+ isOn = propertyValue.isSuspendSupport();
+
+ }
+
+ @Override
+ public void setValue() {
+ propertyValue.setSuspendSupport(isOn);
+ }
+
+ @Override
+ public ModifyDialogItem cloneItem() {
+ return new SuspendSupportItem(getTitle());
+ }
+
+ @Override
+ public void changeItem(ModifyDialogItem srcDialogItem) {
+ if (getItemListComp().isCreateMode()) {
+ setOnOff(false);
+ }
+ }
+
+ @Override
+ protected void buttonChanged() {
+ setValue();
+ }
+
+ @Override
+ public boolean isValid() {
+ String msg = isOn
+ ? Messages.getString("SuspendSupportViewItem.SuspendWarning.0")
+ : "";
+
+ changeItemState(msg.isEmpty() ? ItemState.NORMAL : ItemState.WARNING
+ ,getContentRight() ,msg);
+ return true;
+ }
+}