Package org.eclipse.egit.ui.internal.revision

Examples of org.eclipse.egit.ui.internal.revision.GitCompareFileRevisionEditorInput


    } else {
      oldAction.run();
      return;
    }

    GitCompareFileRevisionEditorInput in = new GitCompareFileRevisionEditorInput(
        left, right, null);

    IWorkbenchPage page = getWorkbenchPage(conf.getSite());
    OpenInCompareAction.openCompareEditor(in, page, reuseEditor);
  }
View Full Code Here


      IWorkbenchPage workBenchPage) {
    final ITypedElement base = CompareUtils.getFileRevisionTypedElement(
        commit1Path, commit1, repository);
    final ITypedElement next = CompareUtils.getFileRevisionTypedElement(
        commit2Path, commit2, repository);
    CompareEditorInput in = new GitCompareFileRevisionEditorInput(base,
        next, null);
    CompareUtils.openInCompare(workBenchPage, in);
  }
View Full Code Here

      encoding = file.getCharset();
    } catch (CoreException e) {
      Activator.handleError(UIText.CompareUtils_errorGettingEncoding, e, true);
    }
    ITypedElement next = new FileRevisionTypedElement(nextFile, encoding);
    GitCompareFileRevisionEditorInput input = new GitCompareFileRevisionEditorInput(
        next, base, null);
    CompareUI.openCompareDialog(input);
  }
View Full Code Here

            gitPath, headCommitId, destCommitId, repository);
      }
    }


    final GitCompareFileRevisionEditorInput in = new GitCompareFileRevisionEditorInput(
        base, destCommit, commonAncestor, null);
    in.getCompareConfiguration().setRightLabel(refName);
    return in;
  }
View Full Code Here

        left = getTypedElement(fileNode, fileNode.leftRevision,
            getBaseVersionText());
        right = getTypedElement(fileNode, fileNode.rightRevision,
            getCompareVersionText());

        GitCompareFileRevisionEditorInput compareInput = new GitCompareFileRevisionEditorInput(
            left, right, PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow().getActivePage());
        CompareUtils.openInCompare(PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow().getActivePage(),
            compareInput);
View Full Code Here

      commonAncestor = getTypedElementForCommonAncestor(repository,
          rightGitPath, leftRev, rightRev);
    else
      commonAncestor = null;

    final GitCompareFileRevisionEditorInput in = new GitCompareFileRevisionEditorInput(
        left, right, commonAncestor, null);
    in.getCompareConfiguration().setLeftLabel(leftRev);
    in.getCompareConfiguration().setRightLabel(rightRev);

    if (page != null)
      openInCompare(page, in);
    else
      CompareUI.openCompareEditor(in);
View Full Code Here

    IFileRevision nextFile;
    nextFile = new WorkingTreeFileRevision(new File(
        repository.getWorkTree(), path));
    String encoding = ResourcesPlugin.getEncoding();
    ITypedElement next = new FileRevisionTypedElement(nextFile, encoding);
    GitCompareFileRevisionEditorInput input = new GitCompareFileRevisionEditorInput(
        next, base, null);
    CompareUI.openCompareDialog(input);
  }
View Full Code Here

    // still happens on initial commits
    final ITypedElement oldSide = createTypedElement(op, oldCommit,
        oldObjectId);
    final ITypedElement newSide = createTypedElement(np, newCommit,
        newObjectId);
    CompareUtils.openInCompare(page, new GitCompareFileRevisionEditorInput(
        newSide, oldSide, null));
  }
View Full Code Here

        if (rev != null) {
          if (compareMode) {
            ITypedElement right = CompareUtils
                .getFileRevisionTypedElement(commitPath,
                    commit, map.getRepository());
            final GitCompareFileRevisionEditorInput in = new GitCompareFileRevisionEditorInput(
                SaveableCompareEditorInput
                    .createFileElement(resource), right,
                null);
            try {
              CompareUtils.openInCompare(workBenchPage, in);
            } catch (Exception e) {
              errorOccurred = true;
            }
          } else
            try {
              EgitUiEditorUtils.openEditor(getPart(event)
                  .getSite().getPage(), rev,
                  new NullProgressMonitor());
            } catch (CoreException e) {
              Activator.logError(
                  UIText.GitHistoryPage_openFailed, e);
              errorOccurred = true;
            }
        } else
          ids.add(commit.getId());
      }
    }
    if (input instanceof File) {
      File fileInput = (File) input;
      Repository repo = getRepository(event);
      gitPath = getRepoRelativePath(repo, fileInput);
      Iterator<?> it = selection.iterator();
      while (it.hasNext()) {
        RevCommit commit = (RevCommit) it.next();
        String commitPath = getRenamedPath(gitPath, commit);
        IFileRevision rev = null;
        try {
          rev = CompareUtils.getFileRevision(commitPath, commit,
              repo, null);
        } catch (IOException e) {
          Activator.logError(NLS.bind(
              UIText.GitHistoryPage_errorLookingUpPath,
              commitPath, commit.getId()), e);
          errorOccurred = true;
        }
        if (rev != null) {
          if (compareMode)
            try {
              ITypedElement left = CompareUtils
                  .getFileRevisionTypedElement(gitPath,
                      new RevWalk(repo).parseCommit(repo
                          .resolve(Constants.HEAD)),
                      repo);
              ITypedElement right = CompareUtils
                  .getFileRevisionTypedElement(commitPath,
                      commit, repo);
              final GitCompareFileRevisionEditorInput in = new GitCompareFileRevisionEditorInput(
                  left, right, null);
              CompareUtils.openInCompare(workBenchPage, in);
            } catch (IOException e) {
              errorOccurred = true;
            }
View Full Code Here

          .getProject());
      final String gitPath = mapping.getRepoRelativePath(file);
      final String commitPath = getRenamedPath(gitPath, commit);
      ITypedElement right = CompareUtils.getFileRevisionTypedElement(
          commitPath, commit, mapping.getRepository());
      final GitCompareFileRevisionEditorInput in = new GitCompareFileRevisionEditorInput(
          SaveableCompareEditorInput.createFileElement(file), right,
          null);
      CompareUtils.openInCompare(workBenchPage, in);
    } else if (input instanceof File) {
      File file = (File) input;
View Full Code Here

TOP

Related Classes of org.eclipse.egit.ui.internal.revision.GitCompareFileRevisionEditorInput

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.