Package org.eclipse.jface.text

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


    // iterate all mapped jsp ranges
    Iterator it = fJsp2JavaMap.keySet().iterator();
    while (it.hasNext()) {
      jspPos = (Position) it.next();
      // need to count the last position as included
      if (!jspPos.includes(jspOffset) && !(jspPos.offset+jspPos.length == jspOffset))
        continue;

      offsetInRange = jspOffset - jspPos.offset;
      javaPos = (Position) fJsp2JavaMap.get(jspPos);
      if(javaPos != null)
View Full Code Here


    Iterator it = ranges.keySet().iterator();
    while(it.hasNext()) {
      Position javaPos = (Position)it.next();
      // also include the start and end offset (only if requested)
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81687
      if(javaPos.includes(javaOffset) || (includeEndOffset && javaPos.offset+javaPos.length == javaOffset))
        return true;
    }
    return false;
  }
View Full Code Here

      while (e.hasNext()) {
        Annotation a = (Annotation) e.next();
        if (!isAnnotationValid(a))
          continue;
        Position p = model.getPosition(a);
        if (p != null && p.includes(offset)) {
          // find the smallest region containing offset
          if ((hoverRegion == null) || (hoverRegion.getLength() > p.getLength())) {
            hoverRegion = new Region(p.getOffset(), p.getLength());
          }
        }
View Full Code Here

    // iterate all mapped jsp ranges
    Iterator it = fJsp2JavaMap.keySet().iterator();
    while (it.hasNext()) {
      jspPos = (Position) it.next();
      // need to count the last position as included
      if (!jspPos.includes(jspOffset) && !(jspPos.offset+jspPos.length == jspOffset))
        continue;

      offsetInRange = jspOffset - jspPos.offset;
      javaPos = (Position) fJsp2JavaMap.get(jspPos);
      if(javaPos != null)
View Full Code Here

    Iterator it = ranges.keySet().iterator();
    while(it.hasNext()) {
      Position javaPos = (Position)it.next();
      // also include the start and end offset (only if requested)
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81687
      if(javaPos.includes(javaOffset) || (includeEndOffset && javaPos.offset+javaPos.length == javaOffset))
        return true;
    }
    return false;
  }
View Full Code Here

        ProjectionAnnotation annotation= (ProjectionAnnotation) e.next();
        if (annotation.isCollapsed()) {
          Position position= fProjectionAnnotationModel.getPosition(annotation);
          // take the first most fine grained match
          if (position != null && touches(selection, position))
            if (found == null || position.includes(found.offset) && position.includes(found.offset + found.length)) {
              found= position;
              bestMatch= annotation;
            }
        }
      }
View Full Code Here

        ProjectionAnnotation annotation= (ProjectionAnnotation) e.next();
        if (annotation.isCollapsed()) {
          Position position= fProjectionAnnotationModel.getPosition(annotation);
          // take the first most fine grained match
          if (position != null && touches(selection, position))
            if (found == null || position.includes(found.offset) && position.includes(found.offset + found.length)) {
              found= position;
              bestMatch= annotation;
            }
        }
      }
View Full Code Here

    if (wodModel != null) {
      IWodUnit wodUnit = wodModel.getWodUnitAtIndex(offset);
      if (wodUnit != null && wodUnit instanceof IWodElement) {
        IWodElement wodElement = (IWodElement) wodUnit;
        Position elementNamePosition = wodElement.getElementNamePosition();
        if (elementNamePosition != null && elementNamePosition.includes(offset)) {
          String elementName = wodElement.getElementName();
          if (elementName != null) {
            QuickRenameRefactoring.renameElement(elementName, htmlViewer, wodViewer, cache, false);
          }
        }
View Full Code Here

        ProjectionAnnotation annotation= (ProjectionAnnotation) e.next();
        if (annotation.isCollapsed()) {
          Position position= fProjectionAnnotationModel.getPosition(annotation);
          // take the first most fine grained match
          if (position != null && touches(selection, position))
            if (found == null || position.includes(found.offset) && position.includes(found.offset + found.length)) {
              found= position;
              bestMatch= annotation;
            }
        }
      }
View Full Code Here

        ProjectionAnnotation annotation= (ProjectionAnnotation) e.next();
        if (annotation.isCollapsed()) {
          Position position= fProjectionAnnotationModel.getPosition(annotation);
          // take the first most fine grained match
          if (position != null && touches(selection, position))
            if (found == null || position.includes(found.offset) && position.includes(found.offset + found.length)) {
              found= position;
              bestMatch= annotation;
            }
        }
      }
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.