Package org.openhab.model.sitemap

Examples of org.openhab.model.sitemap.Slider


 
  /**
   * {@inheritDoc}
   */
  public EList<Widget> renderWidget(Widget w, StringBuilder sb) throws RenderException {
    Slider s = (Slider) w;
   
    String snippetName = "slider";

    String snippet = getSnippet(snippetName);

    // set the default send-update frequency to 200ms 
    String frequency = s.getFrequency()==0 ? "200" : Integer.toString(s.getFrequency());

    snippet = StringUtils.replace(snippet, "%id%", itemUIRegistry.getWidgetId(s));
    snippet = StringUtils.replace(snippet, "%icon%", escapeURLPath(itemUIRegistry.getIcon(s)));
    snippet = StringUtils.replace(snippet, "%item%", w.getItem());
    snippet = StringUtils.replace(snippet, "%label%", getLabel(s));
    snippet = StringUtils.replace(snippet, "%state%", itemUIRegistry.getState(s).toString());
    snippet = StringUtils.replace(snippet, "%frequency%", frequency);
    snippet = StringUtils.replace(snippet, "%switch%", s.isSwitchEnabled() ? "1" : "0");
    snippet = StringUtils.replace(snippet, "%servletname%", WebAppServlet.SERVLET_NAME);

    // Process the color tags
    snippet = processColor(w, snippet);

View Full Code Here


          mappingBean.label = mapping.getLabel();
          bean.mappings.add(mappingBean);
        }
      }
      if(widget instanceof Slider) {
        Slider sliderWidget = (Slider) widget;
        bean.sendFrequency = sliderWidget.getFrequency();
        bean.switchSupport = sliderWidget.isSwitchEnabled();
      }
      if(widget instanceof List) {
        List listWidget = (List) widget;
        bean.separator = listWidget.getSeparator();
      }
View Full Code Here

    }
    if (itemType.equals(StringItem.class)) {
      return SitemapFactory.eINSTANCE.createText();
    }
    if (itemType.equals(DimmerItem.class)) {
      Slider slider = SitemapFactory.eINSTANCE.createSlider();
      slider.setSwitchEnabled(true);
      return slider;
    }
    if (itemType.equals(ColorItem.class)) {
      return SitemapFactory.eINSTANCE.createColorpicker();
    }
View Full Code Here

TOP

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

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.