Mercurial > projects > dwt-addons
comparison dwtx/jface/internal/text/StickyHoverManager.d @ 162:1a5b8f8129df
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 08 Sep 2008 00:51:37 +0200 |
parents | 5cf141e43417 |
children |
comparison
equal
deleted
inserted
replaced
161:f8d52b926852 | 162:1a5b8f8129df |
---|---|
16 import dwtx.jface.internal.text.InternalAccessor; // packageimport | 16 import dwtx.jface.internal.text.InternalAccessor; // packageimport |
17 import dwtx.jface.internal.text.InformationControlReplacer; // packageimport | 17 import dwtx.jface.internal.text.InformationControlReplacer; // packageimport |
18 import dwtx.jface.internal.text.TableOwnerDrawSupport; // packageimport | 18 import dwtx.jface.internal.text.TableOwnerDrawSupport; // packageimport |
19 import dwtx.jface.internal.text.DelayedInputChangeListener; // packageimport | 19 import dwtx.jface.internal.text.DelayedInputChangeListener; // packageimport |
20 | 20 |
21 | |
22 import dwt.dwthelper.utils; | 21 import dwt.dwthelper.utils; |
23 | 22 import tango.text.convert.Format; |
24 | |
25 | 23 |
26 import dwt.DWT; | 24 import dwt.DWT; |
27 import dwt.events.ControlEvent; | 25 import dwt.events.ControlEvent; |
28 import dwt.events.ControlListener; | 26 import dwt.events.ControlListener; |
29 import dwt.events.FocusEvent; | 27 import dwt.events.FocusEvent; |
46 import dwtx.jface.text.IWidgetTokenKeeperExtension; | 44 import dwtx.jface.text.IWidgetTokenKeeperExtension; |
47 import dwtx.jface.text.IWidgetTokenOwner; | 45 import dwtx.jface.text.IWidgetTokenOwner; |
48 import dwtx.jface.text.TextViewer; | 46 import dwtx.jface.text.TextViewer; |
49 import dwtx.jface.util.Geometry; | 47 import dwtx.jface.util.Geometry; |
50 | 48 |
51 | |
52 /** | 49 /** |
53 * Implements a sticky hover control, i.e. a control that replaces a hover | 50 * Implements a sticky hover control, i.e. a control that replaces a hover |
54 * with an enriched and focusable control. | 51 * with an enriched and focusable control. |
55 * <p> | 52 * <p> |
56 * The information control is made visible on request by calling | 53 * The information control is made visible on request by calling |
228 | 225 |
229 /* | 226 /* |
230 * @see dwt.events.FocusListener#focusLost(dwt.events.FocusEvent) | 227 * @see dwt.events.FocusListener#focusLost(dwt.events.FocusEvent) |
231 */ | 228 */ |
232 public void focusLost(FocusEvent e) { | 229 public void focusLost(FocusEvent e) { |
233 if (DEBUG) System.out_.println("StickyHoverManager.Closer.focusLost(): " + e); //$NON-NLS-1$ | 230 if (DEBUG) System.out_.println(Format("StickyHoverManager.Closer.focusLost(): {}", e)); //$NON-NLS-1$ |
234 Display d= fSubjectControl.getDisplay(); | 231 Display d= fSubjectControl.getDisplay(); |
235 d.asyncExec(new class() Runnable { | 232 d.asyncExec(new class() Runnable { |
236 // Without the asyncExec, mouse clicks to the workbench window are swallowed. | 233 // Without the asyncExec, mouse clicks to the workbench window are swallowed. |
237 public void run() { | 234 public void run() { |
238 hideInformationControl(); | 235 hideInformationControl(); |
270 if (fDisplay !is null && !fDisplay.isDisposed()) | 267 if (fDisplay !is null && !fDisplay.isDisposed()) |
271 fDisplay.removeFilter(DWT.MouseMove, this); | 268 fDisplay.removeFilter(DWT.MouseMove, this); |
272 } | 269 } |
273 | 270 |
274 } else if (event.type is DWT.FocusOut) { | 271 } else if (event.type is DWT.FocusOut) { |
275 if (DEBUG) System.out_.println("StickyHoverManager.Closer.handleEvent(): focusOut: " + event); //$NON-NLS-1$ | 272 if (DEBUG) System.out_.println(Format("StickyHoverManager.Closer.handleEvent(): focusOut: {}", event)); //$NON-NLS-1$ |
276 IInformationControl iControl= getCurrentInformationControl2(); | 273 IInformationControl iControl= getCurrentInformationControl2(); |
277 if (iControl !is null && ! iControl.isFocusControl()) | 274 if (iControl !is null && ! iControl.isFocusControl()) |
278 hideInformationControl(); | 275 hideInformationControl(); |
279 } | 276 } |
280 } | 277 } |