Correct reference to EPL in source headers
[egit/chris.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / internal / actions / PushAction.java
blobc17951e7acefd8110581c0aea65210fd6f6302b1
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 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9 package org.eclipse.egit.ui.internal.actions;
11 import java.net.URISyntaxException;
13 import org.eclipse.core.runtime.IStatus;
14 import org.eclipse.core.runtime.Status;
15 import org.eclipse.egit.ui.Activator;
16 import org.eclipse.egit.ui.UIText;
17 import org.eclipse.egit.ui.internal.push.PushWizard;
18 import org.eclipse.jface.action.IAction;
19 import org.eclipse.jface.dialogs.ErrorDialog;
20 import org.eclipse.jface.wizard.WizardDialog;
21 import org.spearce.jgit.lib.Repository;
23 /**
24 * Action for choosing specifications for push, and pushing out to another
25 * repository.
27 public class PushAction extends RepositoryAction {
29 @Override
30 public void run(IAction action) {
31 final Repository repository = getRepository(true);
32 if (repository == null)
33 return;
35 final PushWizard pushWizard;
36 try {
37 pushWizard = new PushWizard(repository);
38 } catch (URISyntaxException x) {
39 ErrorDialog.openError(getShell(), UIText.PushAction_wrongURITitle,
40 UIText.PushAction_wrongURIDescription, new Status(
41 IStatus.ERROR, Activator.getPluginId(), x
42 .getMessage(), x));
43 return;
45 final WizardDialog dialog = new WizardDialog(getShell(), pushWizard);
46 dialog.open();
49 @Override
50 public boolean isEnabled() {
51 return getRepository(false) != null;