/** * Lookup a currency code. * * @param currencyCode ISO4217 currency code * @return a CurrencyData instance * @throws IllegalArgumentException if the currency code is unknown */ private static CurrencyData lookupCurrency(String currencyCode) { CurrencyData currencyData = CurrencyList.get().lookup(currencyCode); if (currencyData == null) { throw new IllegalArgumentException("Currency code " + currencyCode + " is unkown in locale " + LocaleInfo.getCurrentLocale().getLocaleName()); } return currencyData; }
private boolean shouldAddToLogicalRightOfTable(DockLayoutConstant widgetDirection) { // See comments for shouldAddToLogicalLeftOfTable for clarification assert (widgetDirection == LINE_START || widgetDirection == LINE_END || widgetDirection == EAST || widgetDirection == WEST); if (widgetDirection == LINE_END) { return true; } if (LocaleInfo.getCurrentLocale().isRTL()) { return (widgetDirection == WEST); } return (widgetDirection == EAST); } }
private static DateTimeFormatInfo getDefaultDateTimeFormatInfo() { // MUSTFIX(jat): implement return LocaleInfo.getCurrentLocale().getDateTimeFormatInfo(); }
/** * Creates a new date picker. */ public DatePicker() { baseStyle = "x-date-picker"; messages = new DatePickerMessages(); constants = LocaleInfo.getCurrentLocale().getDateTimeConstants(); }
/** * Creates a new number property editor with the default number type (Double). */ public NumberPropertyEditor() { numbers = LocaleInfo.getCurrentLocale().getNumberConstants(); groupSeparator = numbers.groupingSeparator(); }
public void init( String baseUrl, XRPCBatchRequestSender callback ) { this.url = baseUrl + "&locale=" + LocaleInfo.getCurrentLocale().getLocaleName(); this.callback = callback; }
private int getStartOfLinePos() { return (LocaleInfo.getCurrentLocale().isRTL() ? RIGHT : LEFT); } }
private static DateTimeFormatInfo getDefaultDateTimeFormatInfo() { return LocaleInfo.getCurrentLocale().getDateTimeFormatInfo(); }
/** * Convenience method to get the current locale as a string. * @return The current locale as a String. */ protected String getCurrentLocaleAsString() { return LocaleInfo.getCurrentLocale().getLocaleName(); }
private int getEndOfLinePos() { return (LocaleInfo.getCurrentLocale().isRTL() ? LEFT : RIGHT); }
private static DateTimeFormatInfo getDefaultDateTimeFormatInfo() { // MUSTFIX(jat): implement return LocaleInfo.getCurrentLocale().getDateTimeFormatInfo(); }
public void init( String baseUrl, XRPCBatchRequestSender callback ) { this.url = baseUrl + "&locale=" + LocaleInfo.getCurrentLocale().getLocaleName(); this.callback = callback; }
/** * Resolve the specified direction based on the current locale. If the * direction is {@link Direction#LINE_START} or {@link Direction#LINE_END}, * the return value will be one of {@link Direction#EAST} or * {@link Direction#WEST} depending on the RTL mode of the locale. For all * other directions, the specified value is returned. * * @param direction the specified direction * @return the locale */ protected Direction getResolvedDirection(Direction direction) { if (direction == Direction.LINE_START) { return LocaleInfo.getCurrentLocale().isRTL() ? Direction.EAST : Direction.WEST; } else if (direction == Direction.LINE_END) { return LocaleInfo.getCurrentLocale().isRTL() ? Direction.WEST : Direction.EAST; } return direction; }
private static DateTimeFormatInfo getDefaultDateTimeFormatInfo() { // MUSTFIX(jat): implement return LocaleInfo.getCurrentLocale().getDateTimeFormatInfo(); }
String getLocale() { return LocaleInfo.getCurrentLocale().getLocaleName(); } }
private boolean shouldAddToLogicalLeftOfTable(DockLayoutConstant widgetDirection) { assert (widgetDirection == LINE_START || widgetDirection == LINE_END || widgetDirection == EAST || widgetDirection == WEST); // In a bidi-sensitive environment, adding a widget to the logical left // column (think DOM order) means that it will be displayed at the start // of the line direction for the current layout. This is because HTML // tables are bidi-sensitive; the column order switches depending on // the line direction. if (widgetDirection == LINE_START) { return true; } if (LocaleInfo.getCurrentLocale().isRTL()) { // In an RTL layout, the logical left columns will be displayed on the right hand // side. When the direction for the widget is EAST, adding the widget to the logical // left columns will have the desired effect of displaying the widget on the 'eastern' // side of the screen. return (widgetDirection == EAST); } // In an LTR layout, the logical left columns are displayed on the left hand // side. When the direction for the widget is WEST, adding the widget to the // logical left columns will have the desired effect of displaying the widget on the // 'western' side of the screen. return (widgetDirection == WEST); }
private static DateTimeFormatInfo getDefaultDateTimeFormatInfo() { return LocaleInfo.getCurrentLocale().getDateTimeFormatInfo(); }
public void setLocaleName() { localeName = LocaleInfo.getCurrentLocale().getLocaleName(); }
/** * Factory for creating an instance of BidiFormatter whose context direction * matches the current locale's direction, and given the desired span wrapping * behavior (see below). * * @param alwaysSpan Whether {@link #spanWrap} (and its variations) should * always use a 'span' tag, even when the input direction is neutral * or matches the context, so that the DOM structure of the output * does not depend on the combination of directions */ public static BidiFormatter getInstanceForCurrentLocale(boolean alwaysSpan) { return getInstance(LocaleInfo.getCurrentLocale().isRTL(), alwaysSpan); }
private static DateTimeFormatInfo getDefaultDateTimeFormatInfo() { return LocaleInfo.getCurrentLocale().getDateTimeFormatInfo(); }