Package org.openhab.model.sitemap

Examples of org.openhab.model.sitemap.Webview


 
  /**
   * {@inheritDoc}
   */
  public EList<Widget> renderWidget(Widget w, StringBuilder sb) throws RenderException {
    Webview webview = (Webview) w;
    String snippet = getSnippet("webview");     

    int height = webview.getHeight();
    if(height==0) {
      height = 1;
    }
   
    snippet = StringUtils.replace(snippet, "%url%", webview.getUrl());
    snippet = StringUtils.replace(snippet, "%height%", Integer.toString(height*36));
   
    sb.append(snippet);
    return null;
  }
View Full Code Here


              bean.encoding = videoWidget.getEncoding();
            }
            bean.url = videoWidget.getUrl();
          }
          else {
        Webview webViewWidget = (Webview) widget;
        bean.height = webViewWidget.getHeight();
        bean.url = webViewWidget.getUrl();
          }

      String wId = itemUIRegistry.getWidgetId(widget);

      StringBuilder sbBaseUrl = new StringBuilder();
View Full Code Here

        uriString = baseUrl + image.getUrl();
      } else if(widget instanceof Video) {
        Video video = (Video) widget;
        uriString = baseUrl + video.getUrl();
      } else if(widget instanceof Webview) {
        Webview webview = (Webview) widget;
        uriString = baseUrl + webview.getUrl();
      } else {
        if(widget==null) {
          throw new ServletException("Widget '" + widgetId + "' could not be found!");
        } else {
          throw new ServletException("Widget type '" + widget.getClass().getName() + "' is not supported!");
View Full Code Here

TOP

Related Classes of org.openhab.model.sitemap.Webview

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.