static Runnable disableAllButtonsWhileCalcing(final Runnable r) { ret r { final JButton button = heldInstance(JButton); L buttons = childrenOfType(JButton, (Component) getPossiblyInternalFrame(button); final L enabledButtons = onlyEnabledComponents(buttons); disableButtons(enabledButtons); thread { try { callF(r); } finally { enableButtons(enabledButtons); } } }; }