Examples of ILineRange


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

   *
   * @param range the range to paint
   * @param gc the {@link GC} to paint on
   */
  private void paintRange(RevisionRange range, GC gc) {
    ILineRange widgetRange= modelLinesToWidgetLines(range);
    if (widgetRange == null)
      return;

    Revision revision= range.getRevision();
    boolean drawArmedFocus= range == fMouseHandler.fMouseDownRegion;
    boolean drawSelection= !drawArmedFocus && revision == fSelectedRevision;
    boolean drawFocus= !drawSelection && !drawArmedFocus && revision == fFocusRevision;
    Rectangle box= computeBoxBounds(widgetRange);

    gc.setBackground(lookupColor(revision, false));
    if (drawArmedFocus) {
      Color foreground= gc.getForeground();
      Color focusColor= lookupColor(revision, true);
      gc.setForeground(focusColor);
      gc.fillRectangle(box);
      gc.drawRectangle(box.x, box.y, box.width - 1, box.height - 1); // highlight box
      gc.drawRectangle(box.x + 1, box.y + 1, box.width - 3, box.height - 3); // inner highlight box
      gc.setForeground(foreground);
    } else if (drawFocus || drawSelection) {
      Color foreground= gc.getForeground();
      Color focusColor= lookupColor(revision, true);
      gc.setForeground(focusColor);
      gc.fillRectangle(box);
      gc.drawRectangle(box.x, box.y, box.width - 1, box.height - 1); // highlight box
      gc.setForeground(foreground);
    } else {
      gc.fillRectangle(box);
    }

    if ((fShowAuthor || fShowRevision)) {
      int indentation= 1;
      int baselineBias= getBaselineBias(gc, widgetRange.getStartLine());
      if (fShowAuthor && fShowRevision) {
        gc.drawString(revision.getId(), indentation, box.y + baselineBias, true);
        gc.drawString(revision.getAuthor(), fAuthorInset, box.y + baselineBias, true);
      } else if (fShowAuthor) {
        gc.drawString(revision.getAuthor(), indentation, box.y + baselineBias, true);
View Full Code Here

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

   */
  private void handleMouseWheel(Event event) {
    boolean up= event.count > 0;
    int documentHoverLine= fFocusLine;

    ILineRange nextWidgetRange= null;
    ILineRange last= null;
    List ranges= fFocusRevision.getRegions();
    if (up) {
      for (Iterator it= ranges.iterator(); it.hasNext();) {
        RevisionRange range= (RevisionRange) it.next();
        ILineRange widgetRange= modelLinesToWidgetLines(range);
        if (contains(range, documentHoverLine)) {
          nextWidgetRange= last;
          break;
        }
        if (widgetRange != null)
          last= widgetRange;
      }
    } else {
      for (ListIterator it= ranges.listIterator(ranges.size()); it.hasPrevious();) {
        RevisionRange range= (RevisionRange) it.previous();
        ILineRange widgetRange= modelLinesToWidgetLines(range);
        if (contains(range, documentHoverLine)) {
          nextWidgetRange= last;
          break;
        }
        if (widgetRange != null)
View Full Code Here

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

    try {
      // compute the hover information
      Object hoverInfo;
      if (annotationHover instanceof IAnnotationHoverExtension) {
        IAnnotationHoverExtension extension= (IAnnotationHoverExtension) annotationHover;
        ILineRange hoverLineRange= extension.getHoverLineRange(fSourceViewer, line);
        if (hoverLineRange == null)
          return false;
        final int maxVisibleLines= Integer.MAX_VALUE; // allow any number of lines being displayed, as we support scrolling
        hoverInfo= extension.getHoverInfo(fSourceViewer, hoverLineRange, maxVisibleLines);
      } else {
View Full Code Here

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

    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

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

            String delim;
            String insertion;
            int offset;
            int length;
            ILineRange selectionBefore = getLineRange(document, movingArea);
            IRewriteTarget target = null;
            if (pyEdit != null) {
                target = (IRewriteTarget) pyEdit.getAdapter(IRewriteTarget.class);
                if (target != null) {
                    target.beginCompoundChange();
                    if (!getMoveUp()) {
                        //When going up we'll just do a single document change, so, there's
                        //no need to set the redraw.
                        target.setRedraw(false);
                    }
                }
            }
            ILineRange selectionAfter;
            boolean isStringPartition;
            try {
                if (getMoveUp()) {
                    //check partition in the start of the skipped line
                    isStringPartition = ParsingUtils.isStringPartition(document, skippedLine.getOffset());
View Full Code Here

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

    if (fRanges == null) {
      List ranges= new ArrayList(fChangeRegions.size());
      for (Iterator it= fChangeRegions.iterator(); it.hasNext();) {
        ChangeRegion region= (ChangeRegion) it.next();
        for (Iterator inner= region.getAdjustedRanges().iterator(); inner.hasNext();) {
          ILineRange range= (ILineRange) inner.next();
          ranges.add(new RevisionRange(this, range));
        }
      }
      fRanges= Collections.unmodifiableList(ranges);
    }
View Full Code Here

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

   *
   * @param range the range to paint
   * @param gc the {@link GC} to paint on
   */
  private void paintRange(RevisionRange range, GC gc) {
    ILineRange widgetRange= modelLinesToWidgetLines(range);
    if (widgetRange == null)
      return;

    Revision revision= range.getRevision();
    boolean drawArmedFocus= range == fMouseHandler.fMouseDownRegion;
    boolean drawSelection= !drawArmedFocus && revision == fSelectedRevision;
    boolean drawFocus= !drawSelection && !drawArmedFocus && revision == fFocusRevision;
    Rectangle box= computeBoxBounds(widgetRange);

    gc.setBackground(lookupColor(revision, false));
    if (drawArmedFocus) {
      Color foreground= gc.getForeground();
      Color focusColor= lookupColor(revision, true);
      gc.setForeground(focusColor);
      gc.fillRectangle(box);
      gc.drawRectangle(box.x, box.y, box.width - 1, box.height - 1); // highlight box
      gc.drawRectangle(box.x + 1, box.y + 1, box.width - 3, box.height - 3); // inner highlight box
      gc.setForeground(foreground);
    } else if (drawFocus || drawSelection) {
      Color foreground= gc.getForeground();
      Color focusColor= lookupColor(revision, true);
      gc.setForeground(focusColor);
      gc.fillRectangle(box);
      gc.drawRectangle(box.x, box.y, box.width - 1, box.height - 1); // highlight box
      gc.setForeground(foreground);
    } else {
      gc.fillRectangle(box);
    }

    if ((fShowAuthor || fShowRevision)) {
      int indentation= 1;
      int baselineBias= getBaselineBias(gc, widgetRange.getStartLine());
      if (fShowAuthor && fShowRevision) {
        gc.drawString(revision.getId(), indentation, box.y + baselineBias, true);
        gc.drawString(revision.getAuthor(), fAuthorInset, box.y + baselineBias, true);
      } else if (fShowAuthor) {
        gc.drawString(revision.getAuthor(), indentation, box.y + baselineBias, true);
View Full Code Here

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

   */
  private void handleMouseWheel(Event event) {
    boolean up= event.count > 0;
    int documentHoverLine= fFocusLine;

    ILineRange nextWidgetRange= null;
    ILineRange last= null;
    List ranges= fFocusRevision.getRegions();
    if (up) {
      for (Iterator it= ranges.iterator(); it.hasNext();) {
        RevisionRange range= (RevisionRange) it.next();
        ILineRange widgetRange= modelLinesToWidgetLines(range);
        if (contains(range, documentHoverLine)) {
          nextWidgetRange= last;
          break;
        }
        if (widgetRange != null)
          last= widgetRange;
      }
    } else {
      for (ListIterator it= ranges.listIterator(ranges.size()); it.hasPrevious();) {
        RevisionRange range= (RevisionRange) it.previous();
        ILineRange widgetRange= modelLinesToWidgetLines(range);
        if (contains(range, documentHoverLine)) {
          nextWidgetRange= last;
          break;
        }
        if (widgetRange != null)
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.