Source:
private void preselectValues() { for (Entry<String, ReferencePointOptionComposite> entry : referencePointOptionComposites.entrySet()) { String referencePointId = entry.getKey(); ReferencePointOptionComposite referencePointOptionComposite = entry.getValue(); IReferencePoint referencePoint = session.getReferencePoint(referencePointId); if (referencePoint == null) continue; IContainer referencePointDelegate = ResourceConverter.getDelegate(referencePoint); String delegatePath = referencePointDelegate.getFullPath().toPortableString(); referencePointOptionComposite.setExistingDirectoryOptionSelected(delegatePath); referencePointOptionComposite.setEnabled(false); } for (Entry<String, ReferencePointOptionComposite> entry : referencePointOptionComposites.entrySet()) { String referencePointId = entry.getKey(); ReferencePointOptionComposite referencePointOptionComposite = entry.getValue(); IReferencePoint referencePoint = session.getReferencePoint(referencePointId); if (referencePoint != null) { continue; } String remoteReferencePointName = remoteReferencePointIdToNameMapping.get(referencePointId); setReferencePointName(referencePointOptionComposite, remoteReferencePointName); String previousReferencePointPath = previousReferencePointPathMapping.get(remoteReferencePointName); Map<String, IProject> localProjects = Arrays.stream(ResourcesPlugin.getWorkspace().getRoot().getProjects()) .collect(Collectors.toMap(IResource::getName, Function.identity())); if (previousReferencePointPath != null) { IContainer desiredContainer = ReferencePointOptionResult.getContainerForPath(previousReferencePointPath); if (desiredContainer != null && desiredContainer.exists()) { String existingDirectoryPath = desiredContainer.getFullPath().toPortableString(); referencePointOptionComposite.setExistingDirectoryOptionSelected(existingDirectoryPath); } } else if (localProjects.containsKey(remoteReferencePointName)) { String projectPath = localProjects.get(remoteReferencePointName).getFullPath().toPortableString(); referencePointOptionComposite.setExistingDirectoryOptionSelected(projectPath); } } updatePageComplete(null); }

Target:
private void preselectValues() { for (Entry<String, ReferencePointOptionComposite> entry : referencePointOptionComposites.entrySet()) { String referencePointId = entry.getKey(); ReferencePointOptionComposite referencePointOptionComposite = entry.getValue(); String remoteReferencePointName = remoteReferencePointIdToNameMapping.get(referencePointId); setReferencePointName(referencePointOptionComposite, remoteReferencePointName); String previousReferencePointPath = previousReferencePointPathMapping.get(remoteReferencePointName); Map<String, IProject> localProjects = Arrays.stream(ResourcesPlugin.getWorkspace().getRoot().getProjects()) .collect(Collectors.toMap(IResource::getName, Function.identity())); if (previousReferencePointPath != null) { IContainer desiredContainer = ReferencePointOptionResult.getContainerForPath(previousReferencePointPath); if (desiredContainer != null && desiredContainer.exists()) { String existingDirectoryPath = desiredContainer.getFullPath().toPortableString(); referencePointOptionComposite.setExistingDirectoryOptionSelected(existingDirectoryPath); } } else if (localProjects.containsKey(remoteReferencePointName)) { String projectPath = localProjects.get(remoteReferencePointName).getFullPath().toPortableString(); referencePointOptionComposite.setExistingDirectoryOptionSelected(projectPath); } } updatePageComplete(null); }