Package org.openfaces.component.table

Examples of org.openfaces.component.table.BaseColumn


        return ANY_COLUMN_VALUE_EXPRESSION;
    }

    @Override
    public List<UIComponent> getChildren() {
        BaseColumn actualCol = getCurrentlyRenderedColumn();
        if (actualCol instanceof ContextDependentComponent) {
            if (!((ContextDependentComponent) actualCol).isComponentInContext()) {
                // This method is expected to be called only from within the encodeAll method of this instance, and this
                // method sets up column's context. If this check fails then it means that this method is invoked from
                // somewhere else, and if that invocation is rightful then this cell's enterComponentContext method has
                // to be invoked prior to this
                throw new IllegalStateException("The current column is supposed to be in context when its children are retrieved");
            }
        }

        UIComponent headerOrFooterComponentFromFacet = actualCol.getFacet(getFacetName());
        if (headerOrFooterComponentFromFacet != null)
            return Collections.singletonList(headerOrFooterComponentFromFacet);
        else {
            // Returning an empty string output-text here...
            // A non-empty child list is required even when rendering a per-column group header cell for a column that
View Full Code Here


            return getDefaultChildList();
        }
    }

    protected BaseColumn getCurrentlyRenderedColumn() {
        BaseColumn currentlyRenderedColumn = tableBody.getCurrentlyRenderedColumn();
        if (currentlyRenderedColumn == null)
            throw new IllegalStateException("Couldn't retrieve tableBody.currentlyRenderedColumn property. It is " +
                    "expected that rendering for this cell is initiated only from the TableBody cell rendering " +
                    "procedure where currentRenderedColumn is set explicitly prior to rendering the cell contents " +
                    "container (this custom cell implementation)");
View Full Code Here

    private List<UIComponent> getColumnFacet(String columnId) {
        if (cachedFacetMap.containsKey(columnId))
            return cachedFacetMap.get(columnId);

        BaseColumn groupingColumn = dataTable.getColumnById(columnId);
        UIComponent groupingFacet = facetName != null ? groupingColumn.getFacet(facetName) : null;
        List<UIComponent> facetValue = groupingFacet != null ? Collections.singletonList(groupingFacet) : null;
        cachedFacetMap.put(columnId, facetValue);
        return facetValue;
    }
View Full Code Here

        String columnId = getCurrentColumnId();
        return dataTable.getColumnById(columnId);
    }

    public Runnable enterComponentContext() {
        BaseColumn column = getCurrentlyRenderedColumn();
        Runnable undeclareContextVariables = (column instanceof ContextDependentComponent)
                ? ((ContextDependentComponent) column).enterComponentContext()
                : null;
        return undeclareContextVariables;
    }
View Full Code Here

                : null;
        return undeclareContextVariables;
    }

    public boolean isComponentInContext() {
        BaseColumn column = getCurrentlyRenderedColumn();
        return !(column instanceof ContextDependentComponent) ||
                ((ContextDependentComponent) column).isComponentInContext();
    }
View Full Code Here

        List<BaseColumn> allColumns = dataTable.getAllColumns();
        String firstOrdinaryColumnId = null;
        int firstOrdinaryColumnIndex = -1;
        {
            for (int i = 0, allColumnsSize = allColumns.size(); i < allColumnsSize; i++) {
                BaseColumn column = allColumns.get(i);
                if (column instanceof Column) {
                    firstOrdinaryColumnId = column.getId();
                    firstOrdinaryColumnIndex = i;
                    break;
                }
            }
        }
View Full Code Here

            // don't derive converter from a column if an expression is specified explicitly for the filter;
            // explicitly specified expression requires an explicitly specified converter (for the appropriate
            // expression's type) so the absence of explicit converter specification should be interpreted as intentional.
            return null;
        }
        BaseColumn column = getColumn();
        if (column != null) {
            converter = column.getColumnValueConverter();
            return converter;
        }
        return null;
    }
View Full Code Here

            return null;
    }

    public Object getExpression() {
        if (expression == null) {
            BaseColumn column = getColumn();
            if (column != null)
                expression = column.getColumnValueExpression();
        }
        return expression;
    }
View Full Code Here

        cvm.getAttributes().put(PopupMenuRenderer.ATTR_DEFAULT_INDENT_CLASS, "o_popup_menu_indent o_columnVisibilityMenuIndent");

        List<BaseColumn> visibleColumns = table.getRenderedColumns();
        List<BaseColumn> allColumns = table.getAllColumns();
        for (int i = 0, count = allColumns.size(); i < count; i++) {
            BaseColumn column = allColumns.get(i);
            MenuItem menuItem = Components.createComponent(context, MenuItem.COMPONENT_TYPE, MenuItem.class, cvm, "col" + i);
            menuItem.setValue(column.getColumnHeader());
            boolean columnVisible = visibleColumns.contains(column);
            menuItem.setIconUrl(Resources.internalURL(context, null,
                    columnVisible
                            ? SelectBooleanCheckboxImageManager.DEFAULT_SELECTED_IMAGE
                            : SelectBooleanCheckboxImageManager.DEFAULT_UNSELECTED_IMAGE,
View Full Code Here

        FacesContext context = FacesContext.getCurrentInstance();

        UIComponent component = selectRowCheckbox.getParent();
        while (component != null) {
            if (component instanceof BaseColumn) {
                BaseColumn column = (BaseColumn) component;
                AbstractTable table = Components.getParentWithClass(column, AbstractTable.class);
                if (table == null)
                    throw new FacesException("<o:selectRowCheckbox> can only be used in columns of table components " +
                            "(<o:dataTable> or <o:treeTable)");
View Full Code Here

TOP

Related Classes of org.openfaces.component.table.BaseColumn

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.