Mercurial > projects > dwt-addons
comparison dwtx/jface/text/source/VerticalRuler.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 |
---|---|
293 gc.setFont(fTextViewer.getTextWidget().getFont()); | 293 gc.setFont(fTextViewer.getTextWidget().getFont()); |
294 try { | 294 try { |
295 gc.setBackground(fCanvas.getBackground()); | 295 gc.setBackground(fCanvas.getBackground()); |
296 gc.fillRectangle(0, 0, size.x, size.y); | 296 gc.fillRectangle(0, 0, size.x, size.y); |
297 | 297 |
298 if (fTextViewer instanceof ITextViewerExtension5) | 298 if ( cast(ITextViewerExtension5)fTextViewer ) |
299 doPaint1(gc); | 299 doPaint1(gc); |
300 else | 300 else |
301 doPaint(gc); | 301 doPaint(gc); |
302 | 302 |
303 } finally { | 303 } finally { |
340 | 340 |
341 if (fModel is null || fTextViewer is null) | 341 if (fModel is null || fTextViewer is null) |
342 return; | 342 return; |
343 | 343 |
344 IAnnotationAccessExtension annotationAccessExtension= null; | 344 IAnnotationAccessExtension annotationAccessExtension= null; |
345 if (fAnnotationAccess instanceof IAnnotationAccessExtension) | 345 if ( cast(IAnnotationAccessExtension)fAnnotationAccess ) |
346 annotationAccessExtension= cast(IAnnotationAccessExtension) fAnnotationAccess; | 346 annotationAccessExtension= cast(IAnnotationAccessExtension) fAnnotationAccess; |
347 | 347 |
348 StyledText styledText= fTextViewer.getTextWidget(); | 348 StyledText styledText= fTextViewer.getTextWidget(); |
349 IDocument doc= fTextViewer.getDocument(); | 349 IDocument doc= fTextViewer.getDocument(); |
350 | 350 |
375 Annotation annotation= cast(Annotation) iter.next(); | 375 Annotation annotation= cast(Annotation) iter.next(); |
376 | 376 |
377 int lay= IAnnotationAccessExtension.DEFAULT_LAYER; | 377 int lay= IAnnotationAccessExtension.DEFAULT_LAYER; |
378 if (annotationAccessExtension !is null) | 378 if (annotationAccessExtension !is null) |
379 lay= annotationAccessExtension.getLayer(annotation); | 379 lay= annotationAccessExtension.getLayer(annotation); |
380 else if (annotation instanceof IAnnotationPresentation) { | 380 else if ( cast(IAnnotationPresentation)annotation ) { |
381 annotationPresentation= cast(IAnnotationPresentation)annotation; | 381 annotationPresentation= cast(IAnnotationPresentation)annotation; |
382 lay= annotationPresentation.getLayer(); | 382 lay= annotationPresentation.getLayer(); |
383 } | 383 } |
384 maxLayer= Math.max(maxLayer, lay+1); // dynamically update layer maximum | 384 maxLayer= Math.max(maxLayer, lay+1); // dynamically update layer maximum |
385 if (lay !is layer) // wrong layer: skip annotation | 385 if (lay !is layer) // wrong layer: skip annotation |
440 | 440 |
441 if (fModel is null || fTextViewer is null) | 441 if (fModel is null || fTextViewer is null) |
442 return; | 442 return; |
443 | 443 |
444 IAnnotationAccessExtension annotationAccessExtension= null; | 444 IAnnotationAccessExtension annotationAccessExtension= null; |
445 if (fAnnotationAccess instanceof IAnnotationAccessExtension) | 445 if ( cast(IAnnotationAccessExtension)fAnnotationAccess ) |
446 annotationAccessExtension= cast(IAnnotationAccessExtension) fAnnotationAccess; | 446 annotationAccessExtension= cast(IAnnotationAccessExtension) fAnnotationAccess; |
447 | 447 |
448 ITextViewerExtension5 extension= cast(ITextViewerExtension5) fTextViewer; | 448 ITextViewerExtension5 extension= cast(ITextViewerExtension5) fTextViewer; |
449 StyledText textWidget= fTextViewer.getTextWidget(); | 449 StyledText textWidget= fTextViewer.getTextWidget(); |
450 | 450 |
462 Annotation annotation= cast(Annotation) iter.next(); | 462 Annotation annotation= cast(Annotation) iter.next(); |
463 | 463 |
464 int lay= IAnnotationAccessExtension.DEFAULT_LAYER; | 464 int lay= IAnnotationAccessExtension.DEFAULT_LAYER; |
465 if (annotationAccessExtension !is null) | 465 if (annotationAccessExtension !is null) |
466 lay= annotationAccessExtension.getLayer(annotation); | 466 lay= annotationAccessExtension.getLayer(annotation); |
467 else if (annotation instanceof IAnnotationPresentation) { | 467 else if ( cast(IAnnotationPresentation)annotation ) { |
468 annotationPresentation= cast(IAnnotationPresentation)annotation; | 468 annotationPresentation= cast(IAnnotationPresentation)annotation; |
469 lay= annotationPresentation.getLayer(); | 469 lay= annotationPresentation.getLayer(); |
470 } | 470 } |
471 maxLayer= Math.max(maxLayer, lay+1); // dynamically update layer maximum | 471 maxLayer= Math.max(maxLayer, lay+1); // dynamically update layer maximum |
472 if (lay !is layer) // wrong layer: skip annotation | 472 if (lay !is layer) // wrong layer: skip annotation |
604 * @return the corresponding line of the viewer's document | 604 * @return the corresponding line of the viewer's document |
605 * @since 2.1 | 605 * @since 2.1 |
606 */ | 606 */ |
607 protected final static int widgetLine2ModelLine(ITextViewer viewer, int widgetLine) { | 607 protected final static int widgetLine2ModelLine(ITextViewer viewer, int widgetLine) { |
608 | 608 |
609 if (viewer instanceof ITextViewerExtension5) { | 609 if ( cast(ITextViewerExtension5)viewer ) { |
610 ITextViewerExtension5 extension= cast(ITextViewerExtension5) viewer; | 610 ITextViewerExtension5 extension= cast(ITextViewerExtension5) viewer; |
611 return extension.widgetLine2ModelLine(widgetLine); | 611 return extension.widgetLine2ModelLine(widgetLine); |
612 } | 612 } |
613 | 613 |
614 try { | 614 try { |