Mercurial > projects > dwt-addons
comparison dwtx/jface/text/source/AnnotationRulerColumn.d @ 138:b6bad70d540a
Regex instanceof changes
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 02:26:23 +0200 |
parents | 65801ad2b265 |
children | f70d9508c95c |
comparison
equal
deleted
inserted
replaced
137:25170b5a8951 | 138:b6bad70d540a |
---|---|
285 * @param annotationAccess the annotation access | 285 * @param annotationAccess the annotation access |
286 * @since 3.0 | 286 * @since 3.0 |
287 */ | 287 */ |
288 public this(int width, IAnnotationAccess annotationAccess) { | 288 public this(int width, IAnnotationAccess annotationAccess) { |
289 fWidth= width; | 289 fWidth= width; |
290 if (annotationAccess instanceof IAnnotationAccessExtension) | 290 if ( cast(IAnnotationAccessExtension)annotationAccess ) |
291 fAnnotationAccessExtension= cast(IAnnotationAccessExtension) annotationAccess; | 291 fAnnotationAccessExtension= cast(IAnnotationAccessExtension) annotationAccess; |
292 } | 292 } |
293 | 293 |
294 /** | 294 /** |
295 * Constructs this column with the given arguments. | 295 * Constructs this column with the given arguments. |
476 * @return <code>true</code> if the given line contains an annotation | 476 * @return <code>true</code> if the given line contains an annotation |
477 */ | 477 */ |
478 protected bool hasAnnotation(int lineNumber) { | 478 protected bool hasAnnotation(int lineNumber) { |
479 | 479 |
480 IAnnotationModel model= fModel; | 480 IAnnotationModel model= fModel; |
481 if (fModel instanceof IAnnotationModelExtension) | 481 if ( cast(IAnnotationModelExtension)fModel ) |
482 model= (cast(IAnnotationModelExtension)fModel).getAnnotationModel(SourceViewer.MODEL_ANNOTATION_MODEL); | 482 model= (cast(IAnnotationModelExtension)fModel).getAnnotationModel(SourceViewer.MODEL_ANNOTATION_MODEL); |
483 | 483 |
484 if (model is null) | 484 if (model is null) |
485 return false; | 485 return false; |
486 | 486 |
497 | 497 |
498 int lineStart= line.getOffset(); | 498 int lineStart= line.getOffset(); |
499 int lineLength= line.getLength(); | 499 int lineLength= line.getLength(); |
500 | 500 |
501 Iterator e; | 501 Iterator e; |
502 if (fModel instanceof IAnnotationModelExtension2) | 502 if ( cast(IAnnotationModelExtension2)fModel ) |
503 e= (cast(IAnnotationModelExtension2)fModel).getAnnotationIterator(lineStart, lineLength + 1, true, true); | 503 e= (cast(IAnnotationModelExtension2)fModel).getAnnotationIterator(lineStart, lineLength + 1, true, true); |
504 else | 504 else |
505 e= model.getAnnotationIterator(); | 505 e= model.getAnnotationIterator(); |
506 | 506 |
507 while (e.hasNext()) { | 507 while (e.hasNext()) { |
578 gc.setFont(fCachedTextWidget.getFont()); | 578 gc.setFont(fCachedTextWidget.getFont()); |
579 try { | 579 try { |
580 gc.setBackground(fCanvas.getBackground()); | 580 gc.setBackground(fCanvas.getBackground()); |
581 gc.fillRectangle(0, 0, size.x, size.y); | 581 gc.fillRectangle(0, 0, size.x, size.y); |
582 | 582 |
583 if (fCachedTextViewer instanceof ITextViewerExtension5) | 583 if ( cast(ITextViewerExtension5)fCachedTextViewer ) |
584 doPaint1(gc); | 584 doPaint1(gc); |
585 else | 585 else |
586 doPaint(gc); | 586 doPaint(gc); |
587 } finally { | 587 } finally { |
588 gc.dispose(); | 588 gc.dispose(); |
674 Rectangle r= new Rectangle(0, 0, 0, 0); | 674 Rectangle r= new Rectangle(0, 0, 0, 0); |
675 int maxLayer= 1; // loop at least once through layers. | 675 int maxLayer= 1; // loop at least once through layers. |
676 | 676 |
677 for (int layer= 0; layer < maxLayer; layer++) { | 677 for (int layer= 0; layer < maxLayer; layer++) { |
678 Iterator iter; | 678 Iterator iter; |
679 if (fModel instanceof IAnnotationModelExtension2) | 679 if ( cast(IAnnotationModelExtension2)fModel ) |
680 iter= (cast(IAnnotationModelExtension2)fModel).getAnnotationIterator(topLeft, viewPort + 1, true, true); | 680 iter= (cast(IAnnotationModelExtension2)fModel).getAnnotationIterator(topLeft, viewPort + 1, true, true); |
681 else | 681 else |
682 iter= fModel.getAnnotationIterator(); | 682 iter= fModel.getAnnotationIterator(); |
683 | 683 |
684 while (iter.hasNext()) { | 684 while (iter.hasNext()) { |
764 ReusableRegion range= new ReusableRegion(); | 764 ReusableRegion range= new ReusableRegion(); |
765 | 765 |
766 int minLayer= Integer.MAX_VALUE, maxLayer= Integer.MIN_VALUE; | 766 int minLayer= Integer.MAX_VALUE, maxLayer= Integer.MIN_VALUE; |
767 fCachedAnnotations.clear(); | 767 fCachedAnnotations.clear(); |
768 Iterator iter; | 768 Iterator iter; |
769 if (fModel instanceof IAnnotationModelExtension2) | 769 if ( cast(IAnnotationModelExtension2)fModel ) |
770 iter= (cast(IAnnotationModelExtension2)fModel).getAnnotationIterator(vOffset, vLength + 1, true, true); | 770 iter= (cast(IAnnotationModelExtension2)fModel).getAnnotationIterator(vOffset, vLength + 1, true, true); |
771 else | 771 else |
772 iter= fModel.getAnnotationIterator(); | 772 iter= fModel.getAnnotationIterator(); |
773 | 773 |
774 while (iter.hasNext()) { | 774 while (iter.hasNext()) { |