Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 2996f39cc7874f7e5fe49baf3f2b513586c51e18 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*******************************************************************************
 * Copyright (c) 2007 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.team.internal.ui.wizards;

import org.eclipse.core.resources.IProject;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.ui.IConfigurationWizard;
import org.eclipse.team.ui.IConfigurationWizardExtension;

/**
 * Wizard that supports the sharing of multiple projects for those repository providers
 * that have not adapted their {@link IConfigurationWizard} to {@link IConfigurationWizardExtension}.
 */
public class ConfigureMultipleProjectsWizard extends Wizard {

	private final IProject[] projects;
	private final ConfigurationWizardElement element;
	private ProjectSelectionPage projectSelectionPage;

	public ConfigureMultipleProjectsWizard(IProject[] projects, ConfigurationWizardElement element) {
		this.projects = projects;
		this.element = element;
	}


	@Override
	public void addPages() {
		projectSelectionPage = new ProjectSelectionPage(projects, element);
		addPage(projectSelectionPage);
	}

	/* (non-Javadoc)
	 * @see org.eclipse.jface.wizard.Wizard#performFinish()
	 */
	@Override
	public boolean performFinish() {
		// Prompt if there are still unshared projects
		if (projectSelectionPage.hasUnsharedProjects()) {
			return MessageDialog.openConfirm(getShell(), TeamUIMessages.ConfigureMultipleProjectsWizard_0, TeamUIMessages.ConfigureMultipleProjectsWizard_1);
		}
		return true;
	}

}

Back to the top