use of org.eclipse.egit.ui.internal.jobs.RepositoryJob in project egit by eclipse.
the class FetchOperationUI method start.
/**
* Starts the operation asynchronously showing a confirmation dialog after
* completion
*/
public void start() {
final Repository repo = repository;
if (repo == null) {
return;
}
Job job = new RepositoryJob(NLS.bind(UIText.FetchOperationUI_FetchJobName, sourceString), UIPreferences.SHOW_FETCH_POPUP_SUCCESS) {
private FetchResult result;
@Override
public IStatus performJob(IProgressMonitor monitor) {
try {
result = execute(monitor);
} catch (CoreException e) {
return Activator.createErrorStatus(e.getStatus().getMessage(), e);
}
return Status.OK_STATUS;
}
@Override
protected IAction getAction() {
return new ShowResultAction(repo, result, sourceString);
}
@Override
public boolean belongsTo(Object family) {
if (JobFamilies.FETCH.equals(family)) {
return true;
}
return super.belongsTo(family);
}
};
job.setUser(true);
job.schedule();
}
Aggregations