Package org.eclipse.jface.text

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


      }

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


  private Position[] computeOverlappingAnnotationPositions(IRegion modelSelection) {
    List positions= new ArrayList();
    for (Iterator e= fProjectionAnnotationModel.getAnnotationIterator(); e.hasNext();) {
      ProjectionAnnotation annotation= (ProjectionAnnotation) e.next();
      Position position= fProjectionAnnotationModel.getPosition(annotation);
      if (position != null && position.overlapsWith(modelSelection.getOffset(), modelSelection.getLength()) && modelRange2WidgetRange(position) != null)
        positions.add(position);
    }
    return (Position[]) positions.toArray(new Position[positions.size()]);
  }
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

        gapOffset= (previous != null) ? previous.getOffset() + previous.getLength() : 0;
        gap.setOffset(gapOffset);
        gap.setLength(current.getOffset() - gapOffset);
        if ((includeZeroLengthPartitions && overlapsOrTouches(gap, offset, length)) ||
            (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

          Position[] positions= fDocument.getPositions(categories[i]);

          for (int j= 0; j < positions.length; j++) {

            Position p= positions[j];
            if (p.overlapsWith(offset, length)) {

              if (offset < p.getOffset())
                fOverlappingPositionReferences.add(new PositionReference(p, true, categories[i]));

              if (p.getOffset() + p.getLength() < offset + length)
View Full Code Here

          continue;

        Position p = model.getPosition(a);
        // check if this is an annotation in the region we are
        // concerned with
        if (p.overlapsWith(hoverRegion.getOffset(), hoverRegion
            .getLength())) {
          String msg = a.getText();
          if ((msg != null) && msg.trim().length() > 0) {
            // now we only consider ProblemAnnotation,and sometime
            // we have duplicate ProblemAnnotation for the same
View Full Code Here

       
        gapOffset= (previous != null) ? previous.getOffset() + previous.getLength() : 0;
        gap.setOffset(gapOffset);
        gap.setLength(current.getOffset() - gapOffset);
        if ((includeZeroLengthPartitions && overlapsOrTouches(gap, offset, length)) ||
            (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

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

    int firstPosition = -1;
    try {
      while (iter.hasNext()) {
        Position position = (Position) iter.next();
        if (firstPosition == -1) {
          if (position.overlapsWith(offset, 0)) {
            firstPosition = i;
            group
                .addPosition(new LinkedPosition(document, position.getOffset(), position.getLength(),
                    j++));
          }
View Full Code Here

    int firstPosition = -1;
    try {
      while (iter.hasNext()) {
        Position position = (Position) iter.next();
        if (firstPosition == -1) {
          if (position.overlapsWith(offset, 0)) {
            firstPosition = i;
            group
                .addPosition(new LinkedPosition(document, position.getOffset(), position.getLength(),
                    j++));
          }
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.