static A selectAllOnFocusIf(final A tc, final F0 condition) { if (tc != null) onFocus(tc, r { if (isTrue(callF(condition))) awt { tc.selectAll() } }); // important to wait one AWT cycle ret tc; }