Bug 126658 [CommonNavigator] [DND] Complete definition of DND API
bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonViewer.java
}
	}
	/**
	 * Returns the index where the item should be inserted. It uses sorter to
	 * determine the correct position, if sorter is not assigned, returns the
	 * index of the element after the last.
	 * 
	 * @param items
	 *            the items to search
	 * @param lastInsertion
	 *            the start index to start search for position from this allows
	 *            optimising search for multiple elements that are sorted
	 *            themself.
	 * @param element
	 *            element to find position for.
	 * @return the index to use when inserting the element.
	 * 
	 */
	private int insertionPosition(Item[] items, int lastInsertion,
			TreeViewerSorter sorter, Object parent, Object element) {
		int size = items.length;
		if (getSorter() == null)
			return size;
		int min = lastInsertion, max = size - 1;
		while (min <= max) {
			int mid = (min + max) / 2;
			Object data = items[mid].getData();
			int compare = sorter.compare(this, parent, data, element);
			if (compare == 0) {
				return mid;