Package org.eclipse.jface.text.revisions

Examples of org.eclipse.jface.text.revisions.RevisionRange


    }
   
    // draw change regions
    List/* <RevisionRange> */ranges= getRanges(visibleLines);
    for (Iterator it= ranges.iterator(); it.hasNext();) {
      RevisionRange region= (RevisionRange) it.next();
      paintRange(region, gc);
    }
  }
View Full Code Here


    if (ranges.isEmpty() || line == -1)
      return null;

    for (Iterator it= ranges.iterator(); it.hasNext();) {
      RevisionRange range= (RevisionRange) it.next();
      if (contains(range, line))
        return range;
    }

    // line may be right after the last region
    RevisionRange lastRegion= (RevisionRange) ranges.get(ranges.size() - 1);
    if (line == end(lastRegion))
      return lastRegion;
    return null;
  }
View Full Code Here

    // return the interesting subset
    int end= end(lines);
    int first= -1, last= -1;
    for (int i= 0; i < ranges.size(); i++) {
      RevisionRange range= (RevisionRange) ranges.get(i);
      int rangeEnd= end(range);
      if (first == -1 && rangeEnd > lines.getStartLine())
        first= i;
      if (first != -1 && rangeEnd > end) {
        last= i;
View Full Code Here

    Map added= null;
    if (revision != null) {
      added= new HashMap();
      for (Iterator it= revision.getRegions().iterator(); it.hasNext();) {
        RevisionRange range= (RevisionRange) it.next();
        try {
          IRegion charRegion= toCharRegion(range);
          Position position= new Position(charRegion.getOffset(), charRegion.getLength());
          Annotation annotation= new RevisionAnnotation(revision.getId());
          added.put(annotation, position);
View Full Code Here

   */
  private void onFocusLineChanged(int previousLine, int nextLine) {
    if (DEBUG)
      System.out.println("line: " + previousLine + " > " + nextLine); //$NON-NLS-1$ //$NON-NLS-2$
    fFocusLine= nextLine;
    RevisionRange region= getRange(nextLine);
    updateFocusRange(region);
  }
View Full Code Here

    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;
        }
View Full Code Here

          line= document.getLineOfOffset(offset);
        } catch (BadLocationException x) {
          return null;
        }
      if (line != -1) {
        RevisionRange range= getRange(line);
        if (range != null)
          return range.getRevision();
      }
      return null;
    }
View Full Code Here

    private RevisionRange fMouseDownRegion;
   
    private void handleMouseUp(Event e) {
      if (e.button == 1) {
        RevisionRange upRegion= fFocusRange;
        RevisionRange downRegion= fMouseDownRegion;
        fMouseDownRegion= null;

        if (upRegion == downRegion) {
          Revision revision= upRegion == null ? null : upRegion.getRevision();
          if (revision == fSelectedRevision)
View Full Code Here

    /*
     * @see org.eclipse.jface.text.source.IAnnotationHoverExtension#getHoverInfo(org.eclipse.jface.text.source.ISourceViewer,
     *      org.eclipse.jface.text.source.ILineRange, int)
     */
    public Object getHoverInfo(ISourceViewer sourceViewer, ILineRange lineRange, int visibleNumberOfLines) {
      RevisionRange range= getRange(lineRange.getStartLine());
      Object info= range == null ? null : range.getRevision().getHoverInfo();
      return info;
    }
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

TOP

Related Classes of org.eclipse.jface.text.revisions.RevisionRange

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.