comparison dwtx/jface/text/source/projection/ProjectionRulerColumn.d @ 134:51e6e63f930e

Regex fix for casts
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 01:46:20 +0200
parents 7d818bd32d63
children 65801ad2b265
comparison
equal deleted inserted replaced
133:7d818bd32d63 134:51e6e63f930e
83 */ 83 */
84 protected void mouseClicked(int line) { 84 protected void mouseClicked(int line) {
85 clearCurrentAnnotation(); 85 clearCurrentAnnotation();
86 ProjectionAnnotation annotation= findAnnotation(line, true); 86 ProjectionAnnotation annotation= findAnnotation(line, true);
87 if (annotation !is null) { 87 if (annotation !is null) {
88 ProjectionAnnotationModel model= (ProjectionAnnotationModel) getModel(); 88 ProjectionAnnotationModel model= cast(ProjectionAnnotationModel) getModel();
89 model.toggleExpansionState(annotation); 89 model.toggleExpansionState(annotation);
90 } 90 }
91 } 91 }
92 92
93 /** 93 /**
110 110
111 Iterator e= model.getAnnotationIterator(); 111 Iterator e= model.getAnnotationIterator();
112 while (e.hasNext()) { 112 while (e.hasNext()) {
113 Object next= e.next(); 113 Object next= e.next();
114 if (next instanceof ProjectionAnnotation) { 114 if (next instanceof ProjectionAnnotation) {
115 ProjectionAnnotation annotation= (ProjectionAnnotation) next; 115 ProjectionAnnotation annotation= cast(ProjectionAnnotation) next;
116 Position p= model.getPosition(annotation); 116 Position p= model.getPosition(annotation);
117 if (p is null) 117 if (p is null)
118 continue; 118 continue;
119 119
120 int distance= getDistance(annotation, p, document, line); 120 int distance= getDistance(annotation, p, document, line);
153 int endLine= document.getLineOfOffset(position.getOffset() + position.getLength()); 153 int endLine= document.getLineOfOffset(position.getOffset() + position.getLength());
154 if (startLine <= line && line < endLine) { 154 if (startLine <= line && line < endLine) {
155 if (annotation.isCollapsed()) { 155 if (annotation.isCollapsed()) {
156 int captionOffset; 156 int captionOffset;
157 if (position instanceof IProjectionPosition) 157 if (position instanceof IProjectionPosition)
158 captionOffset= ((IProjectionPosition) position).computeCaptionOffset(document); 158 captionOffset= (cast(IProjectionPosition) position).computeCaptionOffset(document);
159 else 159 else
160 captionOffset= 0; 160 captionOffset= 0;
161 161
162 int captionLine= document.getLineOfOffset(position.getOffset() + captionOffset); 162 int captionLine= document.getLineOfOffset(position.getOffset() + captionOffset);
163 if (startLine <= captionLine && captionLine < endLine) 163 if (startLine <= captionLine && captionLine < endLine)
225 /* 225 /*
226 * @see dwtx.jface.text.source.AnnotationRulerColumn#setModel(dwtx.jface.text.source.IAnnotationModel) 226 * @see dwtx.jface.text.source.AnnotationRulerColumn#setModel(dwtx.jface.text.source.IAnnotationModel)
227 */ 227 */
228 public void setModel(IAnnotationModel model) { 228 public void setModel(IAnnotationModel model) {
229 if (model instanceof IAnnotationModelExtension) { 229 if (model instanceof IAnnotationModelExtension) {
230 IAnnotationModelExtension extension= (IAnnotationModelExtension) model; 230 IAnnotationModelExtension extension= cast(IAnnotationModelExtension) model;
231 model= extension.getAnnotationModel(ProjectionSupport.PROJECTION); 231 model= extension.getAnnotationModel(ProjectionSupport.PROJECTION);
232 } 232 }
233 super.setModel(model); 233 super.setModel(model);
234 } 234 }
235 235