use of org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizard in project subclipse by subclipse.
the class RevertAction method confirmRevert.
/**
* prompt revert of selected resources.
*/
protected boolean confirmRevert(IResource[] modifiedResources) {
if (modifiedResources.length == 0) {
if (showNothingToRevertMessage) {
MessageDialog.openInformation(Display.getDefault().getActiveShell(), Policy.bind("RevertAction.0"), // $NON-NLS-1$ //$NON-NLS-2$
Policy.bind("RevertAction.1"));
}
return false;
}
revertPage = new SvnWizardRevertPage(modifiedResources, url, statusMap, false);
revertPage.setResourceRemoved(resourcesHidden);
SvnWizard wizard = new SvnWizard(revertPage);
SvnWizardDialog dialog = new SvnWizardDialog(getShell(), wizard);
boolean revert = (dialog.open() == SvnWizardDialog.OK);
url = null;
resourcesToRevert = revertPage.getSelectedResources();
return revert;
}
use of org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizard in project subclipse by subclipse.
the class LockAction method execute.
protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
if (action != null && !action.isEnabled()) {
action.setEnabled(true);
} else {
if (getSelectedResources() != null && getSelectedResources().length > 0) {
final IResource[] resources = getSelectedResources();
SvnWizardLockPage lockPage = new SvnWizardLockPage(resources);
SvnWizard wizard = new SvnWizard(lockPage);
SvnWizardDialog dialog = new SvnWizardDialog(getShell(), wizard);
wizard.setParentDialog(dialog);
if (dialog.open() == SvnWizardDialog.OK) {
final String comment = lockPage.getComment();
final boolean stealLock = lockPage.isStealLock();
run(new WorkspaceModifyOperation() {
protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
try {
Hashtable table = getProviderMapping(getSelectedResources());
Set keySet = table.keySet();
Iterator iterator = keySet.iterator();
while (iterator.hasNext()) {
SVNTeamProvider provider = (SVNTeamProvider) iterator.next();
LockResourcesCommand command = new LockResourcesCommand(provider.getSVNWorkspaceRoot(), resources, stealLock, comment);
command.run(Policy.subMonitorFor(monitor, 1000));
}
} catch (TeamException e) {
throw new InvocationTargetException(e);
} finally {
monitor.done();
}
}
}, true, /* cancelable */
PROGRESS_DIALOG);
}
}
}
}
Aggregations