writer.endElement(HtmlConstants.TABLE);
}
private UIToolBar createToolBar(FacesContext facesContext, UITabGroup component, int virtualTab, String switchType, TabGroupRenderer.TabList tabList, String clientId) {
Application application = facesContext.getApplication();
// tool bar
UICommand scrollLeft = (UICommand) application.createComponent(UICommand.COMPONENT_TYPE);
scrollLeft.setId(component.getId() + "__" + virtualTab + "__" + "previous");
//scrollLeft.setId(facesContext.getViewRoot().createUniqueId());
scrollLeft.setRendererType(null);
scrollLeft.getAttributes().put(ATTR_IMAGE, "image/tabPrev.gif");
if (tabList.isFirst(virtualTab)) {
scrollLeft.setDisabled(true);
}
if (!(TobagoConfig.getInstance(facesContext).isAjaxEnabled() && SWITCH_TYPE_RELOAD_TAB.equals(switchType))) {
scrollLeft.getAttributes().put(ATTR_ONCLICK, "tobago_previousTab('" + switchType + "','" + clientId + "',"
+ component.getChildCount() + ')');
} else {
scrollLeft.getAttributes().put(ATTR_ONCLICK, "javascript:false");
}
UICommand scrollRight = (UICommand) application.createComponent(UICommand.COMPONENT_TYPE);
scrollRight.setId(component.getId() + "__" + virtualTab + "__" + "next");
scrollRight.setRendererType(null);
scrollRight.getAttributes().put(ATTR_IMAGE, "image/tabNext.gif");
if (tabList.isLast(virtualTab)) {
scrollRight.setDisabled(true);
}
if (!(TobagoConfig.getInstance(facesContext).isAjaxEnabled() && SWITCH_TYPE_RELOAD_TAB.equals(switchType))) {
scrollRight.getAttributes().put(ATTR_ONCLICK, "tobago_nextTab('" + switchType + "','" + clientId + "',"
+ component.getChildCount() + ')');
} else {
scrollRight.getAttributes().put(ATTR_ONCLICK, "javascript:false");
}
/*UICommand commandList = (UICommand) application.createComponent(UICommand.COMPONENT_TYPE);
commandList.setId(component.getId() + "__commandList);
commandList.setRendererType(null);
UIMenu menu = (UIMenu) application.createComponent(UIMenu.COMPONENT_TYPE);
menu.setId(component.getId() + "__" + virtualTab + "__" + "menu");
menu.setRendererType(null);
commandList.getFacets().put(FACET_MENUPOPUP, menu);*/
UIToolBar toolBar = (UIToolBar) application.createComponent(UIToolBar.COMPONENT_TYPE);
toolBar.setId(component.getId() + "__toolBar");
//toolBar.setLabelPosition(UIToolBar.LABEL_OFF);
toolBar.setRendererType("TabNavigationBar");
toolBar.setTransient(true);
//toolBar.setIconSize(AbstractUIToolBar.ICON_OFF);