Package java.text

Examples of java.text.DateFormatSymbols


    // month minus a millisecond.
    calcCal.set(Calendar.DAY_OF_MONTH, lastDOM);
    calcCal.add(Calendar.DATE, 1);
    long lastDOMTime = calcCal.getTimeInMillis() - 1;

    DateFormatSymbols dateSymbols = _getDateFormatSymbols(arc);

    int firstDOW = displayedCalendar.getMinimum(Calendar.DAY_OF_WEEK);
    int lastDOW = displayedCalendar.getMaximum(Calendar.DAY_OF_WEEK);
    int dowCount = lastDOW - firstDOW + 1;

    //
    // Write the month and year drop downs
    //
    // If we're running in inline mode, make sure we have
    // access to the necessary scripts
    if (isInline)
      XhtmlUtils.addLib(context, arc, "_calsd()");


    // make sure that the js lib is added
    XhtmlUtils.addLib(context, arc, "_updateCal()");

    String baseNavURL = _createNavURL(arc,
                                      destString,
                                      minTime,
                                      maxTime,
                                      selectedTime,
                                      id);

    writer.startElement("tr", null);

    // render the previous button
    _renderNextPrev(context,
                    arc,
                    component,
                    bean,
                    true,
                    minTime,
                    firstDOMTime,
                    baseNavURL,
                    isInline);

    writer.startElement("td", null);
    writer.writeAttribute("colspan", IntegerUtils.getString(dowCount - 2), null);
    renderStyleClass(context, arc, styles.TITLE_STYLE);

    // don't wrap the month and year controls
    writer.writeAttribute("nowrap", Boolean.TRUE, null);

    _renderMonthAndYear(context,
                        arc,
                        minTime,
                        maxTime,
                        displayedCalendar,
                        dateSymbols,
                        baseNavURL,
                        id,
                        isInline);

    writer.endElement("td");

    // render the next button
    _renderNextPrev(context,
                    arc,
                    component,
                    bean,
                    false,
                    maxTime,
                    lastDOMTime,
                    baseNavURL,
                    isInline);

    writer.endElement("tr");

    // Place the rest of the calendar content within its own
    // table, so that we can style the calendar's border
    writer.startElement("tr", null);
    writer.startElement("td", null);
    writer.writeAttribute("colspan", IntegerUtils.getString(dowCount), null);

    writer.startElement("table", null);
    //fix for bug 4410632: added summary attribute
    OutputUtils.renderDataTableAttributes(context,
                                            arc,
                                            "0", "0", "0", "100%",
                        arc.getTranslatedString("af_chooseDate.SUMMARY"));
    renderStyleClass(context, arc, styles.CONTENT_STYLE);

    //
    // Write the day of the week headers
    //
    writer.startElement("tr", null);
    renderStyleClass(context, arc, styles.HEADER_STYLE);

    String[] shortWeekdays;
    // Bug 2388968:  Java's "short" weekdays in Arabic are single
    // letters, which we're told are inadequate.  Output entire
    // names instead.
    if ("ar".equals(arc.getLocaleContext().getFormattingLocale().getLanguage()))
      shortWeekdays = dateSymbols.getWeekdays();
    else
      shortWeekdays = dateSymbols.getShortWeekdays();

    for (int i = firstDOW; i <= lastDOW; i++)
    {
      writer.startElement("th", null);
      writer.writeAttribute("scope", "col", null);
View Full Code Here


  private static DateFormatSymbols _getDateFormatSymbols(
    RenderingContext arc
    )
  {
    DateFormatSymbols symbols = (DateFormatSymbols)
                           arc.getProperties().get(_DATE_SYMBOLS_KEY);

    if (symbols == null)
    {
      symbols = new DateFormatSymbols(arc.getLocaleContext().getFormattingLocale());

      arc.getProperties().put(_DATE_SYMBOLS_KEY, symbols);
    }

    return symbols;
View Full Code Here


        Calendar timeKeeper = Calendar.getInstance(currentLocale);
        timeKeeper.setTime(value!=null?value:new Date());

        DateFormatSymbols symbols = new DateFormatSymbols(currentLocale);

        if(inputCalendar.isRenderAsPopup())
        {
            renderPopup(facesContext, inputCalendar, value, timeKeeper, symbols);
        }
View Full Code Here

   */
  private JPanel getCalendarPanel()
  {

    final JPanel p = new JPanel(new GridLayout(7, 7));
    final DateFormatSymbols dateFormatSymbols = new DateFormatSymbols();
    final String[] weekDays = dateFormatSymbols.getShortWeekdays();

    for (int i = 0; i < this.WEEK_DAYS.length; i++)
    {
      p.add(new JLabel(weekDays[this.WEEK_DAYS[i]], SwingConstants.CENTER));
    }
View Full Code Here

    final JPanel p = new JPanel();

    final int minMonth = this.dateView.getMinimum(Calendar.MONTH);
    final int maxMonth = this.dateView.getMaximum(Calendar.MONTH);
    final String[] months = new String[maxMonth - minMonth + 1];
    System.arraycopy(new DateFormatSymbols().getMonths(), minMonth, months, 0, months.length);

    this.monthSelector = new JComboBox(months);
    this.monthSelector.addActionListener(new MonthSelectionAction());
    p.add(this.monthSelector);
View Full Code Here

  {
    if (parameterFormatString != null)
    {
      try
      {
        final SimpleDateFormat dateFormat = new SimpleDateFormat(parameterFormatString, new DateFormatSymbols(locale));
        dateFormat.setTimeZone(timeZone);
        dateFormat.setLenient(true);
        return dateFormat;
      }
      catch (Exception e)
      {
        // boo! Not a valid pattern ...
        // its not a show-stopper either, as the pattern is a mere hint, not a mandatory thing
        logger.warn("Parameter format-string for date-parameter was not a valid date-format-string", e);
      }
    }

    final SimpleDateFormat dateFormat = new SimpleDateFormat(DEFAULT_FORMAT, new DateFormatSymbols(locale));
    dateFormat.setTimeZone(timeZone);
    dateFormat.setLenient(true);
    return dateFormat;
  }
View Full Code Here

  {
    if (parameterFormatString != null)
    {
      try
      {
        final SimpleDateFormat dateFormat = new SimpleDateFormat(parameterFormatString, new DateFormatSymbols(locale));
        dateFormat.setTimeZone(timeZone);
        dateFormat.setLenient(true);
        return dateFormat;
      }
      catch (Exception e)
      {
        // boo! Not a valid pattern ...
        // its not a show-stopper either, as the pattern is a mere hint, not a mandatory thing
        logger.warn("Parameter format-string for date-parameter was not a valid date-format-string", e);
      }
    }

    final SimpleDateFormat dateFormat = new SimpleDateFormat(DEFAULT_FORMAT, new DateFormatSymbols(locale));
    dateFormat.setTimeZone(timeZone);
    dateFormat.setLenient(true);
    return dateFormat;
  }
View Full Code Here

    }

    this.timeZone = timeZone;
    this.pattern = pattern;
    this.locale = locale;
    this.dateFormat = new SimpleDateFormat(pattern, new DateFormatSymbols(locale));
    this.dateFormat.setTimeZone(timeZone);
  }
View Full Code Here

      else
      {
        final String messagePattern = datePatterns.getString("format.datetime");
        this.pattern = MessageFormat.format(messagePattern, new Object[]{dateText, timeText});
      }
      this.dateFormat = new SimpleDateFormat(pattern, new DateFormatSymbols(locale));
    }

    this.dateFormat.setTimeZone(timeZone);
  }
View Full Code Here

    {
      return;
    }
    this.locale = locale;
    this.dateFormat = (SimpleDateFormat) dateFormat.clone();
    this.dateFormat.setDateFormatSymbols(new DateFormatSymbols(locale));
  }
View Full Code Here

TOP

Related Classes of java.text.DateFormatSymbols

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.