Subversion Repository Public Repository

litesoft

Diff Revisions 49 vs 151 for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/logging/BrowserAsLogSyncFactory.java

Diff revisions: vs.
  @@ -1,11 +1,12 @@
1 1 // This Source Code is in the Public Domain per: http://litesoft.org/License.txt
2 2 package org.litesoft.GWT.client.logging;
3 3
4 - import com.google.gwt.user.client.*;
5 4 import org.litesoft.GWT.client.*;
6 5 import org.litesoft.logger.*;
7 6 import org.litesoft.logger.nonpublic.*;
8 7
8 + import com.google.gwt.user.client.*;
9 +
9 10 public class BrowserAsLogSyncFactory implements ProxyLoggerFactory
10 11 {
11 12 public static final int MAX_LOG_LINES_TO_CACHE = 100;
  @@ -57,18 +58,18 @@
57 58 private static boolean sOpen = false;
58 59
59 60 public static native boolean openLogSyncBrowser( String pFeatures, String pHTML ) /*-{
60 - $wnd.loggingWindow = $wnd.open("", "", pFeatures);
61 + $wnd.loggingWindow = $wnd.open( "", "", pFeatures );
61 62 if ( !$wnd.loggingWindow )
62 63 {
63 64 return false;
64 65 }
65 - $wnd.loggingWindow.document.write(pHTML);
66 + $wnd.loggingWindow.document.write( pHTML );
66 67 $wnd.loggingWindow.document.close();
67 68 return true;
68 69 }-*/;
69 70
70 71 public static native boolean addToLogSyncBrowser( String pText )/*-{
71 - if( $wnd.loggingWindow )
72 + if ( $wnd.loggingWindow )
72 73 {
73 74 try
74 75 {
  @@ -159,22 +160,20 @@
159 160 }
160 161 }
161 162
162 - private static final String CLIENT_LOGGING_HTML =
163 - "<html><head><title>Client Side Log</title><script>\n" + //
164 - "function appendToLog( pLogEntry )\n" + //
165 - "{\n" + //
166 - " var myBody = document.body;\n" + //
167 - " var preNode = document.createElement( 'pre' );\n" + //
168 - " preNode.style.margin = '0';\n" + //
169 - " myBody.appendChild( preNode );\n" + //
170 - " var txtNode = document.createTextNode( pLogEntry );\n" + //
171 - " preNode.appendChild( txtNode );\n" + //
172 - " document.close();\n" + //
173 - "}\n" + //
174 - "</script></head><body style='margin:0; padding:0;'>" + //
175 - "<center>Client Side Logging<br>" + //
176 - "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" +
177 - "</center></body></html>";
163 + private static final String CLIENT_LOGGING_HTML = "<html><head><title>Client Side Log</title><script>\n" + //
164 + "function appendToLog( pLogEntry )\n" + //
165 + "{\n" + //
166 + " var myBody = document.body;\n" + //
167 + " var preNode = document.createElement( 'pre' );\n" + //
168 + " preNode.style.margin = '0';\n" + //
169 + " myBody.appendChild( preNode );\n" + //
170 + " var txtNode = document.createTextNode( pLogEntry );\n" + //
171 + " preNode.appendChild( txtNode );\n" + //
172 + " document.close();\n" + //
173 + "}\n" + //
174 + "</script></head><body style='margin:0; padding:0;'>" + //
175 + "<center>Client Side Logging<br>" + //
176 + "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" + "</center></body></html>";
178 177
179 178 @Override
180 179 public ImplLoggerAdapter createImplLoggerAdapter( int pLevel, String pClassname )