Package org.eclipse.jface.text

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


                    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


    int count = 0;
    Iterator it = java2jsp.keySet().iterator();
    Position javaRange = null;
    while(it.hasNext()) {
      javaRange = (Position)it.next();
      if(javaRange.overlapsWith(javaOffset, javaLength))
        count++;
      if(count > 1)
        return true;
    }
    return false;
View Full Code Here

    List results = new ArrayList();
    Iterator it = getJava2JspMap().keySet().iterator();
    Position p = null;
    while(it.hasNext()) {
      p = (Position)it.next();
      if(p.overlapsWith(offset, length))
        results.add(p);
    }
    return (Position[])results.toArray(new Position[results.size()]);
  }
 
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) {
            // it is possible for temporary annotations to
            // duplicate other annotations so make sure not to add
            // dups
View Full Code Here

    int count = 0;
    Iterator it = java2jsp.keySet().iterator();
    Position javaRange = null;
    while(it.hasNext()) {
      javaRange = (Position)it.next();
      if(javaRange.overlapsWith(javaOffset, javaLength))
        count++;
      if(count > 1)
        return true;
    }
    return false;
View Full Code Here

    List results = new ArrayList();
    Iterator it = getJava2JspMap().keySet().iterator();
    Position p = null;
    while(it.hasNext()) {
      p = (Position)it.next();
      if(p.overlapsWith(offset, length))
        results.add(p);
    }
    return (Position[])results.toArray(new Position[results.size()]);
  }
 
View Full Code Here

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

      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

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.