Source:
<code><START> private void preselectValues() { <END> 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); }</code><technical_language>I guess logic is one. question is if is necessary pre-select existing directory disable option change it. I do issue map /A/foo /B/foo /A/bar /C/bar instead of /B/bar is share /A shared /A/foo /A/bar</technical_language>

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