Merge: Merge from tizen_2.3
authorminkee.lee <minkee.lee@samsung.com>
Thu, 8 Jan 2015 05:03:22 +0000 (14:03 +0900)
committerminkee.lee <minkee.lee@samsung.com>
Thu, 8 Jan 2015 05:03:22 +0000 (14:03 +0900)
Change-Id: I99bd922fe509d4014c4131d46221feb8e14c4cd7
Signed-off-by: minkee.lee <minkee.lee@samsung.com>
44 files changed:
common-project/.classpath
common-project/resource/res/spinner_down.gif [new file with mode: 0644]
common-project/resource/res/spinner_up.gif [new file with mode: 0644]
common-project/src/org/tizen/emulator/manager/EmulatorManager.java
common-project/src/org/tizen/emulator/manager/console/ConsoleCreateVM.java
common-project/src/org/tizen/emulator/manager/platform/BaseImage.java
common-project/src/org/tizen/emulator/manager/platform/Skin.java
common-project/src/org/tizen/emulator/manager/plugin/EMPluginLoader.java
common-project/src/org/tizen/emulator/manager/resources/ImageResources.java
common-project/src/org/tizen/emulator/manager/resources/PatchImageResources.java
common-project/src/org/tizen/emulator/manager/tool/CheckEmulatorDir.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/AdvancedViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/DetailViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/LineLabelViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/OptionType.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/property/FileShareViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/property/MaxTouchViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/property/ResolutionSubViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/template/CheckLabelViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/template/CheckSubViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/template/ComboSubViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/template/ComboViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/template/FileSubViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/template/ISubViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/template/LabelViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/template/OnOffSubViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/template/SpinnerSubViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/template/SubViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/template/TextSubViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/template/TextViewItem.java
common-project/src/org/tizen/emulator/manager/ui/dialog/MessageDialog.java
common-project/src/org/tizen/emulator/manager/ui/widgets/CheckBoxButton.java [new file with mode: 0644]
common-project/src/org/tizen/emulator/manager/ui/widgets/CustomSpinner.java [new file with mode: 0644]
common-project/src/org/tizen/emulator/manager/ui/widgets/ImageButton.java
common-project/src/org/tizen/emulator/manager/ui/widgets/ImageCombo.java
common-project/src/org/tizen/emulator/manager/ui/widgets/ImageLabel.java
common-project/src/org/tizen/emulator/manager/ui/widgets/VMButton.java
common-project/src/org/tizen/emulator/manager/ui/widgets/WSTATE.java
common-project/src/org/tizen/emulator/manager/vms/VMWorkerCommon.java
common-project/src/org/tizen/emulator/manager/vms/helper/HelperClass.java
common-project/src/org/tizen/emulator/manager/vms/helper/ProcessOutputReader.java [new file with mode: 0644]
common-project/src/org/tizen/emulator/manager/vms/helper/ProcessResult.java [new file with mode: 0644]
package/changelog
package/pkginfo.manifest

index dae27ea..484d8e3 100644 (file)
@@ -8,5 +8,6 @@
        <classpathentry exported="true" kind="lib" path="lib/jsch-0.1.50.jar"/>
        <classpathentry kind="lib" path="lib/protobuf.jar"/>
        <classpathentry kind="lib" path="lib/jna-4.1.0.jar"/>
+       <classpathentry kind="lib" path="lib/jna-platform-4.1.0.jar"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/common-project/resource/res/spinner_down.gif b/common-project/resource/res/spinner_down.gif
new file mode 100644 (file)
index 0000000..1867dfc
Binary files /dev/null and b/common-project/resource/res/spinner_down.gif differ
diff --git a/common-project/resource/res/spinner_up.gif b/common-project/resource/res/spinner_up.gif
new file mode 100644 (file)
index 0000000..396902d
Binary files /dev/null and b/common-project/resource/res/spinner_up.gif differ
index a6357b1..e584cc0 100755 (executable)
@@ -309,7 +309,7 @@ public class EmulatorManager {
                CheckEmulatorDir.CheckSwapDir();
 
                PlatformList.makePlatformList();
-               EMPluginLoader.completeLoadPlugin();
+//             EMPluginLoader.completeLoadPlugin();
 
                if (isConsoleMode) {
                        EmulatorManager.startConsoleProcessor();
index 419950e..de6e571 100644 (file)
@@ -109,7 +109,7 @@ public class ConsoleCreateVM {
                                                for (Platform platform : PlatformList.getPlatformList()) {
                                                        if (platform.getName().equals(c.getCurrentValue())) {
                                                                for (CustomPlatform cp : PlatformList.getCustomPlatform()) {
-                                                                       if (platform.getProfile().equals(platform.getProfile())) {
+                                                                       if (platform.getProfile().equals(cp.getProfile())) {
                                                                                image = cp.getImageList().get(0);
                                                                                check = true;
                                                                                break;
index 7f4bf8f..6893c23 100644 (file)
@@ -123,7 +123,8 @@ public class BaseImage {
                                if (prop.get("[Meta]") != null) {
                                        loadOldProperty(prop);
                                } else {
-                                       imageName = prop.getProperty(StringResources.IMAGE_NAME).toLowerCase();
+                                       imageName = prop.getProperty(StringResources.IMAGE_NAME);
+//                                     imageName = prop.getProperty(StringResources.IMAGE_NAME).toLowerCase();
                                        if (imageName == null) {
                                                throw new IOException("Image name is null. This image can not add.");
                                        }
@@ -150,7 +151,8 @@ public class BaseImage {
        }
 
        private void loadOldProperty(Properties prop) throws IOException {
-               imageName = prop.getProperty(StringResources.IMAGE_NAME).toLowerCase();
+//             imageName = prop.getProperty(StringResources.IMAGE_NAME).toLowerCase();
+               imageName = prop.getProperty(StringResources.IMAGE_NAME);
                if (imageName == null) {
                        throw new IOException("Image name is null. This image can not add.");
                }
index 79720b5..35d1470 100644 (file)
@@ -83,8 +83,13 @@ public class Skin {
                                                }
                                        }
                                        if (this.resolution == null) {
-                                               throw new IOException("This resolution is not supported ( + " +
-                                                               re + ")");
+                                               try {
+                                                       this.resolution = new RESOLUTION(Integer.valueOf(width),
+                                                                       Integer.valueOf(height), "", 0);
+                                               } catch (NumberFormatException e) {
+                                                       throw new IOException("This resolution is not supported ( + " +
+                                                                       re + ")");
+                                               }
                                        }
                                }
 /*
index c26f713..c71a321 100644 (file)
@@ -95,7 +95,9 @@ public class EMPluginLoader {
                        if (jarFile != null) {
                                Attributes attr = null;
                                try {
-                                       attr = jarFile.getManifest().getMainAttributes();
+                                       if (jarFile.getManifest() != null) {
+                                               attr = jarFile.getManifest().getMainAttributes();
+                                       }
                                } catch (IOException e) {
                                        EMLogger.addStaticLog("Faile to load Manifest file: " + e.getMessage());
                                }
index 96149c0..434ef67 100644 (file)
@@ -168,7 +168,10 @@ public enum ImageResources {
        CHECKBOX_OFF("checkbox_off", ImageType.PNG),
 
        CHECKBOX_ON_DIS("checkbox_on_dis", ImageType.PNG),
-       CHECKBOX_OFF_DIS("checkbox_off_dis", ImageType.PNG)
+       CHECKBOX_OFF_DIS("checkbox_off_dis", ImageType.PNG),
+
+       SPINNER_UP("spinner_up"),
+       SPINNER_DOWN("spinner_down")
        ;
 
        String name;
index a677f79..f4fbed3 100644 (file)
@@ -53,6 +53,7 @@ public class PatchImageResources {
                                left.getImageData().width, 0,
                                width - left.getImageData().width + right.getImageData().width, height);
                gc.drawImage(right,  width - right.getImageData().width, 0);
+               gc.dispose();
                return image;
        }
 
@@ -74,6 +75,7 @@ public class PatchImageResources {
                                left.getImageData().width, 0,
                                width - left.getImageData().width + right.getImageData().width, height);
                gc.drawImage(right,  width - right.getImageData().width, 0);
+               gc.dispose();
                return image;
        }
 
@@ -95,6 +97,7 @@ public class PatchImageResources {
                                left.getImageData().width, 0,
                                width - left.getImageData().width + right.getImageData().width, height);
                gc.drawImage(right,  width - right.getImageData().width, 0);
+               gc.dispose();
                return image;
        }
 
@@ -108,10 +111,10 @@ public class PatchImageResources {
                gc.setInterpolation(SWT.NONE);
                gc.fillRectangle(0, 0, width, height);
 
-               // left         
+               // left
                gc.drawImage(left, 0, 0);
 
-               // middle               
+               // middle
                gc.drawImage(middle, 0, 0,
                                middle.getImageData().width, middle.getImageData().height,
                                left.getImageData().width, 0,
@@ -148,7 +151,7 @@ public class PatchImageResources {
                // right
                gc.drawImage(ImageResources.INPUTBOX_ON_RIGHT.getImage(),
                                width - left.getImageData().width, 0);
-               
+
                gc.dispose();
                return image;
        }
@@ -172,18 +175,18 @@ public class PatchImageResources {
                                middle.getImageData().width, middle.getImageData().height,
                                left.getImageData().width, 0,
                                width - left.getImageData().width * 2, height);
-               
+
                // right
                gc.drawImage(ImageResources.INPUTBOX_OFF_RIGHT.getImage(),
                                width - left.getImageData().width, 0);
-               
+
                gc.dispose();
                return image;
        }
 
        public static Image getSelectTabFolder(int width, int height) {
                Image image = new Image(Display.getCurrent(), width, height);
-               
+
                GC gc = new GC(image);
                gc.setInterpolation(SWT.NONE);
                gc.fillRectangle(0, 0, width, height);
@@ -198,18 +201,17 @@ public class PatchImageResources {
                                middle.getImageData().width, middle.getImageData().height,
                                left.getImageData().width, 0,
                                width - left.getImageData().width * 2, height);
-               
+
                // right
                gc.drawImage(ImageResources.TAB_SELECTED_RIGHT.getImage(),
                                width - left.getImageData().width , 0);
-               
-               gc.dispose();
 
+               gc.dispose();
                return image;
        }
 
        public static Image getUnselectedTabFolder(int width, int height) {
-               
+
                Image left = ImageResources.TAB_UNSELECTED_LEFT.getImage();
                Image middle = ImageResources.TAB_UNSELECTED_MIDDLE.getImage();
                Image right = ImageResources.TAB_UNSELECTED_RIGHT.getImage();
@@ -233,9 +235,7 @@ public class PatchImageResources {
 
                // right
                gc.drawImage(right, width - leftWidth , 0);
-               
                gc.dispose();
-
                return image;
        }
 
@@ -259,12 +259,10 @@ public class PatchImageResources {
                                middle.getImageData().width, middle.getImageData().height,
                                leftWidth, 0,
                                width - (leftWidth + rightWidth), height);
-               
+
                // right
                gc.drawImage(right, width - leftWidth , 0);
-               
                gc.dispose();
-               
                return image;
        }
 
@@ -324,6 +322,7 @@ public class PatchImageResources {
                Image temp = ImageResources.SCROLLBAR_BACK.getImage();
                gc.drawImage(temp, 0, 0, temp.getImageData().width, temp.getImageData().height,
                                0, 0, width, height);
+               gc.dispose();
                return image;
        }
 }
index 123435b..09fcd95 100644 (file)
@@ -51,6 +51,10 @@ public class CheckEmulatorDir {
                File emulator_vms = new File(FilePathResources.getOldTizenSdkDataEmulatorPath());
                if (emulator_vms == null || !emulator_vms.exists()) {
                        return false;
+
+               } else if (emulator_vms.list() == null) {
+                       return false;
+
                } else if (emulator_vms.list().length == 0) { // empty dir
                        emulator_vms.delete();
                        return false;
index 5001590..09015c1 100644 (file)
@@ -124,4 +124,6 @@ public abstract class AdvancedViewItem extends DetailViewItem {
                }
        }
 
+       public void setEnabled(boolean enabled) {}
+
 }
index b8e62c9..ea46757 100644 (file)
@@ -41,10 +41,10 @@ import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Canvas;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
 import org.tizen.emulator.manager.resources.ColorResources;
@@ -56,7 +56,7 @@ public abstract class DetailViewItem implements IInfoViewItem, IModifyViewItem {
        protected Composite comp   = null;
        protected DetailViewItem upperItem = null;
        protected DetailViewItem downItem  = null;
-       protected Label titleLabel;
+       protected Canvas titleLabel;
        protected String title;
        private boolean isCreateMode;
        protected boolean isMinMode = false;
@@ -210,7 +210,7 @@ public abstract class DetailViewItem implements IInfoViewItem, IModifyViewItem {
                        });
                }
 
-               titleLabel = new Label(compList.get(0), SWT.NONE);
+               titleLabel = new Canvas(compList.get(0), SWT.NONE);
                titleLabel.setFont(FontResources.DETAIL_TITLE_FONT.getFont());
                titleLabel.setForeground(ColorResources.DETAIL_TITILE_FONT_COLOR.getColor());
 
index 69391a5..b0d14f6 100644 (file)
@@ -44,12 +44,10 @@ 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.widgets.Label;
+import org.eclipse.swt.widgets.Canvas;
 import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.FontResources;
 import org.tizen.emulator.manager.resources.ImageResources;
-import org.tizen.emulator.manager.ui.detail.item.AdvancedViewItem;
-import org.tizen.emulator.manager.ui.detail.item.DetailViewItem;
 import org.tizen.emulator.manager.ui.widgets.ImageButton;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
 import org.tizen.emulator.manager.vms.xml.template.Item;
@@ -120,7 +118,7 @@ public class LineLabelViewItem extends DetailViewItem{
                        });
                }
 
-               titleLabel = new Label(compList.get(0), SWT.NONE);
+               titleLabel = new Canvas(compList.get(0), SWT.NONE);
                titleLabel.setFont(FontResources.DETAIL_TITLE_FONT.getFont());
                titleLabel.setForeground(ColorResources.DETAIL_TITILE_FONT_COLOR.getColor());
 
index 7a3ada5..d3a21c8 100644 (file)
@@ -41,9 +41,16 @@ public enum OptionType {
        HIDE_LABEL("hideLabel"),
        DEFAULT_IF_EMPTY("defaultIfEmpty"),
        SPREAD_ON_START("spreadOnStart"),
-       PROFILE("profile")
+       PROFILE("profile"),
+       MODIFY_ENABLE("modifyEnable")
        ;
 
+       public static final String VALUE_TRUE = "true";
+       public static final String VALUE_FALSE = "false";
+       public static final String VALUE_ON = "on";
+       public static final String VALUE_OFF = "off";
+
+
        private String name;
 
        private OptionType(String name) {
index a366005..237b591 100644 (file)
@@ -87,7 +87,7 @@ public class FileShareViewItem extends LabelViewItem {
 
        public void setDialogEnable(boolean enable) {
                if (dialogItem != null) {
-                       dialogItem.setEnable(enable);
+                       dialogItem.setEnabled(enable);
                }
        }
 
index 1646853..1f7db54 100644 (file)
@@ -40,6 +40,7 @@ import org.tizen.emulator.manager.ui.detail.item.LineLabelViewItem;
 import org.tizen.emulator.manager.ui.detail.item.template.TextViewItem;
 import org.tizen.emulator.manager.ui.widgets.ImageLabel;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
+import org.tizen.emulator.manager.vms.helper.HelperClass;
 import org.tizen.emulator.manager.vms.xml.template.Item;
 
 public class MaxTouchViewItem extends TextViewItem {
@@ -60,23 +61,20 @@ public class MaxTouchViewItem extends TextViewItem {
        }
 
        @Override
-       public void drawModify() {
-               valueLabel = new ImageLabel(compList.get(0), SWT.NONE);
-               valueLabel.setDisableImage(PatchImageResources.getInputBoxON(INPUTBOX_WIDTH));
+       public boolean settingModifyItem(VMPropertyValue value) {
+               if (isCreateMode() && useDefaultOnCreate) {
+                       newValue = defaultOnCreate;
 
-               FormData data = new FormData();
-               data.left       = new FormAttachment(0, INPUTBOX_OFFSET);
-               data.top        = new FormAttachment(0, INPUTBOX_TOP_GAP);
-               data.width      = valueLabel.getSize().x;
-               data.height = valueLabel.getSize().y;
-               valueLabel.setLayoutData(data);
-               valueLabel.setEnabled(false);
-       }
+               } else {
+                       newValue = String.valueOf(value.maxTouchCount);
+               }
 
-       @Override
-       public boolean settingModifyItem(VMPropertyValue value) {
-               newValue = String.valueOf(value.maxTouchCount);
-               valueLabel.setText(newValue);
+               if (modifyEnable) {
+                       text.setText(newValue);
+
+               } else {
+                       valueLabel.setText(newValue);
+               }
                return false;
        }
 
@@ -86,4 +84,28 @@ public class MaxTouchViewItem extends TextViewItem {
                valueLabel.setText(newValue);
                return false;
        }
+
+       @Override
+       public boolean checkValue() {
+               if (!modifyEnable) {
+                       return true;
+               }
+
+               boolean result = true;
+               String errMsg = null;
+               try {
+                       int val = Integer.parseInt(newValue);
+                       if (val <= 0) {
+                               errMsg = "Max touch value should be positive integer.";
+                               result = false;
+                       }
+
+               } catch(NumberFormatException e) {
+                       result = false;
+                       errMsg = "Max touch value should be integer number.";
+               }
+
+               HelperClass.setStatusBar(errMsg);
+               return result;
+       }
 }
index 0f56a29..06efd38 100644 (file)
@@ -63,6 +63,7 @@ public class ResolutionSubViewItem extends ComboSubViewItem {
 
        @Override
        protected void parseOption(List<Option> optionList) {
+               super.parseOption(optionList);
                resList = new ArrayList<RESOLUTION>();
                for (Option option : optionList) {
                        String[] split = option.getValue().split(",");
index ad9df59..8562d6c 100644 (file)
@@ -51,12 +51,13 @@ import org.tizen.emulator.manager.vms.xml.template.Option;
 public class CheckLabelViewItem extends LabelViewItem {
 
        private ImageButton checkBox;
-       private boolean hideLabel = false;
+       protected boolean hideLabel = false;
 
        public CheckLabelViewItem(Item template, LineLabelViewItem lineLabelViewItem) {
                super(template, lineLabelViewItem);
                TITLE_WIDTH = 60; // override
                parseOption(template.getOption());
+               lineLabelViewItem.addItem(name, this);
        }
 
        protected void parseOption(List<Option> optionList) {
index b0bc01f..1cdf738 100644 (file)
@@ -51,24 +51,24 @@ import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.FontResources;
 import org.tizen.emulator.manager.resources.ImageResources;
 import org.tizen.emulator.manager.ui.detail.item.OptionType;
-import org.tizen.emulator.manager.ui.widgets.ImageButton;
+import org.tizen.emulator.manager.ui.widgets.CheckBoxButton;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
 import org.tizen.emulator.manager.vms.xml.template.Item;
 import org.tizen.emulator.manager.vms.xml.template.Option;
 
-public class CheckSubViewItem implements ISubViewItem {
+public class CheckSubViewItem extends SubViewItem {
 
-       protected String name;
-       protected String title;
-       protected LabelViewItem parentItem;
-       protected Composite comp;  // parent
+//     protected String name;
+//     protected String title;
+//     protected LabelViewItem parentItem;
+//     protected Composite comp;  // parent
 
-       boolean oldValue;
-       boolean newValue;
+       protected boolean oldValue;
+       protected boolean newValue;
 
        protected Label titleLabel;
-       protected ImageButton detailCheckBox; // modify
-       protected ImageButton modifyCheckBox; // modify
+       protected CheckBoxButton detailCheckBox; // modify
+       protected CheckBoxButton modifyCheckBox; // modify
 
        private Label clickedLabel;
        private Rectangle labelRect = new Rectangle(0,0,100,20);
@@ -92,32 +92,28 @@ public class CheckSubViewItem implements ISubViewItem {
        public static String VALUE_ON = "on";
        public static String VALUE_OFF = "off";
 
-       private boolean useDefaultOnCreate = false;
-       private boolean defaultOnCreate = false;
-       private boolean disableOnCreate = false;
-       private boolean titleLabelMouseEnable = true;
+       protected boolean disableOnCreate = false;
+       protected boolean titleLabelMouseEnable = true;
 
-       private boolean defaultIfEmpty = true;
+       protected boolean defaultIfEmpty = true;
 
        public CheckSubViewItem(LabelViewItem parentItem, Composite comp, Item template, boolean isOdd) {
-               this.parentItem = parentItem;
-               this.comp = comp;
-               this.name = template.getName();
-               this.title = template.getTitle();
-               if (!isOdd) {
-                       CHECKBOX_LEFT_GAP += ODD_GAP;
+               super(parentItem, comp, template);
+               if (parentItem instanceof CheckLabelViewItem) {
+                       if (!isOdd) {
+                               CHECKBOX_LEFT_GAP += ODD_GAP;
+                       }
+
+               } else { // LableViewItem's subitem
+                       CHECKBOX_LEFT_GAP = CATEGORY_OFFSET;
                }
+
                parseOption(template.getOption());
        }
 
        protected void parseOption(List<Option> optionList) {
+               super.parseOption(optionList);
                for (Option option : optionList) {
-                       if (option.getName().equals(OptionType.DEFAULT_ON_CREATE.getName())) {
-                               useDefaultOnCreate = true;
-                               if(option.getValue().equals(VALUE_ON)) {
-                                       defaultOnCreate = true;
-                               }
-                       }
                        if (option.getName().equals(OptionType.DEFAULT_IF_EMPTY.getName())) {
                                if(option.getValue().equals(VALUE_OFF)) {
                                        defaultIfEmpty = false;
@@ -129,16 +125,39 @@ public class CheckSubViewItem implements ISubViewItem {
                }
        }
 
+       public void setTitleLabelEnabled(boolean enabled) {
+               titleLabel.setEnabled(enabled);
+               if (enabled) {
+                       titleLabel.setForeground(ColorResources.DETAIL_ENABLE_FONT_COLOR.getColor());
+               } else {
+                       titleLabel.setForeground(ColorResources.DETAIL_DISABLE_FONT_COLOR.getColor());
+               }
+       }
+
+       public void setTitleToolTipText(String text) {
+               titleLabel.setToolTipText(text);
+       }
+
+       public boolean getValue() {
+               return newValue;
+       }
+
+       @Override
+       public String getName() {
+               return name;
+       }
+
        @Override
        public void drawDetail() {
                // checkbox image
-               detailCheckBox = new ImageButton(comp, SWT.NONE);
+               detailCheckBox = new CheckBoxButton(comp, SWT.NONE);
                detailCheckBox.setImages(ImageResources.CHECKBOX_ON_DIS.getImage(), // on normal
                                ImageResources.CHECKBOX_ON_DIS.getImage(),
                                ImageResources.CHECKBOX_ON_DIS.getImage(),
                                ImageResources.CHECKBOX_OFF_DIS.getImage(),  // off normal
                                ImageResources.CHECKBOX_OFF_DIS.getImage(),
                                ImageResources.CHECKBOX_OFF_DIS.getImage(),
+                               ImageResources.CHECKBOX_ON_DIS.getImage(), // disable
                                ImageResources.CHECKBOX_OFF_DIS.getImage()); // disable
 
                FormData data = new FormData();
@@ -152,7 +171,6 @@ public class CheckSubViewItem implements ISubViewItem {
                // text label
                titleLabel = new Label(comp, SWT.NONE);
                titleLabel.setFont(FontResources.DETAIL_LABEL_FONT.getFont());
-               titleLabel.setForeground(ColorResources.DETAIL_ENABLE_FONT_COLOR.getColor());
                titleLabel.setBackground(ColorResources.DETAIL_MIDDLE_COLOR.getColor());
 
 //             titleLabel.setFont(FontResources.DETAIL_TITLE_FONT.getFont());
@@ -166,44 +184,22 @@ public class CheckSubViewItem implements ISubViewItem {
                data.width  = TITLE_WIDTH;
                titleLabel.setLayoutData(data);
                titleLabel.setText(title);
-
+               setTitleLabelEnabled(false);
        }
 
 
        @Override
        public void drawModify() {
                // checkbox
-               modifyCheckBox = new ImageButton(comp, SWT.TOGGLE);
-               modifyCheckBox.setImages(ImageResources.CHECKBOX_ON.getImage(), // on normal
-                               ImageResources.CHECKBOX_ON.getImage(),
-                               ImageResources.CHECKBOX_ON.getImage(),
-                               ImageResources.CHECKBOX_OFF.getImage(),  // off normal
-                               ImageResources.CHECKBOX_OFF.getImage(),
-                               ImageResources.CHECKBOX_OFF.getImage(),
-//                             ImageResources.CHECKBOX_OFF_DIS.getImage(), // disable
-                               ImageResources.CHECKBOX_ON_DIS.getImage()); // disable
-
-               modifyCheckBox.addSelectionListener(new SelectionListener() {
-
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               if (modifyCheckBox.isSelection()) { // NOT SUPPORT
-                                       newValue = false;
-
-                               } else { // SUPPORT
-                                       newValue = true;
-
-                               }
-                               if (!parentItem.isCreateMode()) {
-                                       parentItem.getListener().ChangeValue(parentItem.getThis());
-                               }
-                       }
-
-                       @Override
-                       public void widgetDefaultSelected(SelectionEvent e) {
-                               // TODO Auto-generated method stub
-                       }
-               });
+               modifyCheckBox = new CheckBoxButton(comp, SWT.TOGGLE);
+               modifyCheckBox.setImages(ImageResources.CHECKBOX_OFF.getImage(), // on normal
+                               ImageResources.CHECKBOX_OFF.getImage(), // hover
+                               ImageResources.CHECKBOX_OFF.getImage(), // pushed
+                               ImageResources.CHECKBOX_ON.getImage(),  // select
+                               ImageResources.CHECKBOX_ON.getImage(),  // select_hover
+                               ImageResources.CHECKBOX_ON.getImage(),  // select_pushed
+                               ImageResources.CHECKBOX_ON_DIS.getImage(), // disable_normal
+                               ImageResources.CHECKBOX_OFF_DIS.getImage()); // disable_select
 
                FormData data = new FormData();
                data = new FormData();
@@ -216,7 +212,6 @@ public class CheckSubViewItem implements ISubViewItem {
                // text label
                titleLabel = new Label(comp, SWT.NONE);
                titleLabel.setFont(FontResources.DETAIL_LABEL_FONT.getFont());
-               titleLabel.setForeground(ColorResources.DETAIL_ENABLE_FONT_COLOR.getColor());
                titleLabel.setBackground(ColorResources.DETAIL_MIDDLE_COLOR.getColor());
 
 //             titleLabel.setFont(FontResources.DETAIL_TITLE_FONT.getFont());
@@ -230,8 +225,37 @@ public class CheckSubViewItem implements ISubViewItem {
                data.width  = TITLE_WIDTH;
                titleLabel.setLayoutData(data);
                titleLabel.setText(title);
+               setTitleLabelEnabled(true);
 
-               addListener();
+               addTitleLabelListener();
+               addCheckboxListener();
+       }
+
+       protected void addCheckboxListener() {
+               modifyCheckBox.addSelectionListener(new SelectionListener() {
+
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               if (modifyCheckBox.isSelection()) {
+                                       oldValue = newValue = true;
+
+                               } else {
+                                       oldValue = newValue = false;
+                               }
+
+                               if (parentItem.isCreateMode()) {
+                                       parentItem.getListener().changeConfirmButton();
+                               } else {
+                                       parentItem.getListener().changeConfirmButton(
+                                                       parentItem.getThis());
+                               }
+                       }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
        }
 
        @Override
@@ -255,25 +279,20 @@ public class CheckSubViewItem implements ISubViewItem {
        public boolean settingModifyItem(VMPropertyValue value) {
 
                // Set value.
-               if (parentItem.isCreateMode() && useDefaultOnCreate) {
-                       newValue = oldValue = defaultOnCreate;
-               } else {
-                       String onOffVal = value.getAdvancedOptionSubValue(parentItem.getName(), name).toLowerCase();
-                       newValue = oldValue = checkOnOff(onOffVal);
-               }
+               String val = getModifyValue(value);
+               newValue = oldValue = checkOnOff(val);
 
                // Set enable/disable
                if (parentItem.isCreateMode() && disableOnCreate) {
-                       modifyCheckBox.setEnabled(false);
-                       titleLabelMouseEnable = false;
+                       setEnabled(false);
                } else {
-                       modifyCheckBox.setEnabled(true);
-                       titleLabelMouseEnable = true;
+                       setEnabled(true);
                }
 
                // Set checkbox state.
-               modifyCheckBox.setSelection( newValue ? false : true); // false is checked.
-
+               modifyCheckBox.setChecked(newValue);
+               modifyCheckBox.notifyListeners(SWT.Selection, new Event());
+               setItemState();
                return false;
        }
 
@@ -294,19 +313,20 @@ public class CheckSubViewItem implements ISubViewItem {
        }
 
        public void setCheckBox(boolean checked) {
-               if (checked) {
-                       newValue = true;
-                       modifyCheckBox.setSelection(false);
-               } else {
-                       newValue = false;
-                       modifyCheckBox.setSelection(true);
-               }
-               if (!parentItem.isCreateMode()) {
-                       parentItem.getListener().ChangeValue(parentItem.getThis());
+               if (modifyCheckBox != null) {
+                       oldValue = newValue = checked;
+                       modifyCheckBox.setSelection(checked);
+
+                       if (parentItem.isCreateMode()) {
+                               parentItem.getListener().changeConfirmButton();
+                       } else {
+                               parentItem.getListener().changeConfirmButton(
+                                               parentItem.getThis());
+                       }
                }
        }
 
-       private boolean checkOnOff(String onOffVal) {
+       protected boolean checkOnOff(String onOffVal) {
                if (onOffVal.equals(VALUE_ON)) {
                        return true;
                } else if (onOffVal.equals(VALUE_OFF)) {
@@ -333,6 +353,7 @@ public class CheckSubViewItem implements ISubViewItem {
                                if (labelRect.contains(event.x, event.y)) {
                                        if (clickedLabel == label) {
                                                label.redraw();
+                                               modifyCheckBox.setChecked(!modifyCheckBox.isSelection());
                                                label.notifyListeners(SWT.Selection, new Event());
                                                //notifyListeners(SWT.DefaultSelection, new Event());
                                        }
@@ -351,12 +372,14 @@ public class CheckSubViewItem implements ISubViewItem {
 
                @Override
                public void widgetSelected(SelectionEvent e) {
-                       if (modifyCheckBox.isSelection()) { // NOT SUPPORT
-                               setCheckBox(true);  // change check-box
+                       if (modifyCheckBox.isSelection()) {
+                               setCheckBox(true);
 
-                       } else { // SUPPORT
+                       } else {
                                setCheckBox(false);
                        }
+
+                       modifyCheckBox.notifyListeners(SWT.Selection, new Event());
                }
                @Override
                public void widgetDefaultSelected(SelectionEvent e) {
@@ -364,18 +387,28 @@ public class CheckSubViewItem implements ISubViewItem {
                }
        };
 
-       private void addListener() {
-
+       protected void addTitleLabelListener() {
                titleLabel.addListener(SWT.MouseDown, mouseListener);
                titleLabel.addListener(SWT.MouseUp, mouseListener);
                titleLabel.addListener(SWT.MouseEnter, mouseListener);
                titleLabel.addListener(SWT.MouseExit, mouseListener);
                titleLabel.addListener(SWT.Selection, new TypedListener(selectionListener));
-
                modifyCheckBox.addListener(SWT.MouseEnter, mouseListener);
+       }
 
+       public String getItemValue(VMPropertyValue value) {
+               return value.getAdvancedOptionSubValue(parentItem.getName(), name).toLowerCase();
        }
 
+       public void setEnabled(boolean enabled) {
+               modifyCheckBox.setEnabled(enabled);
+               titleLabelMouseEnable = enabled;
+               setTitleLabelEnabled(enabled);
+       }
 
+       public void setChecked(boolean checked) {
+               oldValue = newValue = checked;
+               modifyCheckBox.setChecked(checked);
+       }
 
 }
index 6f2666a..51de136 100644 (file)
@@ -62,15 +62,14 @@ public class ComboSubViewItem extends SubViewItem {
        protected Image INPUTBOX_ON_IMAGE = null;
        protected static int COMBO_WIDTH = 105;
 
-       protected boolean useDefaultOnCreate = false;
-       protected String defaultOnCreate = null;
-
        public ComboSubViewItem(LabelViewItem parentItem, Composite comp, Item template) {
                super(parentItem, comp, template);
                parseOption(template.getOption());
        }
 
+       @Override
        protected void parseOption(List<Option> optionList) {
+               super.parseOption(optionList);
                for (Option option : optionList) {
                        if (option.getName().equals(OptionType.COMBO_LIST.getName())) {
                                String[] split = option.getValue().split(",");
@@ -78,11 +77,6 @@ public class ComboSubViewItem extends SubViewItem {
                                        comboOptions.add(s.trim());
                                }
                        }
-
-                       if (option.getName().equals(OptionType.DEFAULT_ON_CREATE.getName())) {
-                               useDefaultOnCreate = true;
-                               defaultOnCreate = option.getValue();
-                       }
                }
        }
 
@@ -98,6 +92,7 @@ public class ComboSubViewItem extends SubViewItem {
                combo.setImage(WSTATE.NORMAL, INPUTBOX_ON_IMAGE);
                combo.setImage(WSTATE.PUSH, INPUTBOX_ON_IMAGE);
                combo.setImage(WSTATE.HOVER, INPUTBOX_ON_IMAGE);
+               combo.setImage(WSTATE.DISABLE_ON, INPUTBOX_ON_IMAGE);
 
                combo.setArrowButtonImage(ImageResources.ARROW_DROPDOWN.getImage());
                combo.setEnabled(true);
@@ -148,11 +143,7 @@ public class ComboSubViewItem extends SubViewItem {
 
        @Override
        public boolean settingModifyItem(VMPropertyValue value) {
-               if (parentItem.isCreateMode() && useDefaultOnCreate) {
-                       newValue = defaultOnCreate;
-               } else {
-                       newValue = value.getAdvancedOptionSubValue(parentItem.getName(), name);
-               }
+               newValue = getModifyValue(value);
 
                // make combo box list
                combo.removeAll();
@@ -177,6 +168,8 @@ public class ComboSubViewItem extends SubViewItem {
                                combo.select(index);
                        }
                }
+
+               setItemState();
                return true;
        }
 
@@ -192,4 +185,8 @@ public class ComboSubViewItem extends SubViewItem {
                }
        }
 
+       @Override
+       public void setEnabled(boolean enabled) {
+               combo.setEnabled(enabled);
+       }
 }
index e5f46ea..5762f75 100644 (file)
@@ -73,8 +73,13 @@ public class ComboViewItem extends AdvancedViewItem{
        protected Image INPUTBOX_OFF_IMAGE = null;
        protected int COMBOBOX_WIDTH = 175;
 
-       private boolean useDefaultOnCreate = false;
-       private String defaultOnCreate = null;
+       protected boolean useDefaultOnCreate = false;
+       protected String defaultOnCreate = null;
+
+       public String getValue()
+       {
+               return newValue;
+       }
 
        public ComboViewItem(Item template, LineLabelViewItem lineLabelViewItem) {
                super(lineLabelViewItem);
@@ -141,6 +146,9 @@ public class ComboViewItem extends AdvancedViewItem{
                if (INPUTBOX_ON_IMAGE != null) {
                        INPUTBOX_ON_IMAGE.dispose();
                }
+               if (INPUTBOX_OFF_IMAGE != null) {
+                       INPUTBOX_OFF_IMAGE.dispose();
+               }
        }
 
        @Override
@@ -154,10 +162,15 @@ public class ComboViewItem extends AdvancedViewItem{
                        INPUTBOX_ON_IMAGE = PatchImageResources.getInputBoxON(COMBOBOX_WIDTH);
                }
 
+               if (INPUTBOX_OFF_IMAGE == null) {
+                       INPUTBOX_OFF_IMAGE = PatchImageResources.getInputBoxOff(COMBOBOX_WIDTH);
+               }
+
                combo = new ImageCombo(compList.get(0), SWT.NONE);
                combo.setImage(WSTATE.NORMAL, INPUTBOX_ON_IMAGE);
                combo.setImage(WSTATE.PUSH, INPUTBOX_ON_IMAGE);
                combo.setImage(WSTATE.HOVER, INPUTBOX_ON_IMAGE);
+               combo.setImage(WSTATE.DISABLE_ON, INPUTBOX_ON_IMAGE);
 
                combo.setArrowButtonImage(ImageResources.ARROW_DROPDOWN.getImage());
                combo.setEnabled(true);
@@ -240,4 +253,8 @@ public class ComboViewItem extends AdvancedViewItem{
                return true;
        }
 
+       public void resetCombo() {
+
+       }
+
 }
index aa0a981..167945d 100644 (file)
@@ -83,6 +83,7 @@ public class FileSubViewItem extends SubViewItem {
        public FileSubViewItem(LabelViewItem parentItem, Composite comp, Item template) {
                super(parentItem, comp, template);
 
+               super.parseOption(template.getOption());
                List<Option> optionList = template.getOption();
                for (Option option : optionList) {
                        if (option.getName().equals(OptionType.FILE_FILTER.getName())) {
@@ -209,16 +210,18 @@ public class FileSubViewItem extends SubViewItem {
 
        @Override
        public boolean settingModifyItem(VMPropertyValue value) {
-               newValue = value.getAdvancedOptionSubValue(parentItem.getName(), name);
+               newValue = getModifyValue(value);
                String fileName = newValue.substring(newValue
                                .lastIndexOf(File.separator) + 1, newValue.length());
                filePathLabel.setText(fileName);
                filePathLabel.setToolTipText(newValue);
+               setItemState();
                return true;
        }
 
-       public void setEnable(boolean enable) {
-               selectFileButton.setEnabled(enable);
+       @Override
+       public void setEnabled(boolean enabled) {
+               selectFileButton.setEnabled(enabled);
        }
 
        @Override
@@ -230,4 +233,5 @@ public class FileSubViewItem extends SubViewItem {
                }
        }
 
+
 }
index 7b86e32..8ee84d0 100644 (file)
@@ -40,4 +40,10 @@ public interface ISubViewItem {
        public void setValue(VMPropertyValue value);
        public boolean settingModifyItem(VMPropertyValue value);
        public void closeItem();
+       public String getName();
+       public void setEnabled(boolean enabled);
+       public Boolean getModifyEnable();
+       public void setModifyEnable(boolean enable);
+       public String getItemValue(VMPropertyValue value);
+       public String getModifyValue(VMPropertyValue value);
 }
index d459ad7..3c2efa4 100644 (file)
@@ -49,6 +49,7 @@ public class LabelViewItem extends AdvancedViewItem{
        protected Item template;
        boolean isDeviceItem;
        boolean spreadOnStart = true;
+       protected boolean modifyEnable = true;
 
        public LabelViewItem(Item template, LineLabelViewItem lineLabelViewItem) {
                super(lineLabelViewItem);
@@ -72,9 +73,14 @@ public class LabelViewItem extends AdvancedViewItem{
        private void parseOption(List<Option> optionList) {
                for (Option option : optionList) {
                        if (option.getName().equals(OptionType.SPREAD_ON_START.getName())) {
-                               if(option.getValue().equals("false")) {
+                               if(option.getValue().equals(OptionType.VALUE_FALSE)){
                                        this.spreadOnStart = false;
                                }
+
+                       } else if (option.getName().equals(OptionType.MODIFY_ENABLE.getName())) {
+                               if (option.getValue().equals(OptionType.VALUE_FALSE)) {
+                                       modifyEnable = false;
+                               }
                        }
                }
        }
@@ -150,6 +156,9 @@ public class LabelViewItem extends AdvancedViewItem{
        public void drawModify() {
                for (ISubViewItem subItem : getSubItemList()) {
                        subItem.drawModify();
+                       if (subItem.getModifyEnable() == null) {
+                               subItem.setModifyEnable(modifyEnable);
+                       }
                }
        }
 
index c92730a..556f59e 100644 (file)
@@ -157,10 +157,8 @@ public class OnOffSubViewItem extends SubViewItem{
 
        @Override
        public boolean settingModifyItem(VMPropertyValue value) {
-               onOffButton.setEnabled(true);
-               boolean onOff = value.getAdvancedOptionSubValue(parentItem.getName(), name)
-                               .toLowerCase().equals(VALUE_ON) ? true : false;
-               newValue = oldValue = onOff;
+               String val = getModifyValue(value);
+               newValue = oldValue = val.equals(VALUE_ON) ? true : false;
 
                if (oldValue) {
                        onOffButton.setSelection(false);
@@ -169,6 +167,7 @@ public class OnOffSubViewItem extends SubViewItem{
                        onOffButton.setSelection(true);
                        buttonLabel.setText(StringResources.NOT_SUPPORTED);
                }
+               setItemState();
                return true;
        }
 
index 19d2176..405b37f 100644 (file)
@@ -46,6 +46,7 @@ import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.FontResources;
 import org.tizen.emulator.manager.resources.PatchImageResources;
 import org.tizen.emulator.manager.ui.detail.item.ItemChangeState;
+import org.tizen.emulator.manager.ui.widgets.CustomSpinner;
 import org.tizen.emulator.manager.ui.widgets.ImageLabel;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
 import org.tizen.emulator.manager.vms.xml.template.Item;
@@ -56,7 +57,8 @@ public class SpinnerSubViewItem extends SubViewItem {
        protected int newValue;
 
        // for modify view
-       protected Spinner spinner;
+//     protected Spinner spinner;
+       protected CustomSpinner spinner;
        protected int SPINNER_WIDTH = 105;
        private Image INPUTBOX_ON_IMAGE = null;
 
@@ -86,18 +88,19 @@ public class SpinnerSubViewItem extends SubViewItem {
 
                valueLabel.setLayout(new FormLayout());
 
-               spinner = new Spinner(valueLabel, SWT.NONE);
-               spinner.setValues(0, 0, 999, 0, 1, 1);
+//             spinner = new Spinner(valueLabel, SWT.NONE);
+               spinner = new CustomSpinner(valueLabel, SWT.NONE);
+               spinner.setValues(0, 0, 999, 0, 1, 10);
                spinner.setTextLimit(3);
-
+//
                spinner.setBackground(ColorResources.DETAIL_INPUT_BOX_COLOR.getColor());
                spinner.setFont(FontResources.DETAIL_LABEL_FONT.getFont());
                spinner.setForeground(ColorResources.DETAIL_ENABLE_FONT_COLOR.getColor());
 
                data = new FormData();
                data.left       = new FormAttachment(0, 5);
-               data.top        = new FormAttachment(0, 1);
-               data.right      = new FormAttachment(100, -2);
+               data.top        = new FormAttachment(0, 2);
+               data.right      = new FormAttachment(100, -5);
                data.bottom = new FormAttachment(100, -2);
                spinner.setLayoutData(data);
 
index 55d67f3..645b7db 100644 (file)
@@ -31,6 +31,8 @@
 
 package org.tizen.emulator.manager.ui.detail.item.template;
 
+import java.util.List;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.FormAttachment;
@@ -38,8 +40,11 @@ import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.widgets.Composite;
 import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.PatchImageResources;
+import org.tizen.emulator.manager.ui.detail.item.OptionType;
 import org.tizen.emulator.manager.ui.widgets.ImageLabel;
+import org.tizen.emulator.manager.vms.VMPropertyValue;
 import org.tizen.emulator.manager.vms.xml.template.Item;
+import org.tizen.emulator.manager.vms.xml.template.Option;
 
 public abstract class SubViewItem implements ISubViewItem {
        // for category
@@ -58,6 +63,11 @@ public abstract class SubViewItem implements ISubViewItem {
        protected static int LABEL_WIDTH = 105;
        protected static int TOP_GAP    = 3;
 
+       protected boolean useDefaultOnCreate = false;
+       protected String defaultOnCreate = null;
+       protected Boolean modifyEnable = null;
+
+
        public SubViewItem(LabelViewItem parentItem, Composite comp, Item template) {
                this.parentItem = parentItem;
                this.comp = comp;
@@ -65,6 +75,28 @@ public abstract class SubViewItem implements ISubViewItem {
                this.title = template.getTitle();
        }
 
+       protected void parseOption(List<Option> optionList) {
+               for (Option option : optionList) {
+                       if (option.getName().equals(OptionType.DEFAULT_ON_CREATE.getName())) {
+                               useDefaultOnCreate = true;
+                               defaultOnCreate = option.getValue();
+
+                       } else if (option.getName().equals(OptionType.MODIFY_ENABLE.getName())) {
+                               if (option.getValue().equals(OptionType.VALUE_FALSE)) {
+                                       modifyEnable = false;
+
+                               } else if (option.getValue().equals(OptionType.VALUE_TRUE)) {
+                                       modifyEnable = true;
+                               }
+                       }
+               }
+       }
+
+       @Override
+       public String getName() {
+               return name;
+       }
+
        @Override
        public void drawDetail() {
                // draw category
@@ -117,5 +149,38 @@ public abstract class SubViewItem implements ISubViewItem {
                }
        }
 
+       @Override
+       public void setEnabled(boolean enabled) {}
+
+       @Override
+       public Boolean getModifyEnable() {
+               return modifyEnable;
+       }
+
+       @Override
+       public void setModifyEnable(boolean enable){
+               modifyEnable = enable;
+       }
+
+       public void setItemState() {
+               if (modifyEnable != null) {
+                       setEnabled(modifyEnable);
+               }
+       }
+
+       @Override
+       public String getItemValue(VMPropertyValue value) {
+               return value.getAdvancedOptionSubValue(parentItem.getName(), name);
+       }
+
+       @Override
+       public String getModifyValue(VMPropertyValue value) {
+               if (parentItem.isCreateMode() && useDefaultOnCreate) {
+                       return defaultOnCreate;
+
+               } else {
+                       return getItemValue(value);
+               }
+       }
 
 }
index bd59e69..46e98f5 100644 (file)
@@ -78,7 +78,7 @@ public class TextSubViewItem extends SubViewItem {
 
                valueLabel = new ImageLabel(comp, SWT.NONE);
                valueLabel.setEnableImage(INPUTBOX_ON_IMAGE);
-               valueLabel.setDisableImage(INPUTBOX_OFF_IMAGE);
+//             valueLabel.setDisableImage(INPUTBOX_OFF_IMAGE);
                valueLabel.setLayout(new FormLayout());
 
                FormData data = new FormData();
@@ -148,17 +148,33 @@ public class TextSubViewItem extends SubViewItem {
 
        @Override
        public boolean settingModifyItem(VMPropertyValue value) {
-               newValue = value.getAdvancedOptionSubValue(parentItem.getName(), name);
+               newValue = getModifyValue(value);
                text.setText(newValue);
+               setItemState();
                return false;
        }
 
-       @Override
-       public void closeItem() {
-               super.closeItem();
+       public void setEnabled(boolean enabled) {
+               valueLabel.setEnabled(enabled);
+               text.setEnabled(enabled);
+       }
+
+       public void resetText(boolean enabled) {
+
+               if (enabled) {
+                       // enable text input
+                       setEnabled(true);
+                       newValue = oldValue; // restore
+
+               } else {
+                       // disable text input
+                       setEnabled(false);
+                       oldValue = newValue; // save
+                       newValue = "";
+               }
 
-               if (INPUTBOX_ON_IMAGE != null) {
-                       INPUTBOX_ON_IMAGE.dispose();
+               if (newValue != null) {
+                       text.setText(newValue);
                }
        }
 
index b5d1ff2..66099e3 100644 (file)
@@ -31,6 +31,8 @@
 
 package org.tizen.emulator.manager.ui.detail.item.template;
 
+import java.util.List;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.KeyAdapter;
 import org.eclipse.swt.events.KeyEvent;
@@ -47,10 +49,12 @@ import org.tizen.emulator.manager.resources.PatchImageResources;
 import org.tizen.emulator.manager.ui.detail.item.AdvancedViewItem;
 import org.tizen.emulator.manager.ui.detail.item.ItemChangeState;
 import org.tizen.emulator.manager.ui.detail.item.LineLabelViewItem;
+import org.tizen.emulator.manager.ui.detail.item.OptionType;
 import org.tizen.emulator.manager.ui.widgets.ImageLabel;
 import org.tizen.emulator.manager.vms.VMProperty;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
 import org.tizen.emulator.manager.vms.xml.template.Item;
+import org.tizen.emulator.manager.vms.xml.template.Option;
 
 public class TextViewItem extends AdvancedViewItem{
 
@@ -68,6 +72,12 @@ public class TextViewItem extends AdvancedViewItem{
        protected Image INPUTBOX_ON_IMAGE = null;
        protected Image INPUTBOX_OFF_IMAGE = null;
 
+       protected boolean modifyEnable = true;
+       protected boolean useDefaultOnCreate = false;
+       protected String defaultOnCreate = null;
+
+       protected String VALUE_FALSE = "false";
+
        public TextViewItem(Item template, LineLabelViewItem lineLabelViewItem) {
                super(lineLabelViewItem);
                if (lineLabelViewItem == null) {
@@ -76,6 +86,21 @@ public class TextViewItem extends AdvancedViewItem{
                name = template.getName();
                title = template.getTitle();
                count = 1;
+               parseOption(template.getOption());
+       }
+
+       protected void parseOption(List<Option> optionList) {
+               for (Option option : optionList) {
+                       if (option.getName().equals(OptionType.DEFAULT_ON_CREATE.getName())) {
+                               useDefaultOnCreate = true;
+                               defaultOnCreate = option.getValue();
+
+                       } else if (option.getName().equals(OptionType.MODIFY_ENABLE.getName())) {
+                               if (option.getValue().equals(VALUE_FALSE)) {
+                                       modifyEnable = false;
+                               }
+                       }
+               }
        }
 
        @Override
@@ -96,41 +121,53 @@ public class TextViewItem extends AdvancedViewItem{
 
        @Override
        public void drawModify() {
+               if (modifyEnable) {
+                       if (INPUTBOX_ON_IMAGE == null) {
+                               INPUTBOX_ON_IMAGE = PatchImageResources.getInputBoxON(INPUTBOX_WIDTH);
+                       }
 
-               if (INPUTBOX_ON_IMAGE == null) {
-                       INPUTBOX_ON_IMAGE = PatchImageResources.getInputBoxON(INPUTBOX_WIDTH);
-               }
+                       if (INPUTBOX_OFF_IMAGE == null) {
+                               INPUTBOX_OFF_IMAGE = PatchImageResources.getInputBoxOff(INPUTBOX_WIDTH);
+                       }
 
-               if (INPUTBOX_OFF_IMAGE == null) {
-                       INPUTBOX_OFF_IMAGE = PatchImageResources.getInputBoxOff(INPUTBOX_WIDTH);
-               }
+                       valueLabel = new ImageLabel(compList.get(0), SWT.NONE);
+                       valueLabel.setEnableImage(INPUTBOX_ON_IMAGE);
+       //              valueLabel.setDisableImage(INPUTBOX_OFF_IMAGE);
+                       valueLabel.setLayout(new FormLayout());
 
-               valueLabel = new ImageLabel(compList.get(0), SWT.NONE);
-               valueLabel.setEnableImage(INPUTBOX_ON_IMAGE);
-//             valueLabel.setDisableImage(INPUTBOX_OFF_IMAGE);
-               valueLabel.setLayout(new FormLayout());
+                       FormData data = new FormData();
+                       data.left       = new FormAttachment(0, INPUTBOX_OFFSET);
+                       data.top        = new FormAttachment(0, INPUTBOX_TOP_GAP);
+                       data.width      = valueLabel.getSize().x;
+                       data.height = valueLabel.getSize().y;
+                       valueLabel.setLayoutData(data);
 
-               FormData data = new FormData();
-               data.left       = new FormAttachment(0, INPUTBOX_OFFSET);
-               data.top        = new FormAttachment(0, INPUTBOX_TOP_GAP);
-               data.width      = valueLabel.getSize().x;
-               data.height = valueLabel.getSize().y;
-               valueLabel.setLayoutData(data);
+                       text = new Text(valueLabel, SWT.NONE);
+                       text.setBackground(ColorResources.DETAIL_INPUT_BOX_COLOR.getColor());
+                       text.setFont(FontResources.DETAIL_LABEL_FONT.getFont());
+                       text.setForeground(ColorResources.DETAIL_ENABLE_FONT_COLOR.getColor());
+                       text.setTextLimit(VMProperty.MAX_NAME_LEN);
 
-               text = new Text(valueLabel, SWT.NONE);
-               text.setBackground(ColorResources.DETAIL_INPUT_BOX_COLOR.getColor());
-               text.setFont(FontResources.DETAIL_LABEL_FONT.getFont());
-               text.setForeground(ColorResources.DETAIL_ENABLE_FONT_COLOR.getColor());
-               text.setTextLimit(VMProperty.MAX_NAME_LEN);
+                       data = new FormData();
+                       data.left       = new FormAttachment(0, 5);
+                       data.top        = new FormAttachment(0, 2);
+                       data.right      = new FormAttachment(100, -5);
+                       data.bottom = new FormAttachment(100, -2);
+                       text.setLayoutData(data);
+                       addListener();
 
-               data = new FormData();
-               data.left       = new FormAttachment(0, 5);
-               data.top        = new FormAttachment(0, 2);
-               data.right      = new FormAttachment(100, -5);
-               data.bottom = new FormAttachment(100, -2);
-               text.setLayoutData(data);
+               } else {
+                       valueLabel = new ImageLabel(compList.get(0), SWT.NONE);
+                       valueLabel.setDisableImage(PatchImageResources.getInputBoxON(INPUTBOX_WIDTH));
+                       FormData data = new FormData();
+                       data.left       = new FormAttachment(0, INPUTBOX_OFFSET);
+                       data.top        = new FormAttachment(0, INPUTBOX_TOP_GAP);
+                       data.width      = valueLabel.getSize().x;
+                       data.height = valueLabel.getSize().y;
+                       valueLabel.setLayoutData(data);
+                       valueLabel.setEnabled(false);
+               }
 
-               addListener();
        }
 
        @Override
@@ -155,8 +192,11 @@ public class TextViewItem extends AdvancedViewItem{
                        public void modifyText(ModifyEvent e) {
                                newValue = text.getText();
 
-                               if (!isCreateMode()) {
-                                       getListener().ChangeValue(getThis());
+                               if (isCreateMode()) {
+                                       getListener().changeConfirmButton();
+
+                               } else {
+                                       getListener().changeConfirmButton(getThis());
                                }
                        }
                });
@@ -202,8 +242,19 @@ public class TextViewItem extends AdvancedViewItem{
 
        @Override
        public boolean settingModifyItem(VMPropertyValue value) {
-               newValue = value.getAdvancedOptionValue(name);
-               text.setText(newValue);
+               if (isCreateMode() && useDefaultOnCreate) {
+                       newValue = defaultOnCreate;
+
+               } else {
+                       newValue = value.getAdvancedOptionValue(name);
+               }
+
+               if (modifyEnable) {
+                       text.setText(newValue);
+
+               } else {
+                       valueLabel.setText(newValue);
+               }
                return false;
        }
 
@@ -212,4 +263,29 @@ public class TextViewItem extends AdvancedViewItem{
                return true;
        }
 
+       @Override
+       public void setEnabled(boolean enabled) {
+               valueLabel.setEnabled(enabled);
+               text.setEnabled(enabled);
+       }
+
+       public void resetText(boolean enabled) {
+
+               if (enabled) {
+                       // enable text input
+                       setEnabled(true);
+                       newValue = oldValue; // restore
+
+               } else {
+                       // disable text input
+                       setEnabled(false);
+                       oldValue = newValue; // save
+                       newValue = "";
+               }
+
+               if (newValue != null) {
+                       text.setText(newValue);
+               }
+       }
+
 }
index ccc28f8..fede2a1 100644 (file)
@@ -31,6 +31,8 @@
 package org.tizen.emulator.manager.ui.dialog;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Point;
@@ -39,8 +41,10 @@ import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Shell;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.ui.MainDialog;
@@ -60,6 +64,48 @@ public class MessageDialog
                }
        }
 
+       public void close() {
+               if (dialog != null && !dialog.isDisposed()) {
+                       dialog.close();
+               }
+       }
+
+       public void openNoButtonInfoDialog(final String message) {
+               String title = "Emulator Manager";
+               int icon_style = SWT.ICON_INFORMATION;
+               dialog = new Shell(shell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+               dialog.setText(title);
+               dialog.setLayout(new GridLayout(2, false));
+               dialog.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+
+               Label icon = new Label(dialog, SWT.NONE);
+               icon.setImage(Display.getCurrent().getSystemImage(icon_style));
+               icon.pack();
+
+               Label text = new Label(dialog, SWT.NONE);
+               text.setText(message);
+               text.pack();
+
+               int x = icon.getSize().x + text.getSize().x;
+               int y = 0;
+               if (icon.getSize().y > text.getSize().y ) {
+                       y = icon.getSize().y;
+               } else {
+                       y = text.getSize().y;
+               }
+
+               dialog.setSize(x + 50, y + 60);
+
+               if (MainDialog.getShell() != null) {
+                       Point p = MainDialog.getShell().getLocation();
+                       Point s = MainDialog.getShell().getSize();
+                       dialog.setLocation(p.x + (s.x>>2), p.y + (s.y>>2));
+               }
+
+               dialog.open();
+
+       }
+
        public int openInfoDialog(final String message) {
                return openInfoDialog("Emulator Manager", message);
        }
diff --git a/common-project/src/org/tizen/emulator/manager/ui/widgets/CheckBoxButton.java b/common-project/src/org/tizen/emulator/manager/ui/widgets/CheckBoxButton.java
new file mode 100644 (file)
index 0000000..e9169dd
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * Minkee Lee <minkee.lee@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.widgets;
+
+import org.eclipse.swt.widgets.Composite;
+
+public class CheckBoxButton extends ImageButton {
+
+       public CheckBoxButton(Composite parent, int style) {
+               super(parent, style);
+               // TODO Auto-generated constructor stub
+       }
+
+
+       @Override
+       public boolean isSelection() {
+               if (state == WSTATE.SELECTED ||
+                               state == WSTATE.SELECTED_HOVER || state == WSTATE.SELECTED_PUSH ||
+                               state == WSTATE.DISABLE_ON) {
+                       return true;
+
+               } else {
+                       return false;
+               }
+       }
+
+       @Override
+       public void setEnabled(boolean enable) {
+               int tmpStateId = state.getId();
+               super.setEnabled(enable);
+               state = WSTATE.getState(tmpStateId);
+
+               if (state == WSTATE.SELECTED || state == WSTATE.SELECTED_HOVER ||
+                               state == WSTATE.SELECTED_PUSH || state == WSTATE.DISABLE_ON) {
+                       state = enable ? WSTATE.SELECTED : WSTATE.DISABLE_ON;
+
+               } else {
+                       state = enable ? WSTATE.NORMAL : WSTATE.DISABLE_OFF;
+               }
+               redraw();
+       }
+
+
+       public void setChecked(boolean checked) {
+               selected = checked;
+               if (state == WSTATE.DISABLE_ON || state == WSTATE.DISABLE_OFF) {
+                       state = checked ? WSTATE.DISABLE_ON : WSTATE.DISABLE_OFF;
+
+               } else {
+                       state = checked ? WSTATE.SELECTED : WSTATE.NORMAL;
+               }
+               redraw();
+       }
+
+       @Override
+       public void setSelection(boolean selected) {
+               setChecked(selected);
+               redraw();
+       }
+}
diff --git a/common-project/src/org/tizen/emulator/manager/ui/widgets/CustomSpinner.java b/common-project/src/org/tizen/emulator/manager/ui/widgets/CustomSpinner.java
new file mode 100644 (file)
index 0000000..fb14bd9
--- /dev/null
@@ -0,0 +1,477 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * MunKyu Im <munkyu.im@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * Minkee Lee <minkee.lee@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@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.widgets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.TypedListener;
+import org.tizen.emulator.manager.EmulatorManager;
+import org.tizen.emulator.manager.logging.EMLogger;
+import org.tizen.emulator.manager.resources.ImageResources;
+import org.tizen.emulator.manager.resources.StringResources;
+import org.tizen.emulator.manager.ui.VMsMainView;
+import org.tizen.emulator.manager.ui.dialog.MessageDialog;
+
+public class CustomSpinner extends Composite {
+
+       private Text text;
+       private Canvas arrowUp;
+       private Canvas arrowDown;
+
+       private int selection;
+       private int min;
+       private int max;
+       private int digits;
+       private int increment;
+       private int pageIncrement;
+
+       private boolean isArrowPressed = false;
+
+       private LongPressWorker longPressWorker;
+
+       public boolean isArrowPressed() {
+               return isArrowPressed;
+       }
+
+       public int getIncrement() {
+               return increment;
+       }
+
+       public Text getText() {
+               return text;
+       }
+
+       private Image arrowUpImage = ImageResources.SPINNER_UP.getImage();
+       private Image arrowDownImage = ImageResources.SPINNER_DOWN.getImage();
+
+       public CustomSpinner(Composite parent, int style) {
+               super(parent, style);
+
+               GridLayout gridLayout = new GridLayout();
+               gridLayout.marginBottom = 0;
+               gridLayout.marginTop = 0;
+               gridLayout.marginLeft = 0;
+               gridLayout.marginRight = 0;
+               gridLayout.marginHeight = 0;
+               gridLayout.marginWidth = 0;
+               gridLayout.verticalSpacing = 1;
+               gridLayout.horizontalSpacing = 0;
+               gridLayout.numColumns = 2;
+               this.setLayout(gridLayout);
+
+               text = new Text(this, SWT.NONE);
+               GridData textData = new GridData();
+               textData.verticalSpan = 2;
+               textData.verticalAlignment = GridData.FILL;
+               textData.horizontalAlignment = GridData.FILL;
+               textData.grabExcessHorizontalSpace = true;
+               textData.grabExcessVerticalSpace = true;
+               text.setLayoutData(textData);
+
+               arrowUp = new Canvas(this, SWT.NONE);
+               GridData arrowUpData = new GridData();
+               arrowUpData.verticalAlignment = GridData.FILL;
+               arrowUpData.widthHint = 8;
+               arrowUpData.grabExcessVerticalSpace = true;
+               arrowUp.setLayoutData(arrowUpData);
+
+               arrowDown = new Canvas(this, SWT.NONE);
+               GridData arrowDownData = new GridData();
+               arrowDownData.verticalAlignment = GridData.FILL;
+               arrowDownData.grabExcessVerticalSpace = true;
+               arrowDownData.widthHint = 8;
+               arrowDown.setLayoutData(arrowDownData);
+
+               addTextListener();
+               addArrowPaintListener();
+               addArrowButtonListener();
+               if (EmulatorManager.isLinux()) { // TODO solve windows problem. & check
+                                                                                       // Mac
+                       addMouseWheelListener();
+               }
+               addDisposeListener();
+       }
+
+       public void setValues(int selection, int min, int max, int digits,
+                       int increment, int pageIncrement) {
+               this.selection = selection;
+               this.min = min;
+               this.max = max;
+               this.digits = digits;
+               this.increment = increment;
+               this.pageIncrement = pageIncrement;
+       }
+
+       public void setTextLimit(int textLimit) {
+               text.setTextLimit(textLimit);
+       }
+
+       public void setBackground(Color color) {
+               text.setBackground(color);
+               arrowUp.setBackground(color);
+               arrowDown.setBackground(color);
+       }
+
+       public void setForeground(Color color) {
+               text.setForeground(color);
+               arrowUp.setForeground(color);
+               arrowDown.setForeground(color);
+       }
+
+       public void setFont(Font font) {
+               text.setFont(font);
+       }
+
+       public void setSelection(int value) {
+               selection = value;
+               if (selection > max) {
+                       selection = max;
+               }
+               if (selection < min) {
+                       selection = min;
+               }
+               text.setText(String.valueOf(selection));
+               text.selectAll();
+       }
+
+       public int getSelection() {
+               return selection;
+       }
+
+       public void addModifyListener(ModifyListener listener) {
+               TypedListener typedListener = new TypedListener(listener);
+               addListener(SWT.Modify, typedListener);
+       }
+
+       public void addKeyListener(KeyAdapter listener) {
+               TypedListener typedListener = new TypedListener(listener);
+               addListener(SWT.KeyDown, typedListener);
+       }
+
+       private void addTextListener() {
+
+               // Text input
+               text.addModifyListener(new ModifyListener() {
+                       @Override
+                       public void modifyText(ModifyEvent event) {
+
+                               // If modify event is from setText() call, return.
+                               if (String.valueOf(selection).equals(text.getText())) {
+                                       text.getParent().notifyListeners(SWT.Modify, new Event());
+                                       return;
+                               }
+
+                               // Check if text is integer.
+                               Text widget = (Text) event.widget;
+                               String textValue = widget.getText();
+                               if (!textValue.isEmpty()) {
+                                       try {
+                                               selection = Integer.parseInt(widget.getText());
+
+                                       } catch (NumberFormatException e) {
+                                               int pos = text.getCaretPosition();
+                                               text.setText(String.valueOf(selection));
+                                               text.setSelection(pos - 1);
+                                               EMLogger.getLogger().info(
+                                                               " textModify : " + e.getMessage());
+                                       }
+
+                               } else {
+                                       selection = 0;
+                                       text.setText("0");
+                               }
+
+                               if (selection == 0) {
+                                       text.selectAll();
+                               }
+
+                               text.getParent().notifyListeners(SWT.Modify, new Event());
+                       }
+               });
+
+               // cursor, page up/down
+               text.addListener(SWT.KeyDown, new Listener() {
+
+                       @Override
+                       public void handleEvent(Event event) {
+                               if (event.type == SWT.KeyDown) {
+
+                                       switch (event.keyCode) {
+                                       case SWT.ARROW_UP:
+                                               setSelection(selection + increment);
+                                               // In windows, arrow up event makes cursor move to
+                                               // right.
+                                               // "doit = false" prevent this.
+                                               event.doit = false;
+                                               break;
+
+                                       case SWT.ARROW_DOWN:
+                                               setSelection(selection - increment);
+                                               // In windows, arrow down event makes cursor move to
+                                               // right.
+                                               // "doit = false" prevent this.
+                                               event.doit = false;
+                                               break;
+
+                                       case SWT.PAGE_UP:
+                                               setSelection(selection + pageIncrement);
+                                               break;
+
+                                       case SWT.PAGE_DOWN:
+                                               setSelection(selection - pageIncrement);
+                                               break;
+
+                                       default:
+                                               text.getParent().notifyListeners(SWT.KeyDown, event);
+                                               return;
+                                       }
+                                       text.selectAll();
+
+                               }
+                       }
+               });
+
+       }
+
+       private void addMouseWheelListener() {
+               addListener(SWT.MouseVerticalWheel, new Listener() {
+
+                       @Override
+                       public void handleEvent(Event event) {
+                               // TODO Auto-generated method stub
+
+                               switch (event.type) {
+                               case SWT.MouseVerticalWheel:
+                                       ((Composite) event.widget).setFocus(); // bring focus.
+
+                                       if (event.count > 0) { // scroll up
+                                               setSelection(selection + increment);
+
+                                       } else {
+                                               setSelection(selection - increment);
+                                       }
+
+                                       text.selectAll();
+                                       event.doit = false; // stop scroll event propagation.
+                                       break;
+
+                               default:
+                                       break;
+                               }
+                       }
+
+               });
+       }
+
+       private void addArrowButtonListener() {
+
+               // ArrowUp button listener
+               Listener arrowUpMouseListener = new Listener() {
+                       @Override
+                       public void handleEvent(Event event) {
+                               // TODO Auto-generated method stub
+
+                               switch (event.type) {
+                               case SWT.MouseDown:
+                                       // Increase spinner value.
+                                       Canvas widget = (Canvas) event.widget;
+                                       int arrowIncrement = (widget == arrowUp) ? increment
+                                                       : increment * -1;
+                                       setSelection(selection + arrowIncrement);
+                                       setFocus();
+                                       isArrowPressed = true;
+
+                                       // Start long-press worker.
+                                       longPressWorker = new LongPressWorker(arrowIncrement,
+                                                       (CustomSpinner) ((Composite) event.widget)
+                                                                       .getParent());
+                                       longPressWorker.start();
+                                       break;
+
+                               case SWT.MouseUp:
+                                       // Stop long press worker
+                                       isArrowPressed = false;
+                                       if (longPressWorker.isAlive()) {
+                                               longPressWorker.interrupt();
+                                       }
+                                       break;
+
+                               case SWT.MouseMove:
+                                       if (isArrowPressed) {
+                                               Rectangle rect = ((Canvas) event.widget)
+                                                               .getClientArea();
+                                               if (!rect.contains(event.x, event.y)) {
+                                                       // Stop long press worker
+                                                       isArrowPressed = false;
+                                                       if (longPressWorker.isAlive()) {
+                                                               longPressWorker.interrupt();
+                                                       }
+                                               }
+                                       }
+                                       break;
+
+                               default:
+                                       break;
+                               }
+                       }
+               };
+               arrowUp.addListener(SWT.MouseDown, arrowUpMouseListener);
+               arrowUp.addListener(SWT.MouseUp, arrowUpMouseListener);
+               arrowUp.addListener(SWT.MouseMove, arrowUpMouseListener);
+
+               arrowDown.addListener(SWT.MouseDown, arrowUpMouseListener);
+               arrowDown.addListener(SWT.MouseUp, arrowUpMouseListener);
+               arrowDown.addListener(SWT.MouseMove, arrowUpMouseListener);
+       }
+
+       private void addDisposeListener() {
+               addDisposeListener(new DisposeListener() {
+
+                       @Override
+                       public void widgetDisposed(DisposeEvent event) {
+                               CustomSpinner spinner = (CustomSpinner) event.widget;
+                               spinner.dispose();
+                       }
+
+               });
+       }
+
+       private void addArrowPaintListener() {
+               arrowUp.addPaintListener(new PaintListener() {
+                       @Override
+                       public void paintControl(PaintEvent e) {
+                               // TODO Auto-generated method stub
+                               Canvas canvas = (Canvas) e.widget;
+                               int w = canvas.getBounds().width;
+                               int h = canvas.getBounds().height;
+
+                               e.gc.drawImage(arrowUpImage, 0, h
+                                               - arrowUpImage.getImageData().height);
+                       }
+               });
+
+               arrowDown.addPaintListener(new PaintListener() {
+                       @Override
+                       public void paintControl(PaintEvent e) {
+                               Canvas canvas = (Canvas) e.widget;
+                               int w = canvas.getBounds().width;
+                               int h = canvas.getBounds().height;
+
+                               e.gc.drawImage(arrowDownImage, 0, 0);
+
+                       }
+               });
+       }
+
+       @Override
+       public void dispose() {
+               if (text != null) {
+                       text.dispose();
+               }
+               if (arrowUpImage != null) {
+                       arrowUpImage.dispose();
+               }
+               if (arrowDownImage != null) {
+                       arrowDownImage.dispose();
+               }
+               if (arrowUp != null) {
+                       arrowUp.dispose();
+               }
+               if (arrowDown != null) {
+                       arrowDown.dispose();
+               }
+       }
+
+       @Override
+       public boolean setFocus() {
+               boolean res = text.setFocus();
+               text.selectAll();
+               return res;
+       }
+}
+
+class LongPressWorker extends Thread {
+       CustomSpinner spinner;
+       int increment;
+
+       public LongPressWorker(int increment, CustomSpinner spinner) {
+               this.increment = increment;
+               this.spinner = spinner;
+       }
+
+       @Override
+       public void run() {
+               try {
+                       Thread.sleep(500); // Increase start delay.
+               } catch (InterruptedException e) {
+                       return;
+               }
+
+               while (true) {
+                       if (!spinner.isArrowPressed()) {
+                               break;
+                       }
+                       Display.getDefault().asyncExec(new Runnable() {
+                               @Override
+                               public void run() {
+                                       spinner.setSelection(spinner.getSelection() + increment);
+                                       spinner.setFocus();
+                               }
+                       });
+
+                       try {
+                               Thread.sleep(50); // count up delay while long pressed.
+                       } catch (InterruptedException e) {
+                               return;
+                       }
+               }
+       }
+}
index 06e886d..47472fb 100644 (file)
@@ -95,7 +95,7 @@ public class ImageButton extends Canvas {
                        images.add(s.getId(), null);
                }
 
-               fontColors.set(WSTATE.DISABLE.getId(),
+               fontColors.set(WSTATE.DISABLE_ON.getId(),
                                ColorResources.BUTTON_DISABLE_FONT_COLOR.getColor());
 
                if (checkStyle(style, SWT.RADIO)) {
@@ -213,7 +213,7 @@ public class ImageButton extends Canvas {
                images.set(WSTATE.NORMAL.getId(), normal);
                images.set(WSTATE.HOVER.getId(), hover);
                images.set(WSTATE.PUSH.getId(), pushed);
-               images.set(WSTATE.DISABLE.getId(), disable);
+               images.set(WSTATE.DISABLE_ON.getId(), disable);
 
                if (checkStyle(style, SWT.PUSH)) {
                        defaultPush = false;
@@ -229,7 +229,24 @@ public class ImageButton extends Canvas {
                images.set(WSTATE.SELECTED.getId(), selected);
                images.set(WSTATE.SELECTED_HOVER.getId(), selected_hover);
                images.set(WSTATE.SELECTED_PUSH.getId(), selected_push);
-               images.set(WSTATE.DISABLE.getId(), disable);
+               images.set(WSTATE.DISABLE_ON.getId(), disable);
+
+               if (checkStyle(style, SWT.PUSH)) {
+                       defaultPush = false;
+               }
+               redraw();
+       }
+
+       public void setImages(Image normal, Image hover, Image pushed,
+                       Image selected, Image selected_hover, Image selected_push, Image disable_on, Image disable_off) {
+               images.set(WSTATE.NORMAL.getId(), normal);
+               images.set(WSTATE.HOVER.getId(), hover);
+               images.set(WSTATE.PUSH.getId(), pushed);
+               images.set(WSTATE.SELECTED.getId(), selected);
+               images.set(WSTATE.SELECTED_HOVER.getId(), selected_hover);
+               images.set(WSTATE.SELECTED_PUSH.getId(), selected_push);
+               images.set(WSTATE.DISABLE_ON.getId(), disable_on);
+               images.set(WSTATE.DISABLE_OFF.getId(), disable_off);
 
                if (checkStyle(style, SWT.PUSH)) {
                        defaultPush = false;
@@ -241,7 +258,7 @@ public class ImageButton extends Canvas {
                fontColors.set(WSTATE.NORMAL.getId(), normal);
                fontColors.set(WSTATE.HOVER.getId(), hover);
                fontColors.set(WSTATE.PUSH.getId(), pushed);
-               fontColors.set(WSTATE.DISABLE.getId(), disable);
+               fontColors.set(WSTATE.DISABLE_ON.getId(), disable);
 
                redraw();
        }
@@ -254,7 +271,7 @@ public class ImageButton extends Canvas {
                fontColors.set(WSTATE.SELECTED.getId(), selected);
                fontColors.set(WSTATE.SELECTED_HOVER.getId(), selected_hover);
                fontColors.set(WSTATE.SELECTED_PUSH.getId(), selected_push);
-               fontColors.set(WSTATE.DISABLE.getId(), disable);
+               fontColors.set(WSTATE.DISABLE_ON.getId(), disable);
 
                redraw();
        }
@@ -371,7 +388,7 @@ public class ImageButton extends Canvas {
 
                @Override
                public void handleEvent(Event event) {
-                       if (state == WSTATE.DISABLE) {
+                       if (state == WSTATE.DISABLE_ON) {
                                return;
                        }
 
@@ -429,10 +446,10 @@ public class ImageButton extends Canvas {
 
        public void setSelection(boolean selected) {
                if (selected) {
-                       state = WSTATE.SELECTED;
+                       state = (state == WSTATE.DISABLE_OFF) ? state : WSTATE.SELECTED;
                        this.selected = true;
                } else {
-                       state = state != WSTATE.DISABLE ? WSTATE.NORMAL : WSTATE.DISABLE;
+                       state = state != WSTATE.DISABLE_ON ? WSTATE.NORMAL : WSTATE.DISABLE_ON;
                        this.selected = false;
                }
                redraw();
@@ -456,7 +473,18 @@ public class ImageButton extends Canvas {
        @Override
        public void setEnabled(boolean enable) {
                super.setEnabled(enable);
-               state = (enable ? WSTATE.NORMAL : WSTATE.DISABLE);
+               state = (enable ? WSTATE.NORMAL : WSTATE.DISABLE_ON);
+               redraw();
+       }
+
+       public void setEnabled(boolean enable, boolean isOn) {
+               super.setEnabled(enable);
+               if (enable) {
+                       state = isOn ? WSTATE.NORMAL : WSTATE.SELECTED;
+
+               } else {
+                       state = isOn ? WSTATE.DISABLE_ON : WSTATE.DISABLE_OFF;
+               }
                redraw();
        }
 }
index b2f2c88..f412a71 100644 (file)
@@ -93,14 +93,14 @@ public class ImageCombo extends Canvas {
                        fonts.add(s.getId(), FontResources.COMBO_BUTTON_FONT.getFont());
                }
 
-               images.set(WSTATE.DISABLE.getId(),
+               images.set(WSTATE.DISABLE_ON.getId(),
                                ImageResources.COMBO_DISABLE.getImage());
                images.set(WSTATE.HOVER.getId(),
                                ImageResources.COMBO_HOVER.getImage());
                images.set(WSTATE.PUSH.getId(),
                                ImageResources.COMBO_PUSH.getImage());
 
-               fontColors.add(WSTATE.DISABLE.getId(),
+               fontColors.add(WSTATE.DISABLE_ON.getId(),
                                ColorResources.COMBO_DISABLE_FONT_COLOR.getColor());
        }
 
@@ -256,7 +256,7 @@ public class ImageCombo extends Canvas {
        public void setEnabled(boolean enabled) {
                super.setEnabled(enabled);
                if (!enabled) {
-                       state = WSTATE.DISABLE;
+                       state = WSTATE.DISABLE_ON;
                } else {
                        state = WSTATE.NORMAL;
                }
@@ -356,7 +356,7 @@ public class ImageCombo extends Canvas {
                                e.gc.drawImage(img, x, y);
                        }
 
-                       if (arrowButtonImage != null) {
+                       if (arrowButtonImage != null && state != WSTATE.DISABLE_ON) {
                                int w = arrowButtonImage.getImageData().width;
                                int h = arrowButtonImage.getImageData().height;
                                x += rect.width - w - ARROW_OFFSET;
@@ -377,6 +377,12 @@ public class ImageCombo extends Canvas {
                        if (selectedText != null) {
                                e.gc.drawText(selectedText, x, y, true);
                        }
+
+                       if (state == WSTATE.DISABLE_ON) {
+                               // draw transparent layer
+                               e.gc.setAlpha(150);
+                               e.gc.fillRectangle(rect.x + 5, rect.y + 2, rect.width - 10, rect.height - 4);
+                       }
                }
        };
 
index 2bcc566..2dac04a 100644 (file)
@@ -158,7 +158,7 @@ public class ImageLabel extends Canvas{
                if (enabled) {
                        state = WSTATE.NORMAL;
                } else {
-                       state = WSTATE.DISABLE;
+                       state = WSTATE.DISABLE_ON;
                }
                this.redraw();
        }
index c5b0eae..5ee99ee 100644 (file)
@@ -325,7 +325,7 @@ public class VMButton extends ImageButton {
 
                @Override
                public void handleEvent(Event event) {
-                       if (state == WSTATE.DISABLE) {
+                       if (state == WSTATE.DISABLE_ON) {
                                return;
                        }
 
index 5a37406..953a214 100644 (file)
@@ -36,7 +36,8 @@ public enum WSTATE {
        SELECTED(3),
        SELECTED_HOVER(4),
        SELECTED_PUSH(5),
-       DISABLE(6);
+       DISABLE_ON(6),
+       DISABLE_OFF(7);
 
        private int id;
        WSTATE(int id) {
@@ -47,4 +48,13 @@ public enum WSTATE {
                return id;
        }
 
+       public static WSTATE getState(int id) {
+               for (WSTATE state : WSTATE.values()) {
+                       if (state.id == id) {
+                               return state;
+                       }
+               }
+               return WSTATE.NORMAL;
+       }
+
 }
index 08637dc..4f2110c 100644 (file)
@@ -59,6 +59,7 @@ public class VMWorkerCommon {
        private WorkerThread worker  = null;
        private String baseImagePath = null;
        private String baseImagePartPath = null;
+       private Object lock = new Object();
 
        public void initLauncher() {
 
@@ -258,12 +259,12 @@ public class VMWorkerCommon {
                        dialog.Open(destFile, maxSize);
                        */
 
-                       worker = new WorkerThread(proc);
+                       worker = new WorkerThread(proc, lock);
                        worker.setDaemon(false);
                        worker.start();
-                       synchronized(worker) {
+                       synchronized(lock) {
                                try {
-                                       worker.wait(2000);
+                                       lock.wait(2000);
                                } catch (InterruptedException e) {
                                        e.printStackTrace();
                                }
@@ -287,10 +288,10 @@ public class VMWorkerCommon {
                if (EmulatorManager.isConsoleMode()) {
                        System.out.println("Wait....while creating base image." + StringResources.NEW_LINE
                                                                + "This task can take about 30 ~ 60 seconds");
-                       synchronized(worker) {
+                       synchronized(lock) {
                                while(worker.isAlive()) {
                                        try {
-                                               worker.wait();
+                                               lock.wait();
                                        } catch (InterruptedException e) {
                                                e.printStackTrace();
                                        }
@@ -319,8 +320,10 @@ public class VMWorkerCommon {
        class WorkerThread extends Thread {
                QemuImgProc proc;
                boolean isError;
-               public WorkerThread(QemuImgProc proc) {
+               Object lock;
+               public WorkerThread(QemuImgProc proc, Object lock) {
                        this.proc = proc;
+                       this.lock = lock;
                        isError = false;
                }
 
@@ -338,14 +341,14 @@ public class VMWorkerCommon {
                        if (! proc.Running()) {
                                isError = true;
                        }
-                       synchronized(this) {
+                       synchronized(lock) {
                                if (file != null) {
                                        file.delete();
                                }
                                File baseFile = new File(baseImagePath);
                                File partFile = new File(baseImagePartPath);
                                partFile.renameTo(baseFile);
-                               notifyAll();
+                               lock.notifyAll();
                        }
                }
 
index 489ff5e..a2fa68d 100644 (file)
@@ -38,16 +38,22 @@ import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.net.ConnectException;
+import java.net.Inet4Address;
 import java.net.Inet6Address;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
+import java.net.InterfaceAddress;
 import java.net.NetworkInterface;
 import java.net.ServerSocket;
 import java.net.SocketAddress;
 import java.net.SocketException;
 import java.nio.channels.SocketChannel;
 import java.nio.channels.UnresolvedAddressException;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Enumeration;
+import java.util.List;
+import java.util.regex.Pattern;
 
 import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.logging.EMLogger;
@@ -288,5 +294,54 @@ public class HelperClass {
 
        }
 
+
+
+       public static void setStatusBar(String errMsg) {
+               if (errMsg == null || errMsg.trim().isEmpty()) {
+                       MainDialog.getStatusBar().reset();
+
+               } else {
+                       MainDialog.getStatusBar().error(errMsg);
+               }
+       }
+
+
+       public static ProcessResult runProcess(List<String> cmd) {
+               ProcessResult result = new ProcessResult();
+               ProcessBuilder pb = new ProcessBuilder(cmd);
+               int exitValue = 0;
+               Process process;
+               try {
+                       process = pb.start();
+                       List<String> stdOut = ProcessOutputReader.readStdOut(process, cmd.toString());
+                       List<String> stdErr = ProcessOutputReader.readStdErr(process, cmd.toString());
+                       exitValue = process.waitFor();
+
+                       if (exitValue != 0) {
+                               EMLogger.getLogger().warning("Command returns fail:" +
+                                               "cmd : " + cmd.toString() + ", return : " + exitValue);
+                               result.setResult(false);
+
+                       } else {
+                               result.setResult(true);
+                       }
+                       result.setExitValue(exitValue);
+                       result.setStdOutMsg(stdOut);
+                       result.setStdErrMsg(stdErr);
+
+               } catch (IOException e) {
+                       EMLogger.getLogger().warning("Run process fail. " + e.getMessage());
+                       result.setResult(false);
+                       result.setStdErrMsg(Arrays.asList(e.getMessage()));
+
+               } catch (InterruptedException e) {
+                       result.setResult(false);
+                       EMLogger.getLogger().info("Process end with interrupt. " + e.getMessage());
+                       result.setStdErrMsg(Arrays.asList(e.getMessage()));
+               }
+
+               return result;
+       }
+
 }
 
diff --git a/common-project/src/org/tizen/emulator/manager/vms/helper/ProcessOutputReader.java b/common-project/src/org/tizen/emulator/manager/vms/helper/ProcessOutputReader.java
new file mode 100644 (file)
index 0000000..8ef4ec1
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Minkee Lee <minkee.lee@samsung.com>
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@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.vms.helper;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.emulator.manager.logging.EMLogger;
+
+public class ProcessOutputReader extends Thread {
+
+       private BufferedReader reader;
+       private String processName;
+       private List<String> msgList = new ArrayList<String>();
+       private boolean readFinished;
+
+       public List<String> getMsg() {
+               return msgList;
+       }
+
+       public ProcessOutputReader(BufferedReader reader, String processName) {
+               this.reader = reader;
+               this.processName = processName;
+               this.setDaemon(true);
+       }
+
+       // Read output/error stream of process to prevent blocking due to full of
+       // buffer.
+       public static void startFlush(Process process, String processName) {
+               BufferedReader out = new BufferedReader(new InputStreamReader(
+                               process.getInputStream()));
+               new ProcessOutputReader(out, processName).start();
+
+               BufferedReader err = new BufferedReader(new InputStreamReader(
+                               process.getErrorStream()));
+               new ProcessOutputReader(err, processName).start();
+       }
+
+       // Read process's stdout.
+       public static List<String> readStdOut(Process process, String processName) {
+               BufferedReader out = new BufferedReader(new InputStreamReader(
+                               process.getInputStream()));
+               ProcessOutputReader reader = new ProcessOutputReader(out, processName);
+               reader.start();
+               while (!reader.readFinished) {
+                       try {
+                               Thread.sleep(20);
+                       } catch (InterruptedException e) {
+                               // TODO Auto-generated catch block
+                               e.printStackTrace();
+                       }
+               }
+               return reader.getMsg();
+
+       }
+
+       // Read process's stderr.
+       public static List<String> readStdErr(Process process, String processName) {
+               BufferedReader err = new BufferedReader(new InputStreamReader(
+                               process.getErrorStream()));
+               ProcessOutputReader reader = new ProcessOutputReader(err, processName);
+               reader.start();
+               while (!reader.readFinished) {
+                       try {
+                               Thread.sleep(20);
+                       } catch (InterruptedException e) {
+                               // TODO Auto-generated catch block
+                               e.printStackTrace();
+                       }
+               }
+               return reader.getMsg();
+
+       }
+
+       @Override
+       public void run() {
+               String msg;
+               try {
+                       while ((msg = reader.readLine()) != null) {
+                               msgList.add(msg);
+                       }
+               } catch (IOException e) {
+                       EMLogger.getLogger().warning(e.getMessage());
+               } finally {
+                       try {
+                               reader.close();
+                       } catch (IOException e) {
+                               EMLogger.getLogger().warning(e.getMessage());
+                       }
+               }
+
+               readFinished = true;
+       }
+}
diff --git a/common-project/src/org/tizen/emulator/manager/vms/helper/ProcessResult.java b/common-project/src/org/tizen/emulator/manager/vms/helper/ProcessResult.java
new file mode 100644 (file)
index 0000000..0d1cb72
--- /dev/null
@@ -0,0 +1,82 @@
+/* Emulator Manager
+ *
+ * Copyright (C) 2011 - 2012 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.vms.helper;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ProcessResult {
+       boolean result;
+       int exitValue;
+       List<String> stdOutMsg = new ArrayList<String>();
+       List<String> stdErrMsg = new ArrayList<String>();
+
+       public void setExitValue(int exitValue) {
+               this.exitValue = exitValue;
+       }
+
+       public int getExitValue() {
+               return exitValue;
+       }
+
+       public boolean isSuccess() {
+               return result;
+       }
+
+       public void setResult(boolean result) {
+               this.result = result;
+       }
+
+       public List<String> getStdOutMsg() {
+               return stdOutMsg;
+       }
+
+       public void setStdOutMsg(List<String> stdOutMsg) {
+               this.stdOutMsg = stdOutMsg;
+       }
+
+       public List<String> getStdErrMsg() {
+               return stdErrMsg;
+       }
+
+       public void setStdErrMsg(List<String> stdErrMsg) {
+               this.stdErrMsg = stdErrMsg;
+       }
+
+       public String getResultMessage() {
+               StringBuilder sb = new StringBuilder();
+               for (String str : stdOutMsg) {
+                       sb.append(str).append("\n");
+               }
+               for (String str : stdErrMsg) {
+                       sb.append(str).append("\n");
+               }
+               return sb.toString();
+       }
+}
\ No newline at end of file
index 02d3c78..a1c7ba1 100644 (file)
@@ -1,4 +1,22 @@
+* 2.4.93
+- Revert "Launcher: Added rotary argument. (wearable)"
+- Revert "Resolution: Added 360x360 resolution for wearable."
+== minkee Lee<minkee.lee@samsung.com> 2015-01-05
+
+* 2.4.92
+- CLI: Fixed error - creating custom VM.
+== minkee Lee<minkee.lee@samsung.com> 2015-01-05
+
+* 2.4.91
+- Launcher: Added rotary argument. (wearable)
+== minkee Lee<minkee.lee@samsung.com> 2014-12-30
+
+* 2.4.90
+- Skin: Modified skin-loading logic.
+== minkee Lee<minkee.lee@samsung.com> 2014-12-29
+
 * 2.4.89
+- Resolution: Added 360x360 resolution for wearable.
 - Launcher: Added profile argument.
 - Refresh: Fixed bug that emulator-manager go to hanging state when refresh.
 == minkee Lee<minkee.lee@samsung.com> 2014-12-24
index f5aa93c..f1fef90 100644 (file)
@@ -1,5 +1,5 @@
 Source: emulator-manager
-Version: 2.4.89
+Version: 2.4.93
 Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
 
 Package: emulator-manager