void () { Runnable updateDaemons = () -> { List<DaemonState> daemonStateList = ContainerUtil.filter(GradleDaemonServices.getDaemonsStatus(), state -> myShowStopped || state.getToken() != null); ApplicationManager.getApplication().invokeLater(() -> { myTableModel.setItems(daemonStateList); myContent.stopLoading(); invalidateActions(); }); }; if (ApplicationManager.getApplication().isDispatchThread()) { myContent.startLoading(); ApplicationManager.getApplication().executeOnPooledThread(updateDaemons); } else { ApplicationManager.getApplication().invokeLater(() -> { myContent.startLoading(); ApplicationManager.getApplication().executeOnPooledThread(updateDaemons); }); } }