Package org.openhab.model.sitemap

Examples of org.openhab.model.sitemap.Selection


    snippet = StringUtils.replace(snippet, "%icon%", escapeURLPath(itemUIRegistry.getIcon(w)));
    snippet = StringUtils.replace(snippet, "%label_header%", getLabel(w));
   
    String state = itemUIRegistry.getState(w).toString();
    Selection selection = (Selection) w;
   
    StringBuilder rowSB = new StringBuilder();
    for(Mapping mapping : selection.getMappings()) {
      String rowSnippet = getSnippet("selection_row");
      rowSnippet = StringUtils.replace(rowSnippet, "%item%", w.getItem()!=null ? w.getItem() : "");
      rowSnippet = StringUtils.replace(rowSnippet, "%cmd%", mapping.getCmd()!=null ? mapping.getCmd() : "");
      rowSnippet = StringUtils.replace(rowSnippet, "%label%", mapping.getLabel()!=null ? mapping.getLabel() : "");
      if(state.equals(mapping.getCmd())) {
View Full Code Here


        mappingBean.label = mapping.getLabel();
        bean.mappings.add(mappingBean);
      }
    }
    if (widget instanceof Selection) {
      Selection selectionWidget = (Selection) widget;
      for (Mapping mapping : selectionWidget.getMappings()) {
        MappingBean mappingBean = new MappingBean();
        // Remove quotes - if they exist
        if(mapping.getCmd() != null) {
          if(mapping.getCmd().startsWith("\"") && mapping.getCmd().endsWith("\"")) {
            mappingBean.command = mapping.getCmd().substring(1, mapping.getCmd().length()-1);
View Full Code Here

TOP

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

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.