|
GWT 2.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.core.client.GWT
public final class GWT
Supports core functionality that in some cases requires direct support from the compiler and runtime systems such as runtime type information and deferred binding.
Nested Class Summary | |
---|---|
static interface |
GWT.UncaughtExceptionHandler
This interface is used to catch exceptions at the "top level" just before they escape to the browser. |
Field Summary | |
---|---|
static java.lang.String |
HOSTED_MODE_PERMUTATION_STRONG_NAME
This constant is used by getPermutationStrongName() when running in
hosted mode. |
Constructor Summary | |
---|---|
GWT()
|
Method Summary | ||
---|---|---|
static
|
create(java.lang.Class<?> classLiteral)
Instantiates a class via deferred binding. |
|
static java.lang.String |
getHostPageBaseURL()
Gets the URL prefix of the hosting page, useful for prepending to relative paths of resources which may be relative to the host page. |
|
static java.lang.String |
getModuleBaseURL()
Gets the URL prefix of the module which should be prepended to URLs that are intended to be module-relative, such as RPC entry points and files in the module's public path. |
|
static java.lang.String |
getModuleName()
Gets the name of the running module. |
|
static java.lang.String |
getPermutationStrongName()
Returns the permutation's strong name. |
|
static java.lang.String |
getTypeName(java.lang.Object o)
Deprecated. Use Object.getClass() , Class.getName() |
|
static GWT.UncaughtExceptionHandler |
getUncaughtExceptionHandler()
Returns the currently active uncaughtExceptionHandler. |
|
static java.lang.String |
getUniqueThreadId()
Returns the empty string when running in web mode, but returns a unique string for each thread in hosted mode (for example, different windows accessing the dev mode server will each have a unique id, and hitting refresh without restarting dev mode will result in a new unique id for a particular window. |
|
static java.lang.String |
getVersion()
|
|
static boolean |
isClient()
Returns true when running inside the normal GWT environment,
either in hosted mode or web mode. |
|
static boolean |
isProdMode()
Returns true when running in production mode. |
|
static boolean |
isScript()
Determines whether or not the running program is script or bytecode. |
|
static void |
log(java.lang.String message)
Logs a message to the development shell logger in hosted mode. |
|
static void |
log(java.lang.String message,
java.lang.Throwable e)
Logs a message to the development shell logger in hosted mode. |
|
static void |
runAsync(java.lang.Class<?> name,
RunAsyncCallback callback)
The same as runAsync(RunAsyncCallback) , except with an extra
parameter to provide a name for the call. |
|
static void |
runAsync(RunAsyncCallback callback)
Run the specified callback once the necessary code for it has been loaded. |
|
static void |
setUncaughtExceptionHandler(GWT.UncaughtExceptionHandler handler)
Sets a custom uncaught exception handler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String HOSTED_MODE_PERMUTATION_STRONG_NAME
getPermutationStrongName()
when running in
hosted mode.
Constructor Detail |
---|
public GWT()
Method Detail |
---|
public static <T> T create(java.lang.Class<?> classLiteral)
The argument to create(Class)
must be a class
literal because the web mode compiler must be able to statically determine
the requested type at compile-time. This can be tricky because using a
Class
variable may appear to work correctly in hosted mode.
classLiteral
- a class literal specifying the base class to be
instantiated
public static java.lang.String getHostPageBaseURL()
getModuleBaseURL()
unless you have a specific reason to
load a resource relative to the host page.
public static java.lang.String getModuleBaseURL()
public static java.lang.String getModuleName()
public static java.lang.String getPermutationStrongName()
@Deprecated public static java.lang.String getTypeName(java.lang.Object o)
Object.getClass()
, Class.getName()
public static GWT.UncaughtExceptionHandler getUncaughtExceptionHandler()
DOM.dispatchEvent()
for an example
of how to handle this correctly.
public static java.lang.String getUniqueThreadId()
public static java.lang.String getVersion()
public static boolean isClient()
true
when running inside the normal GWT environment,
either in hosted mode or web mode. Returns false
if this
code is running in a plain JVM. This might happen when running shared code
on the server, or during the bootstrap sequence of a GWTTestCase test.
public static boolean isProdMode()
true
when running in production mode. Returns
false
when running either in development mode, or when running
in a plain JVM.
public static boolean isScript()
public static void log(java.lang.String message)
public static void log(java.lang.String message, java.lang.Throwable e)
public static void runAsync(java.lang.Class<?> name, RunAsyncCallback callback)
runAsync(RunAsyncCallback)
, except with an extra
parameter to provide a name for the call. The name parameter should be
supplied with a class literal. No two runAsync calls in the same program
should use the same name.
public static void runAsync(RunAsyncCallback callback)
public static void setUncaughtExceptionHandler(GWT.UncaughtExceptionHandler handler)
getUncaughtExceptionHandler()
for details.
handler
- the handler that should be called when an exception is about
to escape to the browser, or null
to clear the
handler and allow exceptions to escape.
|
GWT 2.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |