Example usage for com.google.gwt.eclipse.core.launch GWTLaunchConfiguration getStartupUrl

List of usage examples for com.google.gwt.eclipse.core.launch GWTLaunchConfiguration getStartupUrl

Introduction

In this page you can find the example usage for com.google.gwt.eclipse.core.launch GWTLaunchConfiguration getStartupUrl.

Prototype

public static String getStartupUrl(ILaunchConfiguration launchConfiguration) throws CoreException 

Source Link

Usage

From source file:com.google.gdt.eclipse.suite.launch.ui.shortcuts.WebAppLaunchShortcut.java

License:Open Source License

private ILaunchConfiguration searchMatchingUrlAndProject(String startupUrl, IProject project,
        boolean isExternal, ILaunchConfiguration[] configs) throws CoreException {
    List<ILaunchConfiguration> candidates = new ArrayList<ILaunchConfiguration>();

    for (ILaunchConfiguration config : configs) {
        String configUrl = GWTLaunchConfiguration.getStartupUrl(config);

        if (configUrl.equals(startupUrl)
                && LaunchConfigurationUtilities.getProjectName(config).equals(project.getName())
                && WebAppLaunchConfiguration.getRunServer(config) == !isExternal) {
            candidates.add(config);//  w ww.ja va 2  s  .c  o m
        }
    }

    if (candidates.isEmpty()) {
        return null;
    } else if (candidates.size() == 1) {
        return candidates.get(0);
    } else {
        return LaunchConfigurationUtilities.chooseConfiguration(candidates, getShell());
    }
}