Package at.ssw.coco.lib.model.positions

Examples of at.ssw.coco.lib.model.positions.CocoPosition


      if (seg.getLevel() >= 3) {
        continue;
      }

      if (!EXCLUDED_TYPES.contains(seg.getType())) {
        CocoPosition p = seg.getPosition();
        Position pos = new Position(p.getOffset(), p.getLength());
        //Position pos = seg.getPosition();
        int startLine = fDocument.getLineOfOffset(pos.getOffset());
        int endLine = fDocument.getLineOfOffset(pos.getOffset() + pos.getLength());
        if (startLine < endLine) {
          int start = fDocument.getLineOffset(startLine);
View Full Code Here


      fEditor.resetHighlightRange();
    } else {
      Object element = selection.getFirstElement();
      Assert.isTrue(element instanceof ATGSegment);
      ATGSegment segment = (ATGSegment)element;
      CocoPosition pos = segment.getPosition();
      try {
        fEditor.resetHighlightRange(); // force the cursor being moved
        fEditor.setHighlightRange(pos.getOffset(), pos.getLength(), true);
      } catch (IllegalArgumentException x) {
        fEditor.resetHighlightRange();
      }
    }
  }
View Full Code Here

    Object element = getSelectedElement();
    if (element != null) {
      dispose();
      Assert.isTrue(element instanceof ATGSegment);
      ATGSegment segment = (ATGSegment)element;
      CocoPosition pos = segment.getPosition();
      try {
        fEditor.resetHighlightRange(); // force the cursor being moved
        fEditor.setHighlightRange(pos.getOffset(), pos.getLength(), true);
      } catch (IllegalArgumentException x) {
        fEditor.resetHighlightRange();
      }
    }
  }
View Full Code Here

   */
  public CocoPosition getPosition() {
    fixupRegion();
    int offset = fRegion.getOffset();
    int length = fRegion.getLength();
    return new CocoPosition(offset >= 0 ? offset : 0, length >= 0 ? length : 0);
  }
View Full Code Here

TOP

Related Classes of at.ssw.coco.lib.model.positions.CocoPosition

Copyright © 2018 www.massapicom. 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.