Search in sources :

Example 1 with PushWizard

use of org.eclipse.egit.ui.internal.push.PushWizard in project egit by eclipse.

the class PushWizardTester method openPushWizard.

public RepoPropertiesPage openPushWizard(final Repository repository) throws Exception {
    PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {

        @Override
        public void run() {
            try {
                Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
                PushWizard pushWizard = new PushWizard(repository);
                WizardDialog dlg = new WizardDialog(shell, pushWizard);
                dlg.setHelpAvailable(false);
                dlg.open();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    });
    bot.waitUntil(Conditions.shellIsActive(UIText.PushWizard_windowTitleDefault), 20000);
    return new RepoPropertiesPage();
}
Also used : Shell(org.eclipse.swt.widgets.Shell) PushWizard(org.eclipse.egit.ui.internal.push.PushWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 2 with PushWizard

use of org.eclipse.egit.ui.internal.push.PushWizard in project egit by eclipse.

the class PushActionHandler method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    final Repository repository = getRepository(true, event);
    if (repository == null)
        return null;
    final PushWizard pushWizard;
    try {
        pushWizard = new PushWizard(repository);
    } catch (URISyntaxException x) {
        ErrorDialog.openError(getShell(event), UIText.PushAction_wrongURITitle, UIText.PushAction_wrongURIDescription, new Status(IStatus.ERROR, Activator.getPluginId(), x.getMessage(), x));
        return null;
    }
    WizardDialog dlg = new WizardDialog(getShell(event), pushWizard);
    dlg.setHelpAvailable(true);
    dlg.open();
    return null;
}
Also used : Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) Repository(org.eclipse.jgit.lib.Repository) PushWizard(org.eclipse.egit.ui.internal.push.PushWizard) URISyntaxException(java.net.URISyntaxException) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 3 with PushWizard

use of org.eclipse.egit.ui.internal.push.PushWizard in project egit by eclipse.

the class PushCommand method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    List<RepositoryTreeNode> nodes = getSelectedNodes(event);
    RepositoryTreeNode node = nodes.get(0);
    IWizard pushWiz = null;
    try {
        switch(node.getType()) {
            case REF:
                Ref ref = (Ref) node.getObject();
                pushWiz = new PushBranchWizard(node.getRepository(), ref);
                break;
            case TAG:
                pushWiz = createPushTagsWizard(nodes);
                break;
            case REPO:
                pushWiz = new PushWizard(node.getRepository());
                break;
            default:
                // $NON-NLS-1$
                throw new UnsupportedOperationException("type not supported!");
        }
    } catch (URISyntaxException e1) {
        Activator.handleError(e1.getMessage(), e1, true);
        return null;
    }
    WizardDialog dlg = new PushWizardDialog(getShell(event), pushWiz);
    dlg.setHelpAvailable(pushWiz.isHelpAvailable());
    dlg.open();
    return null;
}
Also used : Ref(org.eclipse.jgit.lib.Ref) RepositoryTreeNode(org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode) IWizard(org.eclipse.jface.wizard.IWizard) PushWizard(org.eclipse.egit.ui.internal.push.PushWizard) PushWizardDialog(org.eclipse.egit.ui.internal.push.PushWizardDialog) URISyntaxException(java.net.URISyntaxException) PushBranchWizard(org.eclipse.egit.ui.internal.push.PushBranchWizard) PushWizardDialog(org.eclipse.egit.ui.internal.push.PushWizardDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

PushWizard (org.eclipse.egit.ui.internal.push.PushWizard)3 WizardDialog (org.eclipse.jface.wizard.WizardDialog)3 URISyntaxException (java.net.URISyntaxException)2 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 PushBranchWizard (org.eclipse.egit.ui.internal.push.PushBranchWizard)1 PushWizardDialog (org.eclipse.egit.ui.internal.push.PushWizardDialog)1 RepositoryTreeNode (org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode)1 IWizard (org.eclipse.jface.wizard.IWizard)1 Ref (org.eclipse.jgit.lib.Ref)1 Repository (org.eclipse.jgit.lib.Repository)1 Shell (org.eclipse.swt.widgets.Shell)1