Mercurial > projects > dwt-addons
comparison dwtx/jface/dialogs/Dialog.d @ 82:0aafcf6e5217
Lazy initialization to fix cyclic dep. Thanks yidabu for the report.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 20 Jun 2008 12:44:40 +0200 |
parents | 46a6e0e6ccd4 |
children |
comparison
equal
deleted
inserted
replaced
81:e28b067ce8c5 | 82:0aafcf6e5217 |
---|---|
382 | 382 |
383 /** | 383 /** |
384 * Create a default instance of the blocked handler which does not do | 384 * Create a default instance of the blocked handler which does not do |
385 * anything. | 385 * anything. |
386 */ | 386 */ |
387 public static IDialogBlockedHandler blockedHandler; | 387 private static IDialogBlockedHandler blockedHandler_; |
388 static this(){ | 388 public static IDialogBlockedHandler blockedHandler(){ |
389 blockedHandler = new class IDialogBlockedHandler { | 389 static_this_blockedhandler(); |
390 /* | 390 return blockedHandler_; |
391 * (non-Javadoc) | 391 } |
392 * | 392 public static IDialogBlockedHandler blockedHandler( IDialogBlockedHandler b ){ |
393 * @see dwtx.jface.dialogs.IDialogBlockedHandler#clearBlocked() | 393 static_this_blockedhandler(); |
394 */ | 394 return ( blockedHandler_ = b ); |
395 public void clearBlocked() { | 395 } |
396 // No default behaviour | 396 private static bool static_this_blockedhandler_completed = false; |
397 private static void static_this_blockedhandler(){ | |
398 if( static_this_blockedhandler_completed ){ | |
399 return; | |
400 } | |
401 synchronized{ | |
402 if( static_this_blockedhandler_completed ){ | |
403 return; | |
397 } | 404 } |
398 | 405 blockedHandler_ = new class IDialogBlockedHandler { |
399 /* | 406 /* |
400 * (non-Javadoc) | 407 * (non-Javadoc) |
401 * | 408 * |
402 * @see dwtx.jface.dialogs.IDialogBlockedHandler#showBlocked(dwtx.core.runtime.IProgressMonitor, | 409 * @see dwtx.jface.dialogs.IDialogBlockedHandler#clearBlocked() |
403 * dwtx.core.runtime.IStatus, java.lang.String) | 410 */ |
404 */ | 411 public void clearBlocked() { |
405 public void showBlocked(IProgressMonitor blocking, | 412 // No default behaviour |
406 IStatus blockingStatus, String blockedName) { | 413 } |
407 // No default behaviour | 414 |
408 } | 415 /* |
409 | 416 * (non-Javadoc) |
410 /* | 417 * |
411 * (non-Javadoc) | 418 * @see dwtx.jface.dialogs.IDialogBlockedHandler#showBlocked(dwtx.core.runtime.IProgressMonitor, |
412 * | 419 * dwtx.core.runtime.IStatus, java.lang.String) |
413 * @see dwtx.jface.dialogs.IDialogBlockedHandler#showBlocked(dwt.widgets.Shell, | 420 */ |
414 * dwtx.core.runtime.IProgressMonitor, | 421 public void showBlocked(IProgressMonitor blocking, |
415 * dwtx.core.runtime.IStatus, java.lang.String) | 422 IStatus blockingStatus, String blockedName) { |
416 */ | 423 // No default behaviour |
417 public void showBlocked(Shell parentShell, IProgressMonitor blocking, | 424 } |
418 IStatus blockingStatus, String blockedName) { | 425 |
419 // No default behaviour | 426 /* |
420 } | 427 * (non-Javadoc) |
421 }; | 428 * |
429 * @see dwtx.jface.dialogs.IDialogBlockedHandler#showBlocked(dwt.widgets.Shell, | |
430 * dwtx.core.runtime.IProgressMonitor, | |
431 * dwtx.core.runtime.IStatus, java.lang.String) | |
432 */ | |
433 public void showBlocked(Shell parentShell, IProgressMonitor blocking, | |
434 IStatus blockingStatus, String blockedName) { | |
435 // No default behaviour | |
436 } | |
437 }; | |
438 static_this_blockedhandler_completed = true; | |
439 } | |
422 } | 440 } |
423 | 441 |
424 /** | 442 /** |
425 * Creates a dialog instance. Note that the window will have no visual | 443 * Creates a dialog instance. Note that the window will have no visual |
426 * representation (no widgets) until it is told to open. By default, | 444 * representation (no widgets) until it is told to open. By default, |