Hi Walter, thanks for your question.
I think the method
AbstractTabBox.setSelectedTab(IGroupBox)
is what you are looking for.
I created a TabBox with 3 Tabs:
TabBox
- Tab1Box
- Tab2Box
- Tab3Box
Then I created a Button with an execClickAction and the following implementation
public class SwitchButton extends AbstractButton {
int i = 0;
@Override
protected void execClickAction() throws ProcessingException {
TabBox tabBox = getTabBox();
IGroupBox selectedTab = tabBox.getSelectedTab(); //this one is selected
if (i % 3 == 0) {
tabBox.setSelectedTab(getTab1Box());
}
else if (i % 3 == 1) {
tabBox.setSelectedTab(getTab2Box());
}
else if (i % 3 == 2 {
tabBox.setSelectedTab(getTab3Box());
}
i++;
}
}
What this method does is, it switches to the next Tab if one clicks on the button. I have a counter (i) which will be increased by one if you click the button. The modulo operation (%) makes sure to get values between 0 and 2. If i == 0, show first tab, if i == 1 show second tab and if i == 2 show last tab.
Hope this helps.
Greetings,
Matthias