Examples of WidgetBean


Examples of org.apache.hadoop.chukwa.rest.bean.WidgetBean

  }
 
  public void testWidgetLoad() {
    client = Client.create();
    resource = client.resource("http://localhost:"+restPort);
    WidgetBean widget = resource.path("/hicc/v1/widget/wid/disk").header("Authorization", authorization).get(WidgetBean.class);
    try {
      assertEquals("disk", widget.getId());
    } catch (Exception e) {
      fail(ExceptionUtil.getStackTrace(e));
    }   
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.rest.bean.WidgetBean

          byte[] buffer = new byte[(int)size];
          widgetStream.readFully(buffer);
          widgetStream.close();
          try {
            JSONObject widgetBuffer = (JSONObject) JSONValue.parse(new String(buffer));
            WidgetBean widget = new WidgetBean(widgetBuffer);
            catalog.addCatalog(widget);
            list.put(widget.getId(),widget);
          } catch (Exception e) {
            log.error(ExceptionUtil.getStackTrace(e));
          }
        }
      }
View Full Code Here

Examples of org.apache.hadoop.chukwa.rest.bean.WidgetBean

          byte[] buffer = new byte[(int)size];
          widgetStream.readFully(buffer);
          widgetStream.close();
          try {
            JSONObject widgetBuffer = (JSONObject) JSONValue.parse(new String(buffer));
            WidgetBean widget = new WidgetBean(widgetBuffer);
            catalog.addCatalog(widget);
            list.put(widget.getId(),widget);
          } catch (Exception e) {
            log.error(ExceptionUtil.getStackTrace(e));
          }
        }
      }
View Full Code Here

Examples of org.apache.hadoop.chukwa.rest.bean.WidgetBean

          FSDataInputStream widgetStream = fs.open(fstatus[i].getPath());
          byte[] buffer = new byte[(int)size];
          widgetStream.readFully(buffer);
          widgetStream.close();
          try {
            WidgetBean widget = new WidgetBean(new JSONObject(new String(buffer)));
            catalog.addCatalog(widget);
            list.put(widget.getId(),widget);
          } catch (Exception e) {
            log.error(ExceptionUtil.getStackTrace(e));
          }
        }
      }
View Full Code Here

Examples of org.openhab.io.rest.internal.resources.beans.WidgetBean

      bean.link = UriBuilder.fromUri(uri).path(PATH_SITEMAPS).path(sitemapName).path(pageId).build().toASCIIString();
      if(children!=null) {
        int cntWidget = 0;
        for(Widget widget : children) {
          String widgetId = pageId + "_" + cntWidget;
          WidgetBean subWidget = createWidgetBean(sitemapName, widget, drillDown, uri, widgetId);
        if(subWidget != null)
          bean.widgets.add(subWidget);
          cntWidget++;
        }
      } else {
View Full Code Here

Examples of org.openhab.io.rest.internal.resources.beans.WidgetBean

    // Test visibility
    if(itemUIRegistry.getVisiblity(widget) == false)
      return null;

      WidgetBean bean = new WidgetBean();
      if(widget.getItem()!=null) {
        Item item = ItemResource.getItem(widget.getItem());
          if(item!=null) {
            bean.item = ItemResource.createItemBean(item, false, UriBuilder.fromUri(uri).build().toASCIIString());
          }
      }
      bean.widgetId = widgetId;
      bean.icon = itemUIRegistry.getIcon(widget);
    bean.labelcolor = itemUIRegistry.getLabelColor(widget);
    bean.valuecolor = itemUIRegistry.getValueColor(widget);
      bean.label = itemUIRegistry.getLabel(widget);
      bean.type = widget.eClass().getName();
      if (widget instanceof LinkableWidget) {
      LinkableWidget linkableWidget = (LinkableWidget) widget;
      EList<Widget> children = itemUIRegistry.getChildren(linkableWidget);
        if(widget instanceof Frame) {
          int cntWidget=0;
          for(Widget child : children) {
            widgetId += "_" + cntWidget;
          WidgetBean subWidget = createWidgetBean(sitemapName, child, drillDown, uri, widgetId);
          if(subWidget != null) {
            bean.widgets.add(subWidget);
              cntWidget++;
          }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.