Package org.eclipse.egit.ui.internal.branch

Examples of org.eclipse.egit.ui.internal.branch.BranchOperationUI


  public Object execute(ExecutionEvent event) throws ExecutionException {
    Repository repo = getRepository(event);
    RevCommit commit = getSelectedCommit(event, repo);
    if (commit != null) {
      final BranchOperationUI op = BranchOperationUI.checkout(repo,
          commit.name());
      if (op != null)
        op.start();
    }
    return null;
  }
View Full Code Here


      return null;

    final Ref ref = (Ref) node.getObject();
    Repository repo = node.getRepository();

    BranchOperationUI op = BranchOperationUI.checkout(repo, ref.getName());
    op.start();

    return null;
  }
View Full Code Here

public class CheckoutCommitHandler extends AbstractHistoryCommandHandler {
  public Object execute(ExecutionEvent event) throws ExecutionException {
    ObjectId commitId = getSelectedCommitId(event);
    Repository repo = getRepository(event);

    final BranchOperationUI op;

    List<RefNode> nodes = getRefNodes(commitId, repo, Constants.R_HEADS,
        Constants.R_REMOTES);
    Collections.sort(nodes);

    if (nodes.isEmpty())
      op = BranchOperationUI.checkout(repo, commitId.name());
    else if (nodes.size() == 1)
      op = BranchOperationUI.checkout(repo, nodes.get(0).getObject().getName());
    else {
      BranchSelectionDialog<RefNode> dlg = new BranchSelectionDialog<RefNode>(
          HandlerUtil.getActiveShellChecked(event), nodes,
          UIText.CheckoutHandler_SelectBranchTitle,
          UIText.CheckoutHandler_SelectBranchMessage, SWT.SINGLE);
      if (dlg.open() == Window.OK) {
        op = BranchOperationUI.checkout(repo, dlg.getSelectedNode()
            .getObject().getName());
      } else {
        op = null;
      }
    }

    if (op == null)
      return null;

    op.start();
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.egit.ui.internal.branch.BranchOperationUI

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.