View | Details | Raw Unified | Return to bug 41340 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/team/internal/ccvs/ui/actions/GenerateDiffFileAction.java (-2 / +2 lines)
Lines 31-37 Link Here
31
	public void execute(IAction action) {
31
	public void execute(IAction action) {
32
		final String title = Policy.bind("GenerateCVSDiff.title"); //$NON-NLS-1$
32
		final String title = Policy.bind("GenerateCVSDiff.title"); //$NON-NLS-1$
33
		final IResource[] resources = getSelectedResources();
33
		final IResource[] resources = getSelectedResources();
34
		GenerateDiffFileWizard wizard = new GenerateDiffFileWizard(new StructuredSelection(resources), resources[0]);
34
		GenerateDiffFileWizard wizard = new GenerateDiffFileWizard(new StructuredSelection(resources), resources);
35
		wizard.setWindowTitle(title);
35
		wizard.setWindowTitle(title);
36
		WizardDialog dialog = new WizardDialog(getShell(), wizard);
36
		WizardDialog dialog = new WizardDialog(getShell(), wizard);
37
		dialog.setMinimumPageSize(350, 250);
37
		dialog.setMinimumPageSize(350, 250);
Lines 42-48 Link Here
42
	 * @see org.eclipse.team.internal.ccvs.ui.actions.WorkspaceAction#isEnabledForMultipleResources()
42
	 * @see org.eclipse.team.internal.ccvs.ui.actions.WorkspaceAction#isEnabledForMultipleResources()
43
	 */
43
	 */
44
	protected boolean isEnabledForMultipleResources() {
44
	protected boolean isEnabledForMultipleResources() {
45
		return false;
45
		return true;
46
	}
46
	}
47
47
48
	/**
48
	/**
(-)src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileOperation.java (-3 / +7 lines)
Lines 44-56 Link Here
44
public class GenerateDiffFileOperation implements IRunnableWithProgress {
44
public class GenerateDiffFileOperation implements IRunnableWithProgress {
45
45
46
	private File outputFile;
46
	private File outputFile;
47
	private IResource resource;
47
	private IResource[] resources;
48
	private Shell shell;
48
	private Shell shell;
49
	private LocalOption[] options;
49
	private LocalOption[] options;
50
	private boolean toClipboard;
50
	private boolean toClipboard;
51
51
52
	GenerateDiffFileOperation(IResource resource, File file, boolean toClipboard, LocalOption[] options, Shell shell) {
52
	GenerateDiffFileOperation(IResource[] resources, File file, boolean toClipboard, LocalOption[] options, Shell shell) {
53
		this.resource = resource;
53
		this.resources = resources;
54
		this.outputFile = file;
54
		this.outputFile = file;
55
		this.shell = shell;
55
		this.shell = shell;
56
		this.options = options;
56
		this.options = options;
Lines 73-80 Link Here
73
				os = new FileOutputStream(outputFile);
73
				os = new FileOutputStream(outputFile);
74
			}
74
			}
75
			try {
75
			try {
76
                for (int i = 0; i < resources.length; i++)
77
                {
78
                    IResource resource = resources[i];
76
				CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId());
79
				CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId());
77
				provider.diff(resource, options, new PrintStream(os), new SubProgressMonitor(monitor, 500));
80
				provider.diff(resource, options, new PrintStream(os), new SubProgressMonitor(monitor, 500));
81
                }
78
			} finally {
82
			} finally {
79
				os.close();
83
				os.close();
80
			}
84
			}
(-)src/org/eclipse/team/internal/ccvs/ui/wizards/GenerateDiffFileWizard.java (-5 / +5 lines)
Lines 49-55 Link Here
49
	private PatchFileCreationOptionsPage optionsPage;
49
	private PatchFileCreationOptionsPage optionsPage;
50
	
50
	
51
	private IStructuredSelection selection;
51
	private IStructuredSelection selection;
52
	private IResource resource;
52
	private IResource[] resources;
53
53
54
	/**
54
	/**
55
	 * Page to select a patch file. Overriding validatePage was necessary to allow
55
	 * Page to select a patch file. Overriding validatePage was necessary to allow
Lines 442-451 Link Here
442
	}
442
	}
443
	// end of PatchFileCreationOptionsPage
443
	// end of PatchFileCreationOptionsPage
444
	
444
	
445
	public GenerateDiffFileWizard(IStructuredSelection selection, IResource resource) {
445
	public GenerateDiffFileWizard(IStructuredSelection selection, IResource[] resources) {
446
		super();
446
		super();
447
		this.selection = selection;
447
		this.selection = selection;
448
		this.resource = resource;
448
		this.resources = resources;
449
		setWindowTitle(Policy.bind("GenerateCVSDiff.title")); //$NON-NLS-1$
449
		setWindowTitle(Policy.bind("GenerateCVSDiff.title")); //$NON-NLS-1$
450
		initializeDefaultPageImageDescriptor();
450
		initializeDefaultPageImageDescriptor();
451
	}
451
	}
Lines 520-531 Link Here
520
						return false;
520
						return false;
521
					}
521
					}
522
				}
522
				}
523
				getContainer().run(true, true, new GenerateDiffFileOperation(resource, file, false, optionsPage.getOptions(), getShell()));
523
				getContainer().run(true, true, new GenerateDiffFileOperation(resources, file, false, optionsPage.getOptions(), getShell()));
524
				if(type==mainPage.WORKSPACE) {
524
				if(type==mainPage.WORKSPACE) {
525
					ws.getParent().refreshLocal(IResource.DEPTH_ONE, null);
525
					ws.getParent().refreshLocal(IResource.DEPTH_ONE, null);
526
				}
526
				}
527
			} else {
527
			} else {
528
				getContainer().run(true, true, new GenerateDiffFileOperation(resource, null, true, optionsPage.getOptions(), getShell()));
528
				getContainer().run(true, true, new GenerateDiffFileOperation(resources, null, true, optionsPage.getOptions(), getShell()));
529
			}
529
			}
530
			return true;
530
			return true;
531
		} catch (InterruptedException e1) {
531
		} catch (InterruptedException e1) {

Return to bug 41340