use of org.tigris.subversion.subclipse.ui.operations.RevertOperation in project subclipse by subclipse.
the class RevertSynchronizeOperation method run.
protected void run(SVNTeamProvider provider, SyncInfoSet set, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
if (prompted)
return;
prompted = true;
getShell().getDisplay().syncExec(new Runnable() {
public void run() {
if (resources == null || resources.length == 0) {
revert = false;
return;
}
revertPage = new SvnWizardRevertPage(resources, url, statusMap, true);
revertPage.setResourceRemoved(SVNProviderPlugin.getPlugin().getPluginPreferences().getBoolean(ISVNCoreConstants.PREF_IGNORE_HIDDEN_CHANGES));
SvnWizard wizard = new SvnWizard(revertPage);
SvnWizardDialog dialog = new SvnWizardDialog(getShell(), wizard);
revert = (dialog.open() == SvnWizardDialog.OK);
if (revert)
resourcesToRevert = revertPage.getSelectedResources();
}
});
if (revert) {
boolean includesExternals = false;
if (revertPage != null && !revertPage.isResourceRemoved()) {
for (IResource resource : resourcesToRevert) {
if (isExternal(resource)) {
includesExternals = true;
break;
}
}
}
RevertOperation revertOperation = null;
if (revertPage != null && !revertPage.isResourceRemoved() && !includesExternals) {
revertOperation = new RevertOperation(getPart(), selectedResources);
revertOperation.setRecurse(true);
revertOperation.setResourcesToRevert(resourcesToRevert);
} else {
revertOperation = new RevertOperation(getPart(), resourcesToRevert);
}
revertOperation.run();
}
}
use of org.tigris.subversion.subclipse.ui.operations.RevertOperation in project subclipse by subclipse.
the class RevertAction method execute.
protected void execute(final IAction action) throws InvocationTargetException, InterruptedException {
statusMap = new HashMap();
includesExternals = false;
resourcesHidden = false;
final IResource[] resources = getSelectedResources();
try {
IResource[] modifiedResources = getModifiedResources(resources, new NullProgressMonitor());
if (!confirmRevert(modifiedResources))
return;
RevertOperation revertOperation = null;
if (revertPage != null && !revertPage.isResourceRemoved() && !includesExternals) {
revertOperation = new RevertOperation(getTargetPart(), resources);
revertOperation.setRecurse(true);
revertOperation.setResourcesToRevert(resourcesToRevert);
} else {
revertOperation = new RevertOperation(getTargetPart(), resourcesToRevert);
}
revertOperation.setCanRunAsJob(canRunAsJob);
revertOperation.run();
} catch (SVNException e) {
if (!e.operationInterrupted()) {
throw new InvocationTargetException(e);
}
}
}
Aggregations