use of org.tigris.subversion.subclipse.ui.operations.ReplaceOperation in project subclipse by subclipse.
the class SVNHistoryPage method getUpdateToRevisionAction.
// update to the selected revision (context menu)
private IAction getUpdateToRevisionAction() {
if (updateToRevisionAction == null) {
updateToRevisionAction = getContextMenuAction(Policy.bind("HistoryView.getRevisionAction"), new // $NON-NLS-1$
IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
ISelection selection = getSelection();
if (!(selection instanceof IStructuredSelection))
return;
IStructuredSelection ss = (IStructuredSelection) selection;
ISVNRemoteFile remoteFile = (ISVNRemoteFile) getLogEntry(ss).getRemoteResource();
try {
if (remoteFile != null) {
if (confirmOverwrite()) {
IFile file = (IFile) resource;
new ReplaceOperation(getSite().getPage().getActivePart(), file, remoteFile.getLastChangedRevision()).run(monitor);
historyTableProvider.setRemoteResource(remoteFile);
historyTableProvider.setProjectProperties(ProjectProperties.getProjectProperties(resource));
Display.getDefault().asyncExec(new Runnable() {
public void run() {
tableHistoryViewer.refresh();
}
});
}
}
} catch (InvocationTargetException e) {
throw new CoreException(new SVNStatus(IStatus.ERROR, 0, e.getMessage()));
} catch (InterruptedException e) {
// Cancelled by user
}
}
});
PlatformUI.getWorkbench().getHelpSystem().setHelp(updateToRevisionAction, IHelpContextIds.GET_FILE_REVISION_ACTION);
}
return updateToRevisionAction;
}
use of org.tigris.subversion.subclipse.ui.operations.ReplaceOperation in project subclipse by subclipse.
the class ReplaceWithRemoteAction method execute.
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
IResource[] resources = null;
try {
resources = checkOverwriteOfDirtyResources(getSelectedResources());
} catch (TeamException e) {
throw new InvocationTargetException(e);
}
// Peform the replace in the background
ReplaceOperation replaceOperation = new ReplaceOperation(getTargetPart(), resources, this.revision);
// replaceOperation.setResourcesToUpdate(getSelectedResources());
replaceOperation.run();
}
Aggregations