Package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.table

Examples of org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.table.ColumnData


    physicalColumnIndex = super.renderSpecialColumns(context,
                                                     rc,
                                                     tContext,
                                                     component,
                                                     physicalColumnIndex);
    final ColumnData colData = tContext.getColumnData();
    TreeTableRenderingContext ttrc = (TreeTableRenderingContext) tContext;
    if (ttrc.isFocusColumnVisible())
    {
      colData.setColumnIndex(physicalColumnIndex++,
                             ColumnData.SPECIAL_COLUMN_INDEX);
      SpecialColumnRenderer focusRenderer = getFocusColumnRenderer();
      UIComponent column = focusRenderer.getSpecialColumn();
      delegateRenderer(context, rc, column,
                       getFacesBean(column), focusRenderer);
    }

    // render the object hierarchy column:
    colData.setColumnIndex(physicalColumnIndex++,
                           ColumnData.SPECIAL_COLUMN_INDEX);
    UIComponent treeNodeColumn = ttrc.getTreeNodeStamp();
    delegateRenderer(context, rc, treeNodeColumn,
                     getFacesBean(treeNodeColumn), _TREE_NODE);
View Full Code Here


  {
    // renders <TR> followed by a whole bunch of <TD>..</TD>, followed by
    // </TR>
    ResponseWriter writer = context.getResponseWriter();
    writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
    final ColumnData colData = tContext.getColumnData();
    int physicalColumn = 0;

    int objectNameColumnIndex = colData.getObjectNameColumnIndex();
    for (int i = 0, sz = Math.max(specialColumnCount, objectNameColumnIndex);  i < sz;  i++)
    {
      _renderEmptyCell(context, rc, tContext, physicalColumn++, null, 1);
    }

    int totalCols = tContext.getActualColumnCount();
    UIComponent table = tContext.getTable();
    FacesBean bean = getFacesBean(table);

    if (emptyTextRenderer == null)
    {
      _renderEmptyCell(context, rc, tContext, physicalColumn,
                       getEmptyText(table, bean), totalCols - physicalColumn);
      physicalColumn++;
    }
    else
    {
      delegateRenderer(context, rc, table, bean,  emptyTextRenderer);
      while (physicalColumn < totalCols)
      {
        _renderEmptyCell(context, rc, tContext, physicalColumn++, null, 1);
      }
    }
    // clear the current header id
    colData.setCurrentHeaderID(null);
    writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT);
  }
View Full Code Here

    int                   physicalColumn,
    String                text,
    int                   colspan
    ) throws IOException
  {
    ColumnData colData = tContext.getColumnData();
    ResponseWriter writer = context.getResponseWriter();
    // root columns only, so headerID is singleton
    // rather than space-separated list
    String colID = colData.getHeaderID(physicalColumn);
    colData.setCurrentHeaderID(colID);
    colData.setColumnIndex(physicalColumn, ColumnData.SPECIAL_COLUMN_INDEX);
    writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null);
    renderCellFormatAttributes(context, rc, tContext);
    if (colspan > 1)
      writer.writeAttribute(XhtmlConstants.COLSPAN_ATTRIBUTE, colspan, null);
    if (text != null)
View Full Code Here

        if ((detail != null)&&
            ((UIXTable)tableBase).getDisclosedRowKeys().isContained())
        {
          // indicate that we are now rendering inside of a details section
          renderStage.setStage(RenderStage.DETAIL_ROW_STAGE);
          ColumnData colData = tContext.getColumnData();
          // while rendering the named children in the detail row,
          // do not use the special response writer that
          // defaults data cells with no data to <br>.
          // This fixes bug 2367693.
          writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
          writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null);
          writer.writeAttribute("headers",
                      colData.getHeaderID(tContext.getDetailColumnIndex()),
                      null);
          writer.writeAttribute(XhtmlConstants.COLSPAN_ATTRIBUTE,
                IntegerUtils.getString(tContext.getActualColumnCount()), null);
          String styleClass = SkinSelectors.AF_TABLE_DETAIL_STYLE;
          String borderStyleClass = CellUtils.getBorderClass(
View Full Code Here

    TableRenderingContext tContext,
    UIComponent           component
    ) throws IOException
  {
    // This renders a whole bunch of <TH>...</TH> elements
    final ColumnData colData = tContext.getColumnData();
    // we need to keep track of which row we are on; this makes it easier
    // to do rowSpanning in columnGroups:
    colData.setRowIndex(0);
    int physicalCol = renderSpecialColumns(context, rc, tContext, component, 0);
    renderRegularHeaders(context, rc, tContext, component, physicalCol);
    // we are done, so reset the current row:
    colData.setRowIndex(-1);
  }
View Full Code Here

    ) throws IOException
  {
    // this renders a whole bunch of <TH>...</TH> elements.
    // if there are columnGroups present, it will render some
    // </TR><TR><TH>...</TH> sequences.
    final ColumnData colData = tContext.getColumnData();
    _renderRegularColumns(context, tContext, component, physicalCol);
    int rowSpan = colData.getHeaderRowSpan();
    if (rowSpan > 1)
    {
      ResponseWriter writer = context.getResponseWriter();
      for (int i = 1;  i < rowSpan;  i++)
      {
        colData.setRowIndex(i);
        writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT);
        writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
        _renderRegularColumns(context, tContext, component, physicalCol);
      }
    }
View Full Code Here

    // part of #1313720, base column header count on
    // table child count
    List<UIComponent> children = component.getChildren();
    int colCount  = children.size();
    int[] hidden = tContext.getHiddenColumns();
    ColumnData colData = tContext.getColumnData();
    for (int i = 0;  i < colCount;  i++)
    {
      if (hidden[i] != TableRenderingContext.NORMAL_COLUMN)
        continue;
      UIComponent child = children.get(i);
      if (!(child instanceof UIXColumn))
        continue;

      UIXColumn column = (UIXColumn) child;
      boolean isRowHeader = Boolean.TRUE.equals(
            column.getAttributes().get(CoreColumn.ROW_HEADER_KEY.getName()));
      if (!isRowHeader)
      {
        colData.setColumnIndex(physicalCol, i);
        encodeChild(context, column);
        // ColumnBeans automatically increment the physical and logical
        // column indices (these may be increase by more than one, if
        // there are columnGroups). So we must not increment the column
        // indices here
        physicalCol = colData.getPhysicalColumnIndex();
      }
    }
  }
View Full Code Here

    TableRenderingContext tContext,
    UIComponent           component
    ) throws IOException
  {
    tContext.getRenderStage().setStage(RenderStage.COLUMN_FOOTER_STAGE);
    final ColumnData colData = tContext.getColumnData();
    UIComponent footer = getFacet(component, CoreTable.FOOTER_FACET);
    boolean hasColumnFooters = colData.getPhysicalIndexOfFirstFooter()  >= 0;

    // If there's a table footer, or column footers, we've got work to do
    if ((footer != null) || hasColumnFooters)
    {
      ResponseWriter writer = context.getResponseWriter();
      writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
      boolean useScroll = (getHeight(component, getFacesBean(component)) != null) && isIE(rc);
      if (useScroll)
      {
        writer.writeAttribute("style", "position:relative;"+
                                       "bottom:expression("+
                                        "this.offsetParent.scrollHeight-this.offsetParent.scrollTop-"+
                                        "this.offsetParent.clientHeight+1);" +
                                       "left:-1px", null);
      }

      // total rows may need an ID. see bug 3211593:
      /* Need new scheme for generateUniqueId()?
      String rowID = XhtmlLafUtils.generateUniqueID(tContext);
      writer.writeAttribute(XhtmlLafConstants.ID_ATTRIBUTE, rowID, null);
      tContext.getRowData().setCurrentRowHeaderID(rowID);
      */
      final int firstFooterPhysicalIndex = colData.getPhysicalIndexOfFirstFooter();
      // By default, we try to render the table footer in the same row
      // as the column footers;  this is to save on screen real-estate,
      // and do something with that space in the table if the first N
      // columns have no footer content.
      // When the first column does have a footer, we'll need to push
      // the table footer down to an extra row

      // If there isn't a column footer in the first row, render a TH
      // with a sufficient colspan - and put the table footer in there
      // if it exists.
      // (Note this does need to be != 0, not > 0.  Negative numbers
      // mean there's no column footers, in which case we'll handle
      // outputting the table footer right here)
      if (firstFooterPhysicalIndex != 0)
      {
        writer.startElement(XhtmlConstants.TABLE_HEADER_ELEMENT, null);
        final int colSpan = (firstFooterPhysicalIndex > 0)?  firstFooterPhysicalIndex: tContext.getActualColumnCount();
        writer.writeAttribute(XhtmlConstants.COLSPAN_ATTRIBUTE, IntegerUtils.getString(colSpan), null);
        renderStyleClass(context, rc, SkinSelectors.AF_TABLE_COLUMN_FOOTER_STYLE);
        if (footer != null)
          encodeChild(context, footer);
        writer.endElement(XhtmlConstants.TABLE_HEADER_ELEMENT);
      }

      if (firstFooterPhysicalIndex >= 0)
      {
        colData.setColumnIndex(tContext.getSpecialColumnCount(),
                               0/*logicalColumnIndex*/);

        for(UIComponent child : (List<UIComponent>)component.getChildren())
        {
          if (child.isRendered())
View Full Code Here

    {
      areWeRoot = false;
      currentNode = parentNode.get(parentNode.currentChild);
    }

    final ColumnData colData = tContext.getColumnData();
    int row = colData.getRowIndex();
    int waitUntilRow = currentNode.waitUntilRow;
    // check to see if this columnGroup's header has been rendered:
    if (waitUntilRow==0)
    {
      // this columnGroup's header has not been rendered. So we will render it
      // and skip rendering the headers of our children.
      int totalRows = colData.getHeaderRowSpan();
      int rowSpan = (totalRows - row) - currentNode.rows + 1;

      // This columnGroup may have a rowSpan > 1. So we need to indicate on
      // which row our children will start rendering:
      currentNode.waitUntilRow = rowSpan + row;

      String headerID = _renderColumnHeader(context, rc, tContext, column,
                                            rowSpan, currentNode.cols);
      if (headerID != null)
      {
        if (areWeRoot)
        {
          currentNode.headerIDs = headerID;
        }
        else
        {
          currentNode.headerIDs = parentNode.headerIDs+" "+headerID;
        }
      }
    }
    else if (row >= waitUntilRow)
    {
      // this columnGroup's header has already been rendered. And we have
      // skipped as many rows as necessary (for this columnGroup's
      // rowSpan). So now we can render the headers of our children.
      _setParentNode(tContext, currentNode);
      _renderChildren(context, column, currentNode);
      _setParentNode(tContext, parentNode);
      // and we are done. Do not increment the physicalIndex as our children
      // would have done so:
      return;
    }

    // at this point we need to increment the physical column index, since our
    // children did not render:
    // this columnGroup occupies as many physicalIndices as its colSpan:
    colData.setColumnIndex(colData.getPhysicalColumnIndex() +
                           currentNode.cols,
                           colData.getLogicalColumnIndex());
  }
View Full Code Here

    UIComponent           column,
    int                   rowSpan,
    int                   colSpan
    ) throws IOException
  {
    ColumnData colData = tContext.getColumnData();

    // only no-wrap header cells if specified
    boolean isNoWrap = getHeaderNoWrap(column, getFacesBean(column));

    // indicate to the headerNode that it is a column group header
    colData.setColumnGroupHeader(true);
    // indicate to the headerNode whether or not to permit wrapping:
    colData.setCurrentHeaderNoWrap(isNoWrap);

    final String colID =
      renderHeaderAndSpan(context, rc, tContext, column,
                          rowSpan, colSpan);
    colData.setColumnGroupHeader(false);
    colData.setCurrentHeaderNoWrap(false);

    return colID;
  }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.table.ColumnData

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.