public static String millisecondsToDateString(long millis) { return simpleDateFormat.format(new Date(millis)); }
/** * Gets a <code>NumberFormat</code> instance for the default locale using * the specified pattern and the default currencyCode. * * @param pattern pattern for this formatter * @return a NumberFormat instance * @throws IllegalArgumentException if the specified pattern is invalid */ public static NumberFormat getFormat(String pattern) { return new NumberFormat(pattern, CurrencyList.get().getDefault(), true); }
/** * Provides the global currency format for the current locale, using its * default currency. * * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the current locale */ public static NumberFormat getGlobalCurrencyFormat() { return getGlobalCurrencyFormat(CurrencyList.get().getDefault()); }
/** * Gets the day of week formatter. * * @return the day of week formatter */ protected DateTimeFormat getDayOfWeekFormatter() { return DateTimeFormat.getFormat("ccccc"); }
public String render(Integer object) { if (null == object) { return ""; } return NumberFormat.getDecimalFormat().format(object); } }
double vertDirection = isAnimationVertical ? direction : 0.0; double horizDirection = isAnimationVertical ? 0.0 : LocaleInfo.getCurrentLocale().isRTL() ? -direction : direction;
public String[] timeFormats() { return new String[] { dtfi.timeFormatFull(), dtfi.timeFormatLong(), dtfi.timeFormatMedium(), dtfi.dateFormatShort(), }; }
public String[] dateFormats() { return new String[] { dtfi.dateFormatFull(), dtfi.dateFormatLong(), dtfi.dateFormatMedium(), dtfi.dateFormatShort(), }; }
/** * Parent interface used for test. */ @DefaultLocale("en-US") public interface Parent extends Constants, Messages { @DefaultStringValue("inherited") String inheritedConstant(); @DefaultStringMapValue({"k1", "v1", "k2", "v2"}) Map<String, String> inheritedMap(); @DefaultMessage("inherited") String inheritedMessage(); }
/** * Provides the standard currency format for the current locale. * * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the default locale */ public static NumberFormat getCurrencyFormat() { if (cachedCurrencyFormat == null) { cachedCurrencyFormat = getCurrencyFormat(CurrencyList.get().getDefault()); } return cachedCurrencyFormat; }
/** * Provides the simple currency format for the current locale using its * default currency. Note that these formats may be ambiguous if the * currency isn't clear from other content on the page. * * @return a <code>NumberFormat</code> capable of producing and consuming * currency format for the current locale */ public static NumberFormat getSimpleCurrencyFormat() { return getSimpleCurrencyFormat(CurrencyList.get().getDefault()); }
private void ensureDateTimeConstants() { if (dateTimeConstants == null) { ensureDateTimeFormatInfo(); dateTimeConstants = new DateTimeConstantsAdapter(dateTimeFormatInfo); } }
/** * Creates a value box that wraps the given browser element handle. This is * only used by subclasses. * * @param elem the browser element to wrap */ protected ValueBoxBase(Element elem, Renderer<T> renderer, Parser<T> parser) { super(elem); autoDirHandler = AutoDirectionHandler.addTo(this, BidiPolicy.isBidiEnabled()); this.renderer = renderer; this.parser = parser; }
/** * Returns the list of plural forms, indicating the singular form is optional. */ public static PluralForm[] pluralFormsOptional() { return new PluralForm[] { new PluralForm("other", "Default plural form"), new PluralForm("one", "Count is 1", true), }; }
/** * Gets the direction estimation model of the auto-dir handler. */ public DirectionEstimator getDirectionEstimator() { return autoDirHandler.getDirectionEstimator(); }
/** * Returns a DateTimeConstants instance for this locale. */ public final DateTimeConstants getDateTimeConstants() { ensureDateTimeConstants(); return dateTimeConstants; }
public final String[] getLikelyRegionCodes() { if (likelyRegionCodes == null) { likelyRegionCodes = loadLikelyRegionCodes(); } return likelyRegionCodes; } public final String getRegionName(String regionCode) {
public static String millisecondsToDateTimeString(long millis) { return simpleDateTimeFormat.format(new Date(millis)); }
/** * Constants for labeling the cell tree. Provides just English messages by default. */ @DefaultLocale("en_US") public interface CellTreeMessages extends Messages { @DefaultMessage("Show more") String showMore(); @DefaultMessage("Empty") String emptyTree(); }
@Override public PluralForm[] pluralForms() { return new PluralForm[] { new PluralForm("other", "Default plural form"), new PluralForm("none", "Count is 0"), new PluralForm("one", "Count ends in 1 but not 11"), }; }