Package org.eclipse.egit.ui.internal.repository

Examples of org.eclipse.egit.ui.internal.repository.CreateBranchWizard


    List<RepositoryCommit> commits = getCommits(event);
    if (commits.size() == 1) {
      RepositoryCommit commit = commits.get(0);
      WizardDialog dlg = new WizardDialog(
          HandlerUtil.getActiveShellChecked(event),
          new CreateBranchWizard(commit.getRepository(), commit
              .getRevCommit().name()));
      dlg.setHelpAvailable(false);
      dlg.open();
    }
    return null;
View Full Code Here


            }
          } catch (IOException e1) {
            // base = null;
          }
        }
        CreateBranchWizard wiz = new CreateBranchWizard(repo, base);
        if (new WizardDialog(getShell(), wiz).open() == Window.OK) {
          String newRefName = wiz.getNewBranchName();
          try {
            branchTree.refresh();
            markRef(Constants.R_HEADS + newRefName);
            if (repo.getBranch().equals(newRefName))
              // close branch selection dialog when new branch was
View Full Code Here

    switch (mode) {
    case MODE_CHECKOUT:
      dialog = new CheckoutDialog(getShell(), repository);
      break;
    case MODE_CREATE:
      CreateBranchWizard wiz;
      try {
        if (base == null)
          base = repository.getFullBranch();
        wiz = new CreateBranchWizard(repository, base);
      } catch (IOException e) {
        wiz = new CreateBranchWizard(repository);
      }
      new WizardDialog(getShell(), wiz).open();
      return null;
    case MODE_DELETE:
      new DeleteBranchDialog(getShell(), repository).open();
View Full Code Here

        UIText.BranchOperationUI_CheckoutRemoteTrackingQuestion,
        MessageDialog.QUESTION, buttons, 0);
    int result = questionDialog.open();
    if (result == 0) {
      // Check out as new local branch
      CreateBranchWizard wizard = new CreateBranchWizard(repository,
          target);
      WizardDialog createBranchDialog = new WizardDialog(getShell(),
          wizard);
      createBranchDialog.open();
      return null;
View Full Code Here

      try {
        RevCommit baseCommit = new RevWalk(node.getRepository())
            .parseCommit(ref.getLeaf().getObjectId());
        WizardDialog dlg = new WizardDialog(
            getShell(event),
            new CreateBranchWizard(node.getRepository(), baseCommit.name()));
        dlg.setHelpAvailable(false);
        dlg.open();
      } catch (IOException e) {
        Activator.handleError(e.getMessage(), e, true);
      }
      return null;
    }
    String base = null;
    if (node.getObject() instanceof Ref)
      base = ((Ref) node.getObject()).getName();
    new WizardDialog(getShell(event), new CreateBranchWizard(node
        .getRepository(), base)).open();
    return null;
  }
View Full Code Here

    List<Ref> branches = getBranches(selection, repo);

    if (branches.isEmpty()) {
      PlotCommit commit = (PlotCommit) selection
          .getFirstElement();
      wiz = new CreateBranchWizard(repo, commit.name());
    } else {
      // prefer to create new branch based on a remote tracking branch
      Collections.sort(branches, new Comparator<Ref>() {

        public int compare(Ref o1, Ref o2) {
          String refName1 = o1.getName();
          String refName2 = o2.getName();
          if (refName1.startsWith(Constants.R_REMOTES)) {
            if (refName2.startsWith(Constants.R_HEADS))
              return -1;
            else
              return refName1.compareTo(refName2);
          } else {
            if (refName2.startsWith(Constants.R_REMOTES))
              return 1;
            else
              return refName1.compareTo(refName2);
          }
        }
      });
      Ref branch = branches.get(0).getLeaf();
      wiz = new CreateBranchWizard(repo, branch.getName());
    }

    WizardDialog dlg = new WizardDialog(
        HandlerUtil.getActiveShellChecked(event), wiz);
    dlg.setHelpAvailable(false);
View Full Code Here

TOP

Related Classes of org.eclipse.egit.ui.internal.repository.CreateBranchWizard

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.