本文整理匯總了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/";
}
}