Examples of ResultCell


Examples of org.pentaho.reporting.engine.classic.core.modules.output.table.base.layout.model.ResultCell

    this.column = column;
  }

  protected void startParsing(final Attributes atts) throws SAXException
  {
    final ResultCell resultCell = new ResultCell();
    resultCell.setName(atts.getValue(getUri(), "content-idref"));

    final String attr = atts.getValue(getUri(), "background-color");
    resultCell.setBackgroundColor(ReportParserUtil.parseColor(attr, null));

    final String borderColorTopText = atts.getValue(getUri(), "border-top-color");
    final Color borderColorTop = ReportParserUtil.parseColor(borderColorTopText, null);
    final String borderColorLeftText = atts.getValue(getUri(), "border-left-color");
    final Color borderColorLeft = ReportParserUtil.parseColor(borderColorLeftText, null);
    final String borderColorBottomText = atts.getValue(getUri(), "border-bottom-color");
    final Color borderColorBottom = ReportParserUtil.parseColor(borderColorBottomText, null);
    final String borderColorRightText = atts.getValue(getUri(), "border-right-color");
    final Color borderColorRight = ReportParserUtil.parseColor(borderColorRightText, null);

    final String borderWidthTopText = atts.getValue(getUri(), "border-top-width");
    final Float borderWidthTop = ReportParserUtil.parseFloat(borderWidthTopText, getLocator());
    final String borderWidthLeftText = atts.getValue(getUri(), "border-left-width");
    final Float borderWidthLeft = ReportParserUtil.parseFloat(borderWidthLeftText, getLocator());
    final String borderWidthBottomText = atts.getValue(getUri(), "border-bottom-width");
    final Float borderWidthBottom = ReportParserUtil.parseFloat(borderWidthBottomText, getLocator());
    final String borderWidthRightText = atts.getValue(getUri(), "border-right-width");
    final Float borderWidthRight = ReportParserUtil.parseFloat(borderWidthRightText, getLocator());

    final String borderStyleTopText = atts.getValue(getUri(), "border-top-style");
    final BorderStyle borderStyleTop = parseBorderStyle(borderStyleTopText);
    final String borderStyleLeftText = atts.getValue(getUri(), "border-left-style");
    final BorderStyle borderStyleLeft = parseBorderStyle(borderStyleLeftText);
    final String borderStyleBottomText = atts.getValue(getUri(), "border-bottom-style");
    final BorderStyle borderStyleBottom = parseBorderStyle(borderStyleBottomText);
    final String borderStyleRightText = atts.getValue(getUri(), "border-right-style");
    final BorderStyle borderStyleRight = parseBorderStyle(borderStyleRightText);

    if (borderWidthTop != null)
    {
      resultCell.setTop(new BorderEdge(borderStyleTop, borderColorTop, StrictGeomUtility.toInternalValue(
          borderWidthTop.floatValue())));
    }
    if (borderWidthLeft != null)
    {
      resultCell.setLeft(new BorderEdge(borderStyleLeft, borderColorLeft, StrictGeomUtility.toInternalValue(
          borderWidthLeft.floatValue())));
    }
    if (borderWidthBottom != null)
    {
      resultCell.setBottom(new BorderEdge(borderStyleBottom, borderColorBottom, StrictGeomUtility.toInternalValue(
          borderWidthBottom.floatValue())));
    }
    if (borderWidthRight != null)
    {
      resultCell.setRight(new BorderEdge(borderStyleRight, borderColorRight, StrictGeomUtility.toInternalValue(
          borderWidthRight.floatValue())));
    }

    resultCell.setTopLeft(parseCornerRadius("border-top-left", atts));
    resultCell.setTopRight(parseCornerRadius("border-top-right", atts));
    resultCell.setBottomLeft(parseCornerRadius("border-bottom-left", atts));
    resultCell.setBottomRight(parseCornerRadius("border-bottom-right", atts));

    final int rowSpan = ParserUtil.parseInt(atts.getValue(getUri(), "rowspan"), 1);
    final int colSpan = ParserUtil.parseInt(atts.getValue(getUri(), "colspan"), 1);
    for (int r = row; r < row + rowSpan; r++)
    {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.testcases.table.model.ResultCell

    this.column = column;
  }

  protected void startParsing(final Attributes atts) throws SAXException
  {
    final ResultCell resultCell = new ResultCell();
    resultCell.setName(atts.getValue(getUri(), "content-idref"));

    final String attr = atts.getValue(getUri(), "background-color");
    resultCell.setBackgroundColor(ReportParserUtil.parseColor(attr, null));

    final String borderColorTopText = atts.getValue(getUri(), "border-top-color");
    final Color borderColorTop = ReportParserUtil.parseColor(borderColorTopText, null);
    final String borderColorLeftText = atts.getValue(getUri(), "border-left-color");
    final Color borderColorLeft = ReportParserUtil.parseColor(borderColorLeftText, null);
    final String borderColorBottomText = atts.getValue(getUri(), "border-bottom-color");
    final Color borderColorBottom = ReportParserUtil.parseColor(borderColorBottomText, null);
    final String borderColorRightText = atts.getValue(getUri(), "border-right-color");
    final Color borderColorRight = ReportParserUtil.parseColor(borderColorRightText, null);

    final String borderWidthTopText = atts.getValue(getUri(), "border-top-width");
    final Float borderWidthTop = ReportParserUtil.parseFloat(borderWidthTopText, getLocator());
    final String borderWidthLeftText = atts.getValue(getUri(), "border-left-width");
    final Float borderWidthLeft = ReportParserUtil.parseFloat(borderWidthLeftText, getLocator());
    final String borderWidthBottomText = atts.getValue(getUri(), "border-bottom-width");
    final Float borderWidthBottom = ReportParserUtil.parseFloat(borderWidthBottomText, getLocator());
    final String borderWidthRightText = atts.getValue(getUri(), "border-right-width");
    final Float borderWidthRight = ReportParserUtil.parseFloat(borderWidthRightText, getLocator());

    final String borderStyleTopText = atts.getValue(getUri(), "border-top-style");
    final BorderStyle borderStyleTop = parseBorderStyle(borderStyleTopText);
    final String borderStyleLeftText = atts.getValue(getUri(), "border-left-style");
    final BorderStyle borderStyleLeft = parseBorderStyle(borderStyleLeftText);
    final String borderStyleBottomText = atts.getValue(getUri(), "border-bottom-style");
    final BorderStyle borderStyleBottom = parseBorderStyle(borderStyleBottomText);
    final String borderStyleRightText = atts.getValue(getUri(), "border-right-style");
    final BorderStyle borderStyleRight = parseBorderStyle(borderStyleRightText);

    resultCell.setTop(new BorderEdge(borderStyleTop, borderColorTop, StrictGeomUtility.toInternalValue(borderWidthTop.floatValue())));
    resultCell.setLeft(new BorderEdge(borderStyleLeft, borderColorLeft, StrictGeomUtility.toInternalValue(borderWidthLeft.floatValue())));
    resultCell.setBottom(new BorderEdge(borderStyleBottom, borderColorBottom, StrictGeomUtility.toInternalValue(borderWidthBottom.floatValue())));
    resultCell.setRight(new BorderEdge(borderStyleRight, borderColorRight, StrictGeomUtility.toInternalValue(borderWidthRight.floatValue())));

    resultCell.setTopLeft(parseCornerRadius("border-top-left-radius", atts));
    resultCell.setTopRight(parseCornerRadius("border-top-right-radius", atts));
    resultCell.setBottomLeft(parseCornerRadius("border-bottom-left-radius", atts));
    resultCell.setBottomRight(parseCornerRadius("border-bottom-right-radius", atts));

    final int rowSpan = ParserUtil.parseInt(atts.getValue(getUri(), "rowspan"), 1);
    final int colSpan = ParserUtil.parseInt(atts.getValue(getUri(), "colspan"), 1);
    for (int r = row; r < row + rowSpan; r++)
    {
View Full Code Here

Examples of org.yaac.shared.egql.ResultCell

 
  @Test
  public void testEncodeDecode() {
    BlobKeyPropertyInfo blob = new BlobKeyPropertyInfo("key2");
   
    ResultCell cell = blob.populateResultCell(AutoBeanUtil.getResultCellFactory());
   
    assertEquals(blob, PropertyInfo.Builder.fromResultCell(cell));
  }
View Full Code Here

Examples of org.yaac.shared.egql.ResultCell

    listInfo.add(key2);
   
    BlobKeyPropertyInfo blob = new BlobKeyPropertyInfo("downloadpath");
    listInfo.add(blob);
   
    ResultCell cell = listInfo.populateResultCell(AutoBeanUtil.getResultCellFactory());
   
    assertEquals(listInfo, PropertyInfo.Builder.fromResultCell(cell));
  }
View Full Code Here

Examples of org.yaac.shared.egql.ResultCell

  @Test
  public void testEncodeDecode() {
    KeyInfo key1 = new KeyInfo(null, "kkk", null, 20L, "keyString");
    KeyInfo key2 = new KeyInfo(key1, "fff", null, 201L, "keyString");
   
    ResultCell cell = key2.populateResultCell(AutoBeanUtil.getResultCellFactory());
   
    assertEquals(key2, PropertyInfo.Builder.fromResultCell(cell));
  }
View Full Code Here

Examples of org.yaac.shared.egql.ResultCell

        if (!colMap.containsKey(cell.getTitle())) {
          SortableColumn<List<ResultCell>, SafeHtml> column =
            new SortableColumn<List<ResultCell>, SafeHtml>(new SafeHtmlCell()) {
              @Override
              public SafeHtml getValue(List<ResultCell> cells) {
                ResultCell c = lookupCell(cell.getTitle(), cells);
               
                SafeHtmlBuilder sb = new SafeHtmlBuilder();
               
                if (c == null) {  // not necessary always have this column
                  sb.appendHtmlConstant("<br/>");
                } else {
                  PropertyInfo property = PropertyInfo.Builder.fromResultCell(c);
                 
                  // populate warnings in tooltip
                  List<String> warnings = property.getWarnings();
                 
                  if (warnings != null && !warnings.isEmpty()) {
                    List<String> warningMsgs = transform(warnings, new Function<String, String>(){
                      @Override
                      public String apply(String errorCode) {
                        return errMsgs.getString(errorCode);
                      }
                    });
                   
                    sb.appendHtmlConstant(
                        "<div title='" + Joiner.on("<br/>").join(warningMsgs) + "' style='background-color: yellow;'>" +
                        property.asHtml() + "</div>");
                  } else {
                    sb.appendHtmlConstant(property.asHtml())
                  }
                }
                return sb.toSafeHtml();
              }
          };
         
          resultTable.addColumn(column, cell.getTitle());
          colMap.put(cell.getTitle(), column);
         
          sortHandler.setComparator(column, new Comparator<List<ResultCell>>() {
            @Override
            public int compare(List<ResultCell> cell1s, List<ResultCell> cell2s) {
              // dynamic columns, both c1 and c2 can be null
              ResultCell c1 = lookupCell(cell.getTitle(), cell1s);
              ResultCell c2 = lookupCell(cell.getTitle(), cell2s);
             
              if (c1 == null) {
                if (c2 == null) {
                  return 0;
                } else {
View Full Code Here

Examples of org.yaac.shared.egql.ResultCell

   * @param null1
   * @param object
   * @return
   */
  public static ResultCell newResultCell(PropertyType type, String ...payloads) {
    ResultCell result = newResultCell();
    result.setType(type);
    result.setPayload(Arrays.asList(payloads));
    return result;
  }
View Full Code Here

Examples of org.yaac.shared.egql.ResultCell

        break;
      }
     
      List<ResultCell> resultRow = new ArrayList<ResultCell>(dataRow.size());
      for (PropertyInfo dataProperty : dataRow) {
        ResultCell cell = dataProperty.populateResultCell(AutoBeanUtil.getResultCellFactory());
        resultRow.add(cell);
      }
      result.add(resultRow);
     
      decreaseRemainingResultQuota();
View Full Code Here

Examples of org.yaac.shared.egql.ResultCell

    }
  }

  @Override
  public ResultCell populateResultCell(ResultCellFactory factory) {
    ResultCell cell = super.populateResultCell(factory);
    cell.setType(PropertyType.TEXT);
    cell.setParent(null);
    cell.setChildren(null);
    cell.setPayload(Arrays.asList(preview, size.toString(), downloadPath));
    return cell;
  }
View Full Code Here

Examples of org.yaac.shared.egql.ResultCell

    }
  }

  @Override
  public ResultCell populateResultCell(ResultCellFactory factory) {
    ResultCell cell = super.populateResultCell(factory);
    cell.setType(PropertyType.BLOB);
    cell.setParent(null);
    cell.setChildren(null);
    cell.setPayload(Arrays.asList(size.toString(), downloadPath));
    return cell;
  }
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.