Remove System.out.println from RevWalkFilterTest
[jgit.git] / org.spearce.egit.ui / src / org / spearce / egit / ui / internal / actions / PushAction.java
blobb4af3b50f3bdadbb3c66cb1c81062f124478fbe4
1 /*******************************************************************************
2 * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * See LICENSE for the full license text, also available.
7 *******************************************************************************/
8 package org.spearce.egit.ui.internal.actions;
10 import java.net.URISyntaxException;
12 import org.eclipse.core.runtime.IStatus;
13 import org.eclipse.core.runtime.Status;
14 import org.eclipse.jface.action.IAction;
15 import org.eclipse.jface.dialogs.ErrorDialog;
16 import org.eclipse.jface.wizard.WizardDialog;
17 import org.spearce.egit.ui.Activator;
18 import org.spearce.egit.ui.UIText;
19 import org.spearce.egit.ui.internal.push.PushWizard;
20 import org.spearce.jgit.lib.Repository;
22 /**
23 * Action for choosing specifications for push, and pushing out to another
24 * repository.
26 public class PushAction extends RepositoryAction {
28 @Override
29 public void run(IAction action) {
30 final Repository repository = getRepository(true);
31 if (repository == null)
32 return;
34 final PushWizard pushWizard;
35 try {
36 pushWizard = new PushWizard(repository);
37 } catch (URISyntaxException x) {
38 ErrorDialog.openError(getShell(), UIText.PushAction_wrongURITitle,
39 UIText.PushAction_wrongURIDescription, new Status(
40 IStatus.ERROR, Activator.getPluginId(), x
41 .getMessage(), x));
42 return;
44 final WizardDialog dialog = new WizardDialog(getShell(), pushWizard);
45 dialog.open();
48 @Override
49 public boolean isEnabled() {
50 return getRepository(false) != null;