void () { final CommanderPanel activePanel = getActivePanel(); final CommanderPanel inactivePanel = getInactivePanel(); inactivePanel.setActive(true); activePanel.setActive(false); IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(getPreferredFocusedComponent(inactivePanel), true)); }