Package org.openfaces.component.table.impl

Examples of org.openfaces.component.table.impl.TableDataModel


            setPageIndex(newPageIndex);
    }


    public List getRowListForFiltering(Filter filter) {
        TableDataModel tableDataModel = (TableDataModel) getUiDataValue();
        List result = tableDataModel.getRowListForFiltering(filter);
        return result;
    }
View Full Code Here


        List result = tableDataModel.getRowListForFiltering(filter);
        return result;
    }

    public boolean isDataSourceEmpty() {
        TableDataModel model = getModel();
        if (model == null)
            return true;
        boolean result = model.isSourceDataModelEmpty();
        return result;
    }
View Full Code Here

        return getModel().getDerivedRowHierarchy();
    }

    @Override
    public int getNodeLevel() {
        TableDataModel model = getModel();
        return model.getNodeLevel();
    }
View Full Code Here

        return getNodeHasChildren(rowIndex);
    }

    @Override
    protected boolean getNodeHasChildren(int rowIndex) {
        TableDataModel model = getModel();
        Map<Object, ? extends NodeInfo> rowHierarchy = model.getDerivedRowHierarchy();
        if (rowHierarchy == null) return false;

        if (rowIndex == -1) return false;
        NodeInfo nodeInfo = rowHierarchy.get(rowIndex);
        if (nodeInfo == null) return false;
View Full Code Here

     *
     * @param currentSelectedRowKeys - list of RowKeys of currently selected rows
     * @param allSelectedRowKeys     - list of all RowKeys that in multipleselection now
     */
    private void processSelectionRowsKeys(List<Object> currentSelectedRowKeys, List<Object> allSelectedRowKeys) {
        TableDataModel dataModel = getModel();
        int rowCount = dataModel.getRowCount();
        for (int i = 0; i < rowCount; i++) {
            dataModel.setRowIndex(i);
            Object currentRowKey = dataModel.getRowKey();
            if (currentRowKey == null){
                continue;
            }
            if (!currentSelectedRowKeys.contains(currentRowKey)) {
                if (allSelectedRowKeys.contains(currentRowKey)) {
View Full Code Here

    }

    @Override
    protected void beforeProcessDecodes(FacesContext context) {
        super.beforeProcessDecodes(context);
        TableDataModel model = getModel();
        model.prepareForRestoringRowIndexes();
        restoreRows(false);
    }
View Full Code Here

        restoreRows(false);
    }

    @Override
    protected void restoreRows(boolean forceDecodingRows) {
        TableDataModel model = getModel();
        boolean rowsDecodingRequired = forceDecodingRows || isRowsDecodingRequired();
        updateModel(false, false, rowsDecodingRequired);
        Set unavailableRowIndexes = model.restoreRows(rowsDecodingRequired);
        setUnavailableRowIndexes(unavailableRowIndexes);
    }
View Full Code Here

     * @param rowKey row key object for a row whose page index should be detected.
     * @return index of a page where a row with the specified rowKey is displayed, or -1 of no such row is being
     *         displayed.
     */
    public int getPageIndexForRowKey(Object rowKey) {
        TableDataModel model = getModel();
        int pageCount = model.getPageCount();
        int prevPageIndex = getPageIndex();
        try {
            for (int pageIndex = 0; pageIndex < pageCount; pageIndex++) {
                model.setPageIndex(pageIndex);
                model.setRowKey(rowKey);
                int index = model.getRowIndex();
                if (index != -1)
                    return pageIndex;
            }
        } finally {
            model.setPageIndex(prevPageIndex);
        }
        return -1;
    }
View Full Code Here

        if ((TableUtil.isSortingToggledInThisRequest(context) || TableUtil.isFilteringToggledInThisRequest(context)) && getPageSize() > 0) {
            Boolean restorePaginationPage = false;
            if (getKeepSelectionVisible()) {
                AbstractTableSelection selection = getSelection();
                if (selection instanceof DataTableSelection) {
                    TableDataModel model = getModel();
                    int pageCount = model.getPageCount();
                    Object firstRowData = ((DataTableSelection) selection).getFirstSelectedRowData();
                    if (firstRowData != null) {
                        for (pageIndex = 0; pageIndex < pageCount; pageIndex++) {
                            model.setPageIndex(pageIndex);
                            if (model.isObjectInList(firstRowData)) {
                                restorePaginationPage = true;
                                break;
                            }
                        }
                    }
View Full Code Here

     * method explicitly. Note that this method returns the proper value only after the DataTable is rendered for the
     * first time.
     */
    public void updateModel(boolean updateSortingFromBindings, boolean updatePageIndex, boolean readActualData) {
        setRowsDecodingRequired(readActualData);
        TableDataModel model = getModel();
        model.startUpdate();
        int incomingPageIndex = Integer.MIN_VALUE;
        try {
            if (updateSortingFromBindings) {
                updateSortingFromBindings();
                model.setSortingRules(getSortingRules());

                RowGrouping rowGrouping = getRowGrouping();
                if (rowGrouping != null)
                    model.setGroupingRules(rowGrouping.getGroupingRules());
            }

            if (getRowsDecodingRequired())
                model.setWrappedData(getValueExpression());
            else
                model.setWrappedData(Collections.EMPTY_LIST);
            model.setFilters(getActiveFilters());
            model.setPageSize(getPageSize());

            if (updatePageIndex) {
                incomingPageIndex = getPageIndex();
                model.setPageIndex(incomingPageIndex);
            }
        } finally {
            model.endUpdate();
            if (updatePageIndex && incomingPageIndex != Integer.MIN_VALUE) {
                int newPageIndex = model.getPageIndex();
                if (newPageIndex != incomingPageIndex) {
                    setPageIndex(newPageIndex);
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.openfaces.component.table.impl.TableDataModel

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.