Update the state variables after scrolling the Carousel view port.

@method updateStateAfterScroll
@param {Integer} item The index to which the Carousel has scrolled to.
@param {Integer} sentinel The last element in the view port.
@private
775250
function updateStateAfterScroll(item, sentinel) {
        var carousel   = this,
            page       = carousel.get("currentPage"),
            newPage,
            numPerPage = carousel.get("numVisible");

        newPage = parseInt(carousel._firstItem / numPerPage, 10);
        if (newPage != page) {
            carousel.setAttributeConfig("currentPage", { value: newPage });
            carousel.fireEvent(pageChangeEvent, newPage);
        }

        if (carousel.get("selectOnScroll")) {
            if (carousel.get("selectedItem") != carousel._selectedItem) {
                carousel.set("selectedItem", carousel._selectedItem);
            }
        }

        clearTimeout(carousel._autoPlayTimer);
        delete carousel._autoPlayTimer;
        if (carousel.isAutoPlayOn()) {
            carousel.startAutoPlay();
        }

        carousel.fireEvent(afterScrollEvent,
                           { first: carousel._firstItem,
                             last: sentinel },
                           carousel);
    }
702407
function (item) {
        if (this.state.held && this.state.dragged && this.state.dragged.item === item) {
          return this.state.draggedStyle;
        }
        return undefined;
      }
529826
protected final void itemHasBeenRestored(AbstractItem item)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "itemHasBeenRestored", item);

        super.itemHasBeenRestored(item);
        _setWatermarks((ItemStream)item);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "itemHasBeenRestored");
    }
404151
function (item) {
            var ri,
                key = this._getKeyForItem(item),
                list = this.$renderedItems;
            if (key) {
                list = this.$renderedItemsMap[key];
            }
            for (var i = 0; i < list.length; i++) {
                ri = list[i];
                if (key || ri.item === item) {
                    this.$parent.removeChild(ri.component);
                    list.splice(i, 1);
                    ri.component.destroy();
                    return;
                }
            }
        }
993670
function (event) {
        this.hover = this.getBounds().containsPoint(event.gameX, event.gameY);

        if (this.selected) {
            // follow the pointer
            this.pos.set(event.gameX, event.gameY, this.pos.z);
            this.pos.sub(this.grabOffset);
            this.updateChildBounds();
        }
    }
1157080
function (item, state) {
                state.count = 0;
                state.sub = {};
                item.reset(state.sub);
            }
485800
function scrollInterpolator2 (index, carouselProps) {
    const range = [2, 1, 0, -1];
    const inputRange = getInputRangeFromIndexes(range, index, carouselProps);
    const outputRange = range;

    return { inputRange, outputRange };
}
724169
function setCheckedItem(itemIndex, toggle) {
    const item = this.state.items[itemIndex];

    if (item) {
        if (this.state.isCheckbox && !toggle) {
            item.checked = true;
        } else if (this.state.isCheckbox && toggle) {
            item.checked = !item.checked;
        } else if (this.state.isRadio) {
            this.state.items[itemIndex].checked = true;
        }

        if (this.state.isCheckbox || this.state.isRadio) {
            this.setStateDirty('items');
        }

        if (this.state.isRadio || toggle) {
            this.processAfterStateChange([itemIndex]);
        }
    }
}
1235724
function (item) {
            var key = this._getKeyForItem(item),
                list = this.$renderedItems;
            if (key) {
                list = this.$renderedItemsMap[key];
            }
            if (list) {
                var ri;
                for (var i = 0; i < list.length; i++) {
                    ri = list[i];
                    if (key || ri.item === item) {
                        return ri.component;
                    }
                }
            }
            return null;
        }
772784
public void updateContainer(IndexedContainer data) {

        m_container.removeAllItems();
        m_container = data;
        setContainerDataSource(m_container);
        setItemIconPropertyId(PROP_ICON);
        setRowHeaderMode(RowHeaderMode.ICON_ONLY);

        setVisibleColumns(PROP_CAPTION, PROP_DESCRIPTION, PROP_OU);
        setColumnWidth(null, 40);
        this.refreshRowCache();

    }
314919
function (args) {
            if (this._updatesStopped()) {
                return;
            }
            var dataName = args.dataName;
            if (dataName == "selected") {
                var item = args.dataHolder;
                if ((args.newValue && !args.oldValue) // item was just selected
                        || (!args.newValue && args.oldValue) // item was just unselected
                ) {
                    this._selectionChanged(item.index);
                }
            } else if (dataName == "initiallyDisabled") {
                this._updateCurrentlyDisabled([args.dataHolder]);
            }
        }
888156
function handleScroll(scrollLeft) {
    const { state } = this;
    const { config, items, gap } = state;
    let closest;

    if (scrollLeft >= getMaxOffset(state) - gap) {
        closest = items.length - 1;
    } else {
        // Find the closest item using a binary search on each carousel slide.
        const itemsPerSlide = state.itemsPerSlide || 1;
        const totalItems = items.length;
        let low = 0;
        let high = Math.ceil(totalItems / itemsPerSlide) - 1;

        while (high - low > 1) {
            const mid = Math.floor((low + high) / 2);
            if (scrollLeft > items[mid * itemsPerSlide].left) {
                low = mid;
            } else {
                high = mid;
            }
        }

        const deltaLow = Math.abs(scrollLeft - items[low * itemsPerSlide].left);
        const deltaHigh = Math.abs(scrollLeft - items[high * itemsPerSlide].left);
        closest = normalizeIndex(state, (deltaLow > deltaHigh ? high : low) * itemsPerSlide);
    }

    if (state.index !== closest) {
        config.skipScrolling = true;
        config.preserveItems = true;
        this.setState('index', closest);
        emitAndFire(this, 'carousel-scroll', { index: closest });
    }
}
999507
function handleDotClick(originalEvent, target) {
    if (this.isMoving) {
        return;
    }
    const { state: { config, itemsPerSlide } } = this;
    const slide = parseInt(target.getAttribute('data-slide'), 10);
    config.preserveItems = true;
    this.setState('index', slide * itemsPerSlide);
    emitAndFire(this, 'carousel-slide', { slide: slide + 1, originalEvent });
}
375381
function (obj) {
            var carousel   = this,
                carouselEl = carousel._carouselEl,
                el, item, num, pos;

            num  = carousel.get("numItems");
            item = obj.item;
            pos  = obj.pos;

            if (item && (el = Dom.get(item.id))) {
                if (el && Dom.isAncestor(carouselEl, el)) {
                    Event.purgeElement(el, true);
                    carouselEl.removeChild(el);
                }

                if (carousel.get("selectedItem") == pos) {
                    pos = pos >= num ? num - 1 : pos;
                }
            } else {
                YAHOO.log("Unable to find item", "warn", WidgetName);
            }

            carousel._syncUiItems();
        }
226380
private void updatePaginationState(final SimplePager pager) {

        for (int i = 0; i < getWidgetCount(); i++) {
            if (i == 0) { //previous button
                ((AnchorListItem)getWidget(i)).setEnabled(pager.hasPreviousPage());
            }
            else if (i == getWidgetCount() - 1) { //next button
                ((AnchorListItem)getWidget(i)).setEnabled(pager.hasNextPage());
            }
            else {
                int index = i - 1;
                if (index == pager.getPage()) {
                    ((AnchorListItem)getWidget(i)).setActive(true);
                }
                else {
                    ((AnchorListItem)getWidget(i)).setActive(false);
                }
            }
        }
   }
1280873
public void remove(ItemState item)
   {
      if (item.isNode())
      {
         remove(item.getData().getQPath());
      }
      else 
      {
         removeProperty(item, -1);
      }
   }
565216
function (newItems) {

            var itemsListener = this._itemsListener;
            var json = this.json;
            var oldItems = this._data.items;
            var numberOfItems;

            if (oldItems == newItems) {
                // items did not change
                // return;
                numberOfItems = newItems.length;
            } else {
                if (oldItems) {
                    // remove the listener on the old items object:
                    for (var i = 0, l = oldItems.length; i < l; i++) {
                        json.removeListener(oldItems[i], null, itemsListener);
                    }
                }
                json.setValue(this._data, "items", newItems);

                if (newItems) {
                    numberOfItems = newItems.length;
                    // add the listener on the new items object:
                    for (var i = 0, l = newItems.length; i < l; i++) {
                        json.addListener(newItems[i], null, itemsListener);
                    }
                    var view = this._data.itemsView;
                    if (view) {
                        view.initialArray = newItems;
                        view.refresh(view.CHANGED_INITIAL_ARRAY);
                    }
                }
            }

            if (this._data.displayOptions) {
                this._calcRowCols(this._data.displayOptions.flowOrientation, this._data.numberOfRows, this._data.numberOfColumns, numberOfItems);
            }

        }