Mercurial > projects > dwt-addons
diff dwtx/jface/text/source/projection/ProjectionSupport.d @ 138:b6bad70d540a
Regex instanceof changes
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 02:26:23 +0200 |
parents | 51e6e63f930e |
children | 02cd5f1224d3 |
line wrap: on
line diff
--- a/dwtx/jface/text/source/projection/ProjectionSupport.d Sun Aug 24 02:22:48 2008 +0200 +++ b/dwtx/jface/text/source/projection/ProjectionSupport.d Sun Aug 24 02:26:23 2008 +0200 @@ -79,7 +79,7 @@ * @see dwtx.jface.text.source.AnnotationPainter#findAnnotationModel(dwtx.jface.text.source.ISourceViewer) */ protected IAnnotationModel findAnnotationModel(ISourceViewer sourceViewer) { - if (sourceViewer instanceof ProjectionViewer) { + if ( cast(ProjectionViewer)sourceViewer ) { ProjectionViewer projectionViewer= cast(ProjectionViewer) sourceViewer; return projectionViewer.getProjectionAnnotationModel(); } @@ -90,7 +90,7 @@ * @see dwtx.jface.text.source.AnnotationPainter#skip(dwtx.jface.text.source.Annotation) */ protected bool skip(Annotation annotation) { - if (annotation instanceof ProjectionAnnotation) + if ( cast(ProjectionAnnotation)annotation ) return !(cast(ProjectionAnnotation) annotation).isCollapsed(); return super.skip(annotation); @@ -102,7 +102,7 @@ * @see dwtx.jface.text.source.AnnotationPainter.IDrawingStrategy#draw(dwt.graphics.GC, dwt.custom.StyledText, int, int, dwt.graphics.Color) */ public void draw(Annotation annotation, GC gc, StyledText textWidget, int offset, int length, Color color) { - if (annotation instanceof ProjectionAnnotation) { + if ( cast(ProjectionAnnotation)annotation ) { ProjectionAnnotation projectionAnnotation= cast(ProjectionAnnotation) annotation; if (projectionAnnotation.isCollapsed()) { @@ -373,7 +373,7 @@ */ public Object getAdapter(ISourceViewer viewer, Class required) { if (ProjectionAnnotationModel.class.equals(required)) { - if (viewer instanceof ProjectionViewer) { + if ( cast(ProjectionViewer)viewer ) { ProjectionViewer projectionViewer= cast(ProjectionViewer) viewer; return projectionViewer.getProjectionAnnotationModel(); }