private ILaunchConfiguration getConfigurationNamed(String name) { try { for (ILaunchConfiguration config : DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations()) { if (name.equals(config.getName())) { return config; } } } catch (CoreException exception) { DartUtil.logError(exception); } return null; }
private IFile findFile(IStructuredSelection selection) { Object sel = selection.getFirstElement(); if (sel instanceof IFile) { return (IFile) sel; } else if (sel instanceof DartElement) { try { IResource resource = ((DartElement) sel).getCorrespondingResource(); if (resource instanceof IFile) { return (IFile) resource; } } catch (DartModelException exception) { DartUtil.logError(exception); } } return null; }