use of org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardLockPage in project subclipse by subclipse.
the class SVNFileModificationValidatorPrompt method prompt.
public boolean prompt(IFile[] lockFiles, Object context) {
if (context == null) {
comment = "";
stealLock = false;
return true;
}
this.files = lockFiles;
success = false;
SVNUIPlugin.getStandardDisplay().syncExec(new Runnable() {
public void run() {
SvnWizardLockPage lockPage = new SvnWizardLockPage(files);
SvnWizard wizard = new SvnWizard(lockPage);
SvnWizardDialog dialog = new SvnWizardDialog(Display.getCurrent().getActiveShell(), wizard);
wizard.setParentDialog(dialog);
if (dialog.open() == SvnWizardDialog.OK) {
success = true;
comment = lockPage.getComment();
stealLock = lockPage.isStealLock();
}
}
});
return success;
}
use of org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardLockPage 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