@Override public void beforePhase(final PhaseEvent event) { if (logger.isDebugEnabled()) { logger.debug("enterig RessourceBundlePhaseListener::beforePhase = " + event); } FacesContext context = event.getFacesContext(); try { Locale locale = (Locale) ContextUtils.getSessionAttribute(AbstractI18nAwareBean.LOCALE_ATTRIBUTE); if (locale == null && context.getViewRoot() != null) { locale = context.getViewRoot().getLocale(); } if (locale != null && context.getExternalContext().getRequestMap().get(DEFAULT_STRINGVAR) == null) { TagsConfigurator tagsConfigurator = TagsConfigurator.getInstance(); context.getExternalContext().getRequestMap().put( DEFAULT_STRINGVAR, tagsConfigurator.getStrings(locale)); } } catch (NoRequestBoundException e) { //do nothing logger.warn("in ResourceBundlePhaseListener::beforePhase NoRequestBoundException"); } }
@Override protected void setProperties(final UIComponent component) { TagsConfigurator tagsConfigurator = TagsConfigurator.getInstance(); setLayout(TagUtils.getStringValueExpression( getFacesContext().getApplication(),tagsConfigurator.getMenuLayout())); setStyleClass(TagUtils.getStringValueExpression( getFacesContext().getApplication(),tagsConfigurator.getMenuStyleClass())); setActiveItemClass(TagUtils.getStringValueExpression( getFacesContext().getApplication(),tagsConfigurator.getMenuActiveItemStyleClass())); setItemClass(TagUtils.getStringValueExpression( getFacesContext().getApplication(),tagsConfigurator.getMenuItemStyleClass())); super.setProperties(component); } }
@Override protected void setProperties(final UIComponent component) { TagsConfigurator tagsConfigurator = TagsConfigurator.getInstance(); setLayout(TagUtils.getStringValueExpression( getFacesContext().getApplication(),tagsConfigurator.getMenuLayout())); setStyleClass(TagUtils.getStringValueExpression( getFacesContext().getApplication(),tagsConfigurator.getMenuStyleClass())); setActiveItemClass(TagUtils.getStringValueExpression( getFacesContext().getApplication(),tagsConfigurator.getMenuActiveItemStyleClass())); setItemClass(TagUtils.getStringValueExpression( getFacesContext().getApplication(),tagsConfigurator.getMenuItemStyleClass())); super.setProperties(component); } }
/** * @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; } /*
/** * @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 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 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); }
span.setParent(divNbItemsByPage); span.setId(divNbItemsByPage.getId() + "_items_per_page"); span.setStyleClass(TagsConfigurator.getInstance().getTextStyleClass());
span.setParent(divNbItems); span.setId(divNbItems.getId() + "_numbers_items"); span.setStyleClass(TagsConfigurator.getInstance().getTextStyleClass()); UIParameter param = (UIParameter) a.createComponent(UIParameter.COMPONENT_TYPE); if (UIComponentTag.isValueReference(getItemsName())) {
span.setParent(divNbItems); span.setId(divNbItems.getId() + "_numbers_items"); span.setStyleClass(TagsConfigurator.getInstance().getTextStyleClass()); UIParameter param = (UIParameter) a.createComponent(UIParameter.COMPONENT_TYPE); if (UIComponentTag.isValueReference(getItemsName())) {
span.setParent(divNbItemsByPage); span.setId(divNbItemsByPage.getId() + "_items_per_page"); span.setStyleClass(TagsConfigurator.getInstance().getTextStyleClass());