Refactoring: Image resource close and remove some log.
authorminkee.lee <minkee.lee@samsung.com>
Wed, 15 Oct 2014 06:59:13 +0000 (15:59 +0900)
committerminkee.lee <minkee.lee@samsung.com>
Thu, 16 Oct 2014 12:36:18 +0000 (21:36 +0900)
- Remove ecs connection fail log.

Change-Id: Iae6174590c533b59b0c1c30d65ea9c2541d1e55f
Signed-off-by: minkee.lee <minkee.lee@samsung.com>
common-project/src/org/tizen/emulator/manager/ui/detail/item/template/FileSubViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/template/FileViewItem.java
common-project/src/org/tizen/emulator/manager/ui/detail/item/template/SubViewItem.java
common-project/src/org/tizen/emulator/manager/vms/helper/CheckingRunningEmulator.java
common-project/src/org/tizen/emulator/manager/vms/helper/VMSocket.java

index 175f4a6..aa0a981 100644 (file)
@@ -38,6 +38,7 @@ import java.util.List;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.widgets.Composite;
@@ -65,6 +66,7 @@ public class FileSubViewItem extends SubViewItem {
        // for modify view
        protected ImageLabel filePathLabel;
        protected ImageButton selectFileButton;
+       protected Image INPUTBOX_ON_IMAGE = null;
        protected static int DIR_INPUTBOX_ON_WIDTH      = 133;
        protected static int FILE_SELECT_BUTTON_WIDTH   = 38;
        protected static int FILE_SELECT_BUTTON_HEIGHT  = 20;
@@ -120,8 +122,12 @@ public class FileSubViewItem extends SubViewItem {
        }
 
        protected void makeModifyWidget() {
+               if (INPUTBOX_ON_IMAGE == null) {
+                       INPUTBOX_ON_IMAGE = PatchImageResources.getInputBoxON(DIR_INPUTBOX_ON_WIDTH);
+               }
+
                filePathLabel = new ImageLabel(comp, SWT.NONE);
-               filePathLabel.setEnableImage(PatchImageResources.getInputBoxON(DIR_INPUTBOX_ON_WIDTH));
+               filePathLabel.setEnableImage(INPUTBOX_ON_IMAGE);
                filePathLabel.setEnabled(false);
 
                selectFileButton = new ImageButton(comp, SWT.PUSH);
@@ -215,4 +221,13 @@ public class FileSubViewItem extends SubViewItem {
                selectFileButton.setEnabled(enable);
        }
 
+       @Override
+       public void closeItem() {
+               super.closeItem();
+
+               if (INPUTBOX_ON_IMAGE != null) {
+                       INPUTBOX_ON_IMAGE.dispose();
+               }
+       }
+
 }
index f85d50f..1430eaa 100644 (file)
@@ -38,6 +38,7 @@ import java.util.List;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.widgets.FileDialog;
@@ -63,11 +64,13 @@ public class FileViewItem extends AdvancedViewItem {
        // for Info view
        protected ImageLabel valueLabel;
        protected int INPUTBOX_WIDTH = 175;
+       protected Image INPUTBOX_OFF_IMAGE = null;
 
        // for modify view
        protected ImageLabel filePathLabel;
        protected ImageButton selectFileButton;
        protected int DIR_INPUTBOX_ON_WIDTH     = 133;
+       protected Image INPUTBOX_ON_IMAGE = null;
        protected FileDialog fd;
        protected List<String> filters = new ArrayList<String>();
 
@@ -95,7 +98,10 @@ public class FileViewItem extends AdvancedViewItem {
        @Override
        public void drawDetail() {
                valueLabel = new ImageLabel(compList.get(0), SWT.NONE);
-               valueLabel.setEnableImage(PatchImageResources.getInputBoxOff(INPUTBOX_WIDTH));
+               if (INPUTBOX_OFF_IMAGE == null) {
+                       INPUTBOX_OFF_IMAGE = PatchImageResources.getInputBoxOff(INPUTBOX_WIDTH);
+               }
+               valueLabel.setEnableImage(INPUTBOX_OFF_IMAGE);
                FormData data = new FormData();
                data.left       = new FormAttachment(0, INPUTBOX_OFFSET);
                data.top        = new FormAttachment(0, INPUTBOX_TOP_GAP);
@@ -131,6 +137,12 @@ public class FileViewItem extends AdvancedViewItem {
                if (selectFileButton != null) {
                        selectFileButton.dispose();
                }
+               if (INPUTBOX_ON_IMAGE != null) {
+                       INPUTBOX_ON_IMAGE.dispose();
+               }
+               if (INPUTBOX_OFF_IMAGE != null) {
+                       INPUTBOX_OFF_IMAGE.dispose();
+               }
        }
 
        @Override
@@ -161,7 +173,10 @@ public class FileViewItem extends AdvancedViewItem {
 
        public void makeModifyWidget() {
                filePathLabel = new ImageLabel(compList.get(0), SWT.NONE);
-               filePathLabel.setEnableImage(PatchImageResources.getInputBoxON(DIR_INPUTBOX_ON_WIDTH));
+               if (INPUTBOX_ON_IMAGE == null) {
+                       INPUTBOX_ON_IMAGE = PatchImageResources.getInputBoxON(DIR_INPUTBOX_ON_WIDTH);
+               }
+               filePathLabel.setEnableImage(INPUTBOX_ON_IMAGE);
                filePathLabel.setEnabled(false);
 
                selectFileButton = new ImageButton(compList.get(0), SWT.PUSH);
index 2a4f69d..55d67f3 100644 (file)
@@ -32,6 +32,7 @@
 package org.tizen.emulator.manager.ui.detail.item.template;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.widgets.Composite;
@@ -44,8 +45,10 @@ public abstract class SubViewItem implements ISubViewItem {
        // for category
        protected String name;
        protected ImageLabel category;
+       protected Image CATEGORYBOX_IMAGE;
        protected String title;
        protected ImageLabel valueLabel;
+       protected Image INPUTBOX_OFF_IMAGE;
 
        protected LabelViewItem parentItem;
        protected Composite comp;  // parent
@@ -70,7 +73,10 @@ public abstract class SubViewItem implements ISubViewItem {
                // draw label
                FormData data = new FormData();
                valueLabel = new ImageLabel(comp, SWT.NONE);
-               valueLabel.setEnableImage(PatchImageResources.getInputBoxOff(LABEL_WIDTH));
+               if (INPUTBOX_OFF_IMAGE == null) {
+                       INPUTBOX_OFF_IMAGE = PatchImageResources.getInputBoxOff(LABEL_WIDTH);
+               }
+               valueLabel.setEnableImage(INPUTBOX_OFF_IMAGE);
                data = new FormData();
                data.left       = new FormAttachment(category, 4);
                data.top        = new FormAttachment(0, TOP_GAP);
@@ -81,7 +87,10 @@ public abstract class SubViewItem implements ISubViewItem {
 
        protected void makeCategory() {
                category = new ImageLabel(comp, SWT.NONE);
-               category.setEnableImage(PatchImageResources.getCategoryBox(CATEGORY_WIDTH));
+               if (CATEGORYBOX_IMAGE == null) {
+                       CATEGORYBOX_IMAGE = PatchImageResources.getCategoryBox(CATEGORY_WIDTH);
+               }
+               category.setEnableImage(CATEGORYBOX_IMAGE);
                category.setEnableFontColor(ColorResources.DETAIL_CATEGORY_FONT_COLOR.getColor());
                category.setText(title);
                FormData data = new FormData();
@@ -100,6 +109,12 @@ public abstract class SubViewItem implements ISubViewItem {
                if (valueLabel != null) {
                        valueLabel.dispose();
                }
+               if (INPUTBOX_OFF_IMAGE != null) {
+                       INPUTBOX_OFF_IMAGE.dispose();
+               }
+               if (CATEGORYBOX_IMAGE != null) {
+                       CATEGORYBOX_IMAGE.dispose();
+               }
        }
 
 
index 94a43b5..8419106 100644 (file)
@@ -403,7 +403,7 @@ public class CheckingRunningEmulator {
                                if (addToRegisterQueue(vms, SelectionKey.OP_READ)) {
                                        vms.sendDeviceReq();
                                } else {
-                                       EMLogger.getLogger().warning("Connect to ECS(port:" + vms.getEcs_port() + ") Fail.");
+                                       //EMLogger.getLogger().warning("Connect to ECS(port:" + vms.getEcs_port() + ") Fail.");
                                        vms.disconnect();
                                }
                        } else {
index abc9a1d..add7e4c 100644 (file)
@@ -116,7 +116,7 @@ public class VMSocket {
                        }
                        EMLogger.getLogger().info("Connected to ECS(port:" + ecs_port + ")");
                } catch (IOException e) {
-                       EMLogger.getLogger().info("Connect to ECS(port:" + ecs_port +") Fail." + e.getMessage());
+                       //EMLogger.getLogger().info("Connect to ECS(port:" + ecs_port +") Fail." + e.getMessage());
                        disconnect();
                        return false;
                }