Examples of UIColumn


Examples of org.richfaces.component.UIColumn

        // RichHeaderEncodeStrategy();
        // HeaderEncodeStrategy simpleEncodeStrategy = new
        // SimpleHeaderEncodeStrategy();

        while (headers.hasNext()) {
            UIColumn column = headers.next();
            if (isColumnRendered(column)) {
                if ((Integer) column.getAttributes().get("colspan") != null) {
                    t_colCount = t_colCount
                            + ((Integer) column.getAttributes().get("colspan"))
                                    .intValue();
                } else {
                    t_colCount++;
                }
                if (t_colCount > colCount) {
                    break;
                }

                String classAttribute = facetName + "Class";
                String columnHeaderClass = (String) column.getAttributes().get(
                        classAttribute);

                writer.startElement(element, column);
                encodeStyleClass(writer, null, skinCellClass, headerClass,
                        columnHeaderClass);
                writer.writeAttribute("scope", "col", null);
                getUtils().encodeAttribute(context, column, "colspan");

                boolean sortableColumn = column
                        .getValueExpression("comparator") != null
                        || column.getValueExpression("sortBy") != null;
                column.getAttributes().put("sortable",
                        Boolean.valueOf(sortableColumn));

                HeaderEncodeStrategy strategy = (column instanceof UIColumn && "header"
                        .equals(facetName)) ? new G3HeaderEncodeStrategy()
                        : new SimpleHeaderEncodeStrategy();

                strategy.encodeBegin(context, writer, column, facetName,
                        sortableColumn);

                UIComponent facet = column.getFacet(facetName);
                if (facet != null && isColumnRendered(facet)) {
                    renderChild(context, facet);
                }

                strategy.encodeEnd(context, writer, column, facetName,
View Full Code Here

Examples of org.richfaces.component.UIColumn

        UIExtendedDataTable table = holder.getTable();
        ResponseWriter writer = context.getResponseWriter();
        Iterator<UIColumn> iter = table.getSortedColumns();
        boolean first = true;
        int currentColumn = 0;
        UIColumn column = null;
        if (holder.isFirstRow()) {
            encodeFakeIeRow(context, table, holder);
        }
        if (holder.isGroupingOn() && (rowGroupChanged(context, holder))) {
            encodeGroupRow(context, table, holder);
        }
        holder.setFirstRow(false);
       
        while (iter.hasNext()) {
            column = iter.next();
            // Start new row for first column - expect a case of the detail
            // table, wich will be insert own row.
            boolean isRow = (column instanceof Row);
            if (first && !isRow) {
                encodeRowStart(context, getFirstRowSkinClass(), holder
                        .getRowClass(), table, holder, writer);
            }

            // TODO PKA CHANGE COLUMN RENDERER TO GET RID OF && false
//            if (false && (column instanceof Column)) {
//                boolean breakBefore = ((Column) column).isBreakBefore()
//                        || isRow;
//                if (breakBefore && !first) {
//                    // close current row
//                    writer.endElement(HTML.TR_ELEMENT);
//                    // reset columns counter.
//                    currentColumn = 0;
//                    // Start new row, expect a case of the detail table, wich
//                    // will be insert own row.
//                    if (!isRow) {
//                        holder.nextRow();
//                        encodeRowStart(context, holder.getRowClass(), table,
//                                holder, writer);
//                    }
//                }
//                encodeCellChildren(context, column,
//                        first ? getFirstRowSkinClass() : null,
//                        getRowSkinClass(), holder.getRowClass(),
//                        getCellSkinClass(), holder
//                                .getColumnClass(currentColumn));
//                // renderChild(context, column);
//                if (isRow && iter.hasNext()) {
//                    // Start new row for remained columns.
//                    holder.nextRow();
//                    encodeRowStart(context, holder.getRowClass(), table,
//                            holder, writer);
//                    // reset columns counter.
//                    currentColumn = -1;
//                }
//            } else
            if (column.isRendered()) {
                // UIColumn don't have own renderer
                writer.startElement(HTML.td_ELEM, table);
                getUtils().encodeId(context, column);
                encodeStyleClass(writer, null, getCellSkinClass(), holder.getColumnClass(currentColumn),
                        column.getAttributes().get("styleClass"));
                encodeStyle(writer, null, null, null, column.getAttributes().get("style"));
                // TODO - encode column attributes.
                writer.startElement(HTML.DIV_ELEM, table);
                writer.writeAttribute("class", "extdt-cell-div", null);
                // IE
                renderChildren(context, column);
View Full Code Here

Examples of org.richfaces.component.UIColumn

    public void encodeScriptIfNecessary(FacesContext context,
            UIExtendedDataTable table) throws IOException {
        boolean shouldRender = false;
        Iterator<UIColumn> columns = table.getSortedColumns();
        while (columns.hasNext() && !shouldRender) {
            UIColumn next = columns.next();
            shouldRender = next.isSortable();
            shouldRender = true;// shouldRender || (next instanceof
            // HtmlDataColumn);
        }
        shouldRender = true;
        if (shouldRender) {
View Full Code Here

Examples of org.richfaces.component.UIColumn

        return menuId;
    }// render

    protected void renderMenuItem(UIColumn column) throws IOException {
        if (column instanceof UIColumn) {
            UIColumn dataColumn = (UIColumn) column;
            Boolean v = dataColumn.isVisible();
            boolean columnVisible = (v == null ? Boolean.TRUE : v);
            String actionScript = null;
            if ((!columnVisible) || (visibleColumnsCount > 1)) {
                boolean ajaxSingle = true;
                Map<String, Object> requestOpts = AjaxRendererUtils
                        .buildEventOptions(context, dataColumn);

                if (onAjaxCompleteFunction != null)
                    requestOpts.put(AjaxRendererUtils.ONCOMPLETE_ATTR_NAME,
                            onAjaxCompleteFunction);

                @SuppressWarnings("unchecked")
                Map<String, Object> parameters = (Map<String, Object>) requestOpts
                        .get("parameters");
                if (parameters == null) {
                    parameters = new HashMap<String, Object>();
                    requestOpts.put("parameters", parameters);
                }
                if (ajaxSingle) {
                    if (!parameters
                            .containsKey(AjaxRendererUtils.AJAX_SINGLE_PARAMETER_NAME))
                        parameters.put(
                                AjaxRendererUtils.AJAX_SINGLE_PARAMETER_NAME,
                                dataColumn.getParent().getClientId(context));
                    if (!requestOpts.containsKey("control"))
                        requestOpts.put("control", JSReference.THIS);
                }
                parameters.put(dataColumn.getParent().getClientId(context)
                        + ":" + CHANGE_COL_VISIBILITY, dataColumn.getId());

                JSFunction dropFunction = AjaxRendererUtils.buildAjaxFunction(
                        dataColumn, context);
                dropFunction.addParameter(requestOpts);
                actionScript = dropFunction.toScript();
            }// if

            writer.startElement("li", dataColumn);
            writer.writeAttribute(HTML.class_ATTRIBUTE, "dt-menu-list-item"
                    + (columnVisible ? " dt-menu-item-checked" : ""), null);

            writer.startElement(HTML.a_ELEMENT, dataColumn);
            writer.writeAttribute(HTML.HREF_ATTR, "#", null);
            writer.writeAttribute(HTML.class_ATTRIBUTE,
                    "dt-menu-item dt-menu-check-item", null);
            actionScript = (actionScript == null ? "return false;"
                    : actionScript + ";return false;");
            writer.writeAttribute(HTML.onclick_ATTRIBUTE, actionScript, null);
            writer.startElement(HTML.IMG_ELEMENT, dataColumn);
            writer.writeAttribute(HTML.class_ATTRIBUTE, "dt-menu-item-icon",
                    null);
            InternetResource res = InternetResourceBuilder.getInstance().getResource("/org/richfaces/renderkit/html/images/s.gif");
            writer.writeAttribute(HTML.src_ATTRIBUTE, InternetResourceBuilder
          .getInstance().getUri(res, context, null), null);
            writer.endElement(HTML.IMG_ELEMENT);
            String label = (String)dataColumn.getAttributes().get("label");
            writer.writeText(label == null ? "" : label, null);
            writer.endElement(HTML.a_ELEMENT);
            writer.endElement("li");
        }
    }// encodeMenuItem
View Full Code Here

Examples of org.richfaces.component.UIColumn

   */
  public UIColumn next() {
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    UIColumn result = next;
    next = nextColumn();
    return result;
  }
View Full Code Here

Examples of org.richfaces.component.UIColumn

    next = nextColumn();
    return result;
  }
 
  protected UIColumn nextColumn(){
    UIColumn nextColumn = null;
    while (childrenIterator.hasNext()) {
      UIComponent child = childrenIterator.next();
      if(child instanceof UIColumn){
        nextColumn = (UIColumn)child;
        break;
View Full Code Here

Examples of org.richfaces.component.UIColumn

        return menuId;
    }// render

    protected void renderMenuItem(UIColumn column) throws IOException {
        if (column instanceof UIColumn) {
            UIColumn dataColumn = (UIColumn) column;
            Boolean v = dataColumn.isVisible();
            boolean columnVisible = (v == null ? Boolean.TRUE : v);
            String actionScript = null;
            if ((!columnVisible) || (visibleColumnsCount > 1)) {
                boolean ajaxSingle = true;
                Map<String, Object> requestOpts = AjaxRendererUtils
                        .buildEventOptions(context, dataColumn);

                if (onAjaxCompleteFunction != null)
                    requestOpts.put(AjaxRendererUtils.ONCOMPLETE_ATTR_NAME,
                            onAjaxCompleteFunction);

                @SuppressWarnings("unchecked")
                Map<String, Object> parameters = (Map<String, Object>) requestOpts
                        .get("parameters");
                if (parameters == null) {
                    parameters = new HashMap<String, Object>();
                    requestOpts.put("parameters", parameters);
                }
                if (ajaxSingle) {
                    if (!parameters
                            .containsKey(AjaxRendererUtils.AJAX_SINGLE_PARAMETER_NAME))
                        parameters.put(
                                AjaxRendererUtils.AJAX_SINGLE_PARAMETER_NAME,
                                dataColumn.getParent().getClientId(context));
                    if (!requestOpts.containsKey("control"))
                        requestOpts.put("control", JSReference.THIS);
                }
                parameters.put(dataColumn.getParent().getClientId(context)
                        + ":" + CHANGE_COL_VISIBILITY, dataColumn.getId());

                JSFunction dropFunction = AjaxRendererUtils.buildAjaxFunction(
                        dataColumn, context);
                dropFunction.addParameter(requestOpts);
                actionScript = dropFunction.toScript();
            }// if

            writer.startElement("li", dataColumn);
            writer.writeAttribute(HTML.class_ATTRIBUTE, "dt-menu-list-item"
                    + (columnVisible ? " dt-menu-item-checked" : ""), null);

            writer.startElement(HTML.a_ELEMENT, dataColumn);
            writer.writeAttribute(HTML.HREF_ATTR, "#", null);
            writer.writeAttribute(HTML.class_ATTRIBUTE,
                    "dt-menu-item dt-menu-check-item", null);
            actionScript = (actionScript == null ? "return false;"
                    : actionScript + ";return false;");
            writer.writeAttribute(HTML.onclick_ATTRIBUTE, actionScript, null);
            writer.startElement(HTML.IMG_ELEMENT, dataColumn);
            writer.writeAttribute(HTML.class_ATTRIBUTE, "dt-menu-item-icon",
                    null);
            InternetResource res = InternetResourceBuilder.getInstance().getResource("/org/richfaces/renderkit/html/images/s.gif");
            writer.writeAttribute(HTML.src_ATTRIBUTE, InternetResourceBuilder
          .getInstance().getUri(res, context, null), null);
            writer.endElement(HTML.IMG_ELEMENT);
            String label = (String)dataColumn.getAttributes().get("label");
            writer.writeText(label == null ? "" : label, null);
            writer.endElement(HTML.a_ELEMENT);
            writer.endElement("li");
        }
    }// encodeMenuItem
View Full Code Here

Examples of org.richfaces.component.UIColumn

    public void encodeColumns(FacesContext context,
            UIExtendedDataTable table) throws IOException {
        ResponseWriter writer = context.getResponseWriter();
        Iterator<UIColumn> cols = table.getSortedColumns();
        while (cols.hasNext()) {
            UIColumn col = cols.next();
            if (col.isRendered()) {
                writer.startElement("col", table);
                String colWidth = table.getColumnSize(col);
                if (Integer.valueOf(colWidth) < Integer
                        .valueOf(MIN_COLUMN_WIDTH)) {
                    colWidth = MIN_COLUMN_WIDTH;
View Full Code Here

Examples of org.richfaces.component.UIColumn

     */
    private boolean filteringEnabled(UIExtendedDataTable table) {
        Iterator<UIColumn> columns = table.getSortedColumns();
        boolean enabled = false;
        while (columns.hasNext()) {
            UIColumn col = columns.next();
            if (col instanceof UIColumn) {
                UIColumn dataColumn = (UIColumn) col;
                if (filterEnabledColumn(dataColumn) && dataColumn.isRendered()) {
                    enabled = true;
                    break;
                }
            }
        }
View Full Code Here

Examples of org.richfaces.component.UIColumn

            ResponseWriter writer, UIDataTable table,
            Iterator<UIColumn> headers, String skinCellClass,
            String headerClass, String facetName, String element)
            throws IOException {
        while (headers.hasNext()) {
            UIColumn column = headers.next();
            if (column instanceof UIColumn) {
                if (column.isRendered()) {
                    writer.startElement(element, table);
                    String classAttribute = facetName + "Class";
                    String columnHeaderClass = (String) column.getAttributes()
                            .get(classAttribute);
                    encodeStyleClass(writer, null, skinCellClass, headerClass,
                            columnHeaderClass);
                    UIColumn dataColumn = (UIColumn) column;
                    if (filterEnabledColumn(dataColumn)) {
                        writer.startElement(HTML.DIV_ELEM, column);
                        addInplaceInput(context, column, buildAjaxFunction(
                                context, column, false,
                                getOnAjaxCompleteFunction(context,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.