List of usage examples for com.google.gwt.eclipse.core.launch LegacyGWTLaunchShortcutStrategy LegacyGWTLaunchShortcutStrategy
LegacyGWTLaunchShortcutStrategy
From source file:com.google.gdt.eclipse.suite.launch.WebAppLaunchUtil.java
License:Open Source License
/** * Given a resource, figure out what the target URL should be for a launch * configuration corresponding to this resource. If the resource has several * possible URLs that correspond to it, this method will cause a dialog to pop * up, asking the user to choose one. If the resource's project uses GAE but * not GWT, return empty string; GAE-only projects have no startup url. If the * resource's project uses GWT 2.0+, return empty string since no URL is * started in dev mode./*from w w w . j a v a 2s . co m*/ * * @param resource * @throws CoreException */ public static String determineStartupURL(IResource resource, boolean isExternalLaunch) throws CoreException { ILaunchShortcutStrategy strategy = null; IProject project = resource.getProject(); ExtensionQuery<ILaunchShortcutStrategyProvider> extQuery = new ExtensionQuery<ILaunchShortcutStrategyProvider>( GWTPlugin.PLUGIN_ID, "launchShortcutStrategy", "class"); List<ExtensionQuery.Data<ILaunchShortcutStrategyProvider>> strategyProviderInfos = extQuery.getData(); for (ExtensionQuery.Data<ILaunchShortcutStrategyProvider> data : strategyProviderInfos) { strategy = data.getExtensionPointData().getStrategy(project); break; } if (strategy == null) { if (WebAppLaunchUtil.projectIsGaeOnly(project)) { return ""; } if (WebAppUtilities.isWebApp(project)) { strategy = new WebAppLaunchShortcutStrategy(); } else { assert (GWTNature.isGWTProject(project)); strategy = new LegacyGWTLaunchShortcutStrategy(); } } return strategy.generateUrl(resource, isExternalLaunch); }