Starting from the anchor cell's node, fills the viewport from the anchor to the "ground" and then from the anchor
to the "sky".

@param itemIndex the index of the anchor cell
503736
private void fillViewportFrom(int itemIndex) {
        // cell for itemIndex is assumed to be placed correctly

        // fill up to the ground
        int ground = fillTowardsGroundFrom0(itemIndex);

        // if ground not reached, shift cells to the ground
        double gapBefore = distanceFromGround(ground);
        if(gapBefore > 0) {
            shiftCellsTowardsGround(ground, itemIndex, gapBefore);
        }

        // fill up to the sky
        int sky = fillTowardsSkyFrom0(itemIndex);

        // if sky not reached, add more cells under the ground and then shift
        double gapAfter = distanceFromSky(sky);
        if(gapAfter > 0) {
            ground = fillTowardsGroundFrom0(ground, -gapAfter);
            double extraBefore = -distanceFromGround(ground);
            double shift = Math.min(gapAfter, extraBefore);
            shiftCellsTowardsGround(ground, sky, -shift);
        }

        // crop to the visible cells
        int first = Math.min(ground, sky);
        int last = Math.max(ground, sky);
        while(first < last &&
                orientation.maxY(positioner.getVisibleCell(first)) <= 0.0) {
            ++first;
        }
        while(last > first &&
                orientation.minY(positioner.getVisibleCell(last)) >= sizeTracker.getViewportLength()) {
            --last;
        }
        firstVisibleIndex = first;
        lastVisibleIndex = last;
        positioner.cropTo(first, last + 1);
    }
842916
function (mode, index, item) {
/*Line 44 - 'AtomComboBox.js' */                var element = this.get_element();
/*Line 45 - 'AtomComboBox.js' */                var dataItems = this.get_dataItems();
/*Line 46 - 'AtomComboBox.js' */                element.options.length = dataItems.length;
/*Line 47 - 'AtomComboBox.js' */                var ae = new AtomEnumerator(dataItems);

/*Line 49 - 'AtomComboBox.js' */                var lp = this._labelPath;
/*Line 50 - 'AtomComboBox.js' */                var vp = this._valuePath;
/*Line 51 - 'AtomComboBox.js' */                var label = null;
/*Line 52 - 'AtomComboBox.js' */                var value = null;
/*Line 53 - 'AtomComboBox.js' */                var selectedValue = this.get_value();
/*Line 54 - 'AtomComboBox.js' */                while (ae.next()) {
/*Line 55 - 'AtomComboBox.js' */                    var data = ae.current();
/*Line 56 - 'AtomComboBox.js' */                    label = data;
/*Line 57 - 'AtomComboBox.js' */                    value = data;
/*Line 58 - 'AtomComboBox.js' */                    if (lp)
/*Line 59 - 'AtomComboBox.js' */                        label = label[lp];
/*Line 60 - 'AtomComboBox.js' */                    if (vp)
/*Line 61 - 'AtomComboBox.js' */                        value = value[vp];

/*Line 63 - 'AtomComboBox.js' */                    element.options[ae.currentIndex()] = new Option(label, value, false, value == selectedValue);
/*Line 64 - 'AtomComboBox.js' */                }
/*Line 65 - 'AtomComboBox.js' */            }
302883
public void setCurrentPos(int i)
  {

    if (!m_cacheNodes)
      throw new RuntimeException(
        XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!");

    m_next = i;
  }
1193341
function( x, y ) {
		var contentItem = this._layoutManager._$normalizeContentItem( this._itemConfig ),
			dragProxy = new lm.controls.DragProxy( x, y, this._dragListener, this._layoutManager, contentItem, null );
		
		this._layoutManager.transitionIndicator.transitionElements( this._element, dragProxy.element );
	}
653357
protected void postLayoutChild(final int dataIndex) {
        if (!mContainer.isDynamic()) {
            boolean visibleInLayout = !mViewPort.isClippingEnabled() || inViewPort(dataIndex);
            ViewPortVisibility visibility = visibleInLayout ?
                    ViewPortVisibility.FULLY_VISIBLE : ViewPortVisibility.INVISIBLE;
            Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "onLayout: child with dataId [%d] viewportVisibility = %s",
                    dataIndex, visibility);

            Widget childWidget = mContainer.get(dataIndex);
            if (childWidget != null) {
                childWidget.setViewPortVisibility(visibility);
            }
        }
    }
254231
public void setIndex(int index) {
        ElementBase parent = getParent();
        
        if (parent == null) {
            CWFException.raise("Element has no parent.");
        }
        
        int currentIndex = parent.children.indexOf(this);
        
        if (currentIndex < 0 || currentIndex == index) {
            return;
        }
        
        parent.moveChild(currentIndex, index);
    }
616358
def navigateToIndex( self, index ):
        
        self._completerTree.hide()
        item = self._navigationModel.itemFromIndex(index)
        self.setText(self._navigationModel.itemPath(item))
824112
function(index, item) {
      this.items[index] = (typeof item == "object") ? item.value : item;
      this.ul.childNodes[index].childNodes[0].innerHTML = (typeof item == "object") ? item.label : item;
   }
825734
protected void addItem(ItemState item)
   {
      index.put(item.getData().getIdentifier(), item);
      index.put(item.getData().getQPath(), item);
      index.put(new ParentIDQPathBasedKey(item), item);
      index.put(new IDStateBasedKey(item.getData().getIdentifier(), item.getState()), item);

      if (item.getData().isNode())
      {
         Map<String, ItemState> children = lastChildNodeStates.get(item.getData().getParentIdentifier());
         if (children == null)
         {
            children = new HashMap<String, ItemState>();
            lastChildNodeStates.put(item.getData().getParentIdentifier(), children);
         }
         children.put(item.getData().getIdentifier(), item);

         List<ItemState> listItemState = childNodeStates.get(item.getData().getParentIdentifier());
         if (listItemState == null)
         {
            listItemState = new ArrayList<ItemState>();
            childNodeStates.put(item.getData().getParentIdentifier(), listItemState);
         }
         listItemState.add(item);
         if (item.isPathChanged())
         {
            if (allPathsChanged == null)
            {
               allPathsChanged = new ArrayList<ItemState>();
            }
            allPathsChanged.add(item);
         }
      }
      else
      {
         Map<String, ItemState> children = lastChildPropertyStates.get(item.getData().getParentIdentifier());
         if (children == null)
         {
            children = new HashMap<String, ItemState>();
            lastChildPropertyStates.put(item.getData().getParentIdentifier(), children);
         }
         children.put(item.getData().getIdentifier(), item);

         List<ItemState> listItemState = childPropertyStates.get(item.getData().getParentIdentifier());
         if (listItemState == null)
         {
            listItemState = new ArrayList<ItemState>();
            childPropertyStates.put(item.getData().getParentIdentifier(), listItemState);
         }
         listItemState.add(item);
      }

      if (item.isNode() && item.isPersisted())
      {
         int[] childInfo = childNodesInfo.get(item.getData().getParentIdentifier());
         if (childInfo == null)
         {
            childInfo = new int[2];
         }

         if (item.isDeleted())
         {
            --childInfo[CHILD_NODES_COUNT];
         }
         else if (item.isAdded())
         {
            ++childInfo[CHILD_NODES_COUNT];
            childInfo[CHILD_NODES_LAST_ORDER_NUMBER] = ((NodeData)item.getData()).getOrderNumber();

         }
         childNodesInfo.put(item.getData().getParentIdentifier(), childInfo);
      }
   }
1218046
function(index) {
        if (this.animating) {
            return;
        }

        var indexes = this._getIndex(index),
            cloneIndex = indexes[0], // The index including clones
            visualIndex = indexes[1]; // The index excluding clones

        // Exit early if jumping to same index
        if (visualIndex === this.index) {
            return;
        }

        this.fireEvent('jumping', [this.index]);

        // Update tabs and items state
        this._updateTabs(visualIndex);
        this._updateItems(cloneIndex);

        // Animate and move the items
        this._beforeCycle();

        if (this.options.animation === 'fade') {
            this.items
                .conceal(true)
                .eq(visualIndex)
                    .transitionend(this._afterCycle.bind(this))
                    .reveal(true);

        } else {
            this.container
                .transitionend(this._afterCycle.bind(this))
                .css(this._position, -this._getSizeSum(cloneIndex));
        }

        // Store the index
        this.index = visualIndex;

        this.reset();
        this.fireEvent('jumped', [visualIndex]);
    }
734936
public void prepare(Element anchor, T item) {
        this.currentAnchor = anchor;
        this.currentItem = item;
        if(!this.timer.isRunning())
        {
            timer.schedule(DELAY_MS);
        }
    }
328814
function selectIndex(idx){

    // If another item is currently selected, deselect it
    if(selectedItem) selectedItem.className = selectedItem.className.replace(/\s?selected/,'');

    // Grab the search results straight from the DOM
    var r = document.getElementById('searchresults');
    var items = r.childNodes;

    // If we actually have no items, there's not much we can do
    if(items.length === 0){
      selectedSearchIndex = -1;
      selectedItem = false;
      return;
    }

    // Store the item and its index in helper variables
    selectedSearchIndex = idx;
    var s = selectedItem = items[idx];

    // Select the item
    s.className += ' selected';

    // Figure out whether or not the item is fully visible inside
    // the scrollable view, and if not, then scroll appropriately
    var o = s.offsetTop - r.offsetTop - r.scrollTop;
    if(o < 0){
      r.scrollTop = s.offsetTop - r.offsetTop;
    }else if(o > r.offsetHeight - s.offsetHeight){
      r.scrollTop = o + r.scrollTop - r.offsetHeight + s.offsetHeight;
    }
  }
256926
public void setItem(int node, int index)
  {

    if (!m_mutable)
      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");

    super.setElementAt(node, index);
  }
425632
private void setItem(int index, Timepoint time) {
        time = roundToValidTime(time, index);
        mCurrentTime = time;
        reselectSelector(time, false, index);
    }
1287113
public void addItem (int index, T item)
    {
        if (_items == null) {
            return;
        }
        _items.add(index, item);
    }
205663
private int itemToIndex(I i) {
		Integer r = allItems.absoluteIndexOf(i);
		return r == null ? -1 : r.intValue();
	}
495858
public final void notifyFooterItemRangeChanged(int positionStart, int itemCount) {
        if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > footerItemCount) {
            throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
                    + (positionStart + itemCount - 1) + "] is not within the position bounds for footer items [0 - "
                    + (footerItemCount - 1) + "].");
        }
        notifyItemRangeChanged(positionStart + headerItemCount + contentItemCount, itemCount);
    }