Search in sources :

Example 1 with SvnWizardUpdatePage

use of org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardUpdatePage in project subclipse by subclipse.

the class UpdateDialogAction method execute.

public void execute(IAction action) throws InterruptedException, InvocationTargetException {
    if (action != null && !action.isEnabled()) {
        action.setEnabled(true);
    } else {
        IResource[] resources = getSelectedResources();
        String pageName;
        if (resources.length > 1)
            // $NON-NLS-1$
            pageName = "UpdateDialogWithConflictHandling.multiple";
        else
            // $NON-NLS-1$
            pageName = "UpdateDialogWithConflictHandling";
        SvnWizardUpdatePage updatePage = new SvnWizardUpdatePage(pageName, resources);
        updatePage.setDefaultRevision(revision);
        updatePage.setDepth(depth);
        updatePage.setSetDepth(setDepth);
        SvnWizard wizard = new SvnWizard(updatePage);
        SvnWizardDialog dialog = new SvnWizardDialog(getShell(), wizard);
        wizard.setParentDialog(dialog);
        if (dialog.open() == SvnWizardDialog.OK) {
            SVNRevision svnRevision = updatePage.getRevision();
            UpdateOperation updateOperation = new UpdateOperation(getTargetPart(), resources, svnRevision);
            updateOperation.setDepth(updatePage.getDepth());
            updateOperation.setSetDepth(updatePage.isSetDepth());
            updateOperation.setForce(updatePage.isForce());
            updateOperation.setIgnoreExternals(updatePage.isIgnoreExternals());
            updateOperation.setCanRunAsJob(canRunAsJob);
            updateOperation.setConflictResolver(updatePage.getConflictResolver());
            updateOperation.run();
        }
    }
}
Also used : SvnWizardUpdatePage(org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardUpdatePage) UpdateOperation(org.tigris.subversion.subclipse.ui.operations.UpdateOperation) SvnWizardDialog(org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardDialog) SvnWizard(org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizard) SVNRevision(org.tigris.subversion.svnclientadapter.SVNRevision) IResource(org.eclipse.core.resources.IResource)

Aggregations

IResource (org.eclipse.core.resources.IResource)1 UpdateOperation (org.tigris.subversion.subclipse.ui.operations.UpdateOperation)1 SvnWizard (org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizard)1 SvnWizardDialog (org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardDialog)1 SvnWizardUpdatePage (org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardUpdatePage)1 SVNRevision (org.tigris.subversion.svnclientadapter.SVNRevision)1