void (final Function<? super List<NavBarItem>, Integer> indexToSelectCallback, boolean showPopup) { myUpdateQueue.queueModelUpdateFromFocus(); myUpdateQueue.queueRebuildUi(); myUpdateQueue.queueSelect(() -> { if (!myList.isEmpty()) { int index = indexToSelectCallback.apply(myList); myModel.setSelectedIndex(index); requestSelectedItemFocus(); if (showPopup) { ctrlClick(index); } } }); myUpdateQueue.flush(); }