Search in sources :

Example 1 with SvnWizardRevertPage

use of org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardRevertPage 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();
    }
}
Also used : SvnWizardRevertPage(org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardRevertPage) SvnWizardDialog(org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardDialog) SvnWizard(org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizard) RevertOperation(org.tigris.subversion.subclipse.ui.operations.RevertOperation) IResource(org.eclipse.core.resources.IResource)

Example 2 with SvnWizardRevertPage

use of org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardRevertPage 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;
}
Also used : SvnWizardRevertPage(org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardRevertPage) SvnWizardDialog(org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardDialog) SvnWizard(org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizard)

Aggregations

SvnWizard (org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizard)2 SvnWizardDialog (org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardDialog)2 SvnWizardRevertPage (org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardRevertPage)2 IResource (org.eclipse.core.resources.IResource)1 RevertOperation (org.tigris.subversion.subclipse.ui.operations.RevertOperation)1