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

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

本文整理了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

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

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

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

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

  1. private static Impl impl() {
  2. if (impl == null) {
  3. if (GWT.isClient()) {
  4. impl = GWT.create(Impl.class);
  5. } else {
  6. impl = new ImplServer();
  7. }
  8. }
  9. return impl;
  10. }

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

  1. /**
  2. * Get the instance of the {@link ElementBuilderFactory}.
  3. *
  4. * @return the {@link ElementBuilderFactory}
  5. */
  6. public static ElementBuilderFactory get() {
  7. if (instance == null) {
  8. if (GWT.isClient()) {
  9. instance = GWT.create(ElementBuilderFactory.class);
  10. } else {
  11. // The DOM implementation will not work on the server.
  12. instance = HtmlBuilderFactory.get();
  13. }
  14. }
  15. return instance;
  16. }

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

  1. /**
  2. * Returns the default implementation of the AnimationScheduler API.
  3. */
  4. public static AnimationScheduler get() {
  5. if (instance == null) {
  6. AnimationSupportDetector supportDetector = GWT.create(AnimationSupportDetector.class);
  7. instance = (supportDetector != null && supportDetector.isNativelySupported())
  8. ? new AnimationSchedulerImplStandard() : new AnimationSchedulerImplTimer();
  9. }
  10. return instance;
  11. }

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

  1. public static WidgetParams get() {
  2. if (Util.instance == null) {
  3. Util.instance = GWT.create(WidgetParams.class);
  4. }
  5. return Util.instance;
  6. }
  7. }

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

  1. public static TranslationService getTranslationService() {
  2. if (translationService == null) {
  3. translationService = GWT.create(TranslationService.class);
  4. }
  5. return translationService;
  6. }

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

  1. public static TranslationService getTranslationService() {
  2. if (translationService == null) {
  3. translationService = GWT.create(TranslationService.class);
  4. }
  5. return translationService;
  6. }

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

  1. /**
  2. * get default resource, if not set, create one.
  3. *
  4. * @return default resource.
  5. */
  6. protected static Resources getExtendedResources() {
  7. if (extendedResource == null) { // NOPMD needn't be thread save on client side
  8. extendedResource = GWT.create(ExtendedResources.class);
  9. }
  10. return extendedResource;
  11. }
  12. }

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

  1. @Override
  2. public final AbstractGwtValidator createValidator() {
  3. return GWT.create(GwtValidator.class);
  4. }
  5. }

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

  1. /**
  2. * constructor.
  3. *
  4. * @param pview view of the login page
  5. * @param psession session data
  6. * @param ploginErrorMessage error message to show
  7. */
  8. public LoginCallback(final V pview, final Session psession, final M ploginErrorMessage) {
  9. this(pview, psession, ploginErrorMessage, GWT.create(HttpMessages.class));
  10. }

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

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

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

  1. public static GoogleAnalytics get(String account) {
  2. GoogleAnalytics ga = GoogleAnalytics.cache.get(account);
  3. if (ga == null) {
  4. ga = GWT.create(GoogleAnalytics.class);
  5. ga.initialize(account);
  6. }
  7. return ga;
  8. }

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

  1. @Override
  2. protected Widget createWidget() {
  3. VNavigationManager widget = GWT.create(VNavigationManager.class);
  4. widget.addAnimationListener(this);
  5. return widget;
  6. }

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

  1. @Override
  2. public InlineHTML createWidget() {
  3. InlineHTML inlineHTML = GWT.create(InlineHTML.class);
  4. inlineHTML.addClickHandler(this);
  5. inlineHTML.setStyleName("v-link");
  6. return inlineHTML;
  7. }

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

  1. @Override
  2. public Button createWidget() {
  3. Button b = GWT.create(Button.class);
  4. b.addClickHandler(this);
  5. b.setStylePrimaryName("v-nativebutton");
  6. return b;
  7. }

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

  1. @Override
  2. public VButton createWidget() {
  3. VButton b = GWT.create(VButton.class);
  4. b.addClickHandler(this);
  5. b.setStylePrimaryName("v-nativebutton");
  6. return b;
  7. }

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

  1. /**
  2. * Returns the default implementation of the AnimationScheduler API.
  3. */
  4. public static AnimationScheduler get() {
  5. if (instance == null) {
  6. AnimationSupportDetector supportDetector = GWT.create(AnimationSupportDetector.class);
  7. instance = (supportDetector != null && supportDetector.isNativelySupported())
  8. ? new AnimationSchedulerImplStandard() : new AnimationSchedulerImplTimer();
  9. }
  10. return instance;
  11. }

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

  1. public static CommonCss css()
  2. {
  3. if( bundle == null )
  4. {
  5. bundle = GWT.create( CssBundle.class );
  6. bundle.commonCss().ensureInjected();
  7. }
  8. return bundle.commonCss();
  9. }
  10. }

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

  1. @Override
  2. public void onModuleLoad() {
  3. StyleSheetUrlHolder stylesheetUrlHolder = GWT.create(StyleSheetUrlHolder.class);
  4. List<String> stylesheets = stylesheetUrlHolder.getStyleSheets();
  5. if (stylesheets.size() > 0) {
  6. CssUpdater cssUpdater = new CssUpdater(stylesheetUrlHolder.interval());
  7. for (String url : stylesheets) {
  8. cssUpdater.watchStyleSheet(url);
  9. }
  10. }
  11. }

相关文章