From: jihye424.kim Date: Tue, 10 Nov 2015 05:56:32 +0000 (+0900) Subject: launch option: change key type to 'String' of variable map X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e62025ac577eb038d27791c536b6dfa664633d60;p=sdk%2Femulator%2Femulator-manager.git launch option: change key type to 'String' of variable map - key type: OPTION_KEY -> String -- OPTION_KEY is enum type, so resources package can not add new variable key -- if variable key type is string, resources package can add new variable key Change-Id: Ib2e32d50547d4b00bc4629c08e5e231b80dbf3e8 Signed-off-by: jihye424.kim (cherry picked from commit 4ec77fab78083da11c17c477367a32d27168f1e6) --- diff --git a/src/org/tizen/emulator/manager/vms/option/LaunchConfig.java b/src/org/tizen/emulator/manager/vms/option/LaunchConfig.java index 5d0c7b3..9bbe6ea 100644 --- a/src/org/tizen/emulator/manager/vms/option/LaunchConfig.java +++ b/src/org/tizen/emulator/manager/vms/option/LaunchConfig.java @@ -50,30 +50,45 @@ public class LaunchConfig { List skinOptions = new ArrayList(); QemuOptions qemuOptions = new QemuOptions(); List kernelOptions = new ArrayList(); - Map variables = new HashMap(); - Map varComment = new HashMap(); + Map variables = new HashMap(); + Map varComment = new HashMap(); public static String DEFAULT_VALUE = "[[VARIABLES]]"; //$NON-NLS-1$ public static String SKIN_OPTIONS = "[[SKIN_OPTIONS]]"; //$NON-NLS-1$ public static String QEMU_OPTIONS = "[[QEMU_OPTIONS]]"; //$NON-NLS-1$ - public void addVariable(OPTION_KEY key, String value) { - if (!variables.containsKey(key)) { + public void addVariable(String key, String value) { + if (!variables.containsKey(key)){ variables.put(key, value); } } - public void addVariableWithSpace(OPTION_KEY key, String value) { + public void addVariableWithSpace(String key, String value) { addVariable(key, "\"" + value + "\""); //$NON-NLS-1$ //$NON-NLS-2$ } - public void addVariable(OPTION_KEY key, String value, String comment) { + public void addVariable(String key, String value, String comment) { if (comment != null && !comment.isEmpty()) { varComment.put(key, comment); } addVariable(key, value); } + public void addVariable(OPTION_KEY key, String value) { + addVariable(key.toString(), value); + } + + public void addVariableWithSpace(OPTION_KEY key, String value) { + addVariable(key.toString(), "\"" + value + "\""); //$NON-NLS-1$ //$NON-NLS-2$ + } + + public void addVariable(OPTION_KEY key, String value, String comment) { + if (comment != null && !comment.isEmpty()) { + varComment.put(key.toString(), comment); + } + addVariable(key.toString(), value); + } + public void addQemuOption(String option) { qemuOptions.add(option); }