Package org.eclipse.compare.structuremergeviewer

Examples of org.eclipse.compare.structuremergeviewer.ICompareInput


    private IResource getResource(Object compareInput) {
        if (!(compareInput instanceof ICompareInput)) {
            return null;
        }
        ICompareInput input = (ICompareInput) compareInput;
        if (input == null) {
            return null;
        }

        IResourceProvider rp = null;
        ITypedElement te = input.getLeft();

        if (te instanceof IResourceProvider) {
            rp = (IResourceProvider) te;
        }

        if (rp == null) {
            te = input.getRight();
            if (te instanceof IResourceProvider) {
                rp = (IResourceProvider) te;
            }
        }

        if (rp == null) {
            te = input.getAncestor();
            if (te instanceof IResourceProvider) {
                rp = (IResourceProvider) te;
            }
        }
        if (rp != null) {
View Full Code Here


    return super.hasCompareInputFor(object);
  }

  @Override
  public ICompareInput asCompareInput(Object object) {
    final ICompareInput input = super.asCompareInput(object);
    final ISynchronizationContext ctx = getContext();

    if (input instanceof ResourceDiffCompareInput && ctx instanceof SubscriberMergeContext) {
      // Team only considers local resources as "left"
      // We'll use the cached data instead as left could be remote
      final IResource resource = ((ResourceNode) input.getLeft())
          .getResource();
      final Subscriber subscriber = ((SubscriberMergeContext)ctx).getSubscriber();

      if (resource instanceof IFile
          && subscriber instanceof GitResourceVariantTreeSubscriber) {
View Full Code Here

  }

  @Override
  protected ICompareInput prepareCompareInput(IProgressMonitor monitor)
      throws InvocationTargetException, InterruptedException {
    ICompareInput input = createCompareInput();
    getCompareConfiguration().setLeftEditable(isLeftEditable(input));
    getCompareConfiguration().setRightEditable(isRightEditable(input));
    ensureContentsCached(getLeftRevision(), getRightRevision(), getAncestorRevision(), monitor);
    initLabels(input);
    setTitle(NLS.bind(UIText.GitCompareFileRevisionEditorInput_CompareInputTitle, new String[] { input.getName() }));

    // The compare editor (Structure Compare) will show the diff filenames
    // with their project relative path. So, no need to also show directory entries.
    DiffNode flatDiffNode = new NotifiableDiffNode(null,
        ancestor != null ? Differencer.CONFLICTING : Differencer.CHANGE, ancestor, left, right);
View Full Code Here

    private double getHorizontalSplitRatio() {
      if (fHSplit < 0) {
        Object input = getInput();
        if (input instanceof ICompareInput) {
          ICompareInput ci = (ICompareInput) input;
          if (ci.getLeft() == null)
            return 0.1;
          if (ci.getRight() == null)
            return 0.9;
        }
        return HSPLIT;
      }
      return fHSplit;
View Full Code Here

TOP

Related Classes of org.eclipse.compare.structuremergeviewer.ICompareInput

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.