Search in sources :

Example 1 with BlameHistoryPageInput

use of org.eclipse.egit.ui.internal.blame.BlameOperation.BlameHistoryPageInput in project egit by eclipse.

the class BlameInformationControl method showCommitInHistory.

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);
    }
}
Also used : Repository(org.eclipse.jgit.lib.Repository) BlameHistoryPageInput(org.eclipse.egit.ui.internal.blame.BlameOperation.BlameHistoryPageInput) HistoryPageInput(org.eclipse.egit.ui.internal.history.HistoryPageInput) PartInitException(org.eclipse.ui.PartInitException) IHistoryView(org.eclipse.team.ui.history.IHistoryView) File(java.io.File) BlameHistoryPageInput(org.eclipse.egit.ui.internal.blame.BlameOperation.BlameHistoryPageInput)

Aggregations

File (java.io.File)1 BlameHistoryPageInput (org.eclipse.egit.ui.internal.blame.BlameOperation.BlameHistoryPageInput)1 HistoryPageInput (org.eclipse.egit.ui.internal.history.HistoryPageInput)1 Repository (org.eclipse.jgit.lib.Repository)1 IHistoryView (org.eclipse.team.ui.history.IHistoryView)1 PartInitException (org.eclipse.ui.PartInitException)1