public boolean isCropper() { return _grid != null && inPagingMold() && _grid.getPageSize() <= getTotalSize(); //Single page is considered as not a cropper. //isCropper is called after a component is removed, so //we have to test >= rather than > }
/** Checks whether to invalidate, when a child has been added or * or will be removed. * @param bRemove if child will be removed */ private void checkInvalidateForMoved(Component child, boolean bRemove) { //No need to invalidate if //1) act == last and child in act //2) act != last and child after act //Except removing last element which in act and act has only one element final Grid grid = getGrid(); if (grid != null && grid.inPagingMold() && !isInvalidated()) { final List<Component> children = getChildren(); final int sz = children.size(), pgsz = grid.getPageSize(); int n = sz - (grid.getActivePage() + 1) * pgsz; if (n <= 0) { //must be last page n += pgsz; //check in-act (otherwise, check after-act) if (bRemove && n <= 1) { //last element, in act and remove invalidate(); return; } } else if (n > 50) n = 50; //check at most 50 items (for better performance) for (ListIterator<Component> it = children.listIterator(sz); --n >= 0 && it.hasPrevious();) if (it.previous() == child) return; //no need to invalidate invalidate(); } }
} else if (inPagingMold() && cmd.equals(ZulEvents.ON_PAGE_SIZE)) { final Map<String, Object> data = request.getData(); final int oldsize = getPageSize(); int size = AuRequests.getInt(data, "size", oldsize); if (size != oldsize) {