/** 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(); } }
int size = AuRequests.getInt(data, "size", oldsize); if (size != oldsize) { int begin = getActivePage() * oldsize; int end = begin + oldsize; end = Math.min(getPaginal().getTotalSize(), end);
int atg = pgi != null ? _grid.getActivePage() : 0; RowRenderer renderer = null; Component next = null;