use of com.haulmont.cuba.gui.model.CollectionContainer in project cuba by cuba-platform.
the class CalendarLoader method loadDataContainer.
@SuppressWarnings("unchecked")
protected void loadDataContainer(Calendar component, Element element) {
String containerId = element.attributeValue("dataContainer");
FrameOwner frameOwner = getComponentContext().getFrame().getFrameOwner();
ScreenData screenData = UiControllerUtils.getScreenData(frameOwner);
InstanceContainer container = screenData.getContainer(containerId);
if (!(container instanceof CollectionContainer)) {
throw new GuiDevelopmentException("Not a CollectionContainer: " + containerId, context);
}
component.setEventProvider(new ContainerCalendarEventProvider<>(((CollectionContainer) container)));
}
use of com.haulmont.cuba.gui.model.CollectionContainer in project cuba by cuba-platform.
the class AbstractComponentLoader method loadOptionsContainer.
protected Optional<CollectionContainer> loadOptionsContainer(Element element) {
String containerId = element.attributeValue("optionsContainer");
if (containerId != null) {
FrameOwner frameOwner = getComponentContext().getFrame().getFrameOwner();
ScreenData screenData = UiControllerUtils.getScreenData(frameOwner);
InstanceContainer container = screenData.getContainer(containerId);
if (!(container instanceof CollectionContainer)) {
throw new GuiDevelopmentException("Not a CollectionContainer: " + containerId, context);
}
return Optional.of((CollectionContainer) container);
}
return Optional.empty();
}
use of com.haulmont.cuba.gui.model.CollectionContainer in project cuba by cuba-platform.
the class WebTableFieldFactory method getOptions.
@SuppressWarnings("unchecked")
@Nullable
@Override
protected Options getOptions(EntityValueSource valueSource, String property) {
MetaClass metaClass = valueSource.getEntityMetaClass();
MetaPropertyPath metaPropertyPath = metadataTools.resolveMetaPropertyPath(metaClass, property);
Table.Column columnConf = webTable.getColumnsInternal().get(metaPropertyPath);
CollectionContainer collectionContainer = findOptionsContainer(columnConf);
if (collectionContainer != null) {
return new ContainerOptions(collectionContainer);
}
CollectionDatasource ds = findOptionsDatasource(columnConf, property);
if (ds != null) {
return new DatasourceOptions(ds);
}
return null;
}
Aggregations