ActionCallback (Configurable configurable, String option) { ActionCallback callback = select(configurable); if (option != null && configurable instanceof SearchableConfigurable) { Runnable runnable = ((SearchableConfigurable)configurable).enableSearch(option); callback.doWhenDone(() -> { if (runnable != null) { runnable.run(); } else { setSearchText(option); } }); } return callback; }