当前位置: 首页>>代码示例>>Java>>正文


Java GWT.isClient方法代码示例

本文整理汇总了Java中com.google.gwt.core.shared.GWT.isClient方法的典型用法代码示例。如果您正苦于以下问题:Java GWT.isClient方法的具体用法?Java GWT.isClient怎么用?Java GWT.isClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.core.shared.GWT的用法示例。


在下文中一共展示了GWT.isClient方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doValidation

import com.google.gwt.core.shared.GWT; //导入方法依赖的package包/类
@Override
public void doValidation(AssistedObject kvo, ValidationResult validationResult) {

    String val = new AssistedObjectChecker(kvo, kvo.getDescriptorName(), objectDesc)
        .getString(fieldName);
    if (val == null || "".equals(val))
        return;

    if (GWT.isClient()) {
        if (!val.matches(regExprJS)) {
            validationResult.addFieldError(fieldName, errorMsg);
        }
    } else {
        if (!val.matches(regExprJAVA)) {
            validationResult.addFieldError(fieldName, errorMsg);
        }
    }
}
 
开发者ID:inepex,项目名称:ineform,代码行数:19,代码来源:RegexprValidator.java

示例2: toJSON

import com.google.gwt.core.shared.GWT; //导入方法依赖的package包/类
public static String toJSON(PrimitivesJSO object) {
    if (GWT.isClient()) {
        return JSON.stringify(object);
    } else {
        Serializer serializer = new JreSerializer();
        return serializer.toJSON(object);
    }
}
 
开发者ID:codegen-io,项目名称:jso-builder,代码行数:9,代码来源:PrimitivesJSOJSOBuilder.java

示例3: toJSON

import com.google.gwt.core.shared.GWT; //导入方法依赖的package包/类
public static String toJSON(WithConflictingNames object) {
    if (GWT.isClient()) {
        return JSON.stringify(object);
    } else {
        Serializer serializer = new JreSerializer();
        return serializer.toJSON(object);
    }
}
 
开发者ID:codegen-io,项目名称:jso-builder,代码行数:9,代码来源:WithConflictingNamesJSOBuilder.java

示例4: toJSON

import com.google.gwt.core.shared.GWT; //导入方法依赖的package包/类
public static String toJSON(BasicJSO object) {
    if (GWT.isClient()) {
        return JSON.stringify(object);
    } else {
        Serializer serializer = new JreSerializer();
        return serializer.toJSON(object);
    }
}
 
开发者ID:codegen-io,项目名称:jso-builder,代码行数:9,代码来源:BasicJSOJSOBuilder.java

示例5: sync

import com.google.gwt.core.shared.GWT; //导入方法依赖的package包/类
public ViewOnBase sync() {
	// the 'if' below prevents throwing away inner viewOn's with a outer
	// state. Because, if sync is called fromout fluent when adding inside a
	// viewon, the attached dom is thrown away, which is not supposed to
	// happen then. (for parent!=null&&parent.elemnt!=null)
	//
	// However, it prevents testing against the virtual dom, so we leave it
	// on in pure java (!gwt.isClient()).
	if (!GWT.isClient() || (parent != null && parent.element != null)) {
		Renderer.syncChild(parent, this, view);
		isRendered(true);
	}
	return this;
}
 
开发者ID:nielsbaloe,项目名称:vertxui,代码行数:15,代码来源:ViewOnBase.java

示例6: record

import com.google.gwt.core.shared.GWT; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:10,代码来源:StatRecorder.java

示例7: recordRequest

import com.google.gwt.core.shared.GWT; //导入方法依赖的package包/类
/**
 * Records an http request call tree.
 */
void recordRequest(ExecutionNode node) {
  if (!GWT.isClient() && getSessionContext() != null && getSessionContext().isAuthenticated()) {
    getSessionStore().storeRequest(node);
  }
  globalStore.storeRequest(node);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:10,代码来源:StatRecorder.java

示例8: clearStatistics

import com.google.gwt.core.shared.GWT; //导入方法依赖的package包/类
/**
 * Clears the statistics.
 */
static public void clearStatistics() {
  if (GWT.isClient()) {
    statsRecorder.getGlobalStore().clear();
  } else {
    statsRecorder.getSessionStore().clear();
  }
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:11,代码来源:Timing.java

示例9: getOnlineIndicatorIfSupported

import com.google.gwt.core.shared.GWT; //导入方法依赖的package包/类
public static OnlineIndicator getOnlineIndicatorIfSupported()
{
  if ( null == g_cache )
  {
    if ( GWT.isClient() && Html5OnlineIndicator.isSupported() )
    {
      register( new Html5OnlineIndicator() );
    }
  }
  return g_cache;
}
 
开发者ID:realityforge,项目名称:gwt-online,代码行数:12,代码来源:OnlineIndicator.java

示例10: newWebSocketIfSupported

import com.google.gwt.core.shared.GWT; //导入方法依赖的package包/类
/**
 * Create a WebSocket if supported by the platform.
 *
 * This method will use the registered factory to create the WebSocket instance.
 *
 * @return a WebSocket instance, if supported by the platform, null otherwise.
 */
public static WebSocket newWebSocketIfSupported()
{
  if ( null == g_factory && GWT.isClient() && getSupportDetector().isSupported() )
  {
    register( getSupportDetector().newFactory() );
    return g_factory.newWebSocket();
  }
  return ( null != g_factory ) ? g_factory.newWebSocket() : null;
}
 
开发者ID:realityforge,项目名称:gwt-websockets,代码行数:17,代码来源:WebSocket.java

示例11: getFormat

import com.google.gwt.core.shared.GWT; //导入方法依赖的package包/类
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;
}
 
开发者ID:ltearno,项目名称:hexa.tools,代码行数:14,代码来源:NumberFormat.java

示例12: getFormat

import com.google.gwt.core.shared.GWT; //导入方法依赖的package包/类
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;
}
 
开发者ID:ltearno,项目名称:hexa.tools,代码行数:14,代码来源:DateTimeFormat.java

示例13: log

import com.google.gwt.core.shared.GWT; //导入方法依赖的package包/类
public static void log(Level logLevel, String message, Object caller, Throwable t) {

		String callerString = "static";
		if (caller != null){
			if(caller instanceof String)
				callerString = (String) caller;
			else
				callerString = caller.getClass().getName() + "@" + caller.hashCode();
		}

		boolean isGwtClient = false;
		try{
			isGwtClient = GWT.isClient();
		} catch(Throwable t1) {
			//in Java standalone calling GWT.* might trigger ClassNotFoundException
			//we don't care. we're not on the client side for sure.
		}

		String logString;
		if (isGwtClient) {
			logString = getCurrentTimeStamp() + " ; " + callerString + ": " + message;
			Window.setStatus("[" + logLevel + "] " + logString);
			logString = callerString + ": " + message;
//			speedTracerLog(logString);
		}
		else {
			logString = callerString + ": " + message;
		}

		// GWT.log(logString);
		logger.log(logLevel, logString, t);
		//Log.log(new LogRecord("gwt-log", logLevel, logString, t));

		// } else {
		// System.out.println("[" + logLevel + "] " + logString);
		// }
	}
 
开发者ID:fhcampuswien,项目名称:atom,代码行数:38,代码来源:AtomTools.java

示例14: getMessages

import com.google.gwt.core.shared.GWT; //导入方法依赖的package包/类
public static AtomMessages getMessages() {
	if (messages == null) {
		if (GWT.isClient())
			messages = GWT.create(AtomMessages.class);
		else {
			messages = LocaleFactory.get(AtomMessages.class);
		}
	}
	return messages;
}
 
开发者ID:fhcampuswien,项目名称:atom,代码行数:11,代码来源:AtomTools.java

示例15: getWebSocketUrl

import com.google.gwt.core.shared.GWT; //导入方法依赖的package包/类
private static String getWebSocketUrl() {
  if (GWT.isClient() && Location.getHost().contains(":8888")) {
    return "ws://localhost:" + WEB_SOCKET_PORT + "/QMAClone/websocket/";
  } else if (GWT.isClient() && Location.getHost().contains(":8080")) {
    return "ws://localhost:" + WEB_SOCKET_PORT + "/QMAClone/websocket/";
  } else {
    return "ws://kishibe.dyndns.tv/QMAClone/websocket/";
  }
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:10,代码来源:Constant.java


注:本文中的com.google.gwt.core.shared.GWT.isClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。