protected function parseListing(IMetaModelDataDefinition $container, Contao2BackendViewDefinitionInterface $view)
{
$listing = $view->getListingConfig();
if ($listing->getRootLabel() === null) {
$listing->setRootLabel($this->getMetaModel()->get('name'));
}
if ($listing->getRootIcon() === null && ($inputScreen = $this->getInputScreenDetails()) !== null) {
$icon = ToolboxFile::convertValueToPath($inputScreen->getIcon());
// Determine image to use.
if ($icon && file_exists(TL_ROOT . '/' . $icon)) {
$event = new ResizeImageEvent($icon, 16, 16);
$this->serviceContainer->getEventDispatcher()->dispatch(ContaoEvents::IMAGE_RESIZE, $event);
$icon = $event->getResultImage();
} else {
$icon = 'system/modules/metamodels/assets/images/icons/metamodels.png';
}
$listing->setRootIcon($icon);
}
$this->parseListSorting($listing);
$this->parseListLabel($container, $listing);
if ($inputScreen = $this->getInputScreenDetails()) {
$listing->setShowColumns($inputScreen->isShowColumns());
$renderSetting = $this->serviceContainer->getService('metamodels-view-combinations')->getRenderSetting($container->getName());
$metaModel = $this->serviceContainer->getFactory()->getMetaModel($container->getName());
/** @var $renderSettingCollection \MetaModels\Render\Setting\Collection */
$renderSettingCollection = $this->serviceContainer->getRenderSettingFactory()->createCollection($metaModel, $renderSetting);
$listing->getLabelFormatter($container->getName())->setPropertyNames($renderSettingCollection->getSettingNames());
}
}