@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]); }