void (Content content, final ActiveRunnable toRestore) { final TabInfo current = myTabs.getSelectedInfo(); myTabs.getPresentation().setPaintBlocked(true, true); select(content, false).doWhenDone(() -> { myTabs.getComponent().validate(); toRestore.run().doWhenDone(() -> { assert current != null; myTabs.select(current, true); myTabs.getPresentation().setPaintBlocked(false, true); }); }); }