ContributionTab getActiveTab() { switch (tabbedPane.getSelectedIndex()) { case 0: return librariesContributionTab; case 1: return modesContributionTab; case 2: return toolsContributionTab; case 3: return examplesContributionTab; default: return updatesContributionTab; } }
public void showFrame(Editor editor, ContributionType contributionType) { this.editor = editor; // Calculating index to switch to the required tab int index = getIndex(contributionType); if (dialog == null) { makeFrame(editor); // done before as downloadAndUpdateContributionListing() // requires the current selected tab tabbedPane.setSelectedIndex(index); downloadAndUpdateContributionListing(editor.getBase()); if (index != 4) { Component selected = tabbedPane.getTabComponentAt(tabbedPane.getSelectedIndex()); selected.setBackground(new Color(0xe0fffd)); selected.setForeground(Color.BLACK); } else { updateTabPanel.setBackground(new Color(0xe0fffd)); updateTabLabel.setForeground(Color.BLACK); } } tabbedPane.setSelectedIndex(index); dialog.setVisible(true); }