void () { adjustEditorsVisibility(); myToolbarWrapper.refresh(); myComponent.repaint(); final JComponent focusComponent = getPreferredFocusedComponent(); Component focusOwner = IdeFocusManager.findInstance().getFocusOwner(); if (focusComponent != null && focusOwner != null && SwingUtilities.isDescendingFrom(focusOwner, getComponent())) { IdeFocusManager.findInstanceByComponent(focusComponent).requestFocus(focusComponent, true); } }