void (String text, boolean now, @Nullable Runnable onDone) { Update update = new Update("pathFromTree") { @Override public void run() { myPathIsUpdating = true; getField().setText(text); myPathIsUpdating = false; if (onDone != null) { onDone.run(); } } }; if (now) { update.run(); } else { myUiUpdater.queue(update); } }