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

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


    // 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,
                                   arc,
                                   getNoWrap(bean),
                                   getFormatType(bean));
    }
    else
    {
      colData.setColumnData(getWidth(bean),
                            getFormatType(bean),
                            getNoWrap(bean),
                            getHeaderNoWrap(bean),
                            getSeparateRows(bean),
                            getRowHeader(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 arc,
    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 arc,
    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,
                                       arc,
                                       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

    {
      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:
    // On PDA, where screen width is limited, we cannot afford not to
    // wrap.  isPDA check is used in several places in this class.
    // PDA specific logic will be moved to PDA render kit in the future.
    if (!isPDA(arc))
    {
      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 = getSortableHeaderStyleClass(tContext, sortability);
    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 = "";
    if (supportsScripting(arc))
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

   * @return the skinning selector for the header
   */
  protected String getSortableHeaderStyleClass(TableRenderingContext tContext,
                                      int sortability)
  {
    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;
    }

    switch (sortability)
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, arc, tContext, physicalColumn++, null, 1);
    }

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

    if (emptyTextRenderer == null)
    {
      _renderEmptyCell(context, arc, tContext, physicalColumn,
                       getEmptyText(bean), totalCols - physicalColumn);
      physicalColumn++;
    }
    else
    {
      delegateRenderer(context, arc, table, bean,  emptyTextRenderer);
      while (physicalColumn < totalCols)
      {
        _renderEmptyCell(context, arc, tContext, physicalColumn++, null, 1);
      }
    }
    // clear the current header id
    colData.setCurrentHeaderID(null);
    writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT);
  }
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.