Mercurial > projects > dwt-addons
comparison dwtx/jface/text/source/AnnotationBarHoverManager.d @ 136:6dcb0baaa031
Regex removal of throws decls, some instanceof
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 02:20:40 +0200 |
parents | 65801ad2b265 |
children | b6bad70d540a |
comparison
equal
deleted
inserted
replaced
135:65801ad2b265 | 136:6dcb0baaa031 |
---|---|
554 * | 554 * |
555 * @param lineRange the line range | 555 * @param lineRange the line range |
556 * @return the corresponding character range | 556 * @return the corresponding character range |
557 * @throws BadLocationException in case the given line range is invalid | 557 * @throws BadLocationException in case the given line range is invalid |
558 */ | 558 */ |
559 private IRegion convertToRegion(ILineRange lineRange) throws BadLocationException { | 559 private IRegion convertToRegion(ILineRange lineRange) { |
560 IDocument document= fSourceViewer.getDocument(); | 560 IDocument document= fSourceViewer.getDocument(); |
561 int startOffset= document.getLineOffset(lineRange.getStartLine()); | 561 int startOffset= document.getLineOffset(lineRange.getStartLine()); |
562 int endLine= lineRange.getStartLine() + Math.max(0, lineRange.getNumberOfLines() - 1); | 562 int endLine= lineRange.getStartLine() + Math.max(0, lineRange.getNumberOfLines() - 1); |
563 IRegion lineInfo= document.getLineInformation(endLine); | 563 IRegion lineInfo= document.getLineInformation(endLine); |
564 int endOffset= lineInfo.getOffset() + lineInfo.getLength(); | 564 int endOffset= lineInfo.getOffset() + lineInfo.getLength(); |
572 * @param regions the set of regions | 572 * @param regions the set of regions |
573 * @param line the line | 573 * @param line the line |
574 * @return the region of the set that contains the line | 574 * @return the region of the set that contains the line |
575 * @throws BadLocationException in case line is invalid | 575 * @throws BadLocationException in case line is invalid |
576 */ | 576 */ |
577 private IRegion findRegionContainingLine(IRegion[] regions, int line) throws BadLocationException { | 577 private IRegion findRegionContainingLine(IRegion[] regions, int line) { |
578 IDocument document= fSourceViewer.getDocument(); | 578 IDocument document= fSourceViewer.getDocument(); |
579 IRegion lineInfo= document.getLineInformation(line); | 579 IRegion lineInfo= document.getLineInformation(line); |
580 for (int i= 0; i < regions.length; i++) { | 580 for (int i= 0; i < regions.length; i++) { |
581 if (TextUtilities.overlaps(regions[i], lineInfo)) | 581 if (TextUtilities.overlaps(regions[i], lineInfo)) |
582 return regions[i]; | 582 return regions[i]; |
589 * | 589 * |
590 * @param region the character region | 590 * @param region the character region |
591 * @return the corresponding line range | 591 * @return the corresponding line range |
592 * @throws BadLocationException in case the given region in invalid | 592 * @throws BadLocationException in case the given region in invalid |
593 */ | 593 */ |
594 private ILineRange convertToLineRange(IRegion region) throws BadLocationException { | 594 private ILineRange convertToLineRange(IRegion region) { |
595 IDocument document= fSourceViewer.getDocument(); | 595 IDocument document= fSourceViewer.getDocument(); |
596 int startLine= document.getLineOfOffset(region.getOffset()); | 596 int startLine= document.getLineOfOffset(region.getOffset()); |
597 int endLine= document.getLineOfOffset(region.getOffset() + region.getLength()); | 597 int endLine= document.getLineOfOffset(region.getOffset() + region.getLength()); |
598 return new LineRange(startLine, endLine - startLine + 1); | 598 return new LineRange(startLine, endLine - startLine + 1); |
599 } | 599 } |
674 * | 674 * |
675 * @param line the absolute line number | 675 * @param line the absolute line number |
676 * @return the line number relative to the viewer's visible region | 676 * @return the line number relative to the viewer's visible region |
677 * @throws BadLocationException if <code>line</code> is not valid in the viewer's document | 677 * @throws BadLocationException if <code>line</code> is not valid in the viewer's document |
678 */ | 678 */ |
679 private int getWidgetLineNumber(int line) throws BadLocationException { | 679 private int getWidgetLineNumber(int line) { |
680 if (fSourceViewer instanceof ITextViewerExtension5) { | 680 if (fSourceViewer instanceof ITextViewerExtension5) { |
681 ITextViewerExtension5 extension= cast(ITextViewerExtension5) fSourceViewer; | 681 ITextViewerExtension5 extension= cast(ITextViewerExtension5) fSourceViewer; |
682 return extension.modelLine2WidgetLine(line); | 682 return extension.modelLine2WidgetLine(line); |
683 } | 683 } |
684 | 684 |