use of org.eclipse.egit.ui.internal.fetch.FetchOperationUI in project egit by eclipse.
the class SynchronizeFetchJob method runInWorkspace.
@Override
public IStatus runInWorkspace(IProgressMonitor monitor) {
SubMonitor progress = SubMonitor.convert(monitor, gsdSet.size());
progress.setTaskName(UIText.SynchronizeFetchJob_TaskName);
for (GitSynchronizeData gsd : gsdSet) {
Repository repo = gsd.getRepository();
StoredConfig repoConfig = repo.getConfig();
String remoteName = gsd.getDstRemoteName();
if (remoteName == null) {
progress.worked(1);
continue;
}
progress.subTask(NLS.bind(UIText.SynchronizeFetchJob_SubTaskName, remoteName));
RemoteConfig config;
try {
config = new RemoteConfig(repoConfig, remoteName);
} catch (URISyntaxException e) {
Activator.logError(e.getMessage(), e);
progress.worked(1);
continue;
}
FetchOperationUI fetchOperationUI = new FetchOperationUI(repo, config, timeout, false);
fetchOperationUI.setCredentialsProvider(new EGitCredentialsProvider());
try {
fetchOperationUI.execute(progress.newChild(1));
gsd.updateRevs();
} catch (Exception e) {
showInformationDialog(remoteName);
Activator.logError(e.getMessage(), e);
}
}
return Status.OK_STATUS;
}
use of org.eclipse.egit.ui.internal.fetch.FetchOperationUI in project egit by eclipse.
the class SimpleFetchActionHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
if (repository == null)
return null;
RemoteConfig config = SimpleConfigureFetchDialog.getConfiguredRemote(repository);
if (config == null) {
MessageDialog.openInformation(getShell(event), UIText.SimpleFetchActionHandler_NothingToFetchDialogTitle, UIText.SimpleFetchActionHandler_NothingToFetchDialogMessage);
return null;
}
new FetchOperationUI(repository, config, Activator.getDefault().getPreferenceStore().getInt(UIPreferences.REMOTE_CONNECTION_TIMEOUT), false).start();
return null;
}
use of org.eclipse.egit.ui.internal.fetch.FetchOperationUI in project egit by eclipse.
the class FetchConfiguredRemoteCommand method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
RepositoryTreeNode node = getSelectedNodes(event).get(0);
RemoteConfig config = getRemoteConfig(node);
if (config == null) {
MessageDialog.openInformation(getShell(event), UIText.SimpleFetchActionHandler_NothingToFetchDialogTitle, UIText.SimpleFetchActionHandler_NothingToFetchDialogMessage);
return null;
}
int timeout = Activator.getDefault().getPreferenceStore().getInt(UIPreferences.REMOTE_CONNECTION_TIMEOUT);
new FetchOperationUI(node.getRepository(), config, timeout, false).start();
return null;
}
Aggregations