Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.Position.overlapsWith()


        Position position= fModel.getPosition(annotation);
        if (position == null)
          continue;

        if (!position.overlapsWith(topLeft, viewPort))
          continue;

        try {

          int offset= position.getOffset();
View Full Code Here


          Annotation a= (Annotation) e.next();
          Position p= fModel.getPosition(a);

          if (p == null)
            continue;
          if (visible != null && !p.overlapsWith(visible.getOffset(), visible.getLength()))
            continue;

          int annotationOffset= p.getOffset();
          int annotationLength= p.getLength();
          IRegion widgetRegion= null;
View Full Code Here

    Iterator iterator= getAnnotationIterator();
    while (iterator.hasNext()) {
      ProjectionAnnotation annotation= (ProjectionAnnotation) iterator.next();
      if (!annotation.isCollapsed()) {
        Position position= getPosition(annotation);
        if (position != null && position.overlapsWith(offset, length) /* || is a delete at the boundary */ ) {
          annotation.markCollapsed();
          modifyAnnotation(annotation, false);
          collapsing= true;
        }
      }
View Full Code Here

    Iterator iterator= getAnnotationIterator();
    while (iterator.hasNext()) {
      ProjectionAnnotation annotation= (ProjectionAnnotation) iterator.next();
      if (annotation.isCollapsed()) {
        Position position= getPosition(annotation);
        if (position != null && position.overlapsWith(offset, length) /* || is a delete at the boundary */ ) {
          annotation.markExpanded();
          modifyAnnotation(annotation, false);
          expanding= true;
        }
      }
View Full Code Here

      Position p= model.getPosition(a);
      if (p == null || p.isDeleted())
        continue;

      if (p.overlapsWith(lineStart, lineLength) || p.length == 0 && p.offset == lineStart + lineLength)
        return true;
    }

    return false;
  }
View Full Code Here

        // https://bugs.eclipse.org/bugs/show_bug.cgi?id=20284
        // Position.overlapsWith returns false if the position just starts at the end
        // of the specified range. If the position has zero length, we want to include it anyhow
        int viewPortSize= position.getLength() == 0 ? viewPort + 1 : viewPort;
        if (!position.overlapsWith(topLeft, viewPortSize))
          continue;

        try {

          int offset= position.getOffset();
View Full Code Here

      if (position == null)
        continue;

      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=217710
      int extendedVLength= position.getLength() == 0 ? vLength + 1 : vLength;
      if (!position.overlapsWith(vOffset, extendedVLength))
        continue;

      int lay= IAnnotationAccessExtension.DEFAULT_LAYER;
      if (fAnnotationAccessExtension != null)
        lay= fAnnotationAccessExtension.getLayer(annotation);
View Full Code Here

          if (first < 0)
            break;

          p= category[first];

        } while (p.overlapsWith(e.getOffset(), e.getLength()) ||
              (e.getOffset() == fPreviousDocumentLength &&
               (p.getOffset() + p.getLength() == fPreviousDocumentLength)));

        fPositionUpdater.update(e);
        for (int i= 0; i < category.length; i++) {
View Full Code Here

        // remove all affected positions
        while (first < category.length) {
          TypedPosition p= (TypedPosition) category[first];
          if (lastScannedPosition >= p.offset + p.length ||
              (p.overlapsWith(start, length) &&
                 (!d.containsPosition(fPositionCategory, start, length) ||
                  !contentType.equals(p.getType())))) {

            rememberRegion(p.offset, p.length);
            d.removePosition(fPositionCategory, p);
View Full Code Here

        current= (TypedPosition) category[i];

        gapOffset= (previous != null) ? previous.getOffset() + previous.getLength() : 0;
        gap= new Position(gapOffset, current.getOffset() - gapOffset);
        if ((includeZeroLengthPartitions || gap.getLength() > 0) && gap.overlapsWith(offset, length)) {
          start= Math.max(offset, gapOffset);
          end= Math.min(endOffset, gap.getOffset() + gap.getLength());
          list.add(new TypedRegion(start, end - start, IDocument.DEFAULT_CONTENT_TYPE));
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.