protected ToolWindowTab getNextTab(ToolWindowTab toolWindowTab) {
// Look for column of the next tab in respeto to <code>toolWindowTab</code>
int nextTabCol = -1;
for (Component component : tabContainer.getComponents()) {
if (component instanceof ToolWindowTabButton) {
ToolWindowTabButton tabButton = (ToolWindowTabButton) component;
if (tabButton.getToolWindowTab() == toolWindowTab) {
TableLayoutConstraints constraints = containerLayout.getConstraints(component);
nextTabCol = constraints.col1 + 3;
break;
}
}
}
if (nextTabCol != -1) {
for (Component component : tabContainer.getComponents()) {
if (component instanceof ToolWindowTabButton) {
ToolWindowTabButton tabButton = (ToolWindowTabButton) component;
TableLayoutConstraints constraints = containerLayout.getConstraints(tabButton);
if (constraints.col1 == nextTabCol)
return tabButton.getToolWindowTab();
}
}
for (ToolWindowTab windowTab : toolWindow.getToolWindowTabs()) {
if (windowTab != toolWindowTab)
return windowTab;