/** * Updates the resource mapping for the given launch configuration. * * @param wc working copy * @throws CoreException if an exception occurs updating resource mapping. */ public static void updateResourceMapping(ILaunchConfigurationWorkingCopy wc) throws CoreException { IResource resource = getResource(wc); IResource[] resources = null; if (resource != null) { resources = new IResource[]{resource}; } wc.setMappedResources(resources); }
/** * Updates the resource mapping for the given launch configuration. * * @param wc working copy * @throws CoreException if an exception occurs updating resource mapping. */ public static void updateResourceMapping(ILaunchConfigurationWorkingCopy wc) throws CoreException { IResource resource = getResource(wc); IResource[] resources = null; if (resource != null) { resources = new IResource[]{resource}; } wc.setMappedResources(resources); }
@Override public boolean isCandidate(ILaunchConfiguration candidate) throws CoreException { String pName = candidate.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, EMPTY_STRING); if(pName.equals(EMPTY_STRING)) { return false; } if (!isAvailable(pName)) { return false; } IResource[] mapped = candidate.getMappedResources(); IResource target = getResource(candidate); if (target == null) { return mapped != null; } if (mapped == null) { return true; } if (mapped.length != 1) { return true; } return !target.equals(mapped[0]); }
@Override public boolean isCandidate(ILaunchConfiguration candidate) throws CoreException { String pName = candidate.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, EMPTY_STRING); if(pName.equals(EMPTY_STRING)) { return false; } if (!isAvailable(pName)) { return false; } IResource[] mapped = candidate.getMappedResources(); IResource target = getResource(candidate); if (target == null) { return mapped != null; } if (mapped == null) { return true; } if (mapped.length != 1) { return true; } return !target.equals(mapped[0]); }