protected RouteDefinition getRouteDef(Screen screen) { return screen == null ? null : getScreenContext(screen).getWindowInfo().getRouteDefinition(); }
protected int getScreenHashCode(Screen screen) { ScreenContext screenContext = UiControllerUtils.getScreenContext(screen); WindowInfo windowInfo = screenContext.getWindowInfo(); Map<String, Object> params = getFrame().getContext().getParams(); return windowInfo.hashCode() + (params != null ? params.hashCode() : 0); }
/** * @return true if screen can be opened multiple times from a navigation menu */ protected boolean isMultipleOpen() { WindowInfo windowInfo = UiControllerUtils.getScreenContext(this).getWindowInfo(); if (windowInfo.getDescriptor() != null) { String multipleOpenAttr = windowInfo.getDescriptor().attributeValue("multipleOpen"); if (multipleOpenAttr != null) { return Boolean.parseBoolean(multipleOpenAttr); } } MultipleOpen annotation = this.getClass().getAnnotation(MultipleOpen.class); if (annotation != null) { // default is false return annotation.value(); } return false; }
protected String getParentPrefix(Screen screen) { String parentPrefix = null; Route routeAnnotation = screen.getClass().getAnnotation(Route.class); if (routeAnnotation != null) { parentPrefix = routeAnnotation.parentPrefix(); } else { RouteDefinition routeDef = getScreenContext(screen) .getWindowInfo() .getRouteDefinition(); if (routeDef != null) { parentPrefix = routeDef.getParentPrefix(); } } return parentPrefix; }
/** * Adds a listener that reloads the selected record and sets it to editCt. */ protected void initBrowseItemChangeListener() { getBrowseContainer().addItemChangeListener(e -> { if (e.getItem() != null) { InstanceLoader<T> editLoader = getEditLoader(); DynamicAttributesGuiTools tools = getBeanLocator().get(DynamicAttributesGuiTools.NAME); String screenId = getScreenContext().getWindowInfo().getId(); if (tools.screenContainsDynamicAttributes(getEditContainer().getView(), screenId)) { editLoader.setLoadDynamicAttributes(true); } editLoader.setEntityId(e.getItem().getId()); editLoader.load(); } else { if (!editing) { getEditContainer().setItem(null); } } }); }
String screenId = getScreenContext().getWindowInfo().getId();
String screenId = getScreenContext().getWindowInfo().getId();