@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (AjaxUtil.getSkipExtraRenderingOnPortletsAjax(context))
return;
ResponseWriter writer = context.getResponseWriter();
TabbedPane tabbedPane = (TabbedPane) component;
LoadingMode loadingMode = tabbedPane.getLoadingMode();
if (LoadingMode.AJAX_LAZY.equals(loadingMode) || LoadingMode.AJAX_ALWAYS.equals(loadingMode))
AjaxUtil.prepareComponentForAjax(context, component);
List<SubPanel> allSubPanels = tabbedPane.getSubPanels(true);
// implementation note for one who is going to remove outer table rendering
// need to check, that style="padding: 10px;" (10px for example) do not breaks border under IE
// JSFC-754 TabbedPane border is not solid if set paddings
writer.startElement("table", tabbedPane);
writer.writeAttribute("border", "0", null);
writer.writeAttribute("cellspacing", "0", null);
writer.writeAttribute("cellpadding", "0", null);
writer.writeAttribute("id", tabbedPane.getClientId(context), "id");
Rendering.writeComponentClassAttribute(writer, tabbedPane);
Rendering.writeStandardEvents(writer, tabbedPane);
TabPlacement tabPlacement = getTabPlacement(tabbedPane);
boolean horizontalPlacement = TabPlacement.LEFT.equals(tabPlacement) || TabPlacement.RIGHT.equals(tabPlacement);
boolean paneFirst = TabPlacement.RIGHT.equals(tabPlacement) || TabPlacement.BOTTOM.equals(tabPlacement);
writer.startElement("tr", tabbedPane);
writer.startElement("td", tabbedPane);
writer.writeAttribute("height", "100%", null);
writer.writeAttribute("width", "100%", null);
writer.startElement("table", tabbedPane);
writer.writeAttribute("border", "0", null);
writer.writeAttribute("cellspacing", "0", null);
writer.writeAttribute("cellpadding", "0", null);
writer.writeAttribute("height", "100%", null);
writer.writeAttribute("width", "100%", null);
writer.startElement("tr", tabbedPane);
writer.startElement("td", tabbedPane);
String containerClass = getContainerClass(context, tabbedPane);
String rolloverContainerClass = Styles.getCSSClass(context,
tabbedPane, tabbedPane.getRolloverContainerStyle(), StyleGroup.regularStyleGroup(), tabbedPane.getRolloverContainerClass());
if (paneFirst) {
if (tabbedPane.isMirrorTabSetVisible()) {
encodeTabSet(context, tabbedPane, allSubPanels, true);
writer.endElement("td");
if (!horizontalPlacement) {
writer.endElement("tr");
writer.startElement("tr", tabbedPane);
}
writer.startElement("td", tabbedPane);
}
encodePane(context, tabbedPane, allSubPanels, containerClass);
} else {
encodeTabSet(context, tabbedPane, allSubPanels, false);
}
writer.endElement("td");
if (!horizontalPlacement) {
writer.endElement("tr");
writer.startElement("tr", tabbedPane);
}
writer.startElement("td", tabbedPane);
if (paneFirst) {
encodeTabSet(context, tabbedPane, allSubPanels, false);
} else {
encodePane(context, tabbedPane, allSubPanels, containerClass);
if (tabbedPane.isMirrorTabSetVisible()) {
writer.endElement("td");
if (!horizontalPlacement) {
writer.endElement("tr");
writer.startElement("tr", tabbedPane);
}