Mercurial > projects > dwt-addons
diff dwtx/jface/util/Policy.d @ 72:5df4896124c7
JFace and its examples do compile
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 22 May 2008 17:56:17 +0200 |
parents | 4878bef4a38e |
children | 7ffeace6c47f |
line wrap: on
line diff
--- a/dwtx/jface/util/Policy.d Thu May 22 04:03:58 2008 +0200 +++ b/dwtx/jface/util/Policy.d Thu May 22 17:56:17 2008 +0200 @@ -24,6 +24,7 @@ import dwtx.jface.dialogs.ErrorSupportProvider; import dwtx.jface.util.StatusHandler; +import dwtx.jface.util.SafeRunnableDialog; import dwtx.jface.util.ILogger; import dwt.dwthelper.utils; @@ -151,27 +152,23 @@ private SafeRunnableDialog dialog; public void show(IStatus status, String title) { - Runnable runnable = dgRunnable( (IStatus status_, SafeRunnableDialog* dialog_) { - if (*dialog_ is null || dialog_.getShell().isDisposed()) { - *dialog_ = new SafeRunnableDialog(status_); - *dialog_.create(); - *dialog_.getShell().addDisposeListener( - new class(dialog_) DisposeListener { - private SafeRunnableDialog* dialog__; - this( SafeRunnableDialog* a ){ - dialog__ = a; - } + Runnable runnable = dgRunnable( (IStatus status_) { + if (dialog is null || dialog.getShell().isDisposed()) { + dialog = new SafeRunnableDialog(status_); + dialog.create(); + dialog.getShell().addDisposeListener( + new class DisposeListener { public void widgetDisposed( DisposeEvent e) { - *dialog__ = null; + dialog = null; } }); - *dialog_.open(); + dialog.open(); } else { - *dialog_.addStatus(status_); - *dialog_.refresh(); + dialog.addStatus(status_); + dialog.refresh(); } - }, status, &dialog); + }, status ); if (Display.getCurrent() !is null) { runnable.run(); } else { @@ -290,8 +287,8 @@ */ public static void logException(Exception exception) { getLog().log( - new Status(IStatus.ERROR, JFACE, exception - .getLocalizedMessage(), exception)); + new Status(IStatus.ERROR, JFACE, ExceptionGetLocalizedMessage( exception ) + , exception)); }