Mercurial > projects > dwt-addons
comparison dwtx/jface/text/TextViewer.d @ 186:0e2944da7cd0
Fix anon class problem
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 26 Oct 2008 13:59:03 +0100 |
parents | c6d7b1ea700b |
children | c3583c6ec027 |
comparison
equal
deleted
inserted
replaced
185:987b95661bb9 | 186:0e2944da7cd0 |
---|---|
2650 Display display= getDisplay(); | 2650 Display display= getDisplay(); |
2651 if (display is null) | 2651 if (display is null) |
2652 return; | 2652 return; |
2653 | 2653 |
2654 fNumberOfPostSelectionChangedEvents[0]++; | 2654 fNumberOfPostSelectionChangedEvents[0]++; |
2655 display.timerExec(getEmptySelectionChangedEventDelay(), dgRunnable( (int id, bool fireEqualSelection_) { | 2655 display.timerExec(getEmptySelectionChangedEventDelay(), dgRunnable( &queuePostSelectionChangedRunner, fNumberOfPostSelectionChangedEvents[0], fireEqualSelection)); |
2656 if (id is fNumberOfPostSelectionChangedEvents[0]) { | 2656 } |
2657 // Check again because this is executed after the delay | 2657 private void queuePostSelectionChangedRunner(int id, bool fireEqualSelection_) { |
2658 if (getDisplay() !is null) { | 2658 if (id is fNumberOfPostSelectionChangedEvents[0]) { |
2659 Point selection= fTextWidget.getSelectionRange(); | 2659 // Check again because this is executed after the delay |
2660 if (selection !is null) { | 2660 if (getDisplay() !is null) { |
2661 IRegion r= widgetRange2ModelRange(new Region(selection.x, selection.y)); | 2661 Point selection= fTextWidget.getSelectionRange(); |
2662 if (fireEqualSelection_ || (r !is null && !(cast(Object)r).opEquals(cast(Object)fLastSentPostSelectionChange)) || r is null) { | 2662 if (selection !is null) { |
2663 fLastSentPostSelectionChange= r; | 2663 IRegion r= widgetRange2ModelRange(new Region(selection.x, selection.y)); |
2664 firePostSelectionChanged(selection.x, selection.y); | 2664 if (fireEqualSelection_ || (r !is null && !(cast(Object)r).opEquals(cast(Object)fLastSentPostSelectionChange)) || r is null) { |
2665 } | 2665 fLastSentPostSelectionChange= r; |
2666 firePostSelectionChanged(selection.x, selection.y); | |
2666 } | 2667 } |
2667 } | 2668 } |
2668 } | 2669 } |
2669 }, fNumberOfPostSelectionChangedEvents[0], fireEqualSelection)); | 2670 } |
2670 } | 2671 } |
2671 | |
2672 /** | 2672 /** |
2673 * Sends out a text selection changed event to all registered post selection changed listeners. | 2673 * Sends out a text selection changed event to all registered post selection changed listeners. |
2674 * | 2674 * |
2675 * @param offset the offset of the newly selected range in the visible document | 2675 * @param offset the offset of the newly selected range in the visible document |
2676 * @param length the length of the newly selected range in the visible document | 2676 * @param length the length of the newly selected range in the visible document |