@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; }
protected void loadOptionsContainer(TwinColumn component, Element element) { String containerId = element.attributeValue("optionsContainer"); if (containerId != null) { FrameOwner frameOwner = context.getFrame().getFrameOwner(); ScreenData screenData = UiControllerUtils.getScreenData(frameOwner); InstanceContainer container = screenData.getContainer(containerId); if (!(container instanceof CollectionContainer)) { throw new GuiDevelopmentException("Not a CollectionContainer: " + containerId, context.getCurrentFrameId()); } //noinspection unchecked component.setOptions(new ContainerOptions((CollectionContainer) container)); } } }
protected void loadOptionsContainer(TokenList component, Element element) { String containerId = element.attributeValue("optionsContainer"); if (containerId != null) { FrameOwner frameOwner = context.getFrame().getFrameOwner(); ScreenData screenData = UiControllerUtils.getScreenData(frameOwner); InstanceContainer container = screenData.getContainer(containerId); if (!(container instanceof CollectionContainer)) { throw new GuiDevelopmentException("Not a CollectionContainer: " + containerId, context.getCurrentFrameId()); } //noinspection unchecked component.setOptions(new ContainerOptions((CollectionContainer) container)); } } }
@SuppressWarnings("unchecked") @Override protected void loadContainer(T component, Element element) { super.loadContainer(component, element); String containerId = element.attributeValue("optionsContainer"); if (containerId != null) { FrameOwner frameOwner = context.getFrame().getFrameOwner(); ScreenData screenData = UiControllerUtils.getScreenData(frameOwner); InstanceContainer container = screenData.getContainer(containerId); if (!(container instanceof CollectionContainer)) { throw new GuiDevelopmentException("Not a CollectionContainer: " + containerId, context.getCurrentFrameId()); } component.setOptions(new ContainerOptions((CollectionContainer) container)); } } }
@SuppressWarnings("unchecked") @Override protected void loadContainer(LookupField component, Element element) { super.loadContainer(component, element); String containerId = element.attributeValue("optionsContainer"); if (containerId != null) { FrameOwner frameOwner = context.getFrame().getFrameOwner(); ScreenData screenData = UiControllerUtils.getScreenData(frameOwner); InstanceContainer container = screenData.getContainer(containerId); if (!(container instanceof CollectionContainer)) { throw new GuiDevelopmentException("Not a CollectionContainer: " + containerId, context.getCurrentFrameId()); } component.setOptions(new ContainerOptions((CollectionContainer) container)); } }