diff dwtx/core/internal/runtime/PrintStackUtil.d @ 71:4878bef4a38e

Some fixing
author Frank Benoit <benoit@tionex.de>
date Thu, 22 May 2008 04:03:58 +0200
parents 46a6e0e6ccd4
children 0ea0c9f9008f
line wrap: on
line diff
--- a/dwtx/core/internal/runtime/PrintStackUtil.d	Thu May 22 01:36:46 2008 +0200
+++ b/dwtx/core/internal/runtime/PrintStackUtil.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
  * Port to the D programming language:
@@ -12,38 +12,37 @@
  *******************************************************************************/
 module dwtx.core.internal.runtime.PrintStackUtil;
 
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
 import dwtx.core.runtime.IStatus;
+import tango.io.Print;
+import dwt.dwthelper.utils;
 
 public class PrintStackUtil {
 
-    static public void printChildren(IStatus status, PrintStream output) {
+    static public void printChildren(IStatus status, Print!(char) output) {
         IStatus[] children = status.getChildren();
         if (children is null || children.length is 0)
             return;
         for (int i = 0; i < children.length; i++) {
-            output.println("Contains: " + children[i].getMessage()); //$NON-NLS-1$
-            Throwable exception = children[i].getException();
+            output.formatln("Contains: {}", children[i].getMessage()); //$NON-NLS-1$
+            Exception exception = children[i].getException();
             if (exception !is null)
-                exception.printStackTrace();
+                ExceptionPrintStackTrace(exception);
             printChildren(children[i], output);
         }
     }
 
-    static public void printChildren(IStatus status, PrintWriter output) {
-        IStatus[] children = status.getChildren();
-        if (children is null || children.length is 0)
-            return;
-        for (int i = 0; i < children.length; i++) {
-            output.println("Contains: " + children[i].getMessage()); //$NON-NLS-1$
-            output.flush(); // call to synchronize output
-            Throwable exception = children[i].getException();
-            if (exception !is null)
-                exception.printStackTrace();
-            printChildren(children[i], output);
-        }
-    }
+//     static public void printChildren(IStatus status, Print!(char) output) {
+//         IStatus[] children = status.getChildren();
+//         if (children is null || children.length is 0)
+//             return;
+//         for (int i = 0; i < children.length; i++) {
+//             output.formatln( "Contains: {}", children[i].getMessage()); //$NON-NLS-1$
+//             output.flush(); // call to synchronize output
+//             Exception exception = children[i].getException();
+//             if (exception !is null)
+//                 ExceptionPrintStackTrace(exception);
+//             printChildren(children[i], output);
+//         }
+//     }
 
 }