Package org.eclipse.egit.ui.internal.commit

Examples of org.eclipse.egit.ui.internal.commit.RepositoryCommit


  public Object execute(ExecutionEvent event) throws ExecutionException {
    Repository repository = getRepository(event);
    RevCommit commit = getSelectedCommit(event, repository);
    if (commit != null)
      CommitEditor.openQuiet((new RepositoryCommit(repository, commit)));
    return null;
  }
View Full Code Here


   * @see org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider#getStyledText(java.lang.Object)
   */
  public StyledString getStyledText(Object element) {
    StyledString styled = new StyledString();
    if (element instanceof RepositoryCommit) {
      RepositoryCommit commit = (RepositoryCommit) element;
      RevCommit revCommit = commit.getRevCommit();

      styled.append(MessageFormat.format(
          UIText.CommitResultLabelProvider_SectionMessage,
          commit.abbreviate(), revCommit.getShortMessage()));

      PersonIdent author = revCommit.getAuthorIdent();
      if (author != null)
        styled.append(MessageFormat.format(
            UIText.CommitResultLabelProvider_SectionAuthor,
            author.getName(), dateFormat.format(author.getWhen())),
            StyledString.QUALIFIER_STYLER);

      if (layout == AbstractTextSearchViewPage.FLAG_LAYOUT_FLAT)
        styled.append(MessageFormat.format(
            UIText.CommitResultLabelProvider_SectionRepository,
            commit.getRepositoryName()),
            StyledString.DECORATIONS_STYLER);
    } else if (element instanceof RepositoryMatch) {
      RepositoryMatch repository = (RepositoryMatch) element;
      styled.append(repository.getLabel(repository));
      styled.append(" - ", StyledString.QUALIFIER_STYLER); //$NON-NLS-1$
View Full Code Here

    final List<RepositoryCommit> commits = new ArrayList<RepositoryCommit>();
    final RevWalk walk = new RevWalk(objectReader);
    walk.setRetainBody(true);
    for (ObjectId merge : merges)
      try {
        commits.add(new RepositoryCommit(repository, walk
            .parseCommit(merge)));
      } catch (IOException e) {
        Activator.logError(MessageFormat.format(
            UIText.MergeResultDialog_couldNotFindCommit,
            merge.name()), e);
View Full Code Here

              IDialogConstants.CANCEL_LABEL }, 0);
      setShellStyle(getShellStyle() | SWT.RESIZE);

      List<RepositoryCommit> repoCommits = new ArrayList<RepositoryCommit>();
      for (RevCommit commit : revCommits)
        repoCommits.add(new RepositoryCommit(repository, commit));
      this.commits = repoCommits.toArray(new RepositoryCommit[0]);
    }
View Full Code Here

  public static final String ID = "org.eclipse.egit.ui.commit.CreateBranch"; //$NON-NLS-1$

  public Object execute(ExecutionEvent event) throws ExecutionException {
    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

          walk.markStart(walk.parseCommit(update.getNewObjectId()));
          walk.markUninteresting(walk.parseCommit(update
              .getOldObjectId()));
          List<RepositoryCommit> commits = new ArrayList<RepositoryCommit>();
          for (RevCommit commit : walk)
            commits.add(new RepositoryCommit(repo, commit));
          children = commits.toArray();
          break;
        } catch (IOException e) {
          Activator.logError(
              "Error parsing commits from fetch result", e); //$NON-NLS-1$
View Full Code Here

  public static final String ID = "org.eclipse.egit.ui.commit.Checkout"; //$NON-NLS-1$

  public Object execute(final ExecutionEvent event) throws ExecutionException {
    final List<RepositoryCommit> commits = getCommits(event);
    if (commits.size() == 1) {
      final RepositoryCommit commit = commits.get(0);
      BranchOperationUI.checkout(commit.getRepository(),
          commit.getRevCommit().name()).start();
    }
    return null;
  }
View Full Code Here

      public Object[] getElements(Object element) {
        if (getLayout() == FLAG_LAYOUT_TREE) {
          Map<Repository, RepositoryMatch> repos = new HashMap<Repository, RepositoryMatch>();
          for (Object inputElement : getInput().getElements()) {
            RepositoryCommit commit = (RepositoryCommit) inputElement;
            RepositoryMatch match = repos.get(commit
                .getRepository());
            if (match == null) {
              match = new RepositoryMatch(commit.getRepository());
              repos.put(commit.getRepository(), match);
            }
            match.addCommit(commit);
          }
          return repos.values().toArray();
        }
View Full Code Here

  public static final String ID = "org.eclipse.egit.ui.commit.ShowInHistory"; //$NON-NLS-1$

  public Object execute(final ExecutionEvent event) throws ExecutionException {
    List<RepositoryCommit> commits = getCommits(event);
    if (commits.size() == 1) {
      RepositoryCommit repoCommit = commits.get(0);

      try {
        IHistoryView view = (IHistoryView) PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow().getActivePage()
            .showView(IHistoryView.VIEW_ID);
View Full Code Here

        for (RevCommit commit : walk) {
          if (monitor.isCanceled())
            throw new OperationCanceledException();
          for (SearchMatcher matcher : this.matchers)
            if (matcher.matches(pattern, commit)) {
              result.addResult(new RepositoryCommit(repository,
                  commit));
              break;
            }
        }
      }
View Full Code Here

TOP

Related Classes of org.eclipse.egit.ui.internal.commit.RepositoryCommit

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.