@Nonnull public static Window getWindowNN(Component.BelongToFrame component) { Window window = getWindow(component); if (window == null) { throw new IllegalStateException("Unable to find window for component " + (component.getId() != null ? component.getId() : component.getClass())); } return window; }
@Override public void onClick(EntityLinkField field) { Window frame = ComponentsHelper.getWindow(field); if (frame == null) { throw new IllegalStateException("Please specify Frame for EntityLinkField");
/** * Apply UI permissions to a frame. * * @param container frame */ public void applyUiPermissions(Frame container) { Window window = container instanceof Window ? (Window) container : ComponentsHelper.getWindow(container); if (window == null) { log.warn(String.format("Unable to find window for container %s with id '%s'", container.getClass(), container.getId())); return; } UserSession userSession = sessionSource.getUserSession(); String screenId = window.getId(); Map<String, Integer> uiPermissions = userSession.getPermissionsByType(PermissionType.UI); for (Map.Entry<String, Integer> permissionEntry : uiPermissions.entrySet()) { String target = permissionEntry.getKey(); String targetComponentId = getTargetComponentId(target, screenId); if (targetComponentId != null) { if (targetComponentId.contains("[")) { applyCompositeComponentPermission(window, screenId, permissionEntry.getValue(), targetComponentId); } else if (targetComponentId.contains(">")) { applyComponentActionPermission(window, screenId, permissionEntry.getValue(), targetComponentId); } else { applyComponentPermission(window, screenId, permissionEntry.getValue(), targetComponentId); } } } }
Window window = ComponentsHelper.getWindow(WebAccordion.this); if (window != null) { if (window.getFrameOwner() instanceof LegacyFrame) {
Window window = ComponentsHelper.getWindow(WebTabSheet.this); if (window != null) { if (window.getFrameOwner() instanceof LegacyFrame) {
Window window = ComponentsHelper.getWindow(table); if (window == null) { throw new IllegalStateException("Please specify Frame for Table");
protected void createColumns(com.vaadin.v7.data.Container ds) { @SuppressWarnings("unchecked") Collection<MetaPropertyPath> properties = (Collection<MetaPropertyPath>) ds.getContainerPropertyIds(); Window window = ComponentsHelper.getWindow(this); boolean isLookup = window != null && window.getFrameOwner() instanceof LookupScreen; for (MetaPropertyPath propertyPath : properties) { Table.Column column = columns.get(propertyPath); if (column != null && !(editable && column.isEditable())) { String isLink = column.getXmlDescriptor() == null ? null : column.getXmlDescriptor().attributeValue("link"); if (propertyPath.getRange().isClass()) { if (!isLookup && StringUtils.isNotEmpty(isLink)) { setClickListener(propertyPath.toString(), new LinkCellClickListener(this, applicationContext)); } } else if (propertyPath.getRange().isDatatype()) { if (!isLookup && !StringUtils.isEmpty(isLink)) { setClickListener(propertyPath.toString(), new LinkCellClickListener(this, applicationContext)); } else { if (column.getMaxTextLength() != null) { addGeneratedColumnInternal(propertyPath, new AbbreviatedColumnGenerator(column, dynamicAttributesTools)); setClickListener(propertyPath.toString(), new AbbreviatedCellClickListener(this, dynamicAttributesTools)); } } } else if (!propertyPath.getRange().isEnum()) { throw new UnsupportedOperationException(); } } } }
contentComponent.setDescription(null); Window window = ComponentsHelper.getWindow(WebTabSheet.this); if (window != null) { Settings settings = UiControllerUtils.getSettings(window.getFrameOwner());
contentComponent.setDescription(null); Window window = ComponentsHelper.getWindow(WebAccordion.this); if (window != null) { Settings settings = UiControllerUtils.getSettings(window.getFrameOwner());
removeFilterEntity(); Window window = ComponentsHelper.getWindow(filter); windowManager.close(window); } else {
Window window = ComponentsHelper.getWindow(pickerField); if (window == null) { LoggerFactory.getLogger(PickerField.class).warn("Please specify Frame for PickerField");
@Override public void init(final Map<String, Object> params) { DialogOptions dialogOptions = ComponentsHelper.getWindow(this).getDialogOptions(); if (dialogOptions != null) { dialogOptions.setResizable(true);
Window window = ComponentsHelper.getWindow(ProcActionsFrame.this); final Window.Editor editor; if (window instanceof Window.Editor) {
Window window = ComponentsHelper.getWindow(this); if (window == null) { throw new IllegalStateException("Please specify Frame for EntityLinkField");
Window window = ComponentsHelper.getWindow(pickerField); if (window == null) { throw new IllegalStateException("Please specify Frame for EntityLinkField");