Package org.apache.myfaces.trinidad.context

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


  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


        long dateValueInMs = calendar.getTimeInMillis();
        long tzOffset = calendar.get(Calendar.ZONE_OFFSET) +
                        calendar.get(Calendar.DST_OFFSET);
        // get the timeZone specified in trinidad-config, if any or the
        // client timeZone.
        LocaleContext localeContext = arc.getLocaleContext();
        // find out the difference in timeZone
        tzOffset -= localeContext.getTimeZone().getOffset(dateValueInMs);

        // Bug 4570118
        // make sure that adjusting to correct timeZone doesn't take the
        // long value out of the range. Calendar too doesn't handle this
        // properly ie. MIN_VALUE < (longValue + tzOffset) < MAX_VALUE.
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

  private static class Key
  {
    public Key(StyleContext context)
    {
      TrinidadAgent agent = context.getAgent();
      LocaleContext localeContext = context.getLocaleContext();
      AccessibilityProfile accProfile = context.getAccessibilityProfile();

      _init(
       localeContext.getTranslationLocale(),
       LocaleUtils.getReadingDirection(localeContext),
       agent.getAgentApplication(),
       agent.getAgentVersion(),
       agent.getAgentOS(),
       !context.isDisableStyleCompression(),
View Full Code Here

  // Returns array of matching style sheets sorted by specificity
  private StyleSheetList _getStyleSheets(
    StyleContext context
    )
  {
    LocaleContext localeContext = context.getLocaleContext();
    Locale locale = localeContext.getTranslationLocale();
    int direction = LocaleUtils.getReadingDirection(localeContext);
    int mode = NameUtils.getMode(ModeUtils.getCurrentMode(context));
    TrinidadAgent agent = context.getAgent();
    AccessibilityProfile accProfile = context.getAccessibilityProfile();
View Full Code Here

        long dateValueInMs = calendar.getTimeInMillis();
        long tzOffset = calendar.get(Calendar.ZONE_OFFSET) +
                        calendar.get(Calendar.DST_OFFSET);
        // get the timeZone specified in trinidad-config, if any or the
        // client timeZone.
        LocaleContext localeContext = arc.getLocaleContext();
        // find out the difference in timeZone
        tzOffset -= localeContext.getTimeZone().getOffset(dateValueInMs);

        // Bug 4570118
        // make sure that adjusting to correct timeZone doesn't take the
        // long value out of the range. Calendar too doesn't handle this
        // properly ie. MIN_VALUE < (longValue + tzOffset) < MAX_VALUE.
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

  private static class Key
  {
    public Key(StyleContext context)
    {
      TrinidadAgent agent = context.getAgent();
      LocaleContext localeContext = context.getLocaleContext();
      AccessibilityProfile accProfile = context.getAccessibilityProfile();

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

  private static class Key
  {
    public Key(StyleContext context)
    {
      TrinidadAgent agent = context.getAgent();
      LocaleContext localeContext = context.getLocaleContext();
      AccessibilityProfile accProfile = context.getAccessibilityProfile();

      _init(
       localeContext.getTranslationLocale(),
       LocaleUtils.getReadingDirection(localeContext),
       agent.getAgentApplication(),
       agent.getAgentVersion(),
       agent.getAgentOS(),
       !context.isDisableStyleCompression(),
View Full Code Here

        long dateValueInMs = calendar.getTimeInMillis();
        long tzOffset = calendar.get(Calendar.ZONE_OFFSET) +
                        calendar.get(Calendar.DST_OFFSET);
        // get the timeZone specified in trinidad-config, if any or the
        // client timeZone.
        LocaleContext localeContext = arc.getLocaleContext();
        // find out the difference in timeZone
        tzOffset -= localeContext.getTimeZone().getOffset(dateValueInMs);

        // Bug 4570118
        // make sure that adjusting to correct timeZone doesn't take the
        // long value out of the range. Calendar too doesn't handle this
        // properly ie. MIN_VALUE < (longValue + tzOffset) < MAX_VALUE.
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.