void (String action, Object element) { if (!element.toString().equals(actionElement.toString())) return; Runnable runnable = () -> { myReadyRequest = true; Disposer.dispose(getBuilder()); }; if (actionAction.equals(action)) { if (getBuilder().getUi().isPassthroughMode()) { runnable.run(); } else { //noinspection SSBasedInspection SwingUtilities.invokeLater(runnable); } } }