/** * Gets the locale that should be used to configure this widget. * * @return By default the locale of the bound component. */ protected Locale getLocale() { return component.getLocale(); }
/** * Gets the locale that should be used to configure this widget. * * @return By default the locale of the bound component. */ protected Locale getLocale() { return component.getLocale(); }
/** * Gets the locale that should be used to configure this widget. * * @return By default the locale of the bound component. */ protected Locale getLocale() { return component.getLocale(); }
/** * Gets the locale that should be used to configure this widget. * * @return By default the locale of the bound component. */ protected Locale getLocale() { return component.getLocale(); }
/** * Gets the locale that should be used to configure this widget. * * @return By default the locale of the bound component. */ protected Locale getLocale() { return component.getLocale(); }
@Override protected String getObject(Component component) { return new SimpleDateFormat("yyyy-MM.dd HH:mm:ss.SSS", component.getLocale()) .format(date.getObject()); }
/** * Constructor * * @param component * The component that owns this localized image resource */ public LocalizedImageResource(final Component component) { this.component = component; locale = component.getLocale(); style = component.getStyle(); }
/** * Constructor * * @param component * The component that owns this localized image resource */ public LocalizedImageResource(final Component component) { this.component = component; locale = component.getLocale(); style = component.getStyle(); }
@Override public void bind(Component component) { if (!(component instanceof Page)) { throw new IllegalArgumentException("This behavior should be used at the page, not the chart!"); } super.bind(component); locale = component.getLocale(); }
/** * Get the requested string resource from the underlying resource bundle. The bundle is selected * by locale and the string obtained from the best matching bundle. * * @param component * Used to get the locale * @param key * The key to obtain the string for * @return The string resource value or null if resource not found */ public final String loadStringResource(final Component component, final String key) { final Locale locale = (component != null) ? component.getLocale() : null; return loadStringResource(null, key, locale, null); } }
/** * Get the requested string resource from the underlying resource bundle. The bundle is selected * by locale and the string obtained from the best matching bundle. * * @param component * Used to get the locale * @param key * The key to obtain the string for * @return The string resource value or null if resource not found */ public final String loadStringResource(final Component component, final String key) { final Locale locale = (component != null) ? component.getLocale() : null; return loadStringResource(null, key, locale, null); } }
/** * Constructor * * @param component * The component that owns this localized image resource */ public LocalizedImageResource(final Component component) { this.component = component; locale = component.getLocale(); style = component.getStyle(); variation = component.getVariation(); }
/** * @return the used local */ public Locale getLocale() { Locale l = getComponent() == null ? null : getComponent().getLocale(); return l == null ? Locale.ENGLISH : l; }
/** * Constructor * * @param component * The component that owns this localized image resource */ public LocalizedImageResource(final Component component) { this.component = component; locale = component.getLocale(); style = component.getStyle(); variation = component.getVariation(); }
/** * @return the used local */ public Locale getLocale() { Locale l = getComponent() == null ? null : getComponent().getLocale(); return l == null ? Locale.ENGLISH : l; }
@Override public void onComponentTag(Component component, ComponentTag tag) { super.onComponentTag(component, tag); if(component.isEnabledInHierarchy()) { tag.put("data-date-language", component.getLocale().getLanguage()); } } }
@Override public void onComponentTag(Component component, ComponentTag tag) { super.onComponentTag(component, tag); if(component.isEnabledInHierarchy()){ tag.put("data-date-language", component.getLocale().getLanguage()); } }
/** * @return The locale to use when formatting the resource value */ protected Locale getLocale() { final Locale locale; if (component != null) { locale = component.getLocale(); } else { locale = Session.exists() ? Session.get().getLocale() : Locale.getDefault(); } return locale; }
/** * @return The locale to use when formatting the resource value */ protected Locale getLocale() { final Locale locale; if (component != null) { locale = component.getLocale(); } else { locale = Session.exists() ? Session.get().getLocale() : Locale.getDefault(); } return locale; }
/** * Gets the date pattern to use for putting selected values in the coupled component. * * @return The date pattern */ protected String getDatePattern() { String format = null; if (component instanceof ITextFormatProvider) { format = ((ITextFormatProvider) component).getTextFormat(); // it is possible that components implement ITextFormatProvider but // don't provide a format } if (format == null) { IConverter converter = component.getConverter(DateTime.class); if (!(converter instanceof DateConverter)) { converter = component.getConverter(Date.class); } format = ((DateConverter) converter).getDatePattern(component.getLocale()); } return format; }