Package org.apache.myfaces.trinidad.context

Examples of org.apache.myfaces.trinidad.context.LocaleContext


  }


  private static boolean _isRightToLeft(UIXRenderingContext context)
  {
    LocaleContext lContext = context.getLocaleContext();

    return lContext.isRightToLeft();
  }
View Full Code Here


   */
  private static Calendar _getCalendar(
    RenderingContext arc
    )
  {
    LocaleContext localeContext = arc.getLocaleContext();

    Calendar calendar = Calendar.getInstance(localeContext.getTimeZone(),
                                localeContext.getFormattingLocale());
    if (calendar instanceof GregorianCalendar)
    {
      ((GregorianCalendar) calendar).setGregorianChange(
         new Date(Long.MIN_VALUE));
    }
View Full Code Here

  public static int getReadingDirection(
    ImageContext context,
    Map<Object, Object> properties
    )
  {
    LocaleContext localeContext = context.getLocaleContext();
    int direction = LocaleUtils.getReadingDirection(localeContext);

    if (properties != null)
    {
      Object o = null;
      if ((o = properties.get(ImageConstants.DIRECTION_KEY)) != null)
        direction = ((Integer)o).intValue();
    }

    if (direction == LocaleUtils.DIRECTION_DEFAULT)
    {

      return LocaleUtils.getReadingDirectionForLocale(
                           localeContext.getTranslationLocale());
    }

    return direction;
  }
View Full Code Here

                              ImageConstants.TECATE_NAMESPACE,
                              XMLConstants.RESOURCE_BUNDLE_PROPERTY);

    if (_bundleName != null)
    {
      LocaleContext localeContext = (LocaleContext)context.getProperty(
                                      ImageConstants.TECATE_NAMESPACE,
                                      XMLConstants.LOCALE_CONTEXT_PROPERTY);
      bundle = localeContext.getBundle(_bundleName);
    }

    if ((bundle == null) || (_key == null))
    {
      if (_LOG.isWarning())
View Full Code Here

  {
    public Key(StyleContext context)
    {
      TrinidadAgent agent = context.getAgent();

      LocaleContext localeContext = context.getLocaleContext();

      _init(
       localeContext.getTranslationLocale(),
       LocaleUtils.getReadingDirection(localeContext),
       agent.getAgentApplication(),
       agent.getAgentMajorVersion(),
       agent.getAgentOS(),
       true);
View Full Code Here

    StringBuilder       builder,
    Map<String, String> messages,
    Locale              locale)
  {
    Skin             skin = getSkin(context);
    LocaleContext    lc = new LocaleContextImpl(locale);

    // We get the keys from the bundle, but try to get the values from
    // the skin if possible
    Set<String> keys = messages.keySet();
    boolean writtenOne = false;
View Full Code Here

  protected void outputScriptletImpl(
    FacesContext        context,
    RenderingContext arc) throws IOException
  {
    ResponseWriter writer = context.getResponseWriter();
    LocaleContext lc = arc.getLocaleContext();

    writer.startElement("script", null);
    XhtmlRenderer.renderScriptDeferAttribute(context, arc);

    // Bug #3426092:
    // Render the type="text/javascript" attribute in accessibility mode
    XhtmlRenderer.renderScriptTypeAttribute(context, arc);

    // write out the i18n Locale as a js variable
    writer.writeText("var _locale='", null);
    writer.writeText(lc.getFormattingIANALocaleString(), null);
    writer.writeText("';", null);

    // write out the translation Locale as a js variable
    writer.writeText("var _tLocale='", null);
    writer.writeText(lc.getTranslationIANALocaleString(), null);
    writer.writeText("';", null);

    char groupingSeparator = lc.getGroupingSeparator();

    if (groupingSeparator != 0)
    {
      writer.writeText("var _groupingSep='", null);
      writer.writeText(XhtmlUtils.escapeJS(
                          String.valueOf(groupingSeparator)),
                       null);
      writer.writeText("';", null);
    }

    char decimalSeparator = lc.getDecimalSeparator();

    if (decimalSeparator != 0)
    {
      writer.writeText("var _decimalSep='", null);
      writer.writeText(XhtmlUtils.escapeJS(
View Full Code Here

   *
   * @param context The current RenderingContext.
   */
  public String getSupportedLocaleVariant(RenderingContext arc)
  {
    LocaleContext lc  = arc.getLocaleContext();
    Locale l = lc.getFormattingLocale();
    String variant = l.getVariant();
    variant = variant.toUpperCase();

    if (variant.startsWith("ORACLE"))
      return variant;
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.context.LocaleContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.