void () { ThreadingAssertions.assertEventDispatchThread(); disposeUsageContextPanels(); if (isPreviewUsages()) { myPreviewSplitter.setProportion(getUsageViewSettings().getPreviewUsagesSplitterProportion()); JBTabbedPane tabbedPane = new JBTabbedPane(SwingConstants.BOTTOM); tabbedPane.setTabComponentInsets(null); UsageContextPanel.Provider[] extensions = UsageContextPanel.Provider.EP_NAME.getExtensions(myProject); List<UsageContextPanel.Provider> myUsageContextPanelProviders = ContainerUtil.filter(extensions, provider -> provider.isAvailableFor(this)); Map<@NlsContexts.TabTitle String, JComponent> components = new LinkedHashMap<>(); for (UsageContextPanel.Provider provider : myUsageContextPanelProviders) { JComponent component; if (myCurrentUsageContextProvider == null || myCurrentUsageContextProvider == provider) { myCurrentUsageContextProvider = provider; UsageContextPanel panel = provider.create(this); myAllUsageContextPanels.add(panel); myCurrentUsageContextPanel = panel; component = myCurrentUsageContextPanel.createComponent(); } else { component = new JLabel(); } components.put(provider.getTabTitle(), component); } JBPanelWithEmptyText panel = new JBPanelWithEmptyText(new BorderLayout()); if (components.size() == 1) { panel.add(components.values().iterator().next(), BorderLayout.CENTER); } else { for (Map.Entry<@NlsContexts.TabTitle String, JComponent> entry : components.entrySet()) { tabbedPane.addTab(entry.getKey(), entry.getValue()); } int index = myUsageContextPanelProviders.indexOf(myCurrentUsageContextProvider); tabbedPane.setSelectedIndex(index); tabbedPane.addChangeListener(e -> { int currentIndex = tabbedPane.getSelectedIndex(); UsageContextPanel.Provider selectedProvider = myUsageContextPanelProviders.get(currentIndex); if (selectedProvider != myCurrentUsageContextProvider) { tabSelected(selectedProvider); UsageViewStatisticsCollector.logTabSwitched(myProject, this); } }); panel.add(tabbedPane, BorderLayout.CENTER); } myPreviewSplitter.setSecondComponent(panel); } else { myPreviewSplitter.setSecondComponent(null); myPreviewSplitter.setProportion(1); } myRootPanel.revalidate(); myRootPanel.repaint(); }