/** @param cnt # of children that need special handling (used for optimization). * -1 means process all of them */ private void afterUnmarshal(int cnt) { for (Iterator it = getChildren().iterator(); it.hasNext();) { final Object child = it.next(); if (child instanceof Rows) { _rows = (Rows) child; if (--cnt == 0) break; } else if (child instanceof Columns) { _cols = (Columns) child; if (--cnt == 0) break; } else if (child instanceof Paging) { _pgi = _paging = (Paging) child; addPagingListener(_pgi); if (--cnt == 0) break; } else if (child instanceof Frozen) { _frozen = (Frozen) child; if (--cnt == 0) break; } else if (child instanceof Foot) { _foot = (Foot) child; if (--cnt == 0) break; } } }
/** Creates the internal paging component. */ private void newInternalPaging() { final Paging paging = new InternalPaging(); paging.setDetailed(true); paging.applyProperties(); //min page size is 1 if (_model instanceof Pageable && ((Pageable) _model).getPageSize() > 0) { paging.setPageSize(((Pageable) _model).getPageSize()); } paging.setTotalSize(_rows != null ? getDataLoader().getTotalSize() : 0); //min page index is 0 if (_model instanceof Pageable && ((Pageable) _model).getActivePage() >= 0) { paging.setActivePage(((Pageable) _model).getActivePage()); } paging.setParent(this); if (_pgi != null) addPagingListener(_pgi); }
addPagingListener(_pgi); else newInternalPaging();
_paging.detach(); _pgi.setTotalSize(_rows != null ? getDataLoader().getTotalSize() : 0); addPagingListener(_pgi); if (_pgi instanceof Component) smartUpdate("paginal", _pgi);