Package org.eclipse.jface.text

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


    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


                    boolean overlaps = false;
                    for ( int k = 0; k < positionList.size(); k++ )
                    {
                        Position pos = positionList.get( k );
                        if ( pos.overlapsWith( tokens[i].getOffset(), tokens[i].getLength() ) )
                        {
                            overlaps = true;
                            break;
                        }
                    }
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

      }

      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

  public String getHoverInfo(ITextViewer _textViewer, IRegion _hoverRegion) {
    Iterator annotationsIter = myAnnotationModel.getAnnotationIterator();
    while (annotationsIter.hasNext()) {
      Annotation annotation = (Annotation) annotationsIter.next();
      Position position = myAnnotationModel.getPosition(annotation);
      if (position.overlapsWith(_hoverRegion.getOffset(), _hoverRegion.getLength())) {
        String text = annotation.getText();
        if (text != null && text.trim().length() > 0) {
          return text;
        }
      }
View Full Code Here

    // TODO If this is too slow then we might return new Region(offset, 0)
    Iterator annotationsIter = myAnnotationModel.getAnnotationIterator();
    while (annotationsIter.hasNext()) {
      Annotation annotation = (Annotation) annotationsIter.next();
      Position position = myAnnotationModel.getPosition(annotation);
      if (position.overlapsWith(_offset, 0)) {
        String text = annotation.getText();
        if (text != null && text.trim().length() > 0) {
          return new Region(position.offset, position.length);
        }
      }
View Full Code Here

                if(gapOffset > current.getOffset()) {
                    fDocument.removePosition(getManagingPositionCategories()[0], current);
                    continue;
                }
                gap = new Position(gapOffset, current.getOffset() - gapOffset);
                if (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));
                }
                if (current.overlapsWith(offset, length)) {
View Full Code Here

                previous = current;
            }
            if (previous != null) {
                gapOffset = previous.getOffset() + previous.getLength();
                gap = new Position(gapOffset, fDocument.getLength() - gapOffset);
                if (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

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.