Package org.pentaho.reporting.engine.classic.core.modules.output.table.html.helper

Examples of org.pentaho.reporting.engine.classic.core.modules.output.table.html.helper.DefaultStyleBuilderFactory


      return writer;
    }

    private StyleBuilder.StyleCarrier[] productImpliedStyles()
    {
      DefaultStyleBuilder builder = new DefaultStyleBuilder(new DefaultStyleBuilderFactory());
      builder.append(StyleBuilder.CSSKeys.COLOR, "black");
      builder.append(StyleBuilder.CSSKeys.FONT_SIZE, "10", "pt");
      builder.appendRaw(StyleBuilder.CSSKeys.FONT_FAMILY, "\"Arial Unicode MS\"");
      builder.append(StyleBuilder.CSSKeys.FONT_WEIGHT, "normal");
      builder.append(StyleBuilder.CSSKeys.FONT_STYLE, "normal");
View Full Code Here


      return new HtmlTextExtractor(metaData, getWriter(), contentGenerator, tagHelper);
    }

    private HtmlTagHelper createTagHelper()
    {
      HtmlTagHelper tagHelper = new HtmlTagHelper(report.getConfiguration(), new DefaultStyleBuilderFactory());
      tagHelper.setStyleManager(new InlineStyleManager());
      return tagHelper;
    }
View Full Code Here

      }

      final int colCount = sheetLayout.getColumnCount();
      final boolean emptyCellsUseCSS = getTagHelper().isEmptyCellsUseCSS();
      StyleBuilder styleBuilder = getStyleBuilder();
      DefaultStyleBuilderFactory styleBuilderFactory = getStyleBuilderFactory();

      if (textExtractor == null)
      {
        textExtractor = new HtmlTextExtractor(metaData, xmlWriter, contentGenerator, getTagHelper());
      }

      for (int row = startRow; row < finishRow; row++)
      {
        final int rowHeight = (int) StrictGeomUtility.toExternalValue(sheetLayout.getRowHeight(row));
        final HtmlRowBackgroundStruct struct = getCommonBackground(logicalPage, sheetLayout, row, contentProducer);
        xmlWriter.writeTag(HtmlPrinter.XHTML_NAMESPACE, "tr",
            getTagHelper().createRowAttributes(rowHeight, struct), XmlWriterSupport.OPEN);

        for (int col = 0; col < colCount; col++)
        {
          final RenderBox content = contentProducer.getContent(row, col);
          final CellMarker.SectionType sectionType = contentProducer.getSectionType(row, col);
          if (content == null)
          {
            final RenderBox backgroundBox = contentProducer.getBackground(row, col);
            final CellBackground background;
            if (backgroundBox != null)
            {
              background = cellBackgroundProducer.getBackgroundForBox
                  (logicalPage, sheetLayout, col, row, 1, 1, true, sectionType, backgroundBox);
            }
            else
            {
              background = cellBackgroundProducer.getBackgroundAt(logicalPage, sheetLayout, col, row, true, sectionType);
            }
            writeBackgroundCell(background, xmlWriter);
            continue;
          }

          if (content.isCommited() == false)
          {
            throw new InvalidReportStateException(
                "Uncommited content encountered: " + row + ", " + col + ' ' + content);
          }

          final long contentOffset = contentProducer.getContentOffset(row, col);

          final long colPos = sheetLayout.getXPosition(col);
          final long rowPos = sheetLayout.getYPosition(row);
          if (content.getX() != colPos || (content.getY() + contentOffset) != rowPos)
          {
            // A spanned cell ..
            if (content.isFinishedTable())
            {
              continue;
            }
          }

          final int colSpan = sheetLayout.getColSpan(col, content.getX() + content.getWidth());
          final int rowSpan = sheetLayout.getRowSpan(row, content.getY() + content.getHeight() + contentOffset);

          final CellBackground realBackground = cellBackgroundProducer.getBackgroundForBox
              (logicalPage, sheetLayout, col, row, colSpan, rowSpan, true, sectionType, content);

          final StyleBuilder cellStyle = styleBuilderFactory.createCellStyle(styleBuilder,
              content.getStyleSheet(), content.getBoxDefinition(), realBackground, null, null);
          final AttributeList cellAttributes = getTagHelper().createCellAttributes
              (colSpan, rowSpan, content.getAttributes(), content.getStyleSheet(), realBackground, cellStyle);
          xmlWriter.writeTag(HtmlPrinter.XHTML_NAMESPACE, "td", cellAttributes, XmlWriterSupport.OPEN);
View Full Code Here

                                              final int col,
                                              final FastGridLayout.GridCell gridCell,
                                              final ReportElement content)
  {
    StyleBuilder styleBuilder = getStyleBuilder();
    DefaultStyleBuilderFactory styleBuilderFactory = getStyleBuilderFactory();
    FastHtmlStyleCache.CellStyle cellStyleCache = styleCache.getCellAttributes(row, col);
    if (cellStyleCache == null)
    {
      final CellBackground realBackground = gridCell.getLayoutInfo().getBackground();
      final int colSpan = gridCell.getLayoutInfo().getColumnSpan();
      final int rowSpan = gridCell.getLayoutInfo().getRowSpan();

      if (content == null)
      {
        final StyleBuilder cellStyle = styleBuilderFactory.createCellStyle(styleBuilder, realBackground, null, null);
        final AttributeList cellAttributes = getTagHelper().createCellAttributes
            (colSpan, rowSpan, null, null, realBackground, cellStyle);
        cellStyleCache = new FastHtmlStyleCache.CellStyle(cellAttributes, cellStyle.toArray());
      }
      else
      {
        BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(content.getComputedStyle());
        final StyleBuilder cellStyle = styleBuilderFactory.createCellStyle(styleBuilder,
            content.getComputedStyle(), boxDefinition, realBackground, null, null);
        final AttributeList cellAttributes = getTagHelper().createCellAttributes
            (colSpan, rowSpan, content.getAttributes(), content.getComputedStyle(), realBackground, cellStyle);
        cellStyleCache = new FastHtmlStyleCache.CellStyle(cellAttributes, cellStyle.toArray());
      }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.modules.output.table.html.helper.DefaultStyleBuilderFactory

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.