本文整理了Java中com.google.gwt.core.shared.GWT.isClient()
方法的一些代码示例,展示了GWT.isClient()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GWT.isClient()
方法的具体详情如下:
包路径:com.google.gwt.core.shared.GWT
类名称:GWT
方法名:isClient
[英]Returns true
when running inside the normal GWT environment, either in Development Mode or Production 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.
[中]在开发模式或生产模式下,在正常GWT环境中运行时返回true
。如果此代码在普通JVM中运行,则返回false
。这可能发生在服务器上运行共享代码时,或者在GWTTestCase测试的引导序列期间。
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* 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();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
private static Impl impl() {
if (impl == null) {
if (GWT.isClient()) {
impl = GWT.create(Impl.class);
} else {
impl = new ImplServer();
}
}
return impl;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* 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();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* 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;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
GWT.isClient() ? SerializabilityUtil.class.getClassLoader() : Thread.currentThread()
.getContextClassLoader();
代码示例来源:origin: net.wetheinter/gwt-user
/**
* 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();
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* 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();
}
代码示例来源:origin: com.google.web.bindery/requestfactory-server
/**
* 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();
}
代码示例来源:origin: apache/incubator-wave
private String getModuleName() {
if (GWT.isClient()) {
return com.google.gwt.core.client.GWT.getModuleName();
}
return "";
}
}
代码示例来源:origin: bedatadriven/activityinfo
public ResourceLocatorAdaptor() {
if(!GWT.isClient()) {
throw new IllegalStateException("Can only be called in client code.");
}
this.client = new ActivityInfoClientAsyncImpl();
}
代码示例来源:origin: com.google.web.bindery/requestfactory-server
/**
* Returns {@code true} if {@code clazz} is assignable to any of the value
* types.
*/
static boolean canDecode(Class<?> clazz) {
assert !GWT.isClient();
for (Class<?> valueType : ValueCodex.getAllValueTypes()) {
if (valueType.isAssignableFrom(clazz)) {
return true;
}
}
return false;
}
}
代码示例来源:origin: fr.lteconsulting/hexa.core
public static DateTimeFormat getFormat( String pattern )
{
DateTimeFormat fmt = instances.get( pattern );
if( fmt == null )
{
if( GWT.isClient() )
fmt = new DateTimeFormatGWT( pattern );
else
fmt = new DateTimeFormatJRE( pattern );
}
return fmt;
}
代码示例来源:origin: fr.lteconsulting/hexa.core
public static NumberFormat getFormat( String pattern )
{
NumberFormat fmt = instances.get( pattern );
if( fmt == null )
{
if( GWT.isClient() )
fmt = new NumberFormatGWT( pattern );
else
fmt = new NumberFormatJRE( pattern );
}
return fmt;
}
代码示例来源:origin: ltearno/hexa.tools
public static DateTimeFormat getFormat( String pattern )
{
DateTimeFormat fmt = instances.get( pattern );
if( fmt == null )
{
if( GWT.isClient() )
fmt = new DateTimeFormatGWT( pattern );
else
fmt = new DateTimeFormatJRE( pattern );
}
return fmt;
}
代码示例来源:origin: ltearno/hexa.tools
public static NumberFormat getFormat( String pattern )
{
NumberFormat fmt = instances.get( pattern );
if( fmt == null )
{
if( GWT.isClient() )
fmt = new NumberFormatGWT( pattern );
else
fmt = new NumberFormatJRE( pattern );
}
return fmt;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
private static Impl impl() {
if (impl == null) {
if (GWT.isClient()) {
impl = GWT.create(Impl.class);
} else {
impl = new ImplServer();
}
}
return impl;
}
代码示例来源:origin: net.wetheinter/gwt-user
private static Impl impl() {
if (impl == null) {
if (GWT.isClient()) {
impl = GWT.create(Impl.class);
} else {
impl = new ImplServer();
}
}
return impl;
}
代码示例来源:origin: apache/incubator-wave
/**
* Clears the statistics.
*/
static public void clearStatistics() {
if (GWT.isClient()) {
statsRecorder.getGlobalStore().clear();
} else {
statsRecorder.getSessionStore().clear();
}
}
代码示例来源:origin: apache/incubator-wave
/**
* Records an http request call tree.
*/
void recordRequest(ExecutionNode node) {
if (!GWT.isClient() && getSessionContext() != null && getSessionContext().isAuthenticated()) {
getSessionStore().storeRequest(node);
}
globalStore.storeRequest(node);
}
代码示例来源:origin: apache/incubator-wave
/**
* Records a single incident of measure and duration in millis with threshold.
*/
void record(String name, String module, int duration, int threshold) {
if (!GWT.isClient() && getSessionContext() != null && getSessionContext().isAuthenticated()) {
getSessionStore().recordMeasurement(name, module, duration, threshold);
}
globalStore.recordMeasurement(name, module, duration, threshold);
}
内容来源于网络,如有侵权,请联系作者删除!