final ID localId = remoteUser.getID();
final ID remoteId = selectedEntry.getUser().getID();
IContainer container = (IContainer) roster.getPresenceContainerAdapter().getAdapter(IContainer.class);
final IResource[] resources = getResources(event);
final RemoteShare share = TeamSynchronization.getShare(container.getID());
IWorkbenchPart part = HandlerUtil.getActivePart(event);
final IWorkbenchPartSite site = part == null ? null : part.getSite();
final Shell shell = HandlerUtil.getActiveShellChecked(event);
ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
final boolean[] response = {true};
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
if (resources.length == 1) {
monitor.beginTask(NLS.bind(Messages.SynchronizeWithHandler_SynchronizeResourceTaskName, resources[0].getName()), IProgressMonitor.UNKNOWN);
} else {
monitor.beginTask(Messages.SynchronizeWithHandler_SynchronizeResourcesTaskName, IProgressMonitor.UNKNOWN);
}
try {
if (share.sendShareRequest(localId, remoteId, resources, monitor)) {
scheduleRefreshJob(share, localId, remoteId, resources, remoteUser, site);
} else {
response[0] = false;
}
} catch (ECFException e) {