PROJECT_NOT_SELECTED = No project is selected.\r
PROJECT_NOT_SPECIFIED = Project is not specified.\r
PROJECT_NOT_USABLE = Project is closed or does not exist.\r
+PROJECT_NOT_FOUND = Could not find the project.\r
\r
UPDATE_MODE_LABEL = Enable update mode\r
UPDATE_MODE_TOOLTIP = If you want to set update mode you should turn off RDS option first of all.\r
LAUNCH_END = Tizen application is successfully launched.\r
\r
# Exception\r
-SDB_TIMEOUT_EXCEPTION = There is no response while {0} seconds. Please retry again.
\ No newline at end of file
+SDB_TIMEOUT_EXCEPTION = There is no response while {0} seconds. Please retry again.
--- /dev/null
+/*
+* Common
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact:
+* Taeyoung Son <taeyoung2.son@samsung.com>
+* Kangho Kim <kh5325.kim@samsung.com>
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/
+package org.tizen.common.util;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.SmartDevelopmentBridge;
+
+/**
+ * Utils for launching a Tizen application.
+ * @author Taeyoung Son <taeyoung2.son@samsung.com>
+ *
+ */
+public class LaunchUtil {
+
+ /**
+ * Gets {@link IDevice}.
+ * @param configuration
+ * @param serialNoKey The configuration's attribute key about device serial number.
+ * @return {@link IDevice}. If it cannot find device, return null;
+ * @throws CoreException
+ */
+ public static IDevice getDevice(ILaunchConfiguration configuration, String serialNoKey) throws CoreException {
+ String deviceSerialNo = configuration.getAttribute(serialNoKey, "");
+ IDevice[] devices = SmartDevelopmentBridge.getBridge().getDevices();
+ if (ArrayUtil.isEmpty(devices)) {
+ return null;
+ }
+ for (IDevice device : devices) {
+ if (device.getSerialNumber().equals(deviceSerialNo)) {
+ return device;
+ }
+ }
+ return null;
+ }
+}