@SideOnly(Side.CLIENT)
public void updatePages(boolean systemChange) {
int oldLeft = -1;
int oldRight = -1;
if (!systemChange) {
oldLeft = analystPages.indexOf(leftPage.getContent());
oldRight = analystPages.indexOf(rightPage.getContent());
}
ITitledWidget databasePage = null;
if (isDatabase && !systemChange) {
databasePage = ((analystPages.size() > 0) ? analystPages.get(0) : null);
}
analystPages.clear();
setPage(leftPage, null);
setPage(rightPage, null);
createPages(databasePage);
tabBar.deleteAllChildren();
if (analystPages.size() > 0) {
int width = tabBar.getWidth() / analystPages.size();
int x = 0;
for (ITitledWidget page : analystPages) {
new ControlAnalystButton(tabBar, x, 0, width, tabBar.getHeight(), this, page);
x += width;
}
setPage(leftPage, analystPages.get((oldLeft >= 0) ? oldLeft : 0));
if (analystPages.size() > 1) {
setPage(rightPage, analystPages.get((oldRight >= 0) ? oldRight : 1));
}
}
}