vm property: move 'isRemote' method to VMProperty
authorjihye424.kim <jihye424.kim@samsung.com>
Fri, 15 Jan 2016 08:05:29 +0000 (17:05 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Wed, 20 Jan 2016 04:54:58 +0000 (13:54 +0900)
Change-Id: Icfa7768a8cc152956a339bef79d00ee96e9bf789
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
src/org/tizen/emulator/manager/ui/detail/item/CommonItemListFactory.java
src/org/tizen/emulator/manager/ui/widgets/VMButton.java
src/org/tizen/emulator/manager/vms/VMProperty.java
src/org/tizen/emulator/manager/vms/helper/VMCreatorException.java [new file with mode: 0644]
src/org/tizen/emulator/manager/vms/helper/VMLauncherException.java [new file with mode: 0644]
src/org/tizen/emulator/manager/vms/helper/VMWorkerException.java [moved from src/org/tizen/emulator/manager/vms/helper/CheckingRunningEmulator.java with 61% similarity]
src/org/tizen/emulator/manager/vms/option/RemoteOption.java

index 650d54f..60fe76d 100644 (file)
@@ -64,7 +64,6 @@ import org.tizen.emulator.manager.ui.detail.item.template.FileViewItem;
 import org.tizen.emulator.manager.ui.detail.item.template.LabelViewItem;
 import org.tizen.emulator.manager.ui.detail.item.template.OnOffViewItem;
 import org.tizen.emulator.manager.ui.detail.item.template.TextViewItem;
-import org.tizen.emulator.manager.vms.helper.CheckingRunningEmulator;
 import org.tizen.emulator.manager.vms.xml.template.DeviceList;
 import org.tizen.emulator.manager.vms.xml.template.Item;
 import org.tizen.emulator.manager.vms.xml.template.ObjectFactory;
@@ -94,6 +93,7 @@ public abstract class CommonItemListFactory implements IItemListFactory{
        public static String ITEM_INPUT_DEVICE = "inputDevice"; //$NON-NLS-1$
        public static String ITEM_OCI_DEVICE = "ociDevice"; //$NON-NLS-1$
        public static String ITEM_TUNER = "tuner"; //$NON-NLS-1$
+       public static String ITEM_VIEWER = "viewer";
 
        public static ObjectFactory factory = new ObjectFactory();
 
@@ -158,7 +158,7 @@ public abstract class CommonItemListFactory implements IItemListFactory{
                String name = item.getName();
                String type = item.getType();
 
-               if (name.equals(CheckingRunningEmulator.OPTION_VIEWER)) {
+               if (name.equals(ITEM_VIEWER)) {
                        if (EmulatorManager.isLinux()) {
                                itemList.add(new LabelViewItem(item, currentLineLabel));
                        }
index 1e602f8..d201620 100644 (file)
@@ -65,7 +65,6 @@ import org.tizen.emulator.manager.ui.list.VMButtonFactory;
 import org.tizen.emulator.manager.vms.SKIN_SHAPE;
 import org.tizen.emulator.manager.vms.VMProperty;
 import org.tizen.emulator.manager.vms.VMProperty.FSImageType;
-import org.tizen.emulator.manager.vms.helper.CheckingRunningEmulator;
 import org.tizen.emulator.manager.vms.helper.HelperClass;
 
 public class VMButton extends ImageButton {
@@ -445,7 +444,7 @@ public class VMButton extends ImageButton {
        private void checkToolTipText(VMButton button) {
                VMProperty prop = button.getProperty();
                if (prop != null) {
-                       if (CheckingRunningEmulator.isRemote(prop) && prop.isRunning()) {
+                       if (prop.isRemote() && prop.isRunning()) {
                                int webVMPort = 0;
                                /* FIXME
                                synchronized (ECSSocket.list) {
index 11522e6..e164a9b 100644 (file)
@@ -35,6 +35,8 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
+import org.tizen.emulator.manager.EmulatorManager;
+import org.tizen.emulator.manager.EmulatorManager.ManagerModeType;
 import org.tizen.emulator.manager.platform.BaseImage;
 import org.tizen.emulator.manager.plugin.EMPlugin;
 import org.tizen.emulator.manager.plugin.ExtensionItem;
@@ -344,6 +346,20 @@ public final class VMProperty {
                this.lastLaunched = lastLaunched;
        }
 
+       // FIXME
+       public static String OPTION_VIEWER = "viewer"; //$NON-NLS-1$
+       public static String OPTION_TYPE = "type"; //$NON-NLS-1$
+       public static String VAL_WEB = "Web"; //$NON-NLS-1$
+
+       public boolean isRemote() {
+               if (EmulatorManager.isLinux()
+                               && EmulatorManager.getManagerMode() == ManagerModeType.INHOUSE_MODE
+                               && getPropertyValue().getAdvancedOptionSubValue(OPTION_VIEWER, OPTION_TYPE).equals(VAL_WEB)) {
+                       return true;
+               }
+               return false;
+       }
+
        public enum Architecture {
                x86("x86", 32), i386("i386", 32), x86_64("x86_64", 64); //$NON-NLS-1$ //$NON-NLS-2$
 
diff --git a/src/org/tizen/emulator/manager/vms/helper/VMCreatorException.java b/src/org/tizen/emulator/manager/vms/helper/VMCreatorException.java
new file mode 100644 (file)
index 0000000..d784eac
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * 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>
+ * 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;
+
+@SuppressWarnings("serial")
+@Deprecated // It is temporary wrapper for plugins
+public class VMCreatorException extends org.tizen.emulator.manager.vms.exception.VMCreatorException {
+       public VMCreatorException(String message) {
+               super(message);
+       }
+}
diff --git a/src/org/tizen/emulator/manager/vms/helper/VMLauncherException.java b/src/org/tizen/emulator/manager/vms/helper/VMLauncherException.java
new file mode 100644 (file)
index 0000000..124eafd
--- /dev/null
@@ -0,0 +1,13 @@
+package org.tizen.emulator.manager.vms.helper;
+
+@SuppressWarnings("serial")
+@Deprecated // It is temporary wrapper for plugins
+public class VMLauncherException extends org.tizen.emulator.manager.vms.exception.VMLauncherException {
+       public VMLauncherException(String message) {
+               super(message);
+       }
+
+       public VMLauncherException(String message, boolean isCritical) {
+               super(message, isCritical);
+       }
+}
 
 package org.tizen.emulator.manager.vms.helper;
 
-import org.tizen.emulator.manager.EmulatorManager;
-import org.tizen.emulator.manager.EmulatorManager.ManagerModeType;
-import org.tizen.emulator.manager.vms.VMProperty;
-
-public final class CheckingRunningEmulator {
-       // FIXME
-       public static String OPTION_VIEWER = "viewer"; //$NON-NLS-1$
-       public static String OPTION_TYPE = "type"; //$NON-NLS-1$
-       public static String VAL_WEB = "Web"; //$NON-NLS-1$
+@SuppressWarnings("serial")
+@Deprecated // It is temporary wrapper for plugins
+public class VMWorkerException extends org.tizen.emulator.manager.vms.exception.VMWorkerException {
+       public VMWorkerException(String message) {
+               super(message);
+       }
 
-       public static boolean isRemote(VMProperty prop) {
-               if (EmulatorManager.isLinux()
-                               && EmulatorManager.getManagerMode() == ManagerModeType.INHOUSE_MODE
-                               && prop.getPropertyValue().getAdvancedOptionSubValue(OPTION_VIEWER, OPTION_TYPE).equals(VAL_WEB)) {
-                       return true;
-               }
-               return false;
+       public VMWorkerException(String message, boolean isNeedRefresh) {
+               super(message, isNeedRefresh);
        }
 }
index 3866fea..4c8749a 100644 (file)
@@ -31,7 +31,6 @@ package org.tizen.emulator.manager.vms.option;
 import org.tizen.emulator.manager.console.RemoteManager;
 import org.tizen.emulator.manager.vms.VMProperty;
 import org.tizen.emulator.manager.vms.exception.VMLauncherException;
-import org.tizen.emulator.manager.vms.helper.CheckingRunningEmulator;
 
 public class RemoteOption extends Option {
 
@@ -60,7 +59,7 @@ public class RemoteOption extends Option {
 
        public static boolean isRemoteMode(VMProperty property) {
                if (RemoteManager.getSpiceMode()
-                               || CheckingRunningEmulator.isRemote(property)) {
+                               || property.isRemote()) {
                        return true;
                }
                return false;