Search in sources :

Example 1 with Default

use of org.eclipse.smarthome.model.sitemap.Default in project smarthome by eclipse.

the class ItemUIRegistryImpl method resolveDefault.

private Widget resolveDefault(Widget widget) {
    if (!(widget instanceof Default)) {
        return widget;
    } else {
        String itemName = widget.getItem();
        if (itemName != null) {
            Item item = itemRegistry.get(itemName);
            if (item != null) {
                Widget defaultWidget = getDefaultWidget(item.getClass(), item.getName());
                if (defaultWidget != null) {
                    copyProperties(widget, defaultWidget);
                    defaultWidgets.put(defaultWidget, widget);
                    return defaultWidget;
                }
            }
        }
        return null;
    }
}
Also used : NumberItem(org.eclipse.smarthome.core.library.items.NumberItem) CallItem(org.eclipse.smarthome.core.library.items.CallItem) SwitchItem(org.eclipse.smarthome.core.library.items.SwitchItem) DateTimeItem(org.eclipse.smarthome.core.library.items.DateTimeItem) RollershutterItem(org.eclipse.smarthome.core.library.items.RollershutterItem) GroupItem(org.eclipse.smarthome.core.items.GroupItem) ColorItem(org.eclipse.smarthome.core.library.items.ColorItem) LocationItem(org.eclipse.smarthome.core.library.items.LocationItem) ContactItem(org.eclipse.smarthome.core.library.items.ContactItem) GenericItem(org.eclipse.smarthome.core.items.GenericItem) Item(org.eclipse.smarthome.core.items.Item) StringItem(org.eclipse.smarthome.core.library.items.StringItem) PlayerItem(org.eclipse.smarthome.core.library.items.PlayerItem) ImageItem(org.eclipse.smarthome.core.library.items.ImageItem) DimmerItem(org.eclipse.smarthome.core.library.items.DimmerItem) Widget(org.eclipse.smarthome.model.sitemap.Widget) LinkableWidget(org.eclipse.smarthome.model.sitemap.LinkableWidget) Default(org.eclipse.smarthome.model.sitemap.Default)

Aggregations

GenericItem (org.eclipse.smarthome.core.items.GenericItem)1 GroupItem (org.eclipse.smarthome.core.items.GroupItem)1 Item (org.eclipse.smarthome.core.items.Item)1 CallItem (org.eclipse.smarthome.core.library.items.CallItem)1 ColorItem (org.eclipse.smarthome.core.library.items.ColorItem)1 ContactItem (org.eclipse.smarthome.core.library.items.ContactItem)1 DateTimeItem (org.eclipse.smarthome.core.library.items.DateTimeItem)1 DimmerItem (org.eclipse.smarthome.core.library.items.DimmerItem)1 ImageItem (org.eclipse.smarthome.core.library.items.ImageItem)1 LocationItem (org.eclipse.smarthome.core.library.items.LocationItem)1 NumberItem (org.eclipse.smarthome.core.library.items.NumberItem)1 PlayerItem (org.eclipse.smarthome.core.library.items.PlayerItem)1 RollershutterItem (org.eclipse.smarthome.core.library.items.RollershutterItem)1 StringItem (org.eclipse.smarthome.core.library.items.StringItem)1 SwitchItem (org.eclipse.smarthome.core.library.items.SwitchItem)1 Default (org.eclipse.smarthome.model.sitemap.Default)1 LinkableWidget (org.eclipse.smarthome.model.sitemap.LinkableWidget)1 Widget (org.eclipse.smarthome.model.sitemap.Widget)1