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

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


  private String _getCellFormat(
    TableRenderingContext tContext,
    boolean               isSelect
    ) throws IOException
  {
    ColumnData colData = tContext.getColumnData();
    RowData rowData = tContext.getRowData();
    int row = rowData.getRangeIndex();
    int physicalColumn = colData.getPhysicalColumnIndex();
    int logicalColumn = colData.getLogicalColumnIndex();

    BandingData bandingData = tContext.getBanding();
    boolean band = bandingData.getBand(tContext, row,
                                       physicalColumn,
                                       logicalColumn);
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      rc,
    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, rc, false, false);
    }
    else // !isRowHeader
    {
      writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, column);
      cellClass = getTableDataStyleClass(tContext);
      renderHeadersAttr(context, tContext);
      borderStyleClass = CellUtils.getDataBorderStyle(rc, tContext);
    } // endif (isRowHeader)

    FacesBean bean = getFacesBean(column);
    String userStyleClass = getStyleClass(column, bean);
    String userInlineStyle = getInlineStyle(column, bean);
   
    // Currently, a column's width is rendered in the column's header (<TH>).
    // In cases where all columns of a table have empty headersTexts, no
    // column header is rendered. Hence, a column's width is not supported
    // in the aforementioned case.
    // To fix this problem, lets render the column's width in the 
    // column's data-element (<TD>) that is in the first row.
    Object width = tContext.getColumnWidth(physicalIndex);
   
    if ((!tContext.hasColumnHeaders()) && (width!= null))
    {
      int row = tContext.getRowData().getRangeIndex();
     
      // Find the data element in the first row. Also, if there are
      // subrows, it enough to render the width for the first subrow
      if ((row == 0) && (kidIndex < 1))
      {
        writer.writeAttribute("width", width, null);
      }
    }   

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

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

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

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

    _renderKids(context, rc, tContext, column, kidIndex);
View Full Code Here

    // 3820854 APPS: NEED WAY TO NOT RENDER SELECTION COLUMN HEADER
    if (((header!=null) || (headerText != null)) &&
        !isSpecialColumn())
      tContext.columnHeadersPresent();

    ColumnData colData = tContext.getColumnData();
    if (isSpecialColumn())
    {
      colData.setSpecialColumnData(tContext,
                                   rc,
                                   getNoWrap(component, bean) && !shouldWrap,
                                   shouldWrap,
                                   getFormatType(component, bean));
    }
    else
    {
      colData.setColumnData(getWidth(component, bean),
                            getFormatType(component, bean),
                            getNoWrap(component, bean) && !shouldWrap,
                            getHeaderNoWrap(component, bean) && !shouldWrap,
                            getSeparateRows(component, bean),
                            getRowHeader(component, bean));
    }

    NodeData parentNode = getParentNode(tContext);
    if (parentNode!=null)
    {
      // we are inside a column group

      NodeData currentNode = new NodeData(); //create a leaf node
      if (parentNode.rows < 2)
        parentNode.rows = 2;
      parentNode.cols++;
      parentNode.set(parentNode.currentChild, currentNode);
    }

    UIComponent footer = getFacet(component, CoreColumn.FOOTER_FACET);
    if (footer != null)
    {
      colData.setCurrentColumnHasFooter();
      // if there is a footer, then we need to use explicit headers.
      // see bug 3211593:
      tContext.setExplicitHeaderIDMode(true);
    }
  }
View Full Code Here

    RenderingContext      rc,
    TableRenderingContext tContext,
    UIComponent           column
    ) throws IOException
  {
    ColumnData colData = tContext.getColumnData();

    // only columns that are after the first column that has a footer should
    // render anything:
    if (colData.getPhysicalColumnIndex() <
        colData.getPhysicalIndexOfFirstFooter())
      return;

    ResponseWriter writer = context.getResponseWriter();
    writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null);
    renderHeadersAttr(context, tContext);

    // determine the style for the total cell based on the
    // type of the cell in that table column.
    // totalRow children are either left-justified or right-justified. We
    // right-justify for numbers, and left-justify for everything else:
    String styleClass = ColumnData.selectFormat(tContext,
                                  SkinSelectors.AF_COLUMN_TOTAL_TEXT_STYLE,
                                  SkinSelectors.AF_COLUMN_TOTAL_NUMBER_STYLE,
                                  SkinSelectors.AF_COLUMN_TOTAL_TEXT_STYLE);

    if (tContext.hasGrid(colData.getPhysicalColumnIndex(),
                         true /* vertical*/))
    {
      String borderStyleClass =
               CellUtils.getBorderClass(false, true, false, false);

View Full Code Here

    RenderingContext      rc,
    TableRenderingContext tContext,
    UIComponent           column
    ) throws IOException
  {
    final ColumnData colData = tContext.getColumnData();
    int rowSpan = colData.getHeaderRowSpan();
    NodeData parentNode = getParentNode(tContext);
    if (parentNode!=null)
    {
      // we are inside a columnGroupBean

      NodeData currentNode = parentNode.get(parentNode.currentChild);
      if (currentNode.waitUntilRow != 0)
        return// we have already been rendered
      else
      {
        rowSpan -= colData.getRowIndex();
        currentNode.waitUntilRow = -1; // mark that we have been rendered
      }
    }
    else if (colData.getRowIndex() > 0)
    {
      // we are not inside a columnGroup. However, we are spanning rows, and
      // the table is trying to render us several times. We must make sure we
      // render only the first time
      return;
    }

    String colID = renderHeaderAndSpan(context,
                                       rc,
                                       tContext,
                                       column,
                                       rowSpan,
                                       1//colSpan
                                       );

    if (colID != null)
    {
      // set the headerID for this column
      colData.setHeaderID(colData.getPhysicalColumnIndex(),
                          colID);

      if (parentNode != null)
        colID = parentNode.headerIDs + " " + colID;

      // set the collected space-delimited set of headerIDs
      // for this column and its parents
      colData.setHeaderIDs(colData.getPhysicalColumnIndex(),
                           colID);
    }
  }
View Full Code Here

  public static String getDataStyleClass(
    TableRenderingContext tContext)
  {
    final String cellClass;
    final ColumnData colData = tContext.getColumnData();
    final RowData rowData = tContext.getRowData();
    int logicalColumn = colData.getLogicalColumnIndex();
    //ystem.out.println("logCol:"+logicalColumn);
    BandingData banding = tContext.getBanding();
    boolean band = banding.getBand(tContext,
                                   rowData.getRangeIndex(),
                                   colData.getPhysicalColumnIndex(),
                                   logicalColumn);

    if (band)
    {
      cellClass = ColumnData.selectFormat(
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.