void (final boolean active) { myActive = active; if (active) { myTitlePanel.setBackground(DARK_BLUE); myTitlePanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED, DARK_BLUE_BRIGHTER, DARK_BLUE_DARKER)); myParentTitle.setForeground(Color.white); } else { final Color color = UIUtil.getPanelBackground(); myTitlePanel.setBackground(color); myTitlePanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED, color.brighter(), color.darker())); myParentTitle.setForeground(JBColor.foreground()); } final int[] selectedIndices = myList.getSelectedIndices(); if (selectedIndices.length == 0 && myList.getModel().getSize() > 0) { myList.setSelectedIndex(0); if (!myList.hasFocus()) { IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(myList, true)); } } else if (myList.getModel().getSize() > 0) { // need this to generate SelectionChanged events so that listeners, added by Commander, will be notified myList.setSelectedIndices(selectedIndices); } }