Package org.openhab.core.items

Examples of org.openhab.core.items.GroupItem


                    // if the group has a base item and thus might calculate its state
                    // as a DecimalType or other, we also consider it to be necessary to
                    // send an update to the client as the label of the item might have changed,
                    // even though its state is yet the same.
                    if(item instanceof GroupItem) {
                            GroupItem gItem = (GroupItem) item;
                            if(gItem.getBaseItem()!=null) {
                                    if(!broadcaster.getAtmosphereResources().isEmpty()) {
                                            broadcaster.broadcast(item);
                                    }
                            }
                    }
View Full Code Here


  }

  public static ItemBean createItemBean(Item item, boolean drillDown) {
    ItemBean bean;
    if (item instanceof GroupItem && drillDown) {
      GroupItem groupItem = (GroupItem) item;
      GroupItemBean groupBean = new GroupItemBean();
      Collection<ItemBean> members = new HashSet<ItemBean>();
      for (Item member : groupItem.getMembers()) {
        members.add(createItemBean(member, false));
      }
      groupBean.members = members.toArray(new ItemBean[members.size()]);
      bean = groupBean;
    } else {
View Full Code Here

    EList<Widget> children = new BasicEList<Widget>();
    String itemName = group.getItem();
    try {
      Item item = getItem(itemName);
      if(item instanceof GroupItem) {
        GroupItem groupItem = (GroupItem) item;
        for(Item member : groupItem.getMembers()) {
          Widget widget = getDefaultWidget(member.getClass(), member.getName());
          if(widget!=null) {
            widget.setItem(member.getName());
            children.add(widget);
          }         
View Full Code Here

  static public Map<Item, State> storeStates(Item... items) {
    Map<Item, State> statesMap = Maps.newHashMap();
    if (items != null) {
      for(Item item : items) {
        if (item instanceof GroupItem) {
          GroupItem groupItem = (GroupItem) item;
          for(Item member : groupItem.getAllMembers()) {
            statesMap.put(member, member.getState());
          }
        } else {
          statesMap.put(item, item.getState());
        }
View Full Code Here

TOP

Related Classes of org.openhab.core.items.GroupItem

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.