Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitSynchronizeWizard.java')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitSynchronizeWizard.java61
1 files changed, 61 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitSynchronizeWizard.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitSynchronizeWizard.java
new file mode 100644
index 0000000000..64b3ebf13c
--- /dev/null
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitSynchronizeWizard.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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
+ * Dariusz Luksza <dariusz@luksza.org>
+ *******************************************************************************/
+package org.eclipse.egit.ui.internal.synchronize;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.egit.core.synchronize.dto.GitSynchronizeData;
+import org.eclipse.egit.core.synchronize.dto.GitSynchronizeDataSet;
+import org.eclipse.egit.ui.UIText;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.Repository;
+
+/**
+ * Synchronization wizard for Git repositories
+ */
+public class GitSynchronizeWizard extends Wizard {
+
+ private GitSynchronizeWizardPage page;
+
+ /**
+ * Instantiates a new wizard for synchronizing resources that are being
+ * managed by EGit.
+ */
+ public GitSynchronizeWizard() {
+ setWindowTitle(UIText.GitSynchronizeWizard_synchronize);
+ }
+
+ @Override
+ public void addPages() {
+ page = new GitSynchronizeWizardPage();
+ addPage(page);
+ }
+
+ @Override
+ public boolean performFinish() {
+ Set<IProject> projects = page.getSelectedProjects();
+ GitSynchronizeDataSet gsdSet = new GitSynchronizeDataSet();
+
+ Map<Repository, String> branches = page.getSelectedBranches();
+ for (Repository repo : branches.keySet()) {
+ gsdSet.add(new GitSynchronizeData(repo, Constants.HEAD, branches.get(repo), projects, false));
+ }
+
+ new GitSynchronize(gsdSet);
+
+ return true;
+ }
+
+}

Back to the top