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

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


    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

    //
    // 3. Render each row
    //

    ColumnData colData = tContext.getColumnData();
    final RenderStage renderStage = tContext.getRenderStage();

    renderStage.setStage(RenderStage.DATA_STAGE);


    // use the special response writer in our data section that
    // defaults data cells with no data to <br>
    //tContext.setDataResponseWriterUsed(true);
    int physicalCol = 0;

    if (isEmptyTable)
    {
      writer.startElement("tr", null);
      if (tContext.hasSelection())
      {
        colData.setColumnIndex(physicalCol++, ColumnData.SPECIAL_COLUMN_INDEX);
        _renderEmptyCell(context, rc, tContext, true, null);
      }

      // render detail control (hide/show for the row)
      if (detail != null)
      {
        colData.setColumnIndex(physicalCol++, ColumnData.SPECIAL_COLUMN_INDEX);
        _renderEmptyCell(context, rc, tContext, true, null);
      }

      int objectNameColumnIndex = colData.getObjectNameColumnIndex();
      if (objectNameColumnIndex < physicalCol)
        objectNameColumnIndex = physicalCol;
      for (int columns = colData.getColumnCount(); physicalCol < columns;)
      {
        colData.setColumnIndex(physicalCol, ColumnData.SPECIAL_COLUMN_INDEX);

        final Object emptyText;
        if (objectNameColumnIndex == physicalCol)
        {
          emptyText = getEmptyText(component, bean);
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);
    if (footer != null)
    {
      ResponseWriter writer = context.getResponseWriter();
      writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
      /*  boolean useScroll = (getHeight(getFacesBean(component)) != null) && isIE(arc);
     if (useScroll)
     {
       writer.writeAttribute("style", "position:relative;"+
                                      "bottom:expression("+
                                       "this.offsetParent.scrollHeight-this.offsetParent.scrollTop-"+
                                       "this.offsetParent.clientHeight+1);" +
                                      "left:-1px", null);
     }
  */
      writer.startElement(XhtmlConstants.TABLE_HEADER_ELEMENT, 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();
      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);
      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())
        {
View Full Code Here

        break;
      default:
        throw new AssertionError("Bad renderStage:"+stage);
    }

    ColumnData colData = tContext.getColumnData();
    int[] hidden = tContext.getHiddenColumns();
    int columns = tContext.getColumnCount();

    // render the special columns, such as selection and details:
    int physicalColumn = renderSpecialColumns(context,
                                              rc,
                                              tContext,
                                              component,
                                              0);

    for (int currCol = 0; currCol < columns; currCol++)
    {
      if (hidden[currCol] == TableRenderingContext.NORMAL_COLUMN)
      {
        UIComponent child =
          (UIComponent) component.getChildren().get(currCol);
        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(physicalColumn,currCol);
          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
          physicalColumn = colData.getPhysicalColumnIndex();
        }
      }
    }

  }
View Full Code Here

    ) throws IOException
  {
    tContext.getRenderStage().setStage(RenderStage.COLUMN_HEADER_STAGE);

    ResponseWriter writer = context.getResponseWriter();
    ColumnData colData = tContext.getColumnData();
    colData.setRowIndex(0);
    writer.startElement("tr", null);

    int physicalCol = renderSpecialColumns(context, rc, tContext, component, 0);
    int[] hidden = tContext.getHiddenColumns();
    int colCount = component.getChildCount();

    for (int j = 0; j < colCount; j++)
    {
      if (hidden[j] != TableRenderingContext.NORMAL_COLUMN)
        continue;
      UIComponent child =
        (UIComponent) component.getChildren().get(j);
      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, j);
        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();
      }
    }

    colData.setRowIndex(-1);

    writer.endElement("tr");
  }
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.