Mercurial > projects > dwt-addons
comparison dwtx/jface/internal/text/StickyHoverManager.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 | 53b889547456 |
comparison
equal
deleted
inserted
replaced
139:93a6ec48fd28 | 140:26688fec6d23 |
---|---|
228 | 228 |
229 /* | 229 /* |
230 * @see dwt.events.FocusListener#focusLost(dwt.events.FocusEvent) | 230 * @see dwt.events.FocusListener#focusLost(dwt.events.FocusEvent) |
231 */ | 231 */ |
232 public void focusLost(FocusEvent e) { | 232 public void focusLost(FocusEvent e) { |
233 if cast(DEBUG) System.out.println("StickyHoverManager.Closer.focusLost(): " + e); //$NON-NLS-1$ | 233 if cast(DEBUG) System.out_.println("StickyHoverManager.Closer.focusLost(): " + e); //$NON-NLS-1$ |
234 Display d= fSubjectControl.getDisplay(); | 234 Display d= fSubjectControl.getDisplay(); |
235 d.asyncExec(new class() Runnable { | 235 d.asyncExec(new class() Runnable { |
236 // Without the asyncExec, mouse clicks to the workbench window are swallowed. | 236 // Without the asyncExec, mouse clicks to the workbench window are swallowed. |
237 public void run() { | 237 public void run() { |
238 hideInformationControl(); | 238 hideInformationControl(); |
248 if (!(event.widget instanceof Control) || event.widget.isDisposed()) | 248 if (!(event.widget instanceof Control) || event.widget.isDisposed()) |
249 return; | 249 return; |
250 | 250 |
251 IInformationControl infoControl= getCurrentInformationControl2(); | 251 IInformationControl infoControl= getCurrentInformationControl2(); |
252 if (infoControl !is null && !infoControl.isFocusControl() && infoControl instanceof IInformationControlExtension3) { | 252 if (infoControl !is null && !infoControl.isFocusControl() && infoControl instanceof IInformationControlExtension3) { |
253 // if cast(DEBUG) System.out.println("StickyHoverManager.Closer.handleEvent(): activeShell= " + fDisplay.getActiveShell()); //$NON-NLS-1$ | 253 // if cast(DEBUG) System.out_.println("StickyHoverManager.Closer.handleEvent(): activeShell= " + fDisplay.getActiveShell()); //$NON-NLS-1$ |
254 IInformationControlExtension3 iControl3= cast(IInformationControlExtension3) infoControl; | 254 IInformationControlExtension3 iControl3= cast(IInformationControlExtension3) infoControl; |
255 Rectangle controlBounds= iControl3.getBounds(); | 255 Rectangle controlBounds= iControl3.getBounds(); |
256 if (controlBounds !is null) { | 256 if (controlBounds !is null) { |
257 Point mouseLoc= event.display.map(cast(Control) event.widget, null, event.x, event.y); | 257 Point mouseLoc= event.display.map(cast(Control) event.widget, null, event.x, event.y); |
258 int margin= getKeepUpMargin(); | 258 int margin= getKeepUpMargin(); |
270 if (fDisplay !is null && !fDisplay.isDisposed()) | 270 if (fDisplay !is null && !fDisplay.isDisposed()) |
271 fDisplay.removeFilter(DWT.MouseMove, this); | 271 fDisplay.removeFilter(DWT.MouseMove, this); |
272 } | 272 } |
273 | 273 |
274 } else if (event.type is DWT.FocusOut) { | 274 } else if (event.type is DWT.FocusOut) { |
275 if cast(DEBUG) System.out.println("StickyHoverManager.Closer.handleEvent(): focusOut: " + event); //$NON-NLS-1$ | 275 if cast(DEBUG) System.out_.println("StickyHoverManager.Closer.handleEvent(): focusOut: " + event); //$NON-NLS-1$ |
276 IInformationControl iControl= getCurrentInformationControl2(); | 276 IInformationControl iControl= getCurrentInformationControl2(); |
277 if (iControl !is null && ! iControl.isFocusControl()) | 277 if (iControl !is null && ! iControl.isFocusControl()) |
278 hideInformationControl(); | 278 hideInformationControl(); |
279 } | 279 } |
280 } | 280 } |
304 protected void showInformationControl(Rectangle subjectArea) { | 304 protected void showInformationControl(Rectangle subjectArea) { |
305 if (fTextViewer !is null && fTextViewer.requestWidgetToken(this, WIDGET_PRIORITY)) | 305 if (fTextViewer !is null && fTextViewer.requestWidgetToken(this, WIDGET_PRIORITY)) |
306 super.showInformationControl(subjectArea); | 306 super.showInformationControl(subjectArea); |
307 else | 307 else |
308 if cast(DEBUG) | 308 if cast(DEBUG) |
309 System.out.println("cancelled StickyHoverManager.showInformationControl(..): did not get widget token (with prio)"); //$NON-NLS-1$ | 309 System.out_.println("cancelled StickyHoverManager.showInformationControl(..): did not get widget token (with prio)"); //$NON-NLS-1$ |
310 } | 310 } |
311 | 311 |
312 /* | 312 /* |
313 * @see AbstractInformationControlManager#hideInformationControl() | 313 * @see AbstractInformationControlManager#hideInformationControl() |
314 */ | 314 */ |
337 * @see dwtx.jface.text.IWidgetTokenKeeper#requestWidgetToken(IWidgetTokenOwner) | 337 * @see dwtx.jface.text.IWidgetTokenKeeper#requestWidgetToken(IWidgetTokenOwner) |
338 */ | 338 */ |
339 public bool requestWidgetToken(IWidgetTokenOwner owner) { | 339 public bool requestWidgetToken(IWidgetTokenOwner owner) { |
340 hideInformationControl(); | 340 hideInformationControl(); |
341 if cast(DEBUG) | 341 if cast(DEBUG) |
342 System.out.println("StickyHoverManager gave up widget token (no prio)"); //$NON-NLS-1$ | 342 System.out_.println("StickyHoverManager gave up widget token (no prio)"); //$NON-NLS-1$ |
343 return true; | 343 return true; |
344 } | 344 } |
345 | 345 |
346 /* | 346 /* |
347 * @see dwtx.jface.text.IWidgetTokenKeeperExtension#requestWidgetToken(dwtx.jface.text.IWidgetTokenOwner, int) | 347 * @see dwtx.jface.text.IWidgetTokenKeeperExtension#requestWidgetToken(dwtx.jface.text.IWidgetTokenOwner, int) |
348 */ | 348 */ |
349 public bool requestWidgetToken(IWidgetTokenOwner owner, int priority) { | 349 public bool requestWidgetToken(IWidgetTokenOwner owner, int priority) { |
350 if (getCurrentInformationControl2() !is null) { | 350 if (getCurrentInformationControl2() !is null) { |
351 if (getCurrentInformationControl2().isFocusControl()) { | 351 if (getCurrentInformationControl2().isFocusControl()) { |
352 if cast(DEBUG) | 352 if cast(DEBUG) |
353 System.out.println("StickyHoverManager kept widget token (focused)"); //$NON-NLS-1$ | 353 System.out_.println("StickyHoverManager kept widget token (focused)"); //$NON-NLS-1$ |
354 return false; | 354 return false; |
355 } else if (priority > WIDGET_PRIORITY) { | 355 } else if (priority > WIDGET_PRIORITY) { |
356 hideInformationControl(); | 356 hideInformationControl(); |
357 if cast(DEBUG) | 357 if cast(DEBUG) |
358 System.out.println("StickyHoverManager gave up widget token (prio)"); //$NON-NLS-1$ | 358 System.out_.println("StickyHoverManager gave up widget token (prio)"); //$NON-NLS-1$ |
359 return true; | 359 return true; |
360 } else { | 360 } else { |
361 if cast(DEBUG) | 361 if cast(DEBUG) |
362 System.out.println("StickyHoverManager kept widget token (prio)"); //$NON-NLS-1$ | 362 System.out_.println("StickyHoverManager kept widget token (prio)"); //$NON-NLS-1$ |
363 return false; | 363 return false; |
364 } | 364 } |
365 } | 365 } |
366 if cast(DEBUG) | 366 if cast(DEBUG) |
367 System.out.println("StickyHoverManager gave up widget token (no iControl)"); //$NON-NLS-1$ | 367 System.out_.println("StickyHoverManager gave up widget token (no iControl)"); //$NON-NLS-1$ |
368 return true; | 368 return true; |
369 } | 369 } |
370 | 370 |
371 /* | 371 /* |
372 * @see dwtx.jface.text.IWidgetTokenKeeperExtension#setFocus(dwtx.jface.text.IWidgetTokenOwner) | 372 * @see dwtx.jface.text.IWidgetTokenKeeperExtension#setFocus(dwtx.jface.text.IWidgetTokenOwner) |