code: private Map<String, List<Integer>> createItemIdIndexMap(final boolean expandedOnly) {
  
  		Map<String, List<Integer>> map = new HashMap<>();
  		TreeItemModel treeModel = getTreeModel();
  		int rows = treeModel.getRowCount();
  		Set<String> expanded = null;
  		WTree.ExpandMode mode = getExpandMode();
  		if (expandedOnly) {
  			expanded = getExpandedRows();
  			if (mode == WTree.ExpandMode.LAZY) {
  				expanded = new HashSet<>(expanded);
  				expanded.addAll(getPrevExpandedRows());
  			}
  		}
  
  		for (int i = 0; i < rows; i++) {
  			List<Integer> index = new ArrayList<>();
  			index.add(i);
  			processItemIdIndexMapping(map, index, treeModel, expanded);
  		}
  		return Collections.unmodifiableMap(map);
  	}
docs: Map item ids to the row index.
  
  @param expandedOnly include expanded only
  
  @return the map of item ids to their row index.