/** * @return true if the configuration contains a screen with provided ID */ public boolean hasWindow(String id) { return findWindowInfo(id) != null; }
/** * Get screen information by route. * * @param route route * @return screen's registration information or null if not found */ @Nullable public WindowInfo findWindowInfoByRoute(String route) { String screenId = routes.get(route); return screenId != null ? findWindowInfo(screenId) : null; }
/** * Get screen information by screen ID. * * @param id screen ID as set up in <code>screens.xml</code> * @return screen's registration information * @throws NoSuchScreenException if the screen with specified ID is not registered */ public WindowInfo getWindowInfo(String id) { WindowInfo windowInfo = findWindowInfo(id); if (windowInfo == null) { throw new NoSuchScreenException(id); } return windowInfo; }
@Nullable public WindowInfo getDefaultBrowseScreen(MetaClass metaClass) { WindowInfo browseWindow = windowConfig.findWindowInfo(windowConfig.getBrowseScreenId(metaClass)); if (browseWindow != null && userSessionSource.getUserSession().isScreenPermitted(browseWindow.getId())) { return browseWindow; } WindowInfo lookupWindow = windowConfig.findWindowInfo(windowConfig.getLookupScreenId(metaClass)); if (lookupWindow != null && userSessionSource.getUserSession().isScreenPermitted(lookupWindow.getId())) { return lookupWindow; } return null; }
public List<ScreenComponentDescriptor> getScreenComponents(String screenId) { String key = getScreenComponentsCacheKey(screenId, userSessionSource.getLocale()); List<ScreenComponentDescriptor> screenComponents = screenComponentsCache.get(key); if (screenComponents != null) { return screenComponents; } List<ScreenComponentDescriptor> components = new ArrayList<>(); WindowInfo windowInfo = windowConfig.findWindowInfo(screenId); if (windowInfo != null) { String template = windowInfo.getTemplate(); try { Element layoutElement = getRootLayoutElement(template); if (layoutElement != null) { findScreenComponents(components, null, layoutElement); } } catch (FileNotFoundException e) { log.error("Can't obtain screen's root layout: ", e); } } components = ImmutableList.copyOf(components); cacheScreenComponents(key, components); return components; }
if (getWindowConfig().findWindowInfo(screen) == null) { throw new GuiDevelopmentException("Screen for custom route in related entities not found", context.getFullFrameId(), "componentId", resultComponent.getId());
} else { screen = windowConfig.getBrowseScreenId(metaClass); if (windowConfig.findWindowInfo(screen) != null) { lookupAction.setLookupScreen(screen); lookupAction.setLookupScreenOpenType(OpenType.THIS_TAB);