import org.tizen.web.project.configuration.ConfiguratorFactory;
import org.tizen.web.project.configuration.IW3CConfigurator;
import org.tizen.web.simulator.preferences.Settings;
+import org.tizen.common.core.application.TizenProjectDescription;
public class Simulator {
public static final String pluginID = "org.tizen.web.simulator"; //$NON-NLS-1$
public static final String CHROME_PARAM_URL = "?url="; //$NON-NLS-1$
+ public static final String PLATFORM_PARAM_URL = "&platform="; //$NON-NLS-1$
public static final String INTERNAL_SIMULATOR_PATH = "/pkg/web/index.html"; //$NON-NLS-1$
return null;
}
- public static Process launch(URL url) {
+ public static Process launch(URL url, IProject prj) {
ChromeLauncher launcher = new ChromeLauncher();
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
}
try {
+ StringBuffer launchURL = new StringBuffer();
TYPE type = store.getBoolean(Settings.APP_MODE) ? TYPE.APP : TYPE.URL;
- return launcher.launch(getAppUrl(url, store), type);
+ TizenProjectDescription tprojectDesc = org.tizen.common.util.ProjectUtil.getTizenProjectDescription(prj);
+ launchURL.append(getAppUrl(url, store));
+ launchURL.append(PLATFORM_PARAM_URL);
+ launchURL.append(tprojectDesc.getPlatformName());
+ return launcher.launch(launchURL.toString(), type);
} catch (Exception e) {
DialogUtil.openErrorDialog(getShell(), "Error", String.format(Messages.msgErrLaunchFailed, chromeExecutable)); //$NON-NLS-1$
return null;
URL url;
try {
url = contentFile.getLocationURI().toURL();
- return Simulator.launch(url);
+ return Simulator.launch(url, prj);
} catch (MalformedURLException e) {
DialogUtil.openErrorDialog(getShell(), "Error", Messages.msgErrURLConversion); //$NON-NLS-1$
return null;