void () { myLayout.show(mySettingsPanel, WAIT_CARD); final Runnable replaceLayout = () -> { if (!myIsDisposed) { ensureCurrentPanel().onSomethingChanged(); String schemeName = myModel.getSelectedScheme().getName(); updateSetFrom(); myLayout.show(mySettingsPanel, schemeName); } }; if (ApplicationManager.getApplication().isHeadlessEnvironment()) { replaceLayout.run(); } else { myAlarm.cancel(false); myAlarm = EdtExecutorService.getScheduledExecutorInstance().schedule(replaceLayout, 200, TimeUnit.MILLISECONDS); } }