Search in sources :

Example 11 with Sitemap

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

the class SitemapResource method blockUnlessChangeOccurs.

private boolean blockUnlessChangeOccurs(String sitemapname, String pageId) {
    boolean timeout = false;
    Sitemap sitemap = getSitemap(sitemapname);
    if (sitemap != null) {
        if (pageId.equals(sitemap.getName())) {
            EList<Widget> children = itemUIRegistry.getChildren(sitemap);
            timeout = waitForChanges(children);
        } else {
            Widget pageWidget = itemUIRegistry.getWidget(sitemap, pageId);
            if (pageWidget instanceof LinkableWidget) {
                EList<Widget> children = itemUIRegistry.getChildren((LinkableWidget) pageWidget);
                timeout = waitForChanges(children);
            }
        }
    }
    return timeout;
}
Also used : LinkableWidget(org.eclipse.smarthome.model.sitemap.LinkableWidget) Sitemap(org.eclipse.smarthome.model.sitemap.Sitemap) Widget(org.eclipse.smarthome.model.sitemap.Widget) LinkableWidget(org.eclipse.smarthome.model.sitemap.LinkableWidget)

Aggregations

Sitemap (org.eclipse.smarthome.model.sitemap.Sitemap)11 Widget (org.eclipse.smarthome.model.sitemap.Widget)9 LinkableWidget (org.eclipse.smarthome.model.sitemap.LinkableWidget)6 SitemapProvider (org.eclipse.smarthome.model.sitemap.SitemapProvider)3 ServletException (javax.servlet.ServletException)2 BasicEList (org.eclipse.emf.common.util.BasicEList)2 EList (org.eclipse.emf.common.util.EList)2 EObject (org.eclipse.emf.ecore.EObject)2 Frame (org.eclipse.smarthome.model.sitemap.Frame)2 URI (java.net.URI)1 LinkedList (java.util.LinkedList)1 WebApplicationException (javax.ws.rs.WebApplicationException)1 ItemNotFoundException (org.eclipse.smarthome.core.items.ItemNotFoundException)1 StringType (org.eclipse.smarthome.core.library.types.StringType)1 State (org.eclipse.smarthome.core.types.State)1 Image (org.eclipse.smarthome.model.sitemap.Image)1 Video (org.eclipse.smarthome.model.sitemap.Video)1 RenderException (org.eclipse.smarthome.ui.basic.render.RenderException)1 RenderException (org.eclipse.smarthome.ui.classic.render.RenderException)1 Test (org.junit.Test)1