comparison dwtx/jface/text/source/AnnotationRulerColumn.d @ 162:1a5b8f8129df

...
author Frank Benoit <benoit@tionex.de>
date Mon, 08 Sep 2008 00:51:37 +0200
parents 7926b636c282
children
comparison
equal deleted inserted replaced
161:f8d52b926852 162:1a5b8f8129df
161 161
162 /** 162 /**
163 * Implementation of <code>IRegion</code> that can be reused 163 * Implementation of <code>IRegion</code> that can be reused
164 * by setting the offset and the length. 164 * by setting the offset and the length.
165 */ 165 */
166 private static class ReusableRegion : Position , IRegion {} 166 private static class ReusableRegion : Position , IRegion {
167 public override int getLength(){
168 return super.getLength();
169 }
170 public override int getOffset(){
171 return super.getOffset();
172 }
173 }
167 174
168 /** 175 /**
169 * Pair of an annotation and their associated position. Used inside the paint method 176 * Pair of an annotation and their associated position. Used inside the paint method
170 * for sorting annotations based on the offset of their position. 177 * for sorting annotations based on the offset of their position.
171 * @since 3.0 178 * @since 3.0
421 * @param parent the parent 428 * @param parent the parent
422 * @return the created canvas 429 * @return the created canvas
423 */ 430 */
424 private Canvas createCanvas(Composite parent) { 431 private Canvas createCanvas(Composite parent) {
425 return new class(parent, DWT.NO_BACKGROUND | DWT.NO_FOCUS) Canvas { 432 return new class(parent, DWT.NO_BACKGROUND | DWT.NO_FOCUS) Canvas {
433 this( Composite p, int s ){
434 super(p,s);
435 }
426 /* 436 /*
427 * @see dwt.widgets.Control#addMouseListener(dwt.events.MouseListener) 437 * @see dwt.widgets.Control#addMouseListener(dwt.events.MouseListener)
428 * @since 3.0 438 * @since 3.0
429 */ 439 */
430 public void addMouseListener(MouseListener listener) { 440 public void addMouseListener(MouseListener listener) {
965 * @return <code>true</code> if annotation of the given type should be 975 * @return <code>true</code> if annotation of the given type should be
966 * skipped, <code>false</code> otherwise 976 * skipped, <code>false</code> otherwise
967 * @since 3.0 977 * @since 3.0
968 */ 978 */
969 private bool skip(Annotation annotation) { 979 private bool skip(Annotation annotation) {
970 Object annotationType= annotation.getType(); 980 Object annotationType= stringcast(annotation.getType());
971 Boolean allowed= cast(Boolean) fAllowedAnnotationTypes.get(annotationType); 981 Boolean allowed= cast(Boolean) fAllowedAnnotationTypes.get(annotationType);
972 if (allowed !is null) 982 if (allowed !is null)
973 return !allowed.booleanValue(); 983 return !allowed.booleanValue();
974 984
975 bool skip= skip(annotationType); 985 bool skip= skip(annotationType);