/** * Create a new PlaceController with a {@link DefaultDelegate}. The * DefaultDelegate is created via a call to GWT.create(), so an alternative * default implementation can be provided through <replace-with> rules * in a {@code .gwt.xml} file. * * @param eventBus the {@link EventBus} */ public PlaceController(EventBus eventBus) { this(eventBus, (Delegate) GWT.create(DefaultDelegate.class)); }
/** * Logs a message to the development shell logger in Development Mode, or to * the JavaScript console in Super Dev Mode. Calls are optimized out in Production Mode. */ public static void log(String message) { log(message, null); }
/** * Returns <code>true</code> when running inside the normal GWT environment, * either in Development Mode or Production Mode. Returns <code>false</code> * 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 isClient() { return com.google.gwt.core.shared.GWT.isClient(); }
/** * Determines whether or not the running program is script or bytecode. */ public static boolean isScript() { return com.google.gwt.core.shared.GWT.isScript(); }
/** * Returns <code>true</code> when running in production mode. Returns * <code>false</code> when running either in development mode, or when running * in a plain JVM. */ public static boolean isProdMode() { return com.google.gwt.core.shared.GWT.isProdMode(); }
/** * Instantiates a class via deferred binding. * * <p> * The argument to {@link #create(Class)} <i>must</i> be a class literal * because the Production Mode compiler must be able to statically determine * the requested type at compile-time. This can be tricky because using a * {@link Class} variable may appear to work correctly in Development Mode. * </p> * * @param classLiteral a class literal specifying the base class to be * instantiated * @return the new instance, which must be cast to the requested class */ public static <T> T create(Class<?> classLiteral) { /* * In Production Mode, the compiler directly replaces calls to this method * with a new Object() type expression of the correct rebound type. */ return createImpl(classLiteral); }
/** * Return the built DOM as an {@link Element}. * * @return the {@link Element} that was built */ public Element finish() { if (!GWT.isClient()) { throw new RuntimeException("asElement() can only be called from GWT client code."); } if (asElementCalled) { throw new IllegalStateException("asElement() can only be called once."); } asElementCalled = true; // End all open tags. endAllTags(); return doFinishImpl(); }
public final String getSerializationSignature(Class<?> clazz) { assert clazz != null : "clazz"; if (GWT.isScript()) { return signatureMapNative.get(clazz.hashCode()); } else { return signatureMapJava.get(clazz.getName()); } }
/** * Returns <code>true</code> when running in production mode. Returns * <code>false</code> when running either in development mode, or when running * in a plain JVM. */ public static boolean isProdMode() { return com.google.gwt.core.shared.GWT.isProdMode(); }
/** * Instantiates a class via deferred binding. * * <p> * The argument to {@link #create(Class)} <i>must</i> be a class literal * because the Production Mode compiler must be able to statically determine * the requested type at compile-time. This can be tricky because using a * {@link Class} variable may appear to work correctly in Development Mode. * </p> * * @param classLiteral a class literal specifying the base class to be * instantiated * @return the new instance, which must be cast to the requested class */ public static <T> T create(Class<?> classLiteral) { /* * In Production Mode, the compiler directly replaces calls to this method * with a new Object() type expression of the correct rebound type. */ return com.google.gwt.core.shared.GWT.<T>createImpl(classLiteral); }
/** * Create a new PlaceHistoryHandler with a {@link DefaultHistorian}. The * DefaultHistorian is created via a call to GWT.create(), so an alternative * default implementation can be provided through <replace-with> rules * in a {@code gwt.xml} file. * * @param mapper a {@link PlaceHistoryMapper} instance */ public PlaceHistoryHandler(PlaceHistoryMapper mapper) { this(mapper, (Historian) GWT.create(DefaultHistorian.class)); }
/** * Logs a message to the development shell logger in Development Mode, or to * the console in Super Dev Mode. Calls are optimized out in Production Mode. */ public static void log(String message, Throwable e) { com.google.gwt.core.shared.GWT.log(message, e); }
/** * Get the instance of the {@link ElementBuilderFactory}. * * @return the {@link ElementBuilderFactory} */ public static ElementBuilderFactory get() { if (instance == null) { if (GWT.isClient()) { instance = GWT.create(ElementBuilderFactory.class); } else { // The DOM implementation will not work on the server. instance = HtmlBuilderFactory.get(); } } return instance; }
GWT.isClient() ? SerializabilityUtil.class.getClassLoader() : Thread.currentThread() .getContextClassLoader();
if (GWT.isScript()) { uri = URL.encode(uri);
/** * Returns <code>true</code> when running in production mode. Returns * <code>false</code> when running either in development mode, or when running * in a plain JVM. */ public static boolean isProdMode() { return com.google.gwt.core.shared.GWT.isProdMode(); }
/** * Instantiates a class via deferred binding. * * <p> * The argument to {@link #create(Class)} <i>must</i> be a class literal * because the Production Mode compiler must be able to statically determine * the requested type at compile-time. This can be tricky because using a * {@link Class} variable may appear to work correctly in Development Mode. * </p> * * @param classLiteral a class literal specifying the base class to be * instantiated * @return the new instance, which must be cast to the requested class */ public static <T> T create(Class<?> classLiteral) { /* * In Production Mode, the compiler directly replaces calls to this method * with a new Object() type expression of the correct rebound type. */ return createImpl(classLiteral); }
/** * Returns the default implementation of the AnimationScheduler API. */ public static AnimationScheduler get() { if (instance == null) { AnimationSupportDetector supportDetector = GWT.create(AnimationSupportDetector.class); instance = (supportDetector != null && supportDetector.isNativelySupported()) ? new AnimationSchedulerImplStandard() : new AnimationSchedulerImplTimer(); } return instance; }
/** * Logs a message to the development shell logger in Development Mode, or to * the console in Super Dev Mode. Calls are optimized out in Production Mode. */ public static void log(String message) { com.google.gwt.core.shared.GWT.log(message); }