Package org.eclipse.jface.text.source

Examples of org.eclipse.jface.text.source.LineRange


    int leftStartLine= consistentBefore.leftStart() + shiftBefore;
    int leftLine= consistentAfter.leftEnd();
    if (leftToRight)
      leftLine += lineDelta;
    int leftEndLine= leftLine - shiftAfter;
    ILineRange leftRange= new LineRange(leftStartLine, leftEndLine - leftStartLine);
    IRangeComparator reference= new DocEquivalenceComparator(leftEquivalent, leftRange);

    // right (actual) document
    int rightStartLine= consistentBefore.rightStart() + shiftBefore;
    int rightLine= consistentAfter.rightEnd();
    if (!leftToRight)
      rightLine += lineDelta;
    int rightEndLine= rightLine - shiftAfter;
    ILineRange rightRange= new LineRange(rightStartLine, rightEndLine - rightStartLine);
    IRangeComparator change= new DocEquivalenceComparator(rightEquivalent, rightRange);

    // put an upper bound to the delay we can afford
    if (leftLine - shiftAfter - leftStartLine > 50 || rightLine - shiftAfter - rightStartLine > 50) {
      initialize();
View Full Code Here


                // modify the document
                document.replace(offset, length, insertion);

                if (getMoveUp()) {
                    selectionAfter = new LineRange(selectionBefore.getStartLine() - 1,
                            selectionBefore.getNumberOfLines());
                } else {
                    selectionAfter = new LineRange(selectionBefore.getStartLine() + 1,
                            selectionBefore.getNumberOfLines());
                }
            } finally {
                if (target != null) {
                    target.endCompoundChange();
View Full Code Here

        final int offset = selection.getOffset();
        int startLine = document.getLineOfOffset(offset);
        int endOffset = offset + selection.getLength();
        int endLine = document.getLineOfOffset(endOffset);
        final int nLines = endLine - startLine + 1;
        return new LineRange(startLine, nLines);
    }
View Full Code Here

   * Register revision
   *
   * @return this revision
   */
  public BlameRevision register() {
    addRange(new LineRange(start, lines));
    return this;
  }
View Full Code Here

  /*
   * @see org.eclipse.jface.text.source.IAnnotationHoverExtension#getHoverLineRange(org.eclipse.jface.text.source.ISourceViewer, int)
   */
  public ILineRange getHoverLineRange(ISourceViewer viewer, int lineNumber) {
    return new LineRange(lineNumber, 1);
  }
View Full Code Here

        // ignore and return null
      }
    }
    if (widgetStartLine == -1 || widgetEndLine == -1)
      return null;
    return new LineRange(widgetStartLine, widgetEndLine - widgetStartLine + 1);
  }
View Full Code Here

    }

    if (nextWidgetRange == null)
      return;

    int widgetCurrentFocusLine= modelLinesToWidgetLines(new LineRange(documentHoverLine, 1)).getStartLine();
    int widgetNextFocusLine= nextWidgetRange.getStartLine();
    int newTopPixel= fWidget.getTopPixel() + JFaceTextUtil.computeLineHeight(fWidget, widgetCurrentFocusLine, widgetNextFocusLine, widgetNextFocusLine - widgetCurrentFocusLine);
    fWidget.setTopPixel(newTopPixel);
    if (newTopPixel < 0) {
      Point cursorLocation= fWidget.getDisplay().getCursorLocation();
View Full Code Here

     * @see org.eclipse.jface.text.source.IAnnotationHoverExtension#getHoverLineRange(org.eclipse.jface.text.source.ISourceViewer,
     *      int)
     */
    public ILineRange getHoverLineRange(ISourceViewer viewer, int lineNumber) {
      RevisionRange range= getRange(lineNumber);
      return range == null ? null : new LineRange(lineNumber, 1);
    }
View Full Code Here

   *
   * @return the line coverage of the adjusted ranges
   */
  public ILineRange getAdjustedCoverage() {
    if (fAdjusted.isEmpty())
      return new LineRange(fLines.getStartLine(), 0);

    Range first= (Range) fAdjusted.get(0);
    Range last= (Range) fAdjusted.get(fAdjusted.size() - 1);

    return Range.createAbsolute(first.start(), last.end());
View Full Code Here

  public static ILineRange getVisibleModelLines(ITextViewer viewer) {
    int top= getPartialTopIndex(viewer);
    int bottom= getPartialBottomIndex(viewer);
    if (top == -1 || bottom == -1)
      return null;
    return new LineRange(top, bottom - top + 1);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.source.LineRange

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.