com.vaadin.ui.UI.getExtensions()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(133)

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

UI.getExtensions介绍

暂无

代码示例

代码示例来源:origin: com.haulmont.charts/charts-web-widgets

public static CubaAmchartsResponsiveIntegration get(UI ui) {
  CubaAmchartsResponsiveIntegration optioner = null;
  // Search singleton optioner
  for (Extension extension : ui.getExtensions()) {
    if (extension instanceof CubaAmchartsResponsiveIntegration) {
      optioner = (CubaAmchartsResponsiveIntegration) extension;
      break;
    }
  }
  // Create new optioner if not found
  if (optioner == null) {
    optioner = new CubaAmchartsResponsiveIntegration();
    optioner.extend(ui);
  }
  return optioner;
}

代码示例来源:origin: com.haulmont.charts/charts-web-widgets

public static CubaAmchartsIntegration get(UI ui) {
  CubaAmchartsIntegration optioner = null;
  // Search singleton optioner
  for (Extension extension : ui.getExtensions()) {
    if (extension instanceof CubaAmchartsIntegration) {
      optioner = (CubaAmchartsIntegration) extension;
      break;
    }
  }
  // Create new optioner if not found
  if (optioner == null) {
    optioner = new CubaAmchartsIntegration();
    optioner.extend(ui);
  }
  return optioner;
}

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

public static CubaImageObjectFitPolyfillExtension get(UI ui) {
    CubaImageObjectFitPolyfillExtension extension = null;

    // Search singleton extension
    for (Extension uiExtension : ui.getExtensions()) {
      if (uiExtension instanceof CubaImageObjectFitPolyfillExtension) {
        extension = (CubaImageObjectFitPolyfillExtension) uiExtension;
        break;
      }
    }

    // Create new extension if not found
    if (extension == null) {
      extension = new CubaImageObjectFitPolyfillExtension();
      extension.extend(ui);
    }

    return extension;
  }
}

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

/**
 * Returns a local storage proxy bound to the given UI.
 * 
 * @param ui
 *            the UI to bind to.
 * @return A LocalStorage extension bound to the given UI. If an extension
 *         is not yet applied, a new one is created and applied to the UI.
 */
public static LocalStorage get(UI ui) {
  if (ui == null) {
    throw new IllegalArgumentException("A UI must be provided");
  }
  LocalStorage locator = null;
  // Do we already have an extension attached?
  for (Extension e : ui.getExtensions()) {
    if (e instanceof LocalStorage) {
      locator = (LocalStorage) e;
    }
  }
  // Attach if none found.
  if (locator == null) {
    locator = new LocalStorage();
    locator.extend(UI.getCurrent());
  }
  return locator;
}

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

/**
 * Detects the current geographic location of the client. The detection
 * happens asynchronously and the position is reported to the callback given
 * in the callback argument. Note that this only checks the position once,
 * you need to call this method multiple times if you want to update the
 * location as the client moves.
 * 
 * @param callback
 *            The {@link PositionCallback} instance that is called when the
 *            position is available.
 */
public static void detect(PositionCallback callback) {
  Geolocator locator = null;
  // Do we already have a Geolocator attached?
  for (Extension e : UI.getCurrent().getExtensions()) {
    if (e instanceof Geolocator) {
      locator = (Geolocator) e;
    }
  }
  // Attach a Geolocator if none found.
  if (locator == null) {
    locator = new Geolocator();
    locator.extend(UI.getCurrent());
  }
  locator.detectCurrentPosition(callback);
}

相关文章