litesoft
@ 948
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
package org.litesoft.GWT.client.widgets; import com.google.gwt.user.client.*; import com.google.gwt.user.client.ui.*; public class LowLevelLogger { public static void println( String text ) { print( text ); if ( !appendToLog( DOM.createElement( "BR" ) ) ) { System.out.println(); } } public static void print( String text ) { Element span = DOM.createSpan(); span.setInnerText( text ); if ( !appendToLog( span ) ) { System.out.print( text ); } } private static boolean appendToLog( Element element ) { RootPanel panel = RootPanel.get( "logPanel" ); if ( panel == null ) { return false; } panel.getElement().appendChild( element ); return true; } } |