/** * @param a * @return HtmlTag : LI tag containing the text separator (3 small points). */ private HtmlTag makeLiText(final Application a) { HtmlTag liText = (HtmlTag) a.createComponent(HtmlTag.COMPONENT_TYPE); liText.setValue(HTML.LI_ELEM); liText.setStyle("border:none;background-color:transparent;"); if (getBundles() != null) { HtmlOutputText text = (HtmlOutputText) a.createComponent(HtmlOutputText.COMPONENT_TYPE); text.setValue(getBundles().get(TEXT_SEPARATOR_I18N_KEY)); text.setParent(liText); text.setStyleClass(TagsConfigurator.getInstance().getTextStyleClass()); liText.getChildren().add(text); } return liText; } /*
@Override protected Div makeDivPages(final Application a) { if (logger.isDebugEnabled()) { logger.debug("entering makeDivPagination(" + a + ")"); } Div divPages = (Div) a.createComponent(Div.COMPONENT_TYPE); divPages.setParent(this); divPages.setId(this.getId() + "_div_pages"); divPages.setStyleClass(NAVIGATION_BLOCK); //if there are more than one page on display pagination if (getPaginator().getFirstPageNumber() != getPaginator().getLastPageNumber()) { HtmlTag ul1 = (HtmlTag) a.createComponent(HtmlTag.COMPONENT_TYPE); ul1.setValue(HTML.UL_ELEM); ul1.setId(divPages.getId() + "first_ul"); ul1.setParent(divPages); //PREVIOUS BUTTON if (getPaginator().getCurrentPage() != getPaginator().getFirstPageNumber()) { ul1.getChildren().add(makeLiGroup(a, getStringsVar() + "['" + PREVIOUS_BUTTON_I18N_KEY + "']", null, true, PaginatorUtils.GOTO_PREVIOUS, null, null)); } //BODY of Paginator divPages = makePages(divPages, getPaginator(), ul1, a); } return divPages; }
if (page != pagi.getCurrentPage()) { ul1.getChildren().add( makeLiGroup(a, "" + (page + 1), "" + page, false, PaginatorUtils.RELOAD_DATA, makeLiGroup(a, "" + (page + 1), "" + page, false, PaginatorUtils.RELOAD_DATA, ul1.getChildren().add(makeLiText(a)); String nameValueButton = getPaginatorELExpression() + "." + PaginatorUtils.LAST_PAGE_NUMBER + "+1"; ul1.getChildren().add( makeLiGroup(a, nameValueButton, PaginatorUtils.LAST_PAGE_NUMBER, true, PaginatorUtils.RELOAD_DATA, PaginatorUtils.CURRENT_PAGE, null)); } else if (!pagi.getLastPagesNumber().isEmpty()) { String nameValueButton = getPaginatorELExpression() + "." + PaginatorUtils.FIRST_PAGE_NUMBER + "+1"; ul1.getChildren().add( makeLiGroup(a, nameValueButton, PaginatorUtils.FIRST_PAGE_NUMBER, true, PaginatorUtils.RELOAD_DATA, PaginatorUtils.CURRENT_PAGE, null)); ul1.getChildren().add(makeLiText(a)); for (Object o : pagi.getLastPagesNumber()) { Integer page = (Integer) o;
command.setImmediate(true); command.setParent(li); MethodExpression m = a.getExpressionFactory().createMethodExpression(getFacesContext().getELContext(), TagUtils.makeELExpression(getPaginatorELExpression() + "." + methodForButton),Void.TYPE, new Class<?>[0]); command.setValueExpression(JSFAttr.VALUE_ATTR, a.getExpressionFactory().createValueExpression( getFacesContext().getELContext(), TagUtils.makeELExpression(valueButton), String.class)); } else { listener.setValueBinding(a.createValueBinding( TagUtils.makeELExpression( getPaginatorELExpression() + "." + valueListener))); } else { getPaginatorELExpression() + "." + methodForListener ))); command.addActionListener(listener);
@Override public void encodeBegin(final FacesContext arg0) throws IOException { if (logger.isDebugEnabled()) { logger.debug("Entered encodeBegin for client-Id: " + getId()); } if (!StringUtils.hasText(getStyleClass())) { setStyleClass(TagsConfigurator.getInstance().getPaginatorStyleClass()); } Paginator< ? > pagi = getPaginator(); UIAbstractPaginatorStyle paginatorStyle = null; if (getChildren() != null && !getChildren().isEmpty()) { ////this paginator can have only one son. getChildren().remove(0); } paginatorStyle = new UIPaginatorStyle(); paginatorStyle.setParent(this); paginatorStyle.setAttributes(pagi, getPaginatorELExpression(), getItemsName(), getVisibleBlocks(), getStringsVar(), getOnchange()); getChildren().add(paginatorStyle); if (logger.isDebugEnabled()) { logger.debug("Exited encodeBegin"); } super.encodeBegin(arg0); }
command.setImmediate(true); command.setParent(li); MethodExpression m = a.getExpressionFactory().createMethodExpression(getFacesContext().getELContext(), TagUtils.makeELExpression(getPaginatorELExpression() + "." + methodForButton),Void.TYPE, new Class<?>[0]); command.setValueExpression(JSFAttr.VALUE_ATTR, a.getExpressionFactory().createValueExpression( getFacesContext().getELContext(), TagUtils.makeELExpression(valueButton), String.class)); } else { listener.setValueBinding(a.createValueBinding( TagUtils.makeELExpression( getPaginatorELExpression() + "." + valueListener))); } else { getPaginatorELExpression() + "." + methodForListener ))); command.addActionListener(listener);
@Override public void encodeBegin(final FacesContext arg0) throws IOException { if (logger.isDebugEnabled()) { logger.debug("Entered encodeBegin for client-Id: " + getId()); } if (!StringUtils.hasText(getStyleClass())) { setStyleClass(TagsConfigurator.getInstance().getPaginatorStyleClass()); } Paginator< ? > pagi = getPaginator(); UIAbstractPaginatorStyle paginatorStyle = null; if (getChildren() != null && !getChildren().isEmpty()) { ////this paginator can have only one son. getChildren().remove(0); } paginatorStyle = new UIPaginatorStyle(); paginatorStyle.setParent(this); paginatorStyle.setAttributes(pagi, getPaginatorELExpression(), getItemsName(), getVisibleBlocks(), getStringsVar(), getOnchange()); getChildren().add(paginatorStyle); if (logger.isDebugEnabled()) { logger.debug("Exited encodeBegin"); } super.encodeBegin(arg0); }
@Override protected Div makeDivPages(final Application a) { if (logger.isDebugEnabled()) { logger.debug("entering makeDivPagination(" + a + ")"); } Div divPages = (Div) a.createComponent(Div.COMPONENT_TYPE); divPages.setParent(this); divPages.setId(this.getId() + "_div_pages"); divPages.setStyleClass(NAVIGATION_BLOCK); //if there are more than one page on display pagination if (getPaginator().getFirstPageNumber() != getPaginator().getLastPageNumber()) { HtmlTag ul1 = (HtmlTag) a.createComponent(HtmlTag.COMPONENT_TYPE); ul1.setValue(HTML.UL_ELEM); ul1.setId(divPages.getId() + "first_ul"); ul1.setParent(divPages); //PREVIOUS BUTTON if (getPaginator().getCurrentPage() != getPaginator().getFirstPageNumber()) { ul1.getChildren().add(makeLiGroup(a, getStringsVar() + "['" + PREVIOUS_BUTTON_I18N_KEY + "']", null, true, PaginatorUtils.GOTO_PREVIOUS, null, null)); } //BODY of Paginator divPages = makePages(divPages, getPaginator(), ul1, a); } return divPages; }
if (page != pagi.getCurrentPage()) { ul1.getChildren().add( makeLiGroup(a, "" + (page + 1), "" + page, false, PaginatorUtils.RELOAD_DATA, makeLiGroup(a, "" + (page + 1), "" + page, false, PaginatorUtils.RELOAD_DATA, ul1.getChildren().add(makeLiText(a)); String nameValueButton = getPaginatorELExpression() + "." + PaginatorUtils.LAST_PAGE_NUMBER + "+1"; ul1.getChildren().add( makeLiGroup(a, nameValueButton, PaginatorUtils.LAST_PAGE_NUMBER, true, PaginatorUtils.RELOAD_DATA, PaginatorUtils.CURRENT_PAGE, null)); } else if (!pagi.getLastPagesNumber().isEmpty()) { String nameValueButton = getPaginatorELExpression() + "." + PaginatorUtils.FIRST_PAGE_NUMBER + "+1"; ul1.getChildren().add( makeLiGroup(a, nameValueButton, PaginatorUtils.FIRST_PAGE_NUMBER, true, PaginatorUtils.RELOAD_DATA, PaginatorUtils.CURRENT_PAGE, null)); ul1.getChildren().add(makeLiText(a)); for (Object o : pagi.getLastPagesNumber()) { Integer page = (Integer) o;
/** * @param a * @return HtmlTag : LI tag containing the text separator (3 small points). */ private HtmlTag makeLiText(final Application a) { HtmlTag liText = (HtmlTag) a.createComponent(HtmlTag.COMPONENT_TYPE); liText.setValue(HTML.LI_ELEM); liText.setStyle("border:none;background-color:transparent;"); if (getBundles() != null) { HtmlOutputText text = (HtmlOutputText) a.createComponent(HtmlOutputText.COMPONENT_TYPE); text.setValue(getBundles().get(TEXT_SEPARATOR_I18N_KEY)); text.setParent(liText); text.setStyleClass(TagsConfigurator.getInstance().getTextStyleClass()); liText.getChildren().add(text); } return liText; } /*