Navigator should point to most recent added element.
@param item
486668
public void add(T item) {
        hasElements = true;
        navigator = emptyItemIndex;
        items[emptyItemIndex] = item;
        if (emptyItemIndex == size - 1) {
            wasFullAtleastOnce = true;
        }
        emptyItemIndex = (emptyItemIndex + 1) % size;
    }
978402
protected void openPopup(final A_CmsContextMenuItem item) {

        m_popup.add(item.getSubMenu());
        m_popup.addAutoHidePartner(item.getElement());
        m_popup.setModal(false);
        m_popup.show();

        setSubMenuPosition(item);

        if (m_isFixed) {
            m_popup.setPositionFixed();
        }
    }
163197
public void addItem(T item) {
        mListItems.add(item);
        notifyItemInserted(mListItems.indexOf(item));
    }
981442
public void bind(Object item) {
    this.item = item;
    if (onItemBindListener != null) {
      onItemBindListener.onItemBind(itemView, item, getAdapterPosition());
    }
  }
974263
public synchronized void addItem(final T item) {
        // Log.w(TAG,"public synchronized void addItem(T item) {... (START)");
        // if mapView is not inflated or if not in viewport, add to leftItems
        if (mapView.getWidth() == 0 || !isItemInViewport(item)) {
//            Log.i(TAG,"public synchronized void addItem(T item) {... (1)");
            synchronized (leftItems) {
                // Log.w(TAG,"public synchronized void addItem(T item) {... (2)");
                if (clusterTask != null && clusterTask.isCancelled()) return;
                leftItems.add(item);
            }
        } else if (maxClusteringZoom >= mapView.getModel().mapViewPosition
                .getZoomLevel()) {
            // else add to a cluster;
            Point pos = mapView.getMapViewProjection().toPixels(item.getLatLong());
            // check existing cluster
//            Log.i(TAG,"spublic synchronized void addItem(T item) {...... (3)");
            synchronized (clusters) {
                // Log.w(TAG,"spublic synchronized void addItem(T item) {...... (4)");
                for (Cluster<T> mCluster : clusters) {
//                    Log.i(TAG,"public synchronized void addItem(T item) {... (5)");
                    if (clusterTask != null && clusterTask.isCancelled()) return;
                    if (mCluster.getItems().size() == 0)
                        throw new IllegalArgumentException("cluster.getItems().size() == 0");
                    // find a cluster which contains the marker.
                    // use 1st element to fix the location, hinder the cluster from
                    // running around and isClustering.
                    LatLong gpCenter = mCluster.getItems().get(0)
                            .getLatLong();
                    if (gpCenter == null)
                        throw new IllegalArgumentException();
                    Point ptCenter = mapView.getMapViewProjection().toPixels(gpCenter);
                    // find a cluster which contains the marker.
                    if (pos.distance(ptCenter) <= GRIDSIZE
                    /*
                     * pos.x >= ptCenter.x - GRIDSIZE && pos.x <= ptCenter.x +
                     * GRIDSIZE && pos.y >= ptCenter.y - GRIDSIZE && pos.y <=
                     * ptCenter.y + GRIDSIZE
                     */) {
                        mCluster.addItem(item);
                        return;
                    }
                } // END: for (Cluster<T> cluster : clusters) {
                // No cluster contain the marker, create a new cluster.
                clusters.add(createCluster(item));
            } // END: synchronized (clusters) {
        } else {
            // No clustering allowed, create a new cluster with single item.
            synchronized (clusters) {
//                Log.i(TAG,"public synchronized void addItem(T item) {... (6)");
                clusters.add(createCluster(item));
            }
        }
//        Log.i(TAG,"public synchronized void addItem(T item) {... (END)");
    }
631075
public synchronized T addItem(V item) {
        if(item == null) {
            return self();
        }

        items.add(item);
        if(selectedIndex == -1) {
            selectedIndex = 0;
        }
        invalidate();
        return self();
    }
500000
function(item) {
        var id = item.id || item;

        var removedItem;
        var index = Selectivity.findIndexById(this._data, id);
        if (index > -1) {
            removedItem = this._data[index];
            this._data.splice(index, 1);
        }

        if (this._value[index] !== id) {
            index = this._value.indexOf(id);
        }
        if (index > -1) {
            this._value.splice(index, 1);
        }

        if (removedItem) {
            this.triggerChange({ removed: removedItem });
        }

        if (id === this._highlightedItemId) {
            this._highlightedItemId = null;
        }

        this._updateInputWidth();
    }
660206
protected void addNewField(Item item, String values) {
        if(logger.isDebugEnabled()) {
            logger.debug("Tagging item with field: " + newField + " and value: " + values);
        }
        Document document = item.getDescriptorDom();
        if(document != null) {
            Element root = document.getRootElement();
            if(root != null) {
                for(String value : values.split(",")) {
                    Element newElement = root.addElement(newField);
                    newElement.setText(value);
                }
            }
        }
    }
238138
public void select(Item item, boolean considerSelectableFlag) {
        if (considerSelectableFlag && !item.isSelectable()) {
            return;
        }
        item.withSetSelected(true);
        if (mSelectionListener != null) {
            mSelectionListener.onSelectionChanged(item, true);
        }
    }
1336852
public void ensureVisible(CmsSitemapTreeItem item) {

        // open the tree
        CmsTreeItem ti = item.getParentItem();
        while (ti != null) {
            ti.setOpen(true);
            ti = ti.getParentItem();
        }
        // scroll
        CmsDomUtil.ensureVisible(RootPanel.getBodyElement(), item.getElement(), 200);
    }
193185
@Override
    public void onUpdate(Detector.Detections<Barcode> detectionResults, Barcode item) {
        mOverlay.add(mGraphic);
        mGraphic.updateItem(item);
    }
130756
function(item) {
            if(!item || (item && !item.element) || (item && !item.position))
                return;

            switch(item.position) {
                case 'left':
                    item.element
                    .removeClass('timeline-me-top')
                    .removeClass('timeline-me-right')
                    .removeClass('timeline-me-bottom')
                    .addClass('timeline-me-left');
                    break;
                case 'top':
                    item.element
                    .removeClass('timeline-me-left')
                    .removeClass('timeline-me-right')
                    .removeClass('timeline-me-bottom')
                    .addClass('timeline-me-top');
                    break;
                case 'right':
                    item.element
                    .removeClass('timeline-me-top')
                    .removeClass('timeline-me-left')
                    .removeClass('timeline-me-bottom')
                    .addClass('timeline-me-right');
                    break;
                case 'bottom':
                    item.element
                    .removeClass('timeline-me-top')
                    .removeClass('timeline-me-right')
                    .removeClass('timeline-me-left')
                    .addClass('timeline-me-bottom');
                    break;
            }

            return item;
        }
513910
function(item) {
            var $handle = $.data(item, 'select-handle');

            if ($handle) {
                $handle.removeData('select-item');
                this.removeAllListeners($handle);
            }

            $.removeData(item, 'select');
            $.removeData(item, 'select-handle');

            if (this.$focusedItem && this.$focusedItem[0] === item) {
                this.$focusedItem = null;
            }
        }
3021
def center_on(self, item):
        
        if not isinstance(item, GraphicsItem):
            item = coerce_point(item)
        self.proxy.center_on(item)
953600
function (item) {
            // Check if it already exists in the suggestions list.  Duplicates aren't allowed.
            var exists = false;
            for(var j = 0; j < suggestions.length; j++){
              if(suggestions[j].attr('name').toLowerCase() === item.name.toLowerCase()){
                exists=true;
                break;
              }
            }
            // If it didn't exist, add it to the list of suggestions and the searchTerms.
            if(!exists){
              suggestions.push(item);
            }

            // We are using searchTerms's setter to execute the filter, so have to set the property (not just update):
            var searchTerms = self.viewModel.attr('searchTerms').attr().concat(item.name);
            self.viewModel.attr('searchTerms', searchTerms);
          }
802334
public void add(T item) {
        CompletableFuture<Queue<T>> pending;
        Queue<T> result = null;
        synchronized (this.contents) {
            Exceptions.checkNotClosed(this.closed, this);
            this.contents.addLast(item);
            pending = this.pendingTake;
            this.pendingTake = null;
            if (pending != null) {
                result = fetch(this.contents.size());
            }
        }

        if (pending != null) {
            pending.complete(result);
        }
    }
293410
function(item) {
            var itemElm;
            switch(item.type) {
                case 'milestone':
                    itemElm = this._buildMilestoneElement(item);
                    break;
                case 'smallItem':
                    itemElm = this._buildSmallItemElement(item);
                    break;
                case 'bigItem':
                    itemElm = this._buildBigItemElement(item);
                    break;
            }
            item.element = itemElm;
            this._refreshItemPosition(item);

            item.element.on('timelineMe.itemHeightChanged', function(event) {
                // Do some stuff
            });
            item.element.on('timelineMe.smallItem.displayfull', function(event) {
                // Do some stuff
            });
            item.element.on('timelineMe.bigItem.flipped', function(event) {
                var container = item.element.find('.timeline-me-content-container');
                if(item.element.hasClass('timeline-me-flipped')) {
                    container.height(item.fullContentElement.outerHeight());
                } else {
                    container.height(item.shortContentElement.outerHeight());
                }
            });

            this._buildItemContent(item);
            this._fillItem(item);

            return itemElm;
        }