final IResource[] resources = getSelectedResources(event);
Shell shell = getShell(event);
Repository repository = getRepository(true, event);
final String resourceName = resources.length == 1 ? resources[0].getFullPath()
.lastSegment() : null;
ReplaceTargetSelectionDialog dlg = new ReplaceTargetSelectionDialog(
shell, repository, resourceName);
if (dlg.open() == Window.OK)
return dlg.getRefName();
else
throw new OperationCanceledException();
}