com.haulmont.cuba.gui.config.WindowConfig类的使用及代码示例

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

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

WindowConfig介绍

[英]GenericUI class holding information about all registered in screens.xml screens.
[中]包含screens.xml屏幕中所有注册信息的GenericUI类。

代码示例

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

protected boolean navigationIsNotPermitted(WindowInfo windowInfo) {
  WindowInfo loginWindowInfo = windowConfig.getWindowInfo("loginWindow");
  WindowInfo mainWindowInfo = windowConfig.getWindowInfo("mainWindow");
  return loginWindowInfo.equals(windowInfo)
      || mainWindowInfo.equals(windowInfo);
}

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

public WindowInfo getEditorScreen(Entity entity) {
  MetaClass metaClass = entity.getMetaClass();
  MetaClass originalMetaClass = metadata.getExtendedEntities().getOriginalOrThisMetaClass(metaClass);
  WindowInfo windowInfo = primaryEditors.get(originalMetaClass.getJavaClass());
  if (windowInfo != null) {
    return windowInfo;
  }
  String editorScreenId = getEditorScreenId(metaClass);
  return getWindowInfo(editorScreenId);
}

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

protected Set<String> getAllWindowIds() {
    Collection<WindowInfo> windows = windowConfig.getWindows();
    return windows.stream()
        .map(WindowInfo::getId)
        .collect(Collectors.toSet());
  }
}

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

public String getAvailableLookupScreenId(MetaClass metaClass) {
  String id = getLookupScreenId(metaClass);
  if (!hasWindow(id)) {
    id = getBrowseScreenId(metaClass);
  }
  return id;
}

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

/**
 * Get available lookup screen by class of entity
 *
 * @param entityClass entity class
 * @return id of lookup screen
 * @throws NoSuchScreenException if the screen with specified ID is not registered
 */
public WindowInfo getLookupScreen(Class<? extends Entity> entityClass) {
  MetaClass metaClass = metadata.getSession().getClass(entityClass);
  MetaClass originalMetaClass = metadata.getExtendedEntities().getOriginalOrThisMetaClass(metaClass);
  WindowInfo windowInfo = primaryLookups.get(originalMetaClass.getJavaClass());
  if (windowInfo != null) {
    return windowInfo;
  }
  String lookupScreenId = getAvailableLookupScreenId(metaClass);
  return getWindowInfo(lookupScreenId);
}

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

@EventListener(AppContextInitializedEvent.class)
@Order(Events.HIGHEST_PLATFORM_PRECEDENCE + 300)
protected void init() {
  ClientConfig clientConfig = configuration.getConfig(ClientConfig.class);
  String property = clientConfig.getScreenIdsToSaveHistory();
  if (StringUtils.isNotBlank(property)) {
    screenIds.addAll(Arrays.asList(StringUtils.split(property, ',')));
  }
  for (MetaClass metaClass : metadata.getTools().getAllPersistentMetaClasses()) {
    Map<String, Object> attributes = metadata.getTools().getMetaAnnotationAttributes(metaClass.getAnnotations(),
        TrackEditScreenHistory.class);
    if (Boolean.TRUE.equals(attributes.get("value"))) {
      screenIds.add(windowConfig.getEditorScreenId(metaClass));
    }
  }
}

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

protected void init() {
  widgetTypeInfos = new ArrayList<>();
  try {
    for (WindowInfo windowInfo : windowConfig.getWindows()) {
      DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
      if (StringUtils.isNoneEmpty(windowInfo.getTemplate())) {
                if (ann != null) {
                  String editFrameId = ann.editFrameId();
                  if (StringUtils.isNotBlank(editFrameId) && !windowConfig.hasWindow(editFrameId)) {
                    throw new IllegalArgumentException(
                        String.format("Unable to find %s edit screen in screen config for widget %s",

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

editorScreenId = builder.getScreenId();
} else {
  editorScreenId = windowConfig.getEditorScreen(entity).getId();
WindowInfo windowInfo = windowConfig.getWindowInfo(editorScreenId);
ScreenOptions options = builder.getOptions();

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

protected void initOutputTypeList() {
  ArrayList<ReportOutputType> outputTypes = new ArrayList<>(Arrays.asList(ReportOutputType.values()));
  if (!windowConfig.hasWindow(ShowChartController.JSON_CHART_SCREEN_ID)) {
    outputTypes.remove(ReportOutputType.CHART);
  }
  if (!windowConfig.hasWindow(ShowPivotTableController.PIVOT_TABLE_SCREEN_ID)) {
    outputTypes.remove(ReportOutputType.PIVOT_TABLE);
  }
  outputType.setOptionsList(outputTypes);
}

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

throw new IllegalStateException("Please specify metaclass or property for PickerField");
  currentWindowAlias = windowConfig.getLookupScreenId(metaClass);
if (config.hasWindow(currentWindowAlias)) {
  ((LegacyFrame) lookupWindow).openLookup(
      currentWindowAlias,

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

"for the PickerField", "action ID", getId());
windowAlias = windowConfig.getAvailableLookupScreenId(metaClass);
  windowConfig.getWindowInfo(windowAlias),
  this::handleLookupWindowSelection,
  openType,

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

/**
 * @return  editor screen identifier
 */
public String getWindowId() {
  if (windowId != null) {
    return windowId;
  } else {
    MetaClass metaClass = target.getDatasource().getMetaClass();
    WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
    return windowConfig.getEditorScreenId(metaClass);
  }
}

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

protected Map<String, TemplateFileType> getAvailableTemplateFormats() {
  Messages messages = AppBeans.get(Messages.NAME);
  Map<String, TemplateFileType> result = new LinkedHashMap<>(4);
  result.put(messages.getMessage(TemplateFileType.XLSX), TemplateFileType.XLSX);
  result.put(messages.getMessage(TemplateFileType.DOCX), TemplateFileType.DOCX);
  result.put(messages.getMessage(TemplateFileType.HTML), TemplateFileType.HTML);
  result.put(messages.getMessage(TemplateFileType.CSV), TemplateFileType.CSV);
  WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
  if (windowConfig.hasWindow(ShowChartController.JSON_CHART_SCREEN_ID)) {
    result.put(messages.getMessage(TemplateFileType.CHART), TemplateFileType.CHART);
  }
  return result;
}

代码示例来源: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 WindowInfo getScreenInfo(Class<? extends Screen> screenClass) {
  UiController uiController = screenClass.getAnnotation(UiController.class);
  if (uiController == null) {
    throw new IllegalArgumentException("No @UiController annotation for class " + screenClass);
  }
  String screenId = UiDescriptorUtils.getInferredScreenId(uiController, screenClass);
  return windowConfig.getWindowInfo(screenId);
}

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

windowAlias = windowConfig.getEditorScreenId(entity.getMetaClass());
  windowConfig.getWindowInfo(windowAlias),
  entity,
  screenOpenType

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

protected List<String> getAllScreensIds() {
  return windowConfig.getWindows().stream()
      .map(WindowInfo::getId)
      .collect(Collectors.toList());
}

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

/**
 * @return  editor screen identifier
 */
public String getWindowId() {
  if (windowId != null) {
    return windowId;
  } else {
    MetaClass metaClass = target.getDatasource().getMetaClass();
    WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
    return windowConfig.getEditorScreenId(metaClass);
  }
}

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

if (!windowConfig.hasWindow(defaultScreenId)) {
  log.info("Can't find default screen: {}", defaultScreenId);
  return;

相关文章