return null;
Repository repo = getSelectedItem(Repository.class, event);
if (repo == null)
return null;
final StashApplyOperation op = new StashApplyOperation(repo, commit);
Job job = new WorkspaceJob(MessageFormat.format(
UIText.StashApplyCommand_jobTitle, commit.name())) {
@Override
public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
op.execute(monitor);
} catch (CoreException e) {
return new Status(IStatus.ERROR, Activator.getPluginId(),
MessageFormat.format(
UIText.StashApplyCommand_applyFailed,
commit.abbreviate(7).name(),
e.getLocalizedMessage()), e);
}
return Status.OK_STATUS;
}
@Override
public boolean belongsTo(Object family) {
if (JobFamilies.STASH.equals(family))
return true;
return super.belongsTo(family);
}
};
job.setUser(true);
job.setRule(op.getSchedulingRule());
job.schedule();
return null;
}