本文整理汇总了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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
// }
}
示例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;
}
示例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/";
}
}