protected void applyPermissions(com.haulmont.cuba.gui.components.Component columnComponent) { if (columnComponent instanceof HasValueSource && columnComponent instanceof com.haulmont.cuba.gui.components.Component.Editable) { HasValueSource component = (HasValueSource) columnComponent; MetaPropertyPath propertyPath = ((EntityValueSource) component.getValueSource()).getMetaPropertyPath(); if (propertyPath != null) { com.haulmont.cuba.gui.components.Component.Editable editable = (com.haulmont.cuba.gui.components.Component.Editable) component; editable.setEditable(editable.isEditable() && security.isEntityAttrUpdatePermitted(propertyPath)); } } }
@SuppressWarnings("unchecked") protected void loadContainer(T component, Element element) { String containerId = element.attributeValue("dataContainer"); String property = element.attributeValue("property"); // In case a component has only a property, // we try to obtain `dataContainer` from a parent element. // For instance, a component is placed within the Form component if (Strings.isNullOrEmpty(containerId) && property != null) { containerId = getParentDataContainer(element); } if (!Strings.isNullOrEmpty(containerId)) { if (property == null) { throw new GuiDevelopmentException( String.format("Can't set container '%s' for component '%s' because 'property' " + "attribute is not defined", containerId, component.getId()), context.getFullFrameId()); } FrameOwner frameOwner = context.getFrame().getFrameOwner(); ScreenData screenData = UiControllerUtils.getScreenData(frameOwner); InstanceContainer container = screenData.getContainer(containerId); if (component instanceof HasValueSource) { ((HasValueSource) component).setValueSource(new ContainerValueSource<>(container, property)); } } }
&& ((HasValueSource) component).getValueSource() instanceof EntityValueSource && component instanceof Component.HasCaption && ((Component.HasCaption) component).getCaption() == null) { EntityValueSource valueSource = ((EntityValueSource) ((HasValueSource) component).getValueSource());
((HasValueSource) dynamicAttrComponent).setValueSource(provider.getValueSource(code));
ValueSource valueSource = ((HasValueSource) component).getValueSource(); if (!(valueSource instanceof EntityValueSource)) { return;