base image dialog: add detail mode and modify mode
authorjihye424.kim <jihye424.kim@samsung.com>
Fri, 13 Nov 2015 11:23:48 +0000 (20:23 +0900)
committerjihye424.kim <jihye424.kim@samsung.com>
Mon, 16 Nov 2015 02:24:09 +0000 (11:24 +0900)
- click modify button -> open detail mode or modfiy mode dialog
- detail mode: emulator exist that use base image instance
-- you can modify only description item
- modify mode: emulator does not exist that use base image instance
-- you can modify all item except profile item

Change-Id: Ia44a44efec46a6d37c0158ee2e0c54ec7c05ea7a
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
15 files changed:
src/org/tizen/emulator/manager/platform/baseimage/CustomBaseImageValue.java
src/org/tizen/emulator/manager/ui/renewal/dialog/BaseImageCreateDialog.java
src/org/tizen/emulator/manager/ui/renewal/dialog/ItemListComp.java
src/org/tizen/emulator/manager/ui/renewal/dialog/ModifyDialog.java
src/org/tizen/emulator/manager/ui/renewal/dialoghandler/BaseImageDialogHandler.java
src/org/tizen/emulator/manager/ui/renewal/item/modify/baseimage/BaseImageFileItem.java
src/org/tizen/emulator/manager/ui/renewal/item/modify/baseimage/BaseImageNameItem.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/renewal/item/modify/baseimage/DescriptionItem.java
src/org/tizen/emulator/manager/ui/renewal/item/modify/baseimage/PlatformItem.java
src/org/tizen/emulator/manager/ui/renewal/item/modify/common/NameItem.java
src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ProfileItem.java
src/org/tizen/emulator/manager/ui/renewal/item/modify/common/TextInputBoxItem.java
src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/PropertyValue.java
src/org/tizen/emulator/manager/ui/renewal/widgets/ImageButton.java
src/org/tizen/emulator/manager/vms/VMProperty.java

index 83a8cae..cd567e3 100644 (file)
@@ -40,8 +40,8 @@ public class CustomBaseImageValue {
        private String profile = "";
        private String platformName = "";
        private Platform platform = null;
-       // default value is i386
-       private Architecture cpu = Architecture.i386;
+       // default value is x86
+       private Architecture cpu = Architecture.default32Bit;
        private String filePath = "";
        private String description = "";
        private boolean isAmendable = false;
index 3abdd8c..9be4534 100644 (file)
@@ -51,5 +51,4 @@ public class BaseImageCreateDialog extends ModifyDialog {
                // init body
                super.create(new PropertyValue(imageValue), itemList, dialogMode);
        }
-
 }
index b9c3d56..7a1ee91 100644 (file)
@@ -122,6 +122,9 @@ public class ItemListComp {
 
                isAllItemCreated = true;
 
+               // for check initial value
+               checkValid();
+
                // sort composite
 //             sortItem(propertyValue.getProfile());
 
@@ -214,6 +217,12 @@ public class ItemListComp {
                return false;
        }
 
+       public boolean isDetailMode() {
+               if (dialogMode == DIALOG_MODE.DETAIL) {
+                       return true;
+               }
+               return false;
+       }
 
        public DIALOG_MODE getDialogMode() {
                return dialogMode;
index 3294634..12bdefb 100644 (file)
@@ -74,7 +74,6 @@ public class ModifyDialog extends Dialog {
        }
 
        private void createDialogBody() {
-
                itemListComp.create();
        }
 
index 0e10e80..7534501 100644 (file)
@@ -40,10 +40,10 @@ import org.tizen.emulator.manager.ui.renewal.MainDialog;
 import org.tizen.emulator.manager.ui.renewal.dialog.BaseImageCreateDialog;
 import org.tizen.emulator.manager.ui.renewal.dialog.DIALOG_MODE;
 import org.tizen.emulator.manager.ui.renewal.item.modify.baseimage.BaseImageFileItem;
+import org.tizen.emulator.manager.ui.renewal.item.modify.baseimage.BaseImageNameItem;
 import org.tizen.emulator.manager.ui.renewal.item.modify.baseimage.DescriptionItem;
 import org.tizen.emulator.manager.ui.renewal.item.modify.baseimage.PlatformItem;
 import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem;
-import org.tizen.emulator.manager.ui.renewal.item.modify.common.NameItem;
 import org.tizen.emulator.manager.ui.renewal.item.modify.common.ProfileItem;
 
 public class BaseImageDialogHandler {
@@ -67,9 +67,10 @@ public class BaseImageDialogHandler {
                CustomBaseImageValue value = new CustomBaseImageValue(image);
 
                if (value.isAmendable()) {
-                       value = openDialog("Modify Base Image", DIALOG_MODE.CLONE, value);
-               } else {
                        value = openDialog("Modify Base Image", DIALOG_MODE.MODIFY, value);
+               } else {
+                       // can not modify base image information except description
+                       value = openDialog("Modify Base Image", DIALOG_MODE.DETAIL, value);
                }
 
                return value;
@@ -92,7 +93,7 @@ public class BaseImageDialogHandler {
        public static List<ModifyDialogItem> getDefaultItemList() {
                List<ModifyDialogItem> itemList = new ArrayList<ModifyDialogItem>();
 
-               itemList.add(new NameItem("name", "Image Name"));
+               itemList.add(new BaseImageNameItem());
                itemList.add(new ProfileItem());
                itemList.add(new PlatformItem());
                itemList.add(new BaseImageFileItem());
index 5293f8a..b73d3da 100644 (file)
@@ -75,7 +75,7 @@ public class BaseImageFileItem extends FileDialogItem {
                        setTextBox(imageFilePath);
                }
                // you can not modify if emulator using base image exist.
-               if (getItemListComp().isModifyMode()) {
+               if (getItemListComp().isDetailMode()) {
                        fileDialogButton.setEnabled(false);
                }
        }
diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/baseimage/BaseImageNameItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/baseimage/BaseImageNameItem.java
new file mode 100644 (file)
index 0000000..d945c8d
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2015 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 <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.renewal.item.modify.baseimage;
+
+import java.io.File;
+
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.emulator.manager.platform.BaseImage;
+import org.tizen.emulator.manager.renewal.resources.ImageResources;
+import org.tizen.emulator.manager.resources.StringResources;
+import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem;
+import org.tizen.emulator.manager.ui.renewal.item.modify.common.NameItem;
+import org.tizen.emulator.manager.ui.renewal.item.modify.common.TextInputBoxItem;
+import org.tizen.emulator.manager.ui.renewal.item.modify.comp.PropertyValue;
+import org.tizen.emulator.manager.vms.helper.HelperClass;
+
+public class BaseImageNameItem extends TextInputBoxItem {
+       private final int INPUT_BOX_WIDTH = 236;
+       private String imageName = "";
+
+       public BaseImageNameItem() {
+               super("name", "Image Name");
+       }
+
+       @Override
+       public void setInitialValue(PropertyValue value) {
+               if (value == null) {
+                       return;
+               }
+
+               if (getItemListComp().isCreateMode()) {
+                       this.value = value.getDefaultName();
+
+               } else if (getItemListComp().isCloneMode()){
+                       this.value = value.getCloneName();
+
+               } else {
+                       this.value = value.getName();
+               }
+
+               imageName = this.value;
+       }
+
+       @Override
+       public void create(Composite parent) {
+               // modify dialog item: setItemListComp() -> setInitialValue() -> create() -> setVisible()
+               create(parent, ImageResources.ICON_TITLE_VMNAME, INPUT_BOX_WIDTH, true);
+               // call 'makeBody' function
+       }
+
+       @Override
+       protected void makeBody(int textBoxWidth, boolean needClearButton) {
+               item.setBodyLayoutForm();
+
+               if (getItemListComp().isDetailMode()) {
+                       createTextLabel();
+               } else {
+                       createTextBox(textBoxWidth, needClearButton);
+               }
+       }
+
+       @Override
+       public void setValue(PropertyValue value) {
+               value.setName(this.value);
+       }
+
+       @Override
+       public ModifyDialogItem cloneItem() {
+               return new NameItem(getName(), getTitle());
+       }
+
+       @Override
+       public void textModified() {
+               // check validation
+               // check confirm button enable/disable
+               getItemListComp().checkValid();
+       }
+
+       @Override
+       public boolean isValid() {
+               // item list composite's checkValid() -> item's isValid()
+               boolean isValid = true;
+
+               if (getItemListComp().isDetailMode()) {
+                       return true;
+               }
+
+
+               if (!getItemListComp().isCreateMode()) {
+                       if (!value.isEmpty() && value.equals(imageName)) {
+                               return true;
+                       }
+               }
+
+               String msg = "";
+               // create(clone), modify mode
+               msg = checkBaseImageName(value);
+
+               if (!msg.isEmpty()) {
+                       isValid = false;
+               }
+
+               // changeItemState() -> changeWidgetState()
+               changeItemState(!isValid, INPUT_BOX_WIDTH, msg);
+
+               return isValid;
+       }
+
+       public static String checkBaseImageName(String newName) {
+               String errorMsg = "";
+
+               if (newName.length() > 30) {
+                       errorMsg = "Max length of name is 30";
+               } else if (newName.isEmpty()) {
+                       errorMsg = "Please, input base image name";
+               } else {
+                       BaseImage image = HelperClass.checkDuplicateBaseImageName(newName);
+                       if (image != null) {
+                               errorMsg = "Same name already exist!"
+                                               + StringResources.NEW_LINE
+                                               + newName + " ( " + image.getPlatformName() + " )"
+                                               + StringResources.NEW_LINE
+                                               + "Path: " + image.getPath();
+                       }
+               }
+               return errorMsg;
+       }
+
+       @Override
+       public void changeItemValue(PropertyValue property) {
+               // item list comp's changeItemListForBaseImageDialog() -> chnageItemValue()
+               if (property.isBaseImageValue()) {
+                       if (value != null && !value.isEmpty()) {
+                               return;
+                       }
+
+                       String path = property.getImageFilePath();
+                       if (path != null && !path.isEmpty()) {
+                               String fileName = path.substring(path
+                                               .lastIndexOf(File.separator) + 1, path.length());
+                               if (fileName.contains(".")) {
+                                       fileName = fileName.substring(0, fileName.lastIndexOf("."));
+                               }
+                               value = fileName;
+                               textInputBox.setText(value);
+                       }
+               }
+       }
+}
index ce28e00..79c921c 100644 (file)
@@ -6,7 +6,6 @@ import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Composite;
 import org.tizen.emulator.manager.renewal.resources.ImageResources;
-import org.tizen.emulator.manager.ui.renewal.dialog.DIALOG_MODE;
 import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem;
 import org.tizen.emulator.manager.ui.renewal.item.modify.common.TextInputBoxItem;
 import org.tizen.emulator.manager.ui.renewal.item.modify.comp.ModifyItem;
@@ -24,6 +23,15 @@ public class DescriptionItem extends TextInputBoxItem {
        }
 
        @Override
+       public void setInitialValue(PropertyValue value) {
+               if (value == null) {
+                       return;
+               }
+
+               this.value = value.getDescritpion();
+       }
+
+       @Override
        public void create(Composite parent) {
                create(parent, TITILE_ICON, INPUT_BOX_WIDTH, true);
                // call make body
@@ -34,11 +42,7 @@ public class DescriptionItem extends TextInputBoxItem {
                item.setItemHeight(ITEM_HEIGHT);
                item.setBodyLayoutForm();
 
-               if (getItemListComp().getDialogMode() == DIALOG_MODE.DETAIL) {
-                       // TODO
-               } else {
-                       createTextBox();
-               }
+               createTextBox();
        }
 
        // for create mode
@@ -62,15 +66,6 @@ public class DescriptionItem extends TextInputBoxItem {
        }
 
        @Override
-       public void setInitialValue(PropertyValue value) {
-               if (value == null) {
-                       return;
-               }
-
-               this.value = value.getDescritpion();
-       }
-
-       @Override
        public void setValue(PropertyValue value) {
                value.setDescription(this.value);
        }
index 16ebfa8..a469047 100644 (file)
@@ -69,21 +69,39 @@ public class PlatformItem extends ComboItem {
        }
 
        @Override
+       public void setInitialValue(PropertyValue value) {
+               selectedPlatform = value.getPlatform();
+               arch = value.getArchitecture();
+
+               profile = ProfileList.getProfile(value.getProfile());
+       }
+
+       @Override
        public void create(Composite parent) {
                item.init(parent);
                item.setItemTitle(createIconTitle(item, ImageResources.ICON_TITLE_VERSION));
                item.create();
 
-               createCombo(item, COMBO_WIDTH);
-
                button32 = new ImageButton(item.getBody(), SWT.RADIO);
                button64 = new ImageButton(item.getBody(), SWT.RADIO);
-               settingRadioButton();
 
-               profile = ProfileList.getProfile(getItemListComp().getPropertyValue().getProfile());
+               createCombo(item, COMBO_WIDTH);
+
+               settingRadioButton();
                initPlatformCombo();
        }
 
+       @Override
+       public void setValue(PropertyValue value) {
+               value.setPlatform(selectedPlatform);
+               value.setArchitecture(arch);
+       }
+
+       @Override
+       public ModifyDialogItem cloneItem() {
+               return new PlatformItem();
+       }
+
        private void settingRadioButton() {
                button32.setText("32 bit");
                button32.setFontColor(ColorResources.CONTENT_FONT.getColor());
@@ -102,9 +120,14 @@ public class PlatformItem extends ComboItem {
                data.top = new FormAttachment(0, top);
                button64.setLayoutData(data);
 
-               // set listener
-               button32.addListener(SWT.Selection, radioButtonListener);
-               button64.addListener(SWT.Selection, radioButtonListener);
+               if (getItemListComp().isDetailMode()) {
+                       button32.setEnabled(false, button32.isSelection());
+                       button64.setEnabled(false, button64.isSelection());
+               } else {
+                       // set listener
+                       button32.addListener(SWT.Selection, radioButtonListener);
+                       button64.addListener(SWT.Selection, radioButtonListener);
+               }
        }
 
        private Listener radioButtonListener = new Listener() {
@@ -115,14 +138,13 @@ public class PlatformItem extends ComboItem {
                                return;
                        }
                        if (button32.isSelection()) {
-                               Architecture arch = selectedPlatform.findArchitecture(32);
+                               arch = selectedPlatform.findArchitecture(32);
                                arch = arch != null ? arch : Architecture.i386;
                        }
                        if (button64.isSelection()) {
                                arch = Architecture.x86_64;
                        }
                }
-
        };
 
        private void initPlatformCombo() {
@@ -136,8 +158,8 @@ public class PlatformItem extends ComboItem {
 
                this.comboBox.clear();
 
-               if (getItemListComp().isModifyMode()) {
-                       addComboItem(selectedPlatform.getName());
+               if (getItemListComp().isDetailMode()) {
+                       addComboItem(selectedPlatform.getName(), selectedPlatform);
                        comboBox.select(0);
                        comboBox.setEnabled(false);
                } else {
@@ -146,25 +168,28 @@ public class PlatformItem extends ComboItem {
                        }
 
                        if (!comboBox.getItemList().isEmpty()) {
-                               if (selectedPlatform != null) {
+                               if (selectedPlatform != null && selectedPlatform.getProfile().equals(profile.getName())) {
                                        for (int i = 0; i < comboBox.getItemList().size(); i++) {
                                                if (selectedPlatform.getName().equals(comboBox.getItemList().get(i))) {
+                                                       // call item selected
                                                        selectComboItem(i);
                                                        break;
                                                }
                                        }
                                } else {
                                        selectComboItem(0);
-                                       comboSelected();
                                }
                        }
                }
        }
 
-       private void comboSelected() {
+       @Override
+       public void itemSelected(ComboBox comboBox) {
                selectedPlatform = (Platform)getSelectedData();
-               button32.setEnabled(false);
-               button64.setEnabled(false);
+
+               button32.setEnabled(false, false);
+               button64.setEnabled(false, false);
+
                for (Architecture arch : selectedPlatform.getArchitectureList()) {
                        if (arch == Architecture.i386
                                        || arch == Architecture.x86) {
@@ -174,54 +199,45 @@ public class PlatformItem extends ComboItem {
                        }
                }
 
-               button64.setSelection(false);
-               button32.setSelection(true);
+               // if platform does not support 64bit kernel, change architecture to 32bit from 64bit
+               if (arch.getBit() == 64 && !button64.isEnabled()) {
+                       arch = Architecture.default32Bit;
+               }
+
+               button32.setSelection(arch.getBit() == 32);
+               button64.setSelection(arch.getBit() == 64);
 
                // TODO
                getItemListComp().checkValid();
        }
 
        @Override
-       public void setInitialValue(PropertyValue value) {
-               selectedPlatform = value.getPlatform();
-               arch = value.getArchitecture();
-       }
-
-       @Override
-       public void itemSelected(ComboBox comboBox) {
-               // This is called when combo item is selected
-               comboSelected();
-       }
-
-       @Override
-       public void setValue(PropertyValue value) {
-               value.setPlatform(selectedPlatform);
-               value.setArchitecture(arch);
-       }
-
-       @Override
-       public ModifyDialogItem cloneItem() {
-               return new PlatformItem();
-       }
-
-       @Override
        public void changeItemValue(PropertyValue value) {
+               // changeItemLsitForBaseImageDialog call changeItemValue
+
+               // change profile
                if (profile == null || !profile.getName().equals(value.getProfile())) {
                        profile = ProfileList.getProfile(value.getProfile());
                        initPlatformCombo();
                }
 
+               // change image path
                if (imagePath == null || !imagePath.equals(value.getImageFilePath())) {
                        imagePath = value.getImageFilePath();
                        Architecture a = Architecture.findCpuTypeFromPath(imagePath);
                        if (a != null) {
-                               arch = selectedPlatform.findArchitecture(a.getBit());
+                               Architecture temp = selectedPlatform.findArchitecture(a.getBit());
+                               if (temp == null) {
+                                       // support x86 -> select x86_64
+                                       return;
+                               }
+                               arch = temp;
                                button32.setSelection(false);
                                button64.setSelection(false);
-                               if (arch.getBit() == 64) {
-                                       button64.setSelection(true);
-                               } else {
+                               if (arch.getBit() == 32) {
                                        button32.setSelection(true);
+                               } else {
+                                       button64.setSelection(true);
                                }
                        }
                }
index 9e14c64..c163809 100644 (file)
 
 package org.tizen.emulator.manager.ui.renewal.item.modify.common;
 
-import java.io.File;
-
 import org.eclipse.swt.widgets.Composite;
 import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.platform.BaseImage;
 import org.tizen.emulator.manager.renewal.resources.ImageResources;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.ui.Messages;
@@ -47,8 +44,6 @@ public class NameItem extends TextInputBoxItem {
 
        private final ImageResources TITLE_ICON_RESOURCE = ImageResources.ICON_TITLE_VMNAME;
        private final int INPUT_BOX_WIDTH = 236;
-       private String name;
-
 
        public NameItem(String name, String title) {
                super(name, title);
@@ -75,7 +70,6 @@ public class NameItem extends TextInputBoxItem {
                } else {
                        this.value = value.getName();
                }
-               name = this.value;
        }
 
        @Override
@@ -115,14 +109,6 @@ public class NameItem extends TextInputBoxItem {
                        msg = checkTemplateName(value);
                } else if (property.isVMValue()) {
                        msg = checkVMName(value);
-               } else if (property.isBaseImageValue()) {
-                       if (getItemListComp().isCloneMode() && !value.isEmpty()) {
-                               if (!value.equals(name)) {
-                                       msg = checkBaseImageName(value);
-                               }
-                       } else {
-                               msg = checkBaseImageName(value);
-                       }
                } else {
                        // TODO
                }
@@ -185,45 +171,4 @@ public class NameItem extends TextInputBoxItem {
 
                return errorMsg;
        }
-
-       public static String checkBaseImageName(String newName) {
-               String errorMsg = "";
-
-               if (newName.length() > 30) {
-                       errorMsg = "Max length of name is 30";
-               } else if (newName.isEmpty()) {
-                       errorMsg = "Please, input base image name";
-               } else {
-                       BaseImage image = HelperClass.checkDuplicateBaseImageName(newName);
-                       if (image != null) {
-                               errorMsg = "Same name already exist!"
-                                               + StringResources.NEW_LINE
-                                               + newName + " ( " + image.getPlatformName() + " )"
-                                               + StringResources.NEW_LINE
-                                               + "Path: " + image.getPath();
-                       }
-               }
-               return errorMsg;
-       }
-
-       @Override
-       public void changeItemValue(PropertyValue property) {
-               if (property.isBaseImageValue()) {
-                       if (value != null && !value.isEmpty()) {
-                               return;
-                       }
-
-                       String path = property.getImageFilePath();
-                       if (path != null && !path.isEmpty()) {
-                               String fileName = path.substring(path
-                                               .lastIndexOf(File.separator) + 1, path.length());
-                               if (fileName.contains(".")) {
-                                       fileName = fileName.substring(0, fileName.lastIndexOf("."));
-                               }
-                               value = fileName;
-                               textInputBox.setText(value);
-                               textModified();
-                       }
-               }
-       }
 }
index b15abc4..91d48ee 100644 (file)
@@ -232,7 +232,15 @@ public class ProfileItem extends ModifyDialogItem {
                                @Override
                                public void handleEvent(Event e) {
                                        if (e.type == SWT.Selection) {
-                                               if (!currentProfile.equals(profile)) {
+                                               if (currentProfile.equals(profile)) {
+                                                       return;
+                                               }
+
+                                               PropertyValue value = getItemListComp().getPropertyValue();
+                                               if (value.isBaseImageValue()) {
+                                                       value.setProfile(profile);
+                                                       getItemListComp().changeItemListForBaseImageDialog();
+                                               } else if (value.isTemplateValue()) {
                                                        getItemListComp().changeItemListByProfile(profile);
                                                }
                                        }
@@ -269,4 +277,8 @@ public class ProfileItem extends ModifyDialogItem {
                return new ProfileItem();
        }
 
+       @Override
+       public void changeItemValue(PropertyValue value) {
+               currentProfile = value.getProfile();
+       }
 }
index 09445f9..9f485c1 100644 (file)
@@ -78,8 +78,7 @@ public abstract class TextInputBoxItem extends ModifyDialogItem {
        protected void makeBody(int textBoxWidth, boolean needClearButton) {
                item.setBodyLayoutForm();
 
-               if (getItemListComp().getDialogMode() == DIALOG_MODE.MODIFY
-                               || getItemListComp().getDialogMode() == DIALOG_MODE.DETAIL) {
+               if (getItemListComp().isModifyMode() || getItemListComp().isDetailMode()) {
                        createTextLabel();
                } else {
                        createTextBox(textBoxWidth, needClearButton);
@@ -87,7 +86,7 @@ public abstract class TextInputBoxItem extends ModifyDialogItem {
        }
 
        // for create mode
-       private void createTextBox(int textBoxWidth, boolean needClearButton) {
+       protected void createTextBox(int textBoxWidth, boolean needClearButton) {
                FormData data = new FormData(textBoxWidth, ModifyItem.WIDGET_HEIGHT);
                data.top = new FormAttachment(0, (item.getHeight() - ModifyItem.WIDGET_HEIGHT) / 2);
                data.left = new FormAttachment(0, ModifyItem.BODY_MARGIN_LEFT);
@@ -113,7 +112,7 @@ public abstract class TextInputBoxItem extends ModifyDialogItem {
        }
 
 
-       private void createTextLabel() {
+       protected void createTextLabel() {
                // init canvas;
                Canvas detailCanvas = new Canvas(item.getBody(), SWT.NONE);
 
index ffc2f96..4fdfd1e 100644 (file)
@@ -431,7 +431,6 @@ public class PropertyValue {
                }
        }
 
-
        public boolean getCPUVirtualization() {
                if (isVMValue()) {
                        return vmValue.isHWVirtualization;
index 45b575e..eca0222 100644 (file)
@@ -106,6 +106,7 @@ public class ImageButton extends Canvas {
                                        ImageResources.RADIO_BUTTON_ON.getImage(),
                                        ImageResources.RADIO_BUTTON_ON.getImage(),
                                        ImageResources.RADIO_BUTTON_ON.getImage(),
+                                       ImageResources.RADIO_BUTTON_ON.getImage(),
                                        ImageResources.RADIO_BUTTON_OFF.getImage());
                }
        }
index 7b8acd4..4e0d978 100644 (file)
@@ -270,6 +270,8 @@ public class VMProperty {
 
                private String name;
                private int bit;
+               // for support old version (under 3.0)
+               public static final Architecture default32Bit = Architecture.x86;
 
                Architecture(String arch, int bit) {
                        this.name = arch;
@@ -320,7 +322,7 @@ public class VMProperty {
                                        }
                                }
                        }
-                       return i386;
+                       return null;
                }
 
                public static Architecture getType(String arch) {
@@ -329,7 +331,7 @@ public class VMProperty {
                                        return type;
                                }
                        }
-                       return i386;
+                       return null;
                }
        };