當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。