Package org.eclipse.team.ui.history

Examples of org.eclipse.team.ui.history.IHistoryView


    }
  }

  private void showCommitInHistory() {
    getShell().dispose();
    IHistoryView part;
    try {
      part = (IHistoryView) PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow().getActivePage()
          .showView(IHistoryView.VIEW_ID);
    } catch (PartInitException e) {
      Activator.logError(e.getLocalizedMessage(), e);
      return;
    }

    if (part == null)
      return;

    Repository repository = revision.getRepository();
    if (!repository.isBare()) {
      String sourcePath = revision.getSourcePath();
      File file = new File(repository.getWorkTree(), sourcePath);
      BlameHistoryPageInput input = new BlameHistoryPageInput(repository,
          revision.getCommit(), file);
      part.showHistoryFor(input);
    } else {
      HistoryPageInput input = new BlameHistoryPageInput(repository,
          revision.getCommit());
      part.showHistoryFor(input);
    }
  }
View Full Code Here


    if (editor == null)
      return;

    // Show history view for path
    try {
      IHistoryView part = (IHistoryView) page.showView(
          IHistoryView.VIEW_ID, null, IWorkbenchPage.VIEW_VISIBLE);
      HistoryPageInput input = createHistoryPageInputWhenEditorOpened();
      part.showHistoryFor(input);
    } catch (PartInitException e) {
      Activator.handleError("Error displaying blame annotations", e, //$NON-NLS-1$
          false);
    }
View Full Code Here

        return;
      Object first = ((IStructuredSelection) selection).getFirstElement();
      if (!(first instanceof BlameRevision))
        return;

      IHistoryView part = (IHistoryView) PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow().getActivePage()
          .findView(IHistoryView.VIEW_ID);
      if (part == null)
        return;

      BlameRevision revision = (BlameRevision) first;
      BlameHistoryPageInput input;
      if (resourceFile != null)
        input = new BlameHistoryPageInput(revision.getRepository(),
            revision.getCommit(), resourceFile);
      else if (nonResourceFile != null)
        input = new BlameHistoryPageInput(revision.getRepository(),
            revision.getCommit(), nonResourceFile);
      else
        input = new BlameHistoryPageInput(revision.getRepository(),
            revision.getCommit());
      part.showHistoryFor(input);
    }
View Full Code Here

    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.showHistoryFor(repoCommit);
      } catch (PartInitException e) {
        throw new ExecutionException(e.getMessage(), e);
      }
    }
    return null;
View Full Code Here

  public Object execute(ExecutionEvent event) throws ExecutionException {
    final Repository repo = getRepository(true, event);
    // assert all resources map to the same repository
    if (repo == null)
      return null;
    IHistoryView view;
    try {
      view = (IHistoryView) PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow().getActivePage().showView(
              IHistoryView.VIEW_ID);
      IResource[] resources = getSelectedResources(event);
      if (resources.length == 1) {
        view.showHistoryFor(resources[0]);
        return null;
      }
      HistoryPageInput list = new HistoryPageInput(repo, resources);
      view.showHistoryFor(list);
    } catch (PartInitException e) {
      throw new ExecutionException(e.getMessage(), e);
    }
    return null;
  }
View Full Code Here

      return gitModelWorkbenchAdapter;
    }

    if (adaptableObject instanceof IHistoryView
        && IShowInSource.class == adapterType) {
      IHistoryView historyView = (IHistoryView) adaptableObject;
      IHistoryPage historyPage = historyView.getHistoryPage();
      if (historyPage instanceof GitHistoryPage)
        return historyPage;
    }

    if (adaptableObject instanceof GitModelObject
View Full Code Here

  }

  private GitHistoryPage getPageFromPart(IWorkbenchPart part) {
    if (!(part instanceof IHistoryView))
      return null;
    IHistoryView view = (IHistoryView) part;
    IHistoryPage page = view.getHistoryPage();
    if (page instanceof GitHistoryPage)
      return (GitHistoryPage) page;
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.team.ui.history.IHistoryView

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.