Git Repositories View: add CollapseAll action
[egit.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / internal / clone / GitImportProjectsWizard.java
blob99926d38e2bde96d8ecd927878dad69f87604463
1 /*******************************************************************************
2 * Copyright (c) 2010 SAP AG.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
8 * Contributors:
9 * Mathias Kinzler (SAP AG) - initial implementation
10 *******************************************************************************/
11 package org.eclipse.egit.ui.internal.clone;
13 import java.io.File;
15 import org.eclipse.egit.ui.UIText;
16 import org.eclipse.jface.wizard.Wizard;
17 import org.eclipse.jgit.lib.Repository;
19 /**
20 * A wizard used to import existing projects from a {@link Repository}
22 public class GitImportProjectsWizard extends Wizard {
24 private final String myWorkingDir;
26 private final File myGitDir;
28 /**
29 * @param repository
30 * the repository
31 * @param path
32 * a path, either the working directory of the repository or a
33 * sub-directory thereof
35 public GitImportProjectsWizard(Repository repository, String path) {
36 super();
37 myWorkingDir = path;
38 myGitDir = repository.getDirectory();
39 setWindowTitle(UIText.GitImportProjectsWizard_ImportExistingProjects0);
42 @Override
43 public void addPages() {
45 GitProjectsImportPage page = new GitProjectsImportPage() {
47 @Override
48 public void setVisible(boolean visible) {
49 setGitDir(myGitDir);
50 setProjectsList(myWorkingDir);
51 super.setVisible(visible);
55 addPage(page);
58 @Override
59 public boolean performFinish() {
60 GitProjectsImportPage page = (GitProjectsImportPage) getPages()[0];
61 return page.createProjects();