com.haulmont.cuba.gui.config.WindowConfig.getLookupScreen()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(112)

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

WindowConfig.getLookupScreen介绍

[英]Get available lookup screen by class of entity
[中]按实体类别获取可用的查找屏幕

代码示例

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

/**
 * Open a lookup screen.
 *
 * @param entityClass required class of entity
 * @param handler     is invoked when selection confirmed and the lookup screen closes
 * @param openType    how to open the screen
 * @return created window
 *
 * @deprecated Use {@link ScreenBuilders} bean instead.
 */
@Deprecated
default AbstractLookup openLookup(Class<? extends Entity> entityClass, Window.Lookup.Handler handler,
                 WindowManager.OpenType openType) {
  WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
  WindowInfo lookupScreen = windowConfig.getLookupScreen(entityClass);
  return (AbstractLookup) getWindowManager().openLookup(lookupScreen, handler, openType);
}

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

/**
 * Open a lookup screen.
 *
 * @param entityClass required class of entity
 * @param handler     is invoked when selection confirmed and the lookup screen closes
 * @param openType    how to open the screen
 * @param params      parameters to pass to {@code init()} method of the screen's controller
 * @return created window
 *
 * @deprecated Use {@link ScreenBuilders} bean instead.
 */
@Deprecated
default AbstractLookup openLookup(Class<? extends Entity> entityClass, Window.Lookup.Handler handler,
                 WindowManager.OpenType openType, Map<String, Object> params) {
  WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
  WindowInfo lookupScreen = windowConfig.getLookupScreen(entityClass);
  return (AbstractLookup) getWindowManager().openLookup(lookupScreen, handler, openType, params);
}

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

protected String getLookupScreenInternal() {
  return StringUtils.isNotEmpty(getLookupScreen())
      ? getLookupScreen()
      : windowConfig.getLookupScreen(getLookupEntityClass()).getId();
}

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

protected <E extends Entity> Screen createScreen(LookupBuilder<E> builder, Screens screens) {
  Screen screen;
  if (builder instanceof LookupClassBuilder) {
    LookupClassBuilder lookupClassBuilder = (LookupClassBuilder) builder;
    @SuppressWarnings("unchecked")
    Class<? extends Screen> screenClass = lookupClassBuilder.getScreenClass();
    if (screenClass == null) {
      throw new IllegalArgumentException("Screen class is not set");
    }
    screen = screens.create(screenClass, builder.getLaunchMode(), builder.getOptions());
  } else {
    String lookupScreenId;
    if (builder.getScreenId() != null) {
      lookupScreenId = builder.getScreenId();
    } else {
      lookupScreenId = windowConfig.getLookupScreen(builder.getEntityClass()).getId();
    }
    if (lookupScreenId == null) {
      throw new IllegalArgumentException("Screen id is not set");
    }
    screen = screens.create(lookupScreenId, builder.getLaunchMode(), builder.getOptions());
  }
  return screen;
}

相关文章