Examples of containsOffset()


Examples of com.intellij.openapi.util.TextRange.containsOffset()

    if (body == null) {
      editor.getCaretModel().moveToOffset(offset);
    }
    else {
      final TextRange bodyRange = body.getTextRange();
      editor.getCaretModel().moveToOffset(bodyRange.containsOffset(offset) ? offset : bodyRange.getEndOffset());
    }
  }

  /**
   * must be called not in write action
View Full Code Here

Examples of org.apache.flex.compiler.mxml.IMXMLUnitData.containsOffset()

     * @return the containing unit (or null if no unit contains this offset)
     */
    public IMXMLUnitData findUnitContainingOffset(int offset)
    {
        IMXMLUnitData unit = findNearestUnit(offset);
        if (unit != null && unit.containsOffset(offset))
            return unit;

        return null;
    }

View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion.containsOffset()

  private void getInsertRequiredAttrs(List proposals, ISourceViewer viewer, int offset) {
    IDOMNode node = (IDOMNode) getNodeAt(viewer, offset);
    if ((node != null) && (node.getNodeType() == Node.ELEMENT_NODE)) {
      IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
      if ((startStructuredDocumentRegion != null) && startStructuredDocumentRegion.containsOffset(offset)) {
        IDOMNode cursorNode = (IDOMNode) getNodeAt(viewer, offset);
        List requiredAttrs = getRequiredAttrs(cursorNode);
        if (requiredAttrs.size() > 0) {
          NamedNodeMap currentAttrs = node.getAttributes();
          List insertAttrs = new ArrayList();
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion.containsOffset()

    int regionTextEndOffset = 0;
    if ((startStructuredDocumentRegion != null) && startStructuredDocumentRegion.containsOffset(offset)) {
      region = startStructuredDocumentRegion.getRegionAtCharacterOffset(offset);
      regionTextEndOffset = startStructuredDocumentRegion.getTextEndOffset(region);
    }
    else if ((endStructuredDocumentRegion != null) && endStructuredDocumentRegion.containsOffset(offset)) {
      region = endStructuredDocumentRegion.getRegionAtCharacterOffset(offset);
      regionTextEndOffset = endStructuredDocumentRegion.getTextEndOffset(region);
    }

    if ((region != null) && ((region.getType() == DOMRegionContext.XML_TAG_NAME) || (region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)) && (offset <= regionTextEndOffset)) {
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion.containsOffset()

      return getNamedStyleAtOffset(0);
    // find the ITextRegion at this offset
    if (fNodes == null)
      return null;
    IStructuredDocumentRegion aNode = fNodes;
    while (aNode != null && !aNode.containsOffset(offset))
      aNode = aNode.getNext();
    if (aNode != null) {
      // find the ITextRegion's Context at this offset
      ITextRegion interest = aNode.getRegionAtCharacterOffset(offset);
      if (interest == null)
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion.containsOffset()

    if (offset >= fDocument.getLength())
      return getNamedStyleAtOffset(fDocument.getLength() - 1);
    else if (offset < 0)
      return getNamedStyleAtOffset(0);
    IStructuredDocumentRegion documentRegion = fDocument.getFirstStructuredDocumentRegion();
    while (documentRegion != null && !documentRegion.containsOffset(offset)) {
      documentRegion = documentRegion.getNext();
    }
    if (documentRegion != null) {
      // find the ITextRegion's Context at this offset
      ITextRegion interest = documentRegion.getRegionAtCharacterOffset(offset);
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion.containsOffset()

    if (offset >= fDocument.getLength())
      return getNamedStyleAtOffset(fDocument.getLength() - 1);
    else if (offset < 0)
      return getNamedStyleAtOffset(0);
    IStructuredDocumentRegion documentRegion = fDocument.getFirstStructuredDocumentRegion();
    while (documentRegion != null && !documentRegion.containsOffset(offset)) {
      documentRegion = documentRegion.getNext();
    }
    if (documentRegion != null) {
      // find the ITextRegion's Context at this offset
      ITextRegion interest = documentRegion.getRegionAtCharacterOffset(offset);
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion.containsOffset()

        int targetOffset = -1;
        if (o instanceof IDOMNode) {
          IDOMNode node = (IDOMNode) o;
          IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
          if (startStructuredDocumentRegion != null && startStructuredDocumentRegion.containsOffset(offset)) {
            matchRegion = ((IDOMNode) o).getEndStructuredDocumentRegion();
            if (matchRegion != null)
              targetOffset = matchRegion.getStartOffset() + 2;
          }
          else {
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion.containsOffset()

            if (matchRegion != null)
              targetOffset = matchRegion.getStartOffset() + 2;
          }
          else {
            IStructuredDocumentRegion endStructuredDocumentRegion = node.getEndStructuredDocumentRegion();
            if (endStructuredDocumentRegion != null && endStructuredDocumentRegion.containsOffset(offset)) {
              matchRegion = ((IDOMNode) o).getStartStructuredDocumentRegion();
              if (matchRegion != null)
                targetOffset = matchRegion.getStartOffset() + 1;
            }
          }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion.containsOffset()

        Position pEnd = null;
        String tag = ""; //$NON-NLS-1$
        if (o instanceof IDOMNode) {
          IDOMNode node = (IDOMNode) o;
          IStructuredDocumentRegion startStructuredDocumentRegion = node.getStartStructuredDocumentRegion();
          if (startStructuredDocumentRegion != null && startStructuredDocumentRegion.containsOffset(offset)) {
            if (startStructuredDocumentRegion.getNumberOfRegions() > 1) {
              ITextRegion nameRegion = startStructuredDocumentRegion.getRegions().get(1);
              pStart = new Position(startStructuredDocumentRegion.getStartOffset(nameRegion), nameRegion.getTextLength());
              tag = startStructuredDocumentRegion.getText(nameRegion);
            }
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.