(ActionEvent evt)
| 809 | |
| 810 | bindTabActionListener(b, new ActionListener() { |
| 811 | @Override |
| 812 | public void actionPerformed(ActionEvent evt) { |
| 813 | |
| 814 | if (selectedTab != null) { |
| 815 | if (tabUIID != null) { |
| 816 | selectedTab.setUIID(tabUIID); |
| 817 | } |
| 818 | if (!animateTabSelection) { |
| 819 | selectedTab.setShouldCalcPreferredSize(true); |
| 820 | selectedTab.repaint(); |
| 821 | } |
| 822 | int previousSelectedIndex = tabsContainer.getComponentIndex(selectedTab); |
| 823 | |
| 824 | // this might happen if a tab was removed |
| 825 | if (previousSelectedIndex != -1) { |
| 826 | Component previousContent = contentPane.getComponentAt(previousSelectedIndex); |
| 827 | if (previousContent instanceof Container) { |
| 828 | ((Container) previousContent).setBlockFocus(true); |
| 829 | } |
| 830 | } |
| 831 | } |
| 832 | if (active != tabsContainer.getComponentIndex(b)) { |
| 833 | active = tabsContainer.getComponentIndex(b); |
| 834 | Component content = contentPane.getComponentAt(active); |
| 835 | if (content instanceof Container) { |
| 836 | ((Container) content).setBlockFocus(false); |
| 837 | } |
| 838 | setSelectedIndex(active, animateTabSelection); |
| 839 | initTabsFocus(); |
| 840 | selectedTab = b; |
| 841 | if (!animateTabSelection) { |
| 842 | selectedTab.setShouldCalcPreferredSize(true); |
| 843 | tabsContainer.revalidateLater(); |
| 844 | } |
| 845 | tabsContainer.scrollComponentToVisible(selectedTab); |
| 846 | } |
| 847 | } |
| 848 | }); |
| 849 | |
| 850 | if (component instanceof Container) { |
nothing calls this directly
no test coverage detected