Package java.text

Examples of java.text.SimpleDateFormat.toLocalizedPattern()


     */
    public static String getDatePattern(int dateStyle, Locale locale) {
        SimpleDateFormat formatter = (SimpleDateFormat) DateFormat
                .getDateInstance(dateStyle, locale);
        formatter.setLenient(lenient);
        return formatter.toLocalizedPattern();
    }

    /**
     * Liefert den lokalen Pattern zur Zeit von einem standard Format
     *
 
View Full Code Here


     */
    public static String getTimePattern(int timeStyle, Locale locale) {
        SimpleDateFormat formatter = (SimpleDateFormat) DateFormat
                .getTimeInstance(timeStyle, locale);
        formatter.setLenient(lenient);
        return formatter.toLocalizedPattern();
    }

    /**
     * Liefert den lokalen Pattern zur Datum-Zeit von einem standard Format
     *
 
View Full Code Here

    public static String getDateTimePattern(int dateStyle, int timeStyle,
            Locale locale) {
        SimpleDateFormat formatter = (SimpleDateFormat) DateFormat
                .getDateTimeInstance(dateStyle, timeStyle, locale);
        formatter.setLenient(lenient);
        return formatter.toLocalizedPattern();
    }

    /**
     * Liefert default Ausgabe Format
     *
 
View Full Code Here

            _script.execute(cycle, body, symbols);

            writer.beginEmpty("input");
            writer.attribute("type", "text");
            writer.attribute("name", name);
            writer.attribute("title", formatter.toLocalizedPattern());

            if (value != null)
                writer.attribute("value", formatter.format(value));

            if (disabled)
View Full Code Here

                                LOG.error("Unparsable date: {}", prop.getValue(), e);
                            }
                        }

                        field = new DateTimeFieldPanel("value", label.getDefaultModelObjectAsString(),
                                new Model(parsedDate), df.toLocalizedPattern());
                        break;

                    case Enum:
                        MapChoiceRenderer<String, String> enumCR =
                                new MapChoiceRenderer<String, String>(prop.getEnumValues());
View Full Code Here

    public void test_toLocalizedPattern() {
        // Test for method java.lang.String
        // java.text.SimpleDateFormat.toLocalizedPattern()
        SimpleDateFormat f2 = new SimpleDateFormat("GyMdkHmsSEDFwWahKz",
                new Locale("de", "CH"));
        String pattern = f2.toLocalizedPattern();
        assertTrue("Wrong pattern: " + pattern, pattern
                .equals("GuMtkHmsSEDFwWahKz"));

        // test the new "Z" pattern char
        f2 = new SimpleDateFormat("G y M d Z", new Locale("de", "CH"));
View Full Code Here

        assertTrue("Wrong pattern: " + pattern, pattern
                .equals("GuMtkHmsSEDFwWahKz"));

        // test the new "Z" pattern char
        f2 = new SimpleDateFormat("G y M d Z", new Locale("de", "CH"));
        pattern = f2.toLocalizedPattern();
        assertTrue("Wrong pattern: " + pattern, pattern.equals("G u M t Z"));
    }

    /**
     * @tests java.text.SimpleDateFormat#parse(java.lang.String,
View Full Code Here

    sdf = timeFormat;
    setDate(getCellEditorValue());
    if (timeFormat instanceof SimpleDateFormat)
    {
      final SimpleDateFormat dateFormat = (SimpleDateFormat) timeFormat;
      setToolTipText(dateFormat.toLocalizedPattern());
    }
    else
    {
      setToolTipText(null);
    }
View Full Code Here

    });

    if (timeFormat instanceof SimpleDateFormat)
    {
      final SimpleDateFormat dateFormat = (SimpleDateFormat) timeFormat;
      setToolTipText(dateFormat.toLocalizedPattern());
    }
    else
    {
      setToolTipText(null);
    }
View Full Code Here

    harness.check(format.toPattern(), pattern, "Non-localized pattern " +
      "comes back as is with toPattern().");
    String localizedPattern = translateLocalizedPattern(pattern,
              standard,
              local);
    harness.check(format.toLocalizedPattern(), localizedPattern,
      "Non-localized pattern comes back localized with " +
      "toLocalizedPattern().");
    harness.checkPoint("German locale, German pattern characters in pattern.");
    format = null;
    try
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.