class ItemUIRegistryImpl implements ItemUIRegistry {

    @Override
    public @Nullable Widget getDefaultWidget(@Nullable Class<? extends Item> targetItemType, String itemName) {
        for (ItemUIProvider provider : itemUIProviders) {
            Widget widget = provider.getDefaultWidget(targetItemType, itemName);
            if (widget != null) {
                return widget;
            }
        }

        // do some reasonable default, if no provider had an answer
        // if the itemType is not defined, try to get it from the item name
        Class<? extends Item> itemType = targetItemType;
        if (itemType == null) {
            itemType = getItemType(itemName);
        }
        if (itemType == null) {
            return null;
        }

        if (GroupItem.class.equals(itemType)) {
            return SitemapFactory.eINSTANCE.createGroup();
        } else if (CallItem.class.equals(itemType) //
                || ContactItem.class.equals(itemType) //
                || DateTimeItem.class.equals(itemType)) {
            return SitemapFactory.eINSTANCE.createText();
        } else if (ColorItem.class.equals(itemType)) {
            return SitemapFactory.eINSTANCE.createColorpicker();
        } else if (DimmerItem.class.equals(itemType)) {
            Slider slider = SitemapFactory.eINSTANCE.createSlider();
            slider.setSwitchEnabled(true);
            return slider;
        } else if (ImageItem.class.equals(itemType)) {
            return SitemapFactory.eINSTANCE.createImage();
        } else if (LocationItem.class.equals(itemType)) {
            return SitemapFactory.eINSTANCE.createMapview();
        } else if (NumberItem.class.isAssignableFrom(itemType) //
                || StringItem.class.equals(itemType)) {
            boolean isReadOnly = isReadOnly(itemName);
            if (!isReadOnly && hasStateOptions(itemName)) {
                return SitemapFactory.eINSTANCE.createSelection();
            }
            int commandOptionsSize = getCommandOptionsSize(itemName);
            if (!isReadOnly && commandOptionsSize > 0) {
                return commandOptionsSize <= MAX_BUTTONS ? SitemapFactory.eINSTANCE.createSwitch()
                        : SitemapFactory.eINSTANCE.createSelection();
            } else {
                return SitemapFactory.eINSTANCE.createText();
            }
        } else if (PlayerItem.class.equals(itemType)) {
            return createPlayerButtons();
        } else if (RollershutterItem.class.equals(itemType) //
                || SwitchItem.class.equals(itemType)) {
            return SitemapFactory.eINSTANCE.createSwitch();
        }

        return null;
    }

    @Activate public  ItemUIRegistryImpl(@Reference ItemRegistry itemRegistry);

}