Mercurial > projects > dwt-addons
annotate dwtx/jface/text/hyperlink/HyperlinkManager.d @ 140:26688fec6d23
Following dsss compile errors
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 03:23:46 +0200 |
parents | b6bad70d540a |
children | 75302ef3f92f |
rev | line source |
---|---|
129 | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2008 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Steffen Pingel <steffen.pingel@tasktop.com> (Tasktop Technologies Inc.) - [navigation] hyperlink decoration is not erased when mouse is moved out of Text widget - https://bugs.eclipse.org/bugs/show_bug.cgi?id=100278 | |
11 * Port to the D programming language: | |
12 * Frank Benoit <benoit@tionex.de> | |
13 *******************************************************************************/ | |
14 module dwtx.jface.text.hyperlink.HyperlinkManager; | |
15 | |
131 | 16 import dwtx.jface.text.hyperlink.IHyperlinkPresenterExtension; // packageimport |
17 import dwtx.jface.text.hyperlink.MultipleHyperlinkPresenter; // packageimport | |
18 import dwtx.jface.text.hyperlink.URLHyperlink; // packageimport | |
19 import dwtx.jface.text.hyperlink.IHyperlinkDetectorExtension2; // packageimport | |
20 import dwtx.jface.text.hyperlink.IHyperlinkDetector; // packageimport | |
21 import dwtx.jface.text.hyperlink.IHyperlinkPresenter; // packageimport | |
22 import dwtx.jface.text.hyperlink.URLHyperlinkDetector; // packageimport | |
23 import dwtx.jface.text.hyperlink.DefaultHyperlinkPresenter; // packageimport | |
24 import dwtx.jface.text.hyperlink.AbstractHyperlinkDetector; // packageimport | |
25 import dwtx.jface.text.hyperlink.IHyperlinkDetectorExtension; // packageimport | |
26 import dwtx.jface.text.hyperlink.HyperlinkMessages; // packageimport | |
27 import dwtx.jface.text.hyperlink.IHyperlink; // packageimport | |
28 | |
29 | |
129 | 30 import dwt.dwthelper.utils; |
31 | |
32 import java.util.ArrayList; | |
33 import java.util.Arrays; | |
34 import java.util.Iterator; | |
35 import java.util.List; | |
36 | |
37 import dwt.DWT; | |
38 import dwt.custom.StyledText; | |
39 import dwt.events.FocusEvent; | |
40 import dwt.events.FocusListener; | |
41 import dwt.events.KeyEvent; | |
42 import dwt.events.KeyListener; | |
43 import dwt.events.MouseEvent; | |
44 import dwt.events.MouseListener; | |
45 import dwt.events.MouseMoveListener; | |
46 import dwt.events.MouseTrackListener; | |
47 import dwt.graphics.Point; | |
48 import dwt.widgets.Display; | |
49 import dwt.widgets.Event; | |
50 import dwt.widgets.Listener; | |
51 import dwtx.core.runtime.Assert; | |
52 import dwtx.jface.text.IRegion; | |
53 import dwtx.jface.text.ITextListener; | |
54 import dwtx.jface.text.ITextViewer; | |
55 import dwtx.jface.text.ITextViewerExtension5; | |
56 import dwtx.jface.text.Region; | |
57 import dwtx.jface.text.TextEvent; | |
58 | |
59 | |
60 /** | |
61 * Default implementation of a hyperlink manager. | |
62 * | |
63 * @since 3.1 | |
64 */ | |
65 public class HyperlinkManager : ITextListener, Listener, KeyListener, MouseListener, MouseMoveListener, FocusListener, MouseTrackListener { | |
66 | |
67 /** | |
68 * Detection strategy. | |
69 */ | |
70 public static final class DETECTION_STRATEGY { | |
71 | |
72 String fName; | |
73 | |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
74 private this(String name) { |
129 | 75 fName= name; |
76 } | |
77 | |
78 /* | |
79 * @see java.lang.Object#toString() | |
80 */ | |
81 public String toString() { | |
82 return fName; | |
83 } | |
84 } | |
85 | |
86 | |
87 /** | |
88 * The first detected hyperlink is passed to the | |
89 * hyperlink presenter and no further detector | |
90 * is consulted. | |
91 */ | |
92 public static final DETECTION_STRATEGY FIRST= new DETECTION_STRATEGY("first"); //$NON-NLS-1$ | |
93 | |
94 /** | |
95 * All detected hyperlinks from all detectors are collected | |
96 * and passed to the hyperlink presenter. | |
97 * <p> | |
98 * This strategy is only allowed if {@link IHyperlinkPresenter#canShowMultipleHyperlinks()} | |
99 * returns <code>true</code>. | |
100 * </p> | |
101 */ | |
102 public static final DETECTION_STRATEGY ALL= new DETECTION_STRATEGY("all"); //$NON-NLS-1$ | |
103 | |
104 /** | |
105 * All detected hyperlinks from all detectors are collected | |
106 * and all those with the longest region are passed to the | |
107 * hyperlink presenter. | |
108 * <p> | |
109 * This strategy is only allowed if {@link IHyperlinkPresenter#canShowMultipleHyperlinks()} | |
110 * returns <code>true</code>. | |
111 * </p> | |
112 */ | |
113 public static final DETECTION_STRATEGY LONGEST_REGION_ALL= new DETECTION_STRATEGY("all with same longest region"); //$NON-NLS-1$ | |
114 | |
115 /** | |
116 * All detected hyperlinks from all detectors are collected | |
117 * and form all those with the longest region only the first | |
118 * one is passed to the hyperlink presenter. | |
119 */ | |
120 public static final DETECTION_STRATEGY LONGEST_REGION_FIRST= new DETECTION_STRATEGY("first with longest region"); //$NON-NLS-1$ | |
121 | |
122 | |
123 /** The text viewer on which this hyperlink manager works. */ | |
124 private ITextViewer fTextViewer; | |
125 /** The session is active. */ | |
126 private bool fActive; | |
127 /** The key modifier mask. */ | |
128 private int fHyperlinkStateMask; | |
129 /** | |
130 * The active key modifier mask. | |
131 * @since 3.3 | |
132 */ | |
133 private int fActiveHyperlinkStateMask; | |
134 /** The active hyperlinks. */ | |
135 private IHyperlink[] fActiveHyperlinks; | |
136 /** The hyperlink detectors. */ | |
137 private IHyperlinkDetector[] fHyperlinkDetectors; | |
138 /** The hyperlink presenter. */ | |
139 private IHyperlinkPresenter fHyperlinkPresenter; | |
140 /** The detection strategy. */ | |
141 private final DETECTION_STRATEGY fDetectionStrategy; | |
142 | |
143 | |
144 /** | |
145 * Creates a new hyperlink manager. | |
146 * | |
147 * @param detectionStrategy the detection strategy one of {{@link #ALL}, {@link #FIRST}, {@link #LONGEST_REGION_ALL}, {@link #LONGEST_REGION_FIRST}} | |
148 */ | |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
149 public this(DETECTION_STRATEGY detectionStrategy) { |
129 | 150 Assert.isNotNull(detectionStrategy); |
151 fDetectionStrategy= detectionStrategy; | |
152 } | |
153 | |
154 /** | |
155 * Installs this hyperlink manager with the given arguments. | |
156 * | |
157 * @param textViewer the text viewer | |
158 * @param hyperlinkPresenter the hyperlink presenter | |
159 * @param hyperlinkDetectors the array of hyperlink detectors, must not be empty | |
160 * @param eventStateMask the DWT event state mask to activate hyperlink mode | |
161 */ | |
162 public void install(ITextViewer textViewer, IHyperlinkPresenter hyperlinkPresenter, IHyperlinkDetector[] hyperlinkDetectors, int eventStateMask) { | |
163 Assert.isNotNull(textViewer); | |
164 Assert.isNotNull(hyperlinkPresenter); | |
165 fTextViewer= textViewer; | |
166 fHyperlinkPresenter= hyperlinkPresenter; | |
167 Assert.isLegal(fHyperlinkPresenter.canShowMultipleHyperlinks() || fDetectionStrategy is FIRST || fDetectionStrategy is LONGEST_REGION_FIRST); | |
168 setHyperlinkDetectors(hyperlinkDetectors); | |
169 setHyperlinkStateMask(eventStateMask); | |
170 | |
171 StyledText text= fTextViewer.getTextWidget(); | |
172 if (text is null || text.isDisposed()) | |
173 return; | |
174 | |
175 text.getDisplay().addFilter(DWT.KeyUp, this); | |
176 text.addKeyListener(this); | |
177 text.addMouseListener(this); | |
178 text.addMouseMoveListener(this); | |
179 text.addFocusListener(this); | |
180 text.addMouseTrackListener(this); | |
181 | |
182 fTextViewer.addTextListener(this); | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
183 |
129 | 184 fHyperlinkPresenter.install(fTextViewer); |
185 } | |
186 | |
187 /** | |
188 * Sets the hyperlink detectors for this hyperlink manager. | |
189 * <p> | |
190 * It is allowed to call this method after this | |
191 * hyperlink manger has been installed. | |
192 * </p> | |
193 * | |
194 * @param hyperlinkDetectors and array of hyperlink detectors, must not be empty | |
195 */ | |
196 public void setHyperlinkDetectors(IHyperlinkDetector[] hyperlinkDetectors) { | |
197 Assert.isTrue(hyperlinkDetectors !is null && hyperlinkDetectors.length > 0); | |
198 if (fHyperlinkDetectors is null) | |
199 fHyperlinkDetectors= hyperlinkDetectors; | |
200 else { | |
201 synchronized (fHyperlinkDetectors) { | |
202 fHyperlinkDetectors= hyperlinkDetectors; | |
203 } | |
204 } | |
205 } | |
206 | |
207 /** | |
208 * Sets the DWT event state mask which in combination | |
209 * with the left mouse button triggers the hyperlink mode. | |
210 * <p> | |
211 * It is allowed to call this method after this | |
212 * hyperlink manger has been installed. | |
213 * </p> | |
214 * | |
215 * @param eventStateMask the DWT event state mask to activate hyperlink mode | |
216 */ | |
217 public void setHyperlinkStateMask(int eventStateMask) { | |
218 fHyperlinkStateMask= eventStateMask; | |
219 } | |
220 | |
221 /** | |
222 * Uninstalls this hyperlink manager. | |
223 */ | |
224 public void uninstall() { | |
225 deactivate(); | |
226 | |
227 StyledText text= fTextViewer.getTextWidget(); | |
228 if (text !is null && !text.isDisposed()) { | |
229 text.removeKeyListener(this); | |
230 text.getDisplay().removeFilter(DWT.KeyUp, this); | |
231 text.removeMouseListener(this); | |
232 text.removeMouseMoveListener(this); | |
233 text.removeFocusListener(this); | |
234 text.removeMouseTrackListener(this); | |
235 } | |
236 fTextViewer.removeTextListener(this); | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
237 |
129 | 238 fHyperlinkPresenter.uninstall(); |
239 | |
240 fHyperlinkPresenter= null; | |
241 fTextViewer= null; | |
242 fHyperlinkDetectors= null; | |
243 } | |
244 | |
245 /** | |
246 * Deactivates the currently shown hyperlinks. | |
247 */ | |
248 protected void deactivate() { | |
249 fHyperlinkPresenter.hideHyperlinks(); | |
250 fActive= false; | |
251 } | |
252 | |
253 /** | |
254 * Finds hyperlinks at the current offset. | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
255 * |
129 | 256 * @return the hyperlinks or <code>null</code> if none. |
257 */ | |
258 protected IHyperlink[] findHyperlinks() { | |
259 int offset= getCurrentTextOffset(); | |
260 if (offset is -1) | |
261 return null; | |
262 | |
263 bool canShowMultipleHyperlinks= fHyperlinkPresenter.canShowMultipleHyperlinks(); | |
264 IRegion region= new Region(offset, 0); | |
265 List allHyperlinks= new ArrayList(fHyperlinkDetectors.length * 2); | |
266 synchronized (fHyperlinkDetectors) { | |
267 for (int i= 0, length= fHyperlinkDetectors.length; i < length; i++) { | |
268 IHyperlinkDetector detector= fHyperlinkDetectors[i]; | |
269 if (detector is null) | |
270 continue; | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
271 |
138 | 272 if ( cast(IHyperlinkDetectorExtension2)detector ) { |
134 | 273 int stateMask= (cast(IHyperlinkDetectorExtension2)detector).getStateMask(); |
129 | 274 if (stateMask !is -1 && stateMask !is fActiveHyperlinkStateMask) |
275 continue; | |
276 else if (stateMask is -1 && fActiveHyperlinkStateMask !is fHyperlinkStateMask) | |
277 continue; | |
278 } else if (fActiveHyperlinkStateMask !is fHyperlinkStateMask) | |
279 continue; | |
280 | |
281 IHyperlink[] hyperlinks= detector.detectHyperlinks(fTextViewer, region, canShowMultipleHyperlinks); | |
282 if (hyperlinks is null) | |
283 continue; | |
284 | |
285 Assert.isLegal(hyperlinks.length > 0); | |
286 | |
287 if (fDetectionStrategy is FIRST) { | |
288 if (hyperlinks.length is 1) | |
289 return hyperlinks; | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
290 return [hyperlinks[0]]; |
129 | 291 } |
292 allHyperlinks.addAll(Arrays.asList(hyperlinks)); | |
293 } | |
294 } | |
295 | |
296 if (allHyperlinks.isEmpty()) | |
297 return null; | |
298 | |
299 if (fDetectionStrategy !is ALL) { | |
300 int maxLength= computeLongestHyperlinkLength(allHyperlinks); | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
301 Iterator iter= (new ArrayList(allHyperlinks)).iterator(); |
129 | 302 while (iter.hasNext()) { |
134 | 303 IHyperlink hyperlink= cast(IHyperlink)iter.next(); |
129 | 304 if (hyperlink.getHyperlinkRegion().getLength() < maxLength) |
305 allHyperlinks.remove(hyperlink); | |
306 } | |
307 } | |
308 | |
309 if (fDetectionStrategy is LONGEST_REGION_FIRST) | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
310 return [cast(IHyperlink)allHyperlinks.get(0)]; |
129 | 311 |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
312 return arraycast!(IHyperlink)(allHyperlinks.toArray()); |
129 | 313 |
314 } | |
315 | |
316 /** | |
317 * Computes the length of the longest detected | |
318 * hyperlink. | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
319 * |
129 | 320 * @param hyperlinks |
321 * @return the length of the longest detected | |
322 */ | |
323 protected int computeLongestHyperlinkLength(List hyperlinks) { | |
324 Assert.isLegal(hyperlinks !is null && !hyperlinks.isEmpty()); | |
325 Iterator iter= hyperlinks.iterator(); | |
326 int length= Integer.MIN_VALUE; | |
327 while (iter.hasNext()) { | |
134 | 328 IRegion region= (cast(IHyperlink)iter.next()).getHyperlinkRegion(); |
129 | 329 if (region.getLength() < length) |
330 continue; | |
331 length= region.getLength(); | |
332 } | |
333 return length; | |
334 } | |
335 | |
336 /** | |
337 * Returns the current text offset. | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
338 * |
129 | 339 * @return the current text offset |
340 */ | |
341 protected int getCurrentTextOffset() { | |
342 | |
343 try { | |
344 StyledText text= fTextViewer.getTextWidget(); | |
345 if (text is null || text.isDisposed()) | |
346 return -1; | |
347 | |
348 Display display= text.getDisplay(); | |
349 Point absolutePosition= display.getCursorLocation(); | |
350 Point relativePosition= text.toControl(absolutePosition); | |
351 | |
352 int widgetOffset= text.getOffsetAtLocation(relativePosition); | |
353 Point p= text.getLocationAtOffset(widgetOffset); | |
354 if (p.x > relativePosition.x) | |
355 widgetOffset--; | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
356 |
138 | 357 if ( cast(ITextViewerExtension5)fTextViewer ) { |
134 | 358 ITextViewerExtension5 extension= cast(ITextViewerExtension5)fTextViewer; |
129 | 359 return extension.widgetOffset2ModelOffset(widgetOffset); |
360 } | |
361 | |
362 return widgetOffset + fTextViewer.getVisibleRegion().getOffset(); | |
363 | |
364 } catch (IllegalArgumentException e) { | |
365 return -1; | |
366 } | |
367 } | |
368 | |
369 /* | |
370 * @see dwt.events.KeyListener#keyPressed(dwt.events.KeyEvent) | |
371 */ | |
372 public void keyPressed(KeyEvent event) { | |
373 | |
374 if (fActive) { | |
375 deactivate(); | |
376 return; | |
377 } | |
378 | |
379 if (!isRegisteredStateMask(event.keyCode)) { | |
380 deactivate(); | |
381 return; | |
382 } | |
383 | |
384 fActive= true; | |
385 fActiveHyperlinkStateMask= event.keyCode; | |
386 | |
387 // removed for #25871 (hyperlinks could interact with typing) | |
388 // | |
389 // ITextViewer viewer= getSourceViewer(); | |
390 // if (viewer is null) | |
391 // return; | |
392 // | |
393 // IRegion region= getCurrentTextRegion(viewer); | |
394 // if (region is null) | |
395 // return; | |
396 // | |
397 // highlightRegion(viewer, region); | |
398 // activateCursor(viewer); | |
399 } | |
400 | |
401 /* | |
402 * @see dwt.events.KeyListener#keyReleased(dwt.events.KeyEvent) | |
403 */ | |
404 public void keyReleased(KeyEvent event) { | |
405 } | |
406 | |
407 /* | |
408 * @see dwt.events.MouseListener#mouseDoubleClick(dwt.events.MouseEvent) | |
409 */ | |
410 public void mouseDoubleClick(MouseEvent e) { | |
411 | |
412 } | |
413 | |
414 /* | |
415 * @see dwt.events.MouseListener#mouseDown(dwt.events.MouseEvent) | |
416 */ | |
417 public void mouseDown(MouseEvent event) { | |
418 | |
419 if (!fActive) | |
420 return; | |
421 | |
422 if (event.stateMask !is fActiveHyperlinkStateMask) { | |
423 deactivate(); | |
424 return; | |
425 } | |
426 | |
427 if (event.button !is 1) { | |
428 deactivate(); | |
429 return; | |
430 } | |
431 } | |
432 | |
433 /* | |
434 * @see dwt.events.MouseListener#mouseUp(dwt.events.MouseEvent) | |
435 */ | |
436 public void mouseUp(MouseEvent e) { | |
437 | |
438 if (!fActive) { | |
439 fActiveHyperlinks= null; | |
440 return; | |
441 } | |
442 | |
443 if (e.button !is 1) | |
444 fActiveHyperlinks= null; | |
445 | |
446 deactivate(); | |
447 | |
448 if (fActiveHyperlinks !is null) | |
449 fActiveHyperlinks[0].open(); | |
450 } | |
451 | |
452 /* | |
453 * @see dwt.events.MouseMoveListener#mouseMove(dwt.events.MouseEvent) | |
454 */ | |
455 public void mouseMove(MouseEvent event) { | |
138 | 456 if ( cast(IHyperlinkPresenterExtension)fHyperlinkPresenter ) { |
134 | 457 if (!(cast(IHyperlinkPresenterExtension)fHyperlinkPresenter).canHideHyperlinks()) |
129 | 458 return; |
459 } | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
460 |
129 | 461 if (!isRegisteredStateMask(event.stateMask)) { |
462 if (fActive) | |
463 deactivate(); | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
464 |
129 | 465 return; |
466 } | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
467 |
129 | 468 fActive= true; |
469 fActiveHyperlinkStateMask= event.stateMask; | |
470 | |
471 StyledText text= fTextViewer.getTextWidget(); | |
472 if (text is null || text.isDisposed()) { | |
473 deactivate(); | |
474 return; | |
475 } | |
476 | |
477 if ((event.stateMask & DWT.BUTTON1) !is 0 && text.getSelectionCount() !is 0) { | |
478 deactivate(); | |
479 return; | |
480 } | |
481 | |
482 fActiveHyperlinks= findHyperlinks(); | |
483 if (fActiveHyperlinks is null || fActiveHyperlinks.length is 0) { | |
484 fHyperlinkPresenter.hideHyperlinks(); | |
485 return; | |
486 } | |
487 | |
488 fHyperlinkPresenter.showHyperlinks(fActiveHyperlinks); | |
489 | |
490 } | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
491 |
129 | 492 /** |
493 * Checks whether the given state mask is registered. | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
494 * |
129 | 495 * @param stateMask |
496 * @return <code>true</code> if a detector is registered for the given state mask | |
497 * @since 3.3 | |
498 */ | |
499 private bool isRegisteredStateMask(int stateMask) { | |
500 if (stateMask is fHyperlinkStateMask) | |
501 return true; | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
502 |
129 | 503 synchronized (fHyperlinkDetectors) { |
504 for (int i= 0; i < fHyperlinkDetectors.length; i++) { | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
505 if (cast(IHyperlinkDetectorExtension2)fHyperlinkDetectors[i] ) { |
134 | 506 if (stateMask is (cast(IHyperlinkDetectorExtension2)fHyperlinkDetectors[i]).getStateMask()) |
129 | 507 return true; |
508 } | |
509 } | |
510 } | |
511 return false; | |
512 } | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
513 |
129 | 514 /* |
515 * @see dwt.events.FocusListener#focusGained(dwt.events.FocusEvent) | |
516 */ | |
517 public void focusGained(FocusEvent e) {} | |
518 | |
519 /* | |
520 * @see dwt.events.FocusListener#focusLost(dwt.events.FocusEvent) | |
521 */ | |
522 public void focusLost(FocusEvent event) { | |
523 deactivate(); | |
524 } | |
525 | |
526 /* | |
527 * @see dwt.widgets.Listener#handleEvent(dwt.widgets.Event) | |
528 * @since 3.2 | |
529 */ | |
530 public void handleEvent(Event event) { | |
531 //key up | |
532 deactivate(); | |
533 } | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
534 |
129 | 535 /* |
536 * @see dwtx.jface.text.ITextListener#textChanged(TextEvent) | |
537 * @since 3.2 | |
538 */ | |
539 public void textChanged(TextEvent event) { | |
540 if (event.getDocumentEvent() !is null) | |
541 deactivate(); | |
542 } | |
543 | |
544 /** | |
545 * {@inheritDoc} | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
546 * |
129 | 547 * @since 3.4 |
548 */ | |
549 public void mouseExit(MouseEvent e) { | |
138 | 550 if ( cast(IHyperlinkPresenterExtension)fHyperlinkPresenter ) { |
134 | 551 if (!(cast(IHyperlinkPresenterExtension)fHyperlinkPresenter).canHideHyperlinks()) |
129 | 552 return; |
553 } | |
554 deactivate(); | |
555 } | |
556 | |
557 /** | |
558 * {@inheritDoc} | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
559 * |
129 | 560 * @since 3.4 |
561 */ | |
562 public void mouseEnter(MouseEvent e) { | |
563 } | |
564 | |
565 /** | |
566 * {@inheritDoc} | |
140
26688fec6d23
Following dsss compile errors
Frank Benoit <benoit@tionex.de>
parents:
138
diff
changeset
|
567 * |
129 | 568 * @since 3.4 |
569 */ | |
570 public void mouseHover(MouseEvent e) { | |
571 } | |
572 | |
573 } |