Mercurial > projects > dwt-addons
diff dwtx/jface/util/Policy.d @ 71:4878bef4a38e
Some fixing
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 22 May 2008 04:03:58 +0200 |
parents | 46a6e0e6ccd4 |
children | 5df4896124c7 |
line wrap: on
line diff
--- a/dwtx/jface/util/Policy.d Thu May 22 01:36:46 2008 +0200 +++ b/dwtx/jface/util/Policy.d Thu May 22 04:03:58 2008 +0200 @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation * Chris Gross (schtoo@schtoo.com) - support for ILogger added @@ -23,9 +23,11 @@ import dwtx.jface.dialogs.AnimatorFactory; import dwtx.jface.dialogs.ErrorSupportProvider; +import dwtx.jface.util.StatusHandler; import dwtx.jface.util.ILogger; import dwt.dwthelper.utils; +import dwt.dwthelper.Runnable; import tango.io.Stdout; /** @@ -121,7 +123,7 @@ /** * Sets the status handler used by JFace to handle statuses. - * + * * @param status * the handler to use, or <code>null</code> to use the default * one @@ -133,7 +135,7 @@ /** * Returns the status handler used by JFace to handle statuses. - * + * * @return the status handler * @since 3.4 */ @@ -145,29 +147,31 @@ } private static StatusHandler getDummyStatusHandler() { - return new StatusHandler() { + return new class StatusHandler { private SafeRunnableDialog dialog; - public void show(final IStatus status, String title) { - Runnable runnable = new Runnable() { - public void run() { - if (dialog is null || dialog.getShell().isDisposed()) { - dialog = new SafeRunnableDialog(status); - dialog.create(); - dialog.getShell().addDisposeListener( - new DisposeListener() { - public void widgetDisposed( - DisposeEvent e) { - dialog = null; - } - }); - dialog.open(); - } else { - dialog.addStatus(status); - dialog.refresh(); - } + 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; + } + public void widgetDisposed( + DisposeEvent e) { + *dialog__ = null; + } + }); + *dialog_.open(); + } else { + *dialog_.addStatus(status_); + *dialog_.refresh(); } - }; + }, status, &dialog); if (Display.getCurrent() !is null) { runnable.run(); } else { @@ -281,7 +285,7 @@ /** * Log the Exception to the logger. - * + * * @param exception */ public static void logException(Exception exception) {