|
GWT Tk 0.2.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectasquare.gwt.debug.client.Debug
public class Debug
Facade for debugging methods. Creates methods for printing debug statements
from JSNI and native JavaScript. You can enable/disable debug methods by
pressing the Esc key twice sequentially.
Uses a DebugEventListener
to listen for the enabler key. See
DebugEventListener for
potential conflicts with PopupPanel and DialogBox.
A stub version of this class is provided which will remove this class definition from the final deliverable if placed ahead of this implementation in the classpath. The stub class will prevent debug statements from being displayed, however, the string will still be created by the browser's interpreter. To entirely remove debugging statements from the deliverable you will need to do something like this:
if (Debug.ENABLED)
{
Debug.println("Foo.bar(" + value1 + ',' + value2 + ')');
}
Debug.ENABLED is false in the stub version.
The compiler may optimize out the class if you only
reference this class through JSNI. Consider calling
Debug.init() in your entry point or test case if you are
getting this message:
com.google.gwt.core.client.JavaScriptException: JavaScript TypeError exception: Object doesn't support this property or method.
DebugConsole| Field Summary | |
|---|---|
static char |
DEFAULT_ENABLE_KEY
The default debug enabler key ( Esc). |
static boolean |
ENABLED
|
| Constructor Summary | |
|---|---|
Debug()
|
|
| Method Summary | |
|---|---|
static void |
disable()
Disables debugging, prints a message stating so and hides the in-browser console. |
static void |
dump(JavaScriptObject o)
Displays members of native JavaScript objects. |
static void |
dump(Object o)
Displays members of native JavaScript objects. |
static void |
enable()
Enables debugging and prints a message stating so. |
static void |
enableSilently()
Enable debugging, but does not show the in-browser console. |
static char |
getEnableKey()
Get the key which enables & disables debugging. |
static void |
init()
This is called automatically when the class (script) is loaded. |
static void |
installEventTracer(char enableKey,
int eventMask)
Installs an experimental event tracer. |
static boolean |
isEnabled()
Is debugging enabled at compile time and runtime. |
static void |
prettyPrint(JavaScriptObject o)
Prints a description of a JavaScript object. |
static void |
prettyPrint(Object o)
Prints a description of a JavaScript object. |
static void |
print(String message)
Prints a debugging message to the DebugConsole widget. |
static void |
println(String message)
Prints a debugging message to the DebugConsole widget, follwed by
"\r\n". |
static void |
printToBrowserConsole(String message)
Prints a message to the native browser console, if available. |
static void |
setEnableKey(char enableKey)
Set the key which enables & disables debugging. |
static void |
uninstallEventTracer()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean ENABLED
public static final char DEFAULT_ENABLE_KEY
Esc).
| Constructor Detail |
|---|
public Debug()
| Method Detail |
|---|
public static void init()
public static char getEnableKey()
public static void setEnableKey(char enableKey)
enableKey - a keycode representing the enabler keypublic static void enableSilently()
public static void enable()
public static void disable()
public static boolean isEnabled()
public static void print(String message)
DebugConsole widget. The
message is mirrored to the browser's native console, if supported. In
hosted mode the message is mirrored to System.out and the GWT
Shell.
message - DebugConsolepublic static void println(String message)
DebugConsole widget, follwed by
"\r\n". The message is mirrored to the browser's native console, if
supported. In hosted mode the message is mirrored to System.out
and the GWT Shell.
message - DebugConsolepublic static void printToBrowserConsole(String message)
message - public static void prettyPrint(Object o)
prettyPrint(JavaScriptObject)public static void prettyPrint(JavaScriptObject o)
public static void dump(Object o)
dump(JavaScriptObject)public static void dump(JavaScriptObject o)
public static void installEventTracer(char enableKey,
int eventMask)
Some events are not tracing in Firefox at this time, even though the events trigger listeners in GWT widgets.
enableKey - a keyCode or (char) 0 for the default ('e')eventMask - a bitwise event mask, 0 for no events or -1 for the
defaultDebugEventListener,
Eventpublic static void uninstallEventTracer()
installEventTracer(char, int)
|
GWT Tk 0.2.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||