com.google.gwt.core.shared.GWT.create()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(134)

本文整理了Java中com.google.gwt.core.shared.GWT.create()方法的一些代码示例,展示了GWT.create()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GWT.create()方法的具体详情如下:
包路径:com.google.gwt.core.shared.GWT
类名称:GWT
方法名:create

GWT.create介绍

[英]Instantiates a class via deferred binding.

The argument to #create(Class) must be a class literal because the Production Mode compiler must be able to statically determine the requested type at compile-time. This can be tricky because using a Class variable may appear to work correctly in Development Mode.
[中]通过延迟绑定实例化类。
#create(Class)的参数必须是类文字,因为生产模式编译器必须能够在编译时静态确定请求的类型。这可能很棘手,因为在开发模式下使用类变量似乎可以正常工作。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Create a new PlaceController with a {@link DefaultDelegate}. The
 * DefaultDelegate is created via a call to GWT.create(), so an alternative
 * default implementation can be provided through <replace-with> rules
 * in a {@code .gwt.xml} file.
 * 
 * @param eventBus the {@link EventBus}
 */
public PlaceController(EventBus eventBus) {
 this(eventBus, (Delegate) GWT.create(DefaultDelegate.class));
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Create a new PlaceHistoryHandler with a {@link DefaultHistorian}. The
 * DefaultHistorian is created via a call to GWT.create(), so an alternative
 * default implementation can be provided through <replace-with> rules
 * in a {@code gwt.xml} file.
 * 
 * @param mapper a {@link PlaceHistoryMapper} instance
 */
public PlaceHistoryHandler(PlaceHistoryMapper mapper) {
 this(mapper, (Historian) GWT.create(DefaultHistorian.class));
}

代码示例来源: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

/**
 * 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

/**
 * Returns the default implementation of the AnimationScheduler API.
 */
public static AnimationScheduler get() {
 if (instance == null) {
  AnimationSupportDetector supportDetector = GWT.create(AnimationSupportDetector.class);
  instance = (supportDetector != null && supportDetector.isNativelySupported())
      ? new AnimationSchedulerImplStandard() : new AnimationSchedulerImplTimer();
 }
 return instance;
}

代码示例来源:origin: fr.putnami.pwt/pwt

public static WidgetParams get() {
    if (Util.instance == null) {
      Util.instance = GWT.create(WidgetParams.class);
    }
    return Util.instance;
  }
}

代码示例来源:origin: org.jboss.errai/errai-ui

public static TranslationService getTranslationService() {
 if (translationService == null) {
  translationService = GWT.create(TranslationService.class);
 }
 return translationService;
}

代码示例来源:origin: errai/errai

public static TranslationService getTranslationService() {
 if (translationService == null) {
  translationService = GWT.create(TranslationService.class);
 }
 return translationService;
}

代码示例来源:origin: ManfredTremmel/gwt-bean-validators

/**
  * get default resource, if not set, create one.
  *
  * @return default resource.
  */
 protected static Resources getExtendedResources() {
  if (extendedResource == null) { // NOPMD needn't be thread save on client side
   extendedResource = GWT.create(ExtendedResources.class);
  }
  return extendedResource;
 }
}

代码示例来源:origin: ManfredTremmel/gwt-bean-validators

@Override
 public final AbstractGwtValidator createValidator() {
  return GWT.create(GwtValidator.class);
 }
}

代码示例来源:origin: de.knightsoft-net/gwtp-spring-integration-client

/**
 * constructor.
 *
 * @param pview view of the login page
 * @param psession session data
 * @param ploginErrorMessage error message to show
 */
public LoginCallback(final V pview, final Session psession, final M ploginErrorMessage) {
 this(pview, psession, ploginErrorMessage, GWT.create(HttpMessages.class));
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Create a new PlaceController with a {@link DefaultDelegate}. The
 * DefaultDelegate is created via a call to GWT.create(), so an alternative
 * default implementation can be provided through <replace-with> rules
 * in a {@code .gwt.xml} file.
 * 
 * @param eventBus the {@link EventBus}
 */
public PlaceController(EventBus eventBus) {
 this(eventBus, (Delegate) GWT.create(DefaultDelegate.class));
}

代码示例来源:origin: Putnami/putnami-web-toolkit

public static GoogleAnalytics get(String account) {
  GoogleAnalytics ga = GoogleAnalytics.cache.get(account);
  if (ga == null) {
    ga = GWT.create(GoogleAnalytics.class);
    ga.initialize(account);
  }
  return ga;
}

代码示例来源:origin: com.vaadin.addon/vaadin-touchkit-agpl

@Override
protected Widget createWidget() {
  VNavigationManager widget = GWT.create(VNavigationManager.class);
  widget.addAnimationListener(this);
  return widget;
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

@Override
public InlineHTML createWidget() {
  InlineHTML inlineHTML = GWT.create(InlineHTML.class);
  inlineHTML.addClickHandler(this);
  inlineHTML.setStyleName("v-link");
  return inlineHTML;
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

@Override
public Button createWidget() {
  Button b = GWT.create(Button.class);
  b.addClickHandler(this);
  b.setStylePrimaryName("v-nativebutton");
  return b;
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

@Override
public VButton createWidget() {
  VButton b = GWT.create(VButton.class);
  b.addClickHandler(this);
  b.setStylePrimaryName("v-nativebutton");
  return b;
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * Returns the default implementation of the AnimationScheduler API.
 */
public static AnimationScheduler get() {
 if (instance == null) {
  AnimationSupportDetector supportDetector = GWT.create(AnimationSupportDetector.class);
  instance = (supportDetector != null && supportDetector.isNativelySupported())
      ? new AnimationSchedulerImplStandard() : new AnimationSchedulerImplTimer();
 }
 return instance;
}

代码示例来源:origin: fr.lteconsulting/hexa.core

public static CommonCss css()
  {
    if( bundle == null )
    {
      bundle = GWT.create( CssBundle.class );
      bundle.commonCss().ensureInjected();
    }

    return bundle.commonCss();
  }
}

代码示例来源:origin: com.googlecode.mgwt/mgwt

@Override
public void onModuleLoad() {
 StyleSheetUrlHolder stylesheetUrlHolder = GWT.create(StyleSheetUrlHolder.class);
 List<String> stylesheets = stylesheetUrlHolder.getStyleSheets();
 if (stylesheets.size() > 0) {
  CssUpdater cssUpdater = new CssUpdater(stylesheetUrlHolder.interval());
  for (String url : stylesheets) {
   cssUpdater.watchStyleSheet(url);
  }
 }
}

相关文章