private void writeTabsLine(ResponseWriter w, FacesContext context, UIComponent comp) throws IOException { w.startElement(DIV, comp); String id = comp.getClientId() + AbstractTabPanel.HEADER_META_COMPONENT; w.writeAttribute(ID_ATTRIBUTE, id, null); AbstractTabPanel tabPanel = (AbstractTabPanel) comp; if (tabPanel.isHeaderPositionedTop()) { w.writeAttribute(CLASS, "rf-tab-hdr-tabline-vis rf-tab-hdr-tabline-top", null); } else { w.writeAttribute(CLASS, "rf-tab-hdr-tabline-vis rf-tab-hdr-tabline-btm", null); } w.startElement("table", comp); w.writeAttribute(CLASS_ATTRIBUTE, "rf-tab-hdr-tabs", null); w.writeAttribute("cellspacing", "0", null); w.startElement(TBODY_ELEMENT, comp); w.startElement(TR_ELEMENT, comp); writeTopTabFirstSpacer(w, comp); writeTabLine(w, context, tabPanel); writeTopTabLastSpacer(w, comp); w.endElement(TR_ELEMENT); w.endElement(TBODY_ELEMENT); w.endElement("table"); writeTopTabsControl(w, comp, "rf-tab-hdr-scrl-lft rf-tab-hdn", "\u00AB"); writeTopTabsControl(w, comp, "rf-tab-hdr-tablst rf-tab-hdn", "\u2193"); writeTopTabsControl(w, comp, "rf-tab-hdr-scrl-rgh rf-tab-hdn", "\u00BB"); w.endElement(DIV_ELEM); }
private void writeTopTabLastSpacer(ResponseWriter w, UIComponent comp) throws IOException { AbstractTabPanel tabPanel = (AbstractTabPanel) comp; if (tabPanel.isHeaderAlignedLeft()) { writeTopTabSpacer(w, comp, "padding-right: 5px; width: 100%;", "rf-tab-hdr-spcr"); } else { writeTopTabSpacer(w, comp, "padding-right: 5px;", "rf-tab-hdr-spcr"); } }
@Override protected void doEncodeEnd( final ResponseWriter writer, FacesContext context, UIComponent component) throws IOException { AbstractTabPanel panel = (AbstractTabPanel) component; if (!panel.isHeaderPositionedTop()) { writeTabsLineSeparator(writer, component); writeTabsLine(writer, context, component); } writer.endElement(HtmlConstants.DIV_ELEM); }
@Override protected void doEncodeBegin(ResponseWriter w, FacesContext context, UIComponent component) throws IOException { super.doEncodeBegin(w, context, component); AbstractTabPanel tabPanel = (AbstractTabPanel) component; if (tabPanel.isHeaderPositionedTop()) { writeTabsLine(w, context, component); writeTabsLineSeparator(w, component); } }
private void writeTabLine( final ResponseWriter w, final FacesContext context, final AbstractTabPanel panel) throws IOException { panel.visitTogglePanelItems( panel, new TogglePanelVisitCallback() { @Override public VisitResult visit(FacesContext context, TogglePanelVisitState visitState) { AbstractTogglePanelItemInterface item = visitState.getItem(); if (item.isRendered() && item instanceof AbstractTab) { try { AbstractTab tab = (AbstractTab) item; writeTopTabHeader(context, w, tab); writeTopTabSpacer(w, panel); } catch (IOException e) { throw new FacesException(e); } } return VisitResult.ACCEPT; } }); }