protected void changeTabIndex(UIComponent component, int selectedIndex) {
TabSet tabSet = (TabSet) component;
int oldSelectedIndex = tabSet.getSelectedIndex();
if (oldSelectedIndex != selectedIndex) {
tabSet.setSelectedIndex(selectedIndex);
tabSet.queueEvent(new SelectionChangeEvent(tabSet, oldSelectedIndex, selectedIndex));
}
List<Object> tabItems = getTabItems(tabSet);
Object tabItem = tabItems.get(selectedIndex);
Object tabValue = (tabItem instanceof TabSetItem) ? ((TabSetItem) tabItem).getItemValue() : null;