/** * @param locale * @see javax.faces.component.UIViewRoot#setLocale(java.util.Locale) */ public void setLocale(Locale locale) { original.setLocale(locale); }
/** * @see Faces#setLocale(Locale) */ public static void setLocale(FacesContext context, Locale locale) { UIViewRoot viewRoot = context.getViewRoot(); if (viewRoot == null) { throw new IllegalStateException(ERROR_NO_VIEW); } viewRoot.setLocale(locale); }
/** * @see Faces#setLocale(Locale) */ public static void setLocale(FacesContext context, Locale locale) { UIViewRoot viewRoot = context.getViewRoot(); if (viewRoot == null) { throw new IllegalStateException(ERROR_NO_VIEW); } viewRoot.setLocale(locale); }
protected void restoreLocale(FacesContext facesContext, Entry entry) { if (entry.locale != null && facesContext.getViewRoot() != null) { facesContext.getViewRoot().setLocale(entry.locale); } }
public FenixBackingBean() { final FacesContext facesContext = FacesContext.getCurrentInstance(); final Locale locale = I18N.getLocale(); facesContext.getViewRoot().setLocale(locale); }
public UIViewRoot getViewRoot() { if (viewRoot == null) { viewRoot = new UIViewRoot(); viewRoot.setLocale(Locale.getDefault()); } return viewRoot; }
public UIViewRoot getViewRoot() { if (viewRoot == null) { viewRoot = new UIViewRoot(); viewRoot.setLocale(Locale.getDefault()); } return viewRoot; }
/** * <p>Establish the specified <code>Locale</code> for this response.</p> * * @param context The {@link Context} we are operating on. * @param locale The Locale for the request. */ protected void setLocale(Context context, Locale locale) { FacesContext fcontext = (FacesContext) context.get("context"); fcontext.getViewRoot().setLocale(locale); }
public void setLocaleCode(String localeCode) { Iterator<Locale> locales = FacesContext.getCurrentInstance().getApplication().getSupportedLocales(); while (locales.hasNext()) { Locale locale = locales.next(); if (!Strings.isEmpty(locale.getLanguage()) && locale.getLanguage().equals(localeCode)) { this.localeCode = localeCode; FacesContext.getCurrentInstance().getViewRoot().setLocale(new Locale(localeCode)); setCookieValue(localeCode); break; } } }
public UIViewRoot getViewRoot() { if (viewRoot == null) { viewRoot = new UIViewRoot(); viewRoot.setLocale(Locale.getDefault()); viewRoot.setViewId(RIConstants.FACES_PREFIX + "xhtml"); } return viewRoot; }
@Override public UIViewRoot getViewRoot() { if (viewRoot == null) { viewRoot = new UIViewRoot(); viewRoot.setLocale(Locale.getDefault()); viewRoot.setViewId(FACES_PREFIX + "xhtml"); } return viewRoot; }
@Override public UIViewRoot getViewRoot() { if (viewRoot == null) { viewRoot = new UIViewRoot(); viewRoot.setLocale(Locale.getDefault()); viewRoot.setViewId(FACES_PREFIX + "xhtml"); } return viewRoot; }
@Override public UIViewRoot getViewRoot() { if (viewRoot == null) { viewRoot = new UIViewRoot(); viewRoot.setLocale(Locale.getDefault()); viewRoot.setViewId(FACES_PREFIX + "xhtml"); } return viewRoot; }
private UIViewRoot getViewRootForAlreadySetView(RequestContext context, FacesContext facesContext) { if (logger.isDebugEnabled()) { logger.debug("Existing view root found with id '" + facesContext.getViewRoot().getId() + "'"); } UIViewRoot viewRoot = facesContext.getViewRoot(); viewRoot.setLocale(context.getExternalContext().getLocale()); processTree(facesContext, viewRoot); return viewRoot; }
private UIViewRoot getViewRootForAlreadySetView(RequestContext context, FacesContext facesContext) { if (logger.isDebugEnabled()) { logger.debug("Existing view root found with id '" + facesContext.getViewRoot().getId() + "'"); } UIViewRoot viewRoot = facesContext.getViewRoot(); viewRoot.setLocale(context.getExternalContext().getLocale()); processTree(facesContext, viewRoot); return viewRoot; }
/** * This template method called from the {@link #setupFacesRequest()} to create components view tree in the virtual request. * The default implementation is only creates {@link UIViewRoot} instance for view ID "/test.xhtml". * @return */ protected UIViewRoot setupView() { UIViewRoot viewRoot = (UIViewRoot) application.createComponent(UIViewRoot.COMPONENT_TYPE); viewRoot.setViewId("/test.xhtml"); viewRoot.setLocale(Locale.getDefault()); viewRoot.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT); return viewRoot; }
/** * This template method called from the {@link #setupFacesRequest()} to create components view tree in the virtual request. * The default implementation is only creates {@link UIViewRoot} instance for view ID "/test.xhtml". * @return */ protected UIViewRoot setupView() { UIViewRoot viewRoot = (UIViewRoot) application.createComponent(UIViewRoot.COMPONENT_TYPE); viewRoot.setViewId("/test.xhtml"); viewRoot.setLocale(Locale.getDefault()); viewRoot.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT); return viewRoot; }
protected void initDefaultView() { UIViewRoot root = new UIViewRoot(); root.setViewId("/viewId"); root.setLocale(getLocale()); root.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT); this.facesContext.setViewRoot(root); }
protected void initDefaultView() { UIViewRoot root = new UIViewRoot(); root.setViewId("/viewId"); root.setLocale(getLocale()); root.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT); facesContext.setViewRoot(root); }
@Override public void setLocale(final Locale locale) { super.setLocale(locale); final ClientProperties clientProperties = ClientProperties.getInstance(getFacesContext()); clientProperties.setLocale(locale); clientProperties.updateUserAgent(getFacesContext()); }