boolean (@NotNull JTree tree, TreeModel model) { UIUtil.dispatchAllInvocationEvents(); if (model instanceof AsyncTreeModel async) { if (async.isProcessing()) return true; UIUtil.dispatchAllInvocationEvents(); return async.isProcessing(); } AbstractTreeBuilder builder = AbstractTreeBuilder.getBuilderFor(tree); if (builder == null) return false; AbstractTreeUi ui = builder.getUi(); if (ui == null) return false; return ui.hasPendingWork(); }