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

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


    {
      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, arc, 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(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, arc, tContext, column,
                          rowSpan, colSpan);
    colData.setColumnGroupHeader(false);
    colData.setCurrentHeaderNoWrap(false);

    return colID;
  }
View Full Code Here

    UIComponent           column,
    int                   rowSpan,
    int                   colSpan)
    throws IOException
  {
    ColumnData colData = tContext.getColumnData();
    String colID;
    if (shouldRenderId(context, column) ||
        tContext.isExplicitHeaderIDMode())
      // =-=AEW THIS WILL GENERATE DIFFS FROM "unique ID" land
      colID = getClientId(context, column);
    else
      colID = null;


    int physicalIndex = colData.getPhysicalColumnIndex();
    int sortability = getSortability(tContext, column);
    boolean sortable = (sortability != SORT_NO) &&
                       supportsNavigation(arc);
                      
    if(sortable)
    {
      // the sortable script has a "state" parameter, so add this
      // to the form data if the agent does not support dynamic
      // generation of elements (on those that do, form data elements
      // can be created on the fly as necessary); see the JS
      // referenced in this.getSortingOnclick
      Object domLevel =
        arc.getAgent().getCapabilities().get(TrinidadAgent.CAP_DOM);
      if(
        domLevel == null ||
        domLevel == TrinidadAgent.DOM_CAP_NONE ||
        domLevel == TrinidadAgent.DOM_CAP_FORM)
      {
        FormData formData = arc.getFormData();
        if(formData != null)
        {
          formData.addNeededValue(XhtmlConstants.STATE_PARAM);
        }     
      }
    }

    // we do not want to wrap if wrapping has explicitly been disabled. if we
    // are inside a columnGroup then we need to check the header format on the
    // columnGroup: bug 3201579:
    boolean isNoWrap = colData.isColumnGroupHeader()
      ? colData.getCurrentHeaderNoWrap()
    // =-=AEW It's weird that we're going back to colData instead
    // of just looking on ourselves!  When we're in a columnGroup, sure.
      : colData.getHeaderNoWrap(physicalIndex);


    String sortIconName = _getIconName(sortability);
    Icon sortIcon = arc.getIcon(sortIconName);
    boolean hasSortingIcon = (sortIcon != null) && !sortIcon.isNull();

    // we do not want to wrap if there is an icon on the header:
    isNoWrap = isNoWrap || hasSortingIcon;
    //       || getRequired(bean);
    //       || getMessageType(bean);

    Object width = tContext.getColumnWidth(physicalIndex);

    ResponseWriter rw = context.getResponseWriter();
    rw.startElement("th", column);
    rw.writeAttribute("id", colID, "id");

    CellUtils.renderHeaderAttrs(context, tContext,
                                null, //abbreviation (MISSING!)
                                width,
                                isNoWrap,
                                true); //isColHeader

    String styleClass = _getHeaderStyleClass(tContext, sortable);
    String borderStyleClass =
      CellUtils.getHeaderBorderStyle(tContext,
                                     arc,
                                     true, //isColHeader
                                     sortable);

    renderStyleClasses(context, arc, new String[]{ styleClass,
                                                   borderStyleClass});

    String style = getHeaderInlineStyle(arc);
    renderInlineStyleAttribute(context, arc, style);

    if (colSpan > 1)
      rw.writeAttribute("colspan", IntegerUtils.getString(colSpan), null);

    if (rowSpan == 0)
      rowSpan = colData.getHeaderRowSpan();
    if (rowSpan > 1)
      rw.writeAttribute("rowspan", IntegerUtils.getString(rowSpan), null);


    String sortOnclick = getSortingOnclick(arc, tContext, column, sortability);
View Full Code Here

    _setParentNode(tContext, currentNode);

    // "Render" the children to execute their "compute mode"
    _renderChildren(context, component, currentNode);

    ColumnData colData = tContext.getColumnData();
    if (areWeRoot)
    {
      colData.setHeaderRowSpan(currentNode.rows);
      int cols = currentNode.cols + colData.getColumnCount() - 1;
      colData.setColumnCount(cols);
    }
    else
    {
      int rows = currentNode.rows+1;
      if (parentNode.rows < rows)
View Full Code Here

  }

  private String _getHeaderStyleClass(TableRenderingContext tContext,
                                      boolean isSortable)
  {
    ColumnData colData = tContext.getColumnData();
    // if we are a columnGroup header, then we must be centered:
    if (colData.isColumnGroupHeader())
    {
      return SkinSelectors.AF_COLUMN_HEADER_ICON_STYLE;
    }

    if (isSortable)
View Full Code Here

      assert false : "Bad renderStage:"+stage;
    }

    // after we render, we must increment both the physical and the logical
    // column indices
    ColumnData colData = tContext.getColumnData();
    colData.incrementColumnIndex();
  }
View Full Code Here

  private void _startRowMode(
    TableRenderingContext tContext,
    UIComponent           column)
    throws IOException
  {
    ColumnData colData = tContext.getColumnData();
    int physicalIndex  = colData.getPhysicalColumnIndex();

    // check to see if each cell in this column comprises of multiple rows:
    if (colData.useSeparateRows(physicalIndex))
    {
      // if so, then the number of rows it spans is the number of visible
      // children it has:
      int kids = getRenderedChildCount(column);
      RowData rowData = tContext.getRowData();
View Full Code Here

    RenderingContext arc,
    TableRenderingContext tContext,
    UIComponent           column)
    throws IOException
  {
    ColumnData colData = tContext.getColumnData();
    RowData rowData = tContext.getRowData();
    final int physicalIndex  = colData.getPhysicalColumnIndex();
    final int subRow = rowData.getCurrentSubRow();
    // this is the row span for the entire row:
    final int currentRowSpan = rowData.getCurrentRowSpan();

    // check to see if each cell in this column comprises of multiple rows:
    if (colData.useSeparateRows(physicalIndex))
      handleSeparateRows:
    {
      // if so, then we need to render the next child that has not been
      // rendered yet:
      int totalKids = getRenderedChildCount(column);
View Full Code Here

    if (tContext.isExplicitHeaderIDMode())
    {
      RowData rowData = tContext.getRowData();
      String rowID = rowData.getCurrentRowHeaderID();

      ColumnData colData = tContext.getColumnData();
      int physicalIndex  = colData.getPhysicalColumnIndex();
      String headers = colData.getHeaderIDs(physicalIndex);
      if (rowID != null)
      {
        headers = rowID+" "+headers;
      }
View Full Code Here

                         int kidIndex,
                         int rowSpan)
    throws IOException
  {
    ResponseWriter writer = context.getResponseWriter();
    ColumnData colData = tContext.getColumnData();
    final int physicalIndex  = colData.getPhysicalColumnIndex();
    final boolean isRowHeader = colData.isRowHeader(physicalIndex);

    final String cellClass;
    final String borderStyleClass;

    if (isRowHeader)
    {
      writer.startElement(XhtmlConstants.TABLE_HEADER_ELEMENT, column);
      cellClass = TableRenderer.getRowHeaderFormatClass();
      if (tContext.isExplicitHeaderIDMode())
      {
        String headerID = column.getClientId(context);
        RowData rowData = tContext.getRowData();
        rowData.setCurrentRowHeaderID(headerID);
        writer.writeAttribute(XhtmlConstants.ID_ATTRIBUTE, headerID, null);
      }
      else
      {
        writer.writeAttribute("scope", "row", null);
      }

      borderStyleClass =
      CellUtils.getHeaderBorderStyle(tContext, arc, false, false);
    }
    else // !isRowHeader
    {
      writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, column);
      cellClass = getTableDataStyleClass(tContext);
      renderHeadersAttr(context, tContext);
      borderStyleClass = CellUtils.getDataBorderStyle(arc, tContext);
    } // endif (isRowHeader)

    FacesBean bean = getFacesBean(column);
    String userStyleClass = getStyleClass(bean);
    String userInlineStyle = getInlineStyle(bean);

    renderStyleClasses(context, arc, new String[]{userStyleClass, cellClass, borderStyleClass});

    writer.writeAttribute("style", userInlineStyle, null);

    if (colData.getNoWrap(physicalIndex))
      writer.writeAttribute(XhtmlConstants.NOWRAP_ATTRIBUTE, Boolean.TRUE, null);

    CellUtils.renderSpan(context, true /*isRowSpan*/, rowSpan);

    _renderKids(context, arc, tContext, column, kidIndex);
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.