Mercurial > projects > dwt-addons
diff dwtx/jface/text/DefaultTextHover.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 | 51e6e63f930e |
children | f70d9508c95c |
line wrap: on
line diff
--- a/dwtx/jface/text/DefaultTextHover.d Sun Aug 24 01:52:31 2008 +0200 +++ b/dwtx/jface/text/DefaultTextHover.d Sun Aug 24 02:20:40 2008 +0200 @@ -166,7 +166,7 @@ /** * Standard implementation of {@link dwtx.jface.text.ITextHover}. - * + * * @since 3.2 */ public class DefaultTextHover : ITextHover { @@ -176,14 +176,14 @@ /** * Creates a new annotation hover. - * + * * @param sourceViewer this hover's annotation model */ public this(ISourceViewer sourceViewer) { Assert.isNotNull(sourceViewer); fSourceViewer= sourceViewer; } - + /* * @see dwtx.jface.text.ITextHover#getHoverInfo(dwtx.jface.text.ITextViewer, dwtx.jface.text.IRegion) */ @@ -191,7 +191,7 @@ IAnnotationModel model= getAnnotationModel(fSourceViewer); if (model is null) return null; - + Iterator e= model.getAnnotationIterator(); while (e.hasNext()) { Annotation a= cast(Annotation) e.next(); @@ -204,7 +204,7 @@ } } } - + return null; } @@ -214,26 +214,26 @@ public IRegion getHoverRegion(ITextViewer textViewer, int offset) { return findWord(textViewer.getDocument(), offset); } - + /** * Tells whether the annotation should be included in * the computation. - * + * * @param annotation the annotation to test * @return <code>true</code> if the annotation is included in the computation */ protected bool isIncluded(Annotation annotation) { return true; } - + private IAnnotationModel getAnnotationModel(ISourceViewer viewer) { - if (viewer instanceof ISourceViewerExtension2) { + if (cast(ISourceViewerExtension2)viewer ) { ISourceViewerExtension2 extension= cast(ISourceViewerExtension2) viewer; return extension.getVisualAnnotationModel(); } return viewer.getAnnotationModel(); } - + private IRegion findWord(IDocument document, int offset) { int start= -2; int end= -1;