Mercurial > projects > dwt-addons
comparison dwtx/jface/text/source/OverviewRuler.d @ 138:b6bad70d540a
Regex instanceof changes
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 02:26:23 +0200 |
parents | 65801ad2b265 |
children | 02cd5f1224d3 |
comparison
equal
deleted
inserted
replaced
137:25170b5a8951 | 138:b6bad70d540a |
---|---|
249 Annotation next= cast(Annotation) fIterator.next(); | 249 Annotation next= cast(Annotation) fIterator.next(); |
250 | 250 |
251 if (next.isMarkedDeleted()) | 251 if (next.isMarkedDeleted()) |
252 continue; | 252 continue; |
253 | 253 |
254 if (ignr && (next instanceof AnnotationBag)) | 254 if (ignr && ( cast(AnnotationBag)next )) |
255 continue; | 255 continue; |
256 | 256 |
257 fNext= next; | 257 fNext= next; |
258 Object annotationType= next.getType(); | 258 Object annotationType= next.getType(); |
259 if (fType is null || fType.equals(annotationType) || !fConfiguredAnnotationTypes.contains(annotationType) && isSubtype(annotationType)) { | 259 if (fType is null || fType.equals(annotationType) || !fConfiguredAnnotationTypes.contains(annotationType) && isSubtype(annotationType)) { |
264 } | 264 } |
265 fNext= null; | 265 fNext= null; |
266 } | 266 } |
267 | 267 |
268 private bool isSubtype(Object annotationType) { | 268 private bool isSubtype(Object annotationType) { |
269 if (fAnnotationAccess instanceof IAnnotationAccessExtension) { | 269 if ( cast(IAnnotationAccessExtension)fAnnotationAccess ) { |
270 IAnnotationAccessExtension extension= cast(IAnnotationAccessExtension) fAnnotationAccess; | 270 IAnnotationAccessExtension extension= cast(IAnnotationAccessExtension) fAnnotationAccess; |
271 return extension.isSubtype(annotationType, fType); | 271 return extension.isSubtype(annotationType, fType); |
272 } | 272 } |
273 return fType.equals(annotationType); | 273 return fType.equals(annotationType); |
274 } | 274 } |
535 | 535 |
536 fHitDetectionCursor= new Cursor(parent.getDisplay(), DWT.CURSOR_HAND); | 536 fHitDetectionCursor= new Cursor(parent.getDisplay(), DWT.CURSOR_HAND); |
537 | 537 |
538 fHeader= new Canvas(parent, DWT.NONE); | 538 fHeader= new Canvas(parent, DWT.NONE); |
539 | 539 |
540 if (fAnnotationAccess instanceof IAnnotationAccessExtension) { | 540 if ( cast(IAnnotationAccessExtension)fAnnotationAccess ) { |
541 fHeader.addMouseTrackListener(new class() MouseTrackAdapter { | 541 fHeader.addMouseTrackListener(new class() MouseTrackAdapter { |
542 /* | 542 /* |
543 * @see dwt.events.MouseTrackAdapter#mouseHover(dwt.events.MouseEvent) | 543 * @see dwt.events.MouseTrackAdapter#mouseHover(dwt.events.MouseEvent) |
544 * @since 3.3 | 544 * @since 3.3 |
545 */ | 545 */ |
642 gc.setBackground(fCanvas.getBackground()); | 642 gc.setBackground(fCanvas.getBackground()); |
643 gc.fillRectangle(0, 0, size.x, size.y); | 643 gc.fillRectangle(0, 0, size.x, size.y); |
644 | 644 |
645 cacheAnnotations(); | 645 cacheAnnotations(); |
646 | 646 |
647 if (fTextViewer instanceof ITextViewerExtension5) | 647 if ( cast(ITextViewerExtension5)fTextViewer ) |
648 doPaint1(gc); | 648 doPaint1(gc); |
649 else | 649 else |
650 doPaint(gc); | 650 doPaint(gc); |
651 | 651 |
652 } finally { | 652 } finally { |
906 rulerLength= Math.max(rulerLength, 1); | 906 rulerLength= Math.max(rulerLength, 1); |
907 | 907 |
908 lines[0]= (pixel0 * maxLines) / rulerLength; | 908 lines[0]= (pixel0 * maxLines) / rulerLength; |
909 lines[1]= (pixel1 * maxLines) / rulerLength; | 909 lines[1]= (pixel1 * maxLines) / rulerLength; |
910 | 910 |
911 if (fTextViewer instanceof ITextViewerExtension5) { | 911 if ( cast(ITextViewerExtension5)fTextViewer ) { |
912 ITextViewerExtension5 extension= cast(ITextViewerExtension5) fTextViewer; | 912 ITextViewerExtension5 extension= cast(ITextViewerExtension5) fTextViewer; |
913 lines[0]= extension.widgetLine2ModelLine(lines[0]); | 913 lines[0]= extension.widgetLine2ModelLine(lines[0]); |
914 lines[1]= extension.widgetLine2ModelLine(lines[1]); | 914 lines[1]= extension.widgetLine2ModelLine(lines[1]); |
915 } else { | 915 } else { |
916 try { | 916 try { |
1145 * @return <code>true</code> if annotation is covered, <code>false</code> | 1145 * @return <code>true</code> if annotation is covered, <code>false</code> |
1146 * otherwise | 1146 * otherwise |
1147 * @since 3.0 | 1147 * @since 3.0 |
1148 */ | 1148 */ |
1149 private bool isCovered(Object annotationType, Set configured) { | 1149 private bool isCovered(Object annotationType, Set configured) { |
1150 if (fAnnotationAccess instanceof IAnnotationAccessExtension) { | 1150 if ( cast(IAnnotationAccessExtension)fAnnotationAccess ) { |
1151 IAnnotationAccessExtension extension= cast(IAnnotationAccessExtension) fAnnotationAccess; | 1151 IAnnotationAccessExtension extension= cast(IAnnotationAccessExtension) fAnnotationAccess; |
1152 Iterator e= configured.iterator(); | 1152 Iterator e= configured.iterator(); |
1153 while (e.hasNext()) { | 1153 while (e.hasNext()) { |
1154 if (extension.isSubtype(annotationType,e.next())) | 1154 if (extension.isSubtype(annotationType,e.next())) |
1155 return true; | 1155 return true; |
1233 private Color findColor(Object annotationType) { | 1233 private Color findColor(Object annotationType) { |
1234 Color color= cast(Color) fAnnotationTypes2Colors.get(annotationType); | 1234 Color color= cast(Color) fAnnotationTypes2Colors.get(annotationType); |
1235 if (color !is null) | 1235 if (color !is null) |
1236 return color; | 1236 return color; |
1237 | 1237 |
1238 if (fAnnotationAccess instanceof IAnnotationAccessExtension) { | 1238 if ( cast(IAnnotationAccessExtension)fAnnotationAccess ) { |
1239 IAnnotationAccessExtension extension= cast(IAnnotationAccessExtension) fAnnotationAccess; | 1239 IAnnotationAccessExtension extension= cast(IAnnotationAccessExtension) fAnnotationAccess; |
1240 Object[] superTypes= extension.getSupertypes(annotationType); | 1240 Object[] superTypes= extension.getSupertypes(annotationType); |
1241 if (superTypes !is null) { | 1241 if (superTypes !is null) { |
1242 for (int i= 0; i < superTypes.length; i++) { | 1242 for (int i= 0; i < superTypes.length; i++) { |
1243 color= cast(Color) fAnnotationTypes2Colors.get(superTypes[i]); | 1243 color= cast(Color) fAnnotationTypes2Colors.get(superTypes[i]); |