Mercurial > projects > dwt-addons
comparison dwtx/jface/text/source/projection/ProjectionAnnotationHover.d @ 138:b6bad70d540a
Regex instanceof changes
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 02:26:23 +0200 |
parents | 6dcb0baaa031 |
children | f70d9508c95c |
comparison
equal
deleted
inserted
replaced
137:25170b5a8951 | 138:b6bad70d540a |
---|---|
89 */ | 89 */ |
90 private bool isCaptionLine(ProjectionAnnotation annotation, Position position, IDocument document, int line) { | 90 private bool isCaptionLine(ProjectionAnnotation annotation, Position position, IDocument document, int line) { |
91 if (position.getOffset() > -1 && position.getLength() > -1) { | 91 if (position.getOffset() > -1 && position.getLength() > -1) { |
92 try { | 92 try { |
93 int captionOffset; | 93 int captionOffset; |
94 if (position instanceof IProjectionPosition) | 94 if ( cast(IProjectionPosition)position ) |
95 captionOffset= (cast(IProjectionPosition) position).computeCaptionOffset(document); | 95 captionOffset= (cast(IProjectionPosition) position).computeCaptionOffset(document); |
96 else | 96 else |
97 captionOffset= 0; | 97 captionOffset= 0; |
98 int startLine= document.getLineOfOffset(position.getOffset() + captionOffset); | 98 int startLine= document.getLineOfOffset(position.getOffset() + captionOffset); |
99 return line is startLine; | 99 return line is startLine; |
104 } | 104 } |
105 | 105 |
106 private String getProjectionTextAtLine(ISourceViewer viewer, int line, int numberOfLines) { | 106 private String getProjectionTextAtLine(ISourceViewer viewer, int line, int numberOfLines) { |
107 | 107 |
108 IAnnotationModel model= null; | 108 IAnnotationModel model= null; |
109 if (viewer instanceof ISourceViewerExtension2) { | 109 if ( cast(ISourceViewerExtension2)viewer ) { |
110 ISourceViewerExtension2 viewerExtension= cast(ISourceViewerExtension2) viewer; | 110 ISourceViewerExtension2 viewerExtension= cast(ISourceViewerExtension2) viewer; |
111 IAnnotationModel visual= viewerExtension.getVisualAnnotationModel(); | 111 IAnnotationModel visual= viewerExtension.getVisualAnnotationModel(); |
112 if (visual instanceof IAnnotationModelExtension) { | 112 if ( cast(IAnnotationModelExtension)visual ) { |
113 IAnnotationModelExtension modelExtension= cast(IAnnotationModelExtension) visual; | 113 IAnnotationModelExtension modelExtension= cast(IAnnotationModelExtension) visual; |
114 model= modelExtension.getAnnotationModel(ProjectionSupport.PROJECTION); | 114 model= modelExtension.getAnnotationModel(ProjectionSupport.PROJECTION); |
115 } | 115 } |
116 } | 116 } |
117 | 117 |