void updateActionItems() {
    if (!myUpdateTimer.isRunning()) {// don't update actions if was hidden
      return;
    }

    final long timeNs = System.nanoTime();
    final long elapsedFromStartShowNs = timeNs - myStartShowNs;
    myLastUpdateNs = timeNs;

    if (USE_CACHED_PRESENTATIONS && elapsedFromStartShowNs < DELAY_FOR_CACHED_PRESENTATIONS_NS) {
      // When user types text and presses modifier keys it causes to show alternative touchbar layouts, some of them are visible less than second.
      // To avoid unnecessary slow-update invocations for such bars we always try to use cached presentations for the first 500 ms
      if (myStats != null) {
        myStats.incrementCounter(StatsCounters.forceUseCached);
      }
      // start manual timer to update action-buttons if necessary
      final Timer t = new Timer(DELAY_FOR_CACHED_PRESENTATIONS_MS, e -> {
        if (System.nanoTime() - myLastUpdateNs > DELAY_FOR_CACHED_PRESENTATIONS_NS) { // update action-buttons if last update was long time ago
          if (myStats != null) {
            myStats.incrementCounter(StatsCounters.forceCachedDelayedUpdateCount);
          }
          updateActionItems();
        }
      });
      t.setRepeats(false);
      t.start();
      return;
    }

    if (myCustomizer != null) {
      myCustomizer.onBeforeActionsExpand(myActionGroup);
    }

    // NOTE: some of buttons (from dialogs for example) has custom component (used in _performAction, as event source (i.e. DataContext))
    // but here we expand actions with current-focus-component (theoretically it can cause that some actions will be updated incorrectly)
    DataContext dataContext = Utils.createAsyncDataContext(DataManager.getInstance().getDataContext(Helpers.getCurrentFocusComponent()));
    if (myLastUpdate != null) myLastUpdate.cancel();
    myLastUpdate = Utils.expandActionGroupAsync(myActionGroup, myFactory, dataContext, ActionPlaces.TOUCHBAR_GENERAL, true, false);
    myLastUpdate.onSuccess(actions -> _applyPresentationChanges(actions)).onProcessed(__ -> myLastUpdate = null);
    if (myStats != null) {
      myStats.incrementCounter(StatsCounters.totalUpdateDurationNs, System.nanoTime() - timeNs);
    }
  }
void updateActionItems()